mantisbt:addson_requirements
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mantisbt:addson_requirements [2006/09/23 17:34] – created vboctor | mantisbt:addson_requirements [2008/10/29 04:25] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Mantis | + | ====== Mantis |
- | **Author:** Victor Boctor | + | * **Author:** Victor Boctor |
- | **Status:** In Progress | + | |
===== Introduction ===== | ===== Introduction ===== | ||
- | Mantis currently supports some extensibility features like custom fields, custom functions, custom constants, and custom strings. | + | Mantis currently supports some extensibility features like custom fields, custom functions, custom constants, and custom strings. |
===== Types of Plug-in ===== | ===== Types of Plug-in ===== | ||
Line 14: | Line 14: | ||
* Issue Action - Ability to add an action button to the Issue View page, this is like the Monitor and Delete buttons. | * Issue Action - Ability to add an action button to the Issue View page, this is like the Monitor and Delete buttons. | ||
* Reports - Users should be able to easily develop extra reports | * Reports - Users should be able to easily develop extra reports | ||
- | * Extensions - Ability to implement a Mantis extension which cuts accross | + | * Extensions - Ability to implement a Mantis extension which cuts across |
- | ===== Add-On Support Infrastructure ===== | + | ===== Plug-ins Support Infrastructure ===== |
- | * Ability to detect all adds-on in the Mantis directory structure. | + | * Ability to detect all plug-ins in the Mantis directory structure. |
- | * From the add-ons page, allow users to install / un-install | + | * From the manage plug-ins page, allow administrators (configurable threshold) |
- | * Keep track of the installed | + | * Keep track of the installed |
* Extend the database scheme upgrade script to support modules. | * Extend the database scheme upgrade script to support modules. | ||
+ | * Detailed documentation about how to implement Mantis plug-ins. | ||
- | ===== Components of an Add-On | + | ===== Information about a plugin |
- | * Install Script - Once the module is place in the Mantis directory structure, it can be activating by running its install script. | + | * Name |
- | * Check pre-requisites | + | * Publisher |
- | * Add-ons can provide their installation wizard or apply the installation steps without any user inputs. | + | * Publisher' |
- | * Detect the install vs. upgrade scenario. | + | * Description |
- | * Extend the database as required. | + | * Status |
- | * Add the add-on to the list of installed add-ons. | + | * Creation Date |
- | * Add the module specific configuration options. | + | * Mantis Minimum Version |
- | * Add the module specific information | + | * PHP Minimum Version |
+ | * PHP Maximum Version (?) | ||
+ | * RequiredModules (array) | ||
- | * Uninstall Script - Modules must provide the ability to un-install them, this includes the following: | + | We can add support for dependencies |
- | * Removing the add-on from the list of installed add-ons. | + | |
- | * Reverting | + | |
- | * Remove add-on specific custom fields. | + | |
- | * Remove the module specific configuration options. | + | |
===== Directory Structure ===== | ===== Directory Structure ===== | ||
Line 48: | Line 47: | ||
lang/ | lang/ | ||
modules/ | modules/ | ||
- | | + | |
- | | + | css/ |
- | lang/ | + | *.css |
- | strings_english.txt | + | |
- | + | logo.jpg (some plugins may have logos, file name is configurable) | |
+ | core/ | ||
+ | | ||
+ | *.js | ||
+ | doc/ | ||
+ | readme.html | ||
+ | lang/ | ||
+ | | ||
+ | | ||
+ | (new pages - included from module_page.php based on module name and action) | ||
+ | # | ||
+ | # | ||
+ | # | ||
</ | </ | ||
+ | |||
+ | * # | ||
+ | * register in events | ||
+ | * register necessary css based on current page. | ||
+ | * register necessary javascript based on current page. | ||
+ | * register menu options (menu, label_id, url) | ||
+ | * register string_display_filter | ||
+ | * register view issues links (e.g. csv, graphs, etc) | ||
+ | * register view issue links (e.g. Wiki) | ||
+ | * register the pages to include the plug-in (or ALL). | ||
+ | * register the pages to exclude the plug-in (or empty array) | ||
+ | * Support system exclude from pages (e.g. download attachment, module management page, etc) | ||
+ | |||
+ | ===== Configuration Options ===== | ||
+ | |||
+ | * manage_plugins_threshold. | ||
+ | |||
+ | Note that the plugins are always applied to all projects. | ||
+ | |||
+ | ===== New Pages ===== | ||
+ | |||
+ | The following pages will allow management of plug-ins and all their related details: | ||
+ | |||
+ | * manage_modules_page.php: | ||
+ | * manage_modules_add.php: | ||
+ | * manage_modules_remove.php: | ||
+ | * module_page.php: | ||
+ | |||
+ | ===== Plug-ins APIs ===== | ||
+ | |||
+ | This is the standard APIs that are used in managing modules and allowing modules to interact with some standard Mantis functionality. | ||
+ | |||
+ | * module_event - trigger an event with the appropriate parameters. | ||
+ | * module_event_is_subscribed() - check before doing extra work for the event. | ||
+ | * module_include_all() | ||
+ | * module_include_lang() | ||
+ | * module_include_css() | ||
+ | * module_include_javascript() | ||
+ | * module_get_info( $p_module_name ); | ||
+ | * module_install( $p_module_name ); | ||
+ | * module_get_dependencies( $p_module_name ) | ||
+ | * module_can_install( $p_module_name ) | ||
+ | * module_get_depedents( $p_module ) | ||
+ | * module_can_uninstall( $p_module ) | ||
+ | |||
+ | ===== Events ===== | ||
+ | |||
+ | Events are integration points that are similar to custom functions, however, they can be handled by one or more of the installed plug-ins. | ||
+ | |||
+ | * issue created | ||
+ | * issue updated | ||
+ | * issue deleted | ||
+ | * issue viewed | ||
+ | * issue cloned | ||
+ | * issue moved | ||
+ | * issue assigned | ||
+ | * issue re-assigned | ||
+ | * issue status changed | ||
+ | * issue attachment attached | ||
+ | * issue attachment deleted | ||
+ | * issue attachment preview | ||
+ | * user created by administrator | ||
+ | * user signed up | ||
+ | * user logged in for first time | ||
+ | * user pruned | ||
+ | * user deleted | ||
+ | * user disabled | ||
+ | * user authentication failed | ||
+ | * user logged in | ||
+ | * user updated | ||
+ | * user added to project | ||
+ | * user removed from project | ||
+ | * cronjob | ||
+ | * news added | ||
+ | * news updated | ||
+ | * news deleted | ||
+ | * note added | ||
+ | * note updated | ||
+ | * note deleted | ||
+ | * issue monitored | ||
+ | * issue unmonitored | ||
+ | * relationship_added | ||
+ | * relationship_deleted | ||
+ | * relationship_updated | ||
+ | * sponsorship_added | ||
+ | * sponsorship_updated | ||
+ | * sponsorship_deleted | ||
+ | * category_added | ||
+ | * category_updated | ||
+ | * category_deleted | ||
+ | * version_added | ||
+ | * version_updated | ||
+ | * version_deleted | ||
+ | * checkin | ||
+ | * project file attached | ||
+ | * project file deleted | ||
+ | * tag created | ||
+ | * tag updated | ||
+ | * tag deleted | ||
+ | * tag attached | ||
+ | * tag detached | ||
+ | * user heartbeat (can be used for users online) | ||
+ | * error (only for php errors, email errors, etc - i.e. system errors). | ||
+ | |||
+ | ===== Output Hooks ===== | ||
+ | |||
+ | Plug-ins should be able to create new pages, however, they should also be able to enrich the content of some of the existing pages. | ||
+ | |||
+ | * issue view | ||
+ | * user view | ||
+ | * project page view | ||
+ | * my view page | ||
+ | * below menu (similar to the current location of "last visited" | ||
+ | |||
+ | ===== Ideas for Plugins ===== | ||
+ | |||
+ | * notification plugins | ||
+ | * email plugin | ||
+ | * twitter pluggin | ||
+ | * sms pluggin | ||
+ | * attachment preview | ||
+ | * files (e.g. images, txt, flash) | ||
+ | * urls (e.g. youtube) | ||
+ | * bbcode | ||
+ | * Issue Action Group (may need a bit of cleanup) | ||
+ | * Audit Log | ||
+ | * Issues Last Visited (as a plug-in rather than built-in feature) | ||
+ | * Email admin on errors | ||
+ | * Wiki integration? | ||
+ | * Email Reports: e.g. issues matching filter sent to < | ||
+ | * created by a user | ||
+ | * can be public, hence, will trigger for each user | ||
+ | * min access level | ||
+ | * max access level | ||
+ | * for each project? | ||
+ | |||
+ | ===== To be Spec'd ===== | ||
+ | |||
+ | * Detail the parameters sent to each of the events. | ||
+ | * How are the plug-ins going to be distributed. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
===== Feedback ===== | ===== Feedback ===== | ||
This is still in progress, but you are free to contribute ideas. | This is still in progress, but you are free to contribute ideas. | ||
+ | |||
+ | * (DGtlRift) I would say that in " | ||
+ | * plugin version - could be used by a plugin manager to query if there is an updated plugin available from the plugin' | ||
+ | * minimum mantis compatibility version - verify that this plugin will actually work with this version of mantis. | ||
+ | * (DGtlRift) I would also suggest that the " | ||
+ | * I'm also thinking that it may be easier to use a hash table to store the constants in # | ||
+ | * Perhaps XML would be better for having this info | ||
+ | * (deboutv) In my plugin manager, I have chosen to provide Mantis plugin in pkg format. This file is the result of a zip and a serialize of an array => gzcompress( serialize( array ), 9 ); The array contains the following fields: | ||
+ | < | ||
+ | $t_pkg[' | ||
+ | $t_pkg[' | ||
+ | // | ||
+ | $t_pkg[' | ||
+ | $t_pkg[' | ||
+ | $t_pkg[' | ||
+ | $t_pkg[' | ||
+ | </ | ||
+ | * (deboutv) Hacking Mantis with a plugin. We need to think about the security of the Mantis application and its data. Allowing plugins is dangerous because of the content of the plugin (it could pretend to be a BBCode interpreter but in reality it could be a BBCode interpreter and a spy). With a plugin (ie: code of third parties), you can read/write the SQL database, grant priviledges to the users... | ||
+ | * (DGtlRift) There should also be a description of how plugins themselves should generate events. | ||
+ | * (DGtlRift) Re: Distribution. | ||
+ | * The most simple way is to just have a list of tar.gz compressed archives of each plugin. | ||
+ | * The next option would be to offer the ability to install via the admin interface, where Mantis would check against a web list of available plugins and download (to the server) and install the plugin (requiring Mantis to have write privileges) to the plugins directory. | ||
+ | * Another option is to have all the plgins in RPM form - which would automate installation for the sysadmin. | ||
+ | * (DGtlRift) Should the plugins be globally " | ||
+ | |||
+ | ==== First implementation ==== | ||
+ | |||
+ | A first implementation has been written, you can find it [[http:// | ||
+ | |||
+ | === Respect === | ||
+ | |||
+ | * Ability to detect add-ons. | ||
+ | * Allow configuration of the add-ons. | ||
+ | |||
+ | === Does not respect === | ||
+ | |||
+ | * No install/ | ||
+ | * Check the requirements. | ||
+ | * Directory structure not respected: | ||
+ | < | ||
+ | mantis/ | ||
+ | admin/ | ||
+ | core/ | ||
+ | lang/ | ||
+ | plugins_page.php | ||
+ | plugins/ | ||
+ | plugin1/ | ||
+ | plugin2/ | ||
+ | plugin3/ | ||
+ | index.php | ||
+ | info.php | ||
+ | core/ | ||
+ | functions_api.php | ||
+ | lang/ | ||
+ | strings_english.txt | ||
+ | </ | ||
+ | |||
+ | === What the plugin manager does? === | ||
+ | |||
+ | * It is in charge to load the strings_*.txt file according to the current language | ||
+ | * It is in charge to allow configuration of the plugin according to the access_level. The configuration page is located into index.php | ||
+ | * It checks new release of the plugin (optional). |
mantisbt/addson_requirements.1159047282.txt.gz · Last modified: 2008/10/29 04:31 (external edit)