dev-guide:creating-own-plugin
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| dev-guide:creating-own-plugin [2024/04/12 12:45] – created gaetan | dev-guide:creating-own-plugin [2025/04/02 15:30] (current) – gaetan | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Creating a new Plugin ===== | + | ===== GroIMP |
| ==== Plugin structure ==== | ==== Plugin structure ==== | ||
| Line 7: | Line 7: | ||
| Firstly, a plugin has to have a special directory layout. The layout depends on how you run GroIMP. There are currently two layout: | Firstly, a plugin has to have a special directory layout. The layout depends on how you run GroIMP. There are currently two layout: | ||
| - As compiled plugin. | - As compiled plugin. | ||
| - | - As source code. | + | - As compiled classes. |
| In the compiled version of GroIMP (the one deployed and installed with the executable files) the plugins are loaded as: | In the compiled version of GroIMP (the one deployed and installed with the executable files) the plugins are loaded as: | ||
| Line 15: | Line 15: | ||
| * plugin.properties | * plugin.properties | ||
| * plugin.xml | * plugin.xml | ||
| + | * doc/ | ||
| * dependencies.jar ... | * dependencies.jar ... | ||
| Line 22: | Line 23: | ||
| * target | * target | ||
| * classes | * classes | ||
| - | * plugin.properties | + | |
| - | * plugin.xml | + | * plugin.xml |
| * < | * < | ||
| * < | * < | ||
| Line 31: | Line 32: | ||
| **Important: | **Important: | ||
| - | By default GroIMP load plugins from its root/ | + | By default GroIMP load plugins from its root/ |
| ==== Using Maven ==== | ==== Using Maven ==== | ||
| Line 46: | Line 47: | ||
| * plugin.properties | * plugin.properties | ||
| * plugin.xml | * plugin.xml | ||
| + | * doc/ | ||
| * < | * < | ||
| * assembly | * assembly | ||
| Line 156: | Line 158: | ||
| The second part - remote properties: | The second part - remote properties: | ||
| + | |||
| <code xml> | <code xml> | ||
| < | < | ||
| Line 173: | Line 176: | ||
| < | < | ||
| </ | </ | ||
| - | </code | + | </code> |
| defines: | defines: | ||
| Line 208: | Line 211: | ||
| </ | </ | ||
| - | < | + | </code> |
| defines the dependencies to: | defines the dependencies to: | ||
| Line 284: | Line 287: | ||
| Within the registry-element, | Within the registry-element, | ||
| + | |||
| + | |||
| + | ===== Embedded documentation ===== | ||
| + | |||
| + | The embedded documentation of GroIMP is based on the docbook format with the htmlhelp template. | ||
| + | The docbook file must be created in src/ | ||
| + | There are several docbook editors available online. | ||
| + | With GroIMP 2.1.4 it is also possible to use a markdown file as a source of documentation, | ||
| + | A documentation on the Markdown based approach can be found [[dev-guide: | ||
| + | |||
| + | The compilation including the embedded help is described [[maintainer-guide: | ||
| + | |||
| + | The linking of the embedded documentation | ||
| + | |||
| + | ===== Linking an example ===== | ||
| + | |||
| + | In order to make your plugin easier to get started with, it is recommended to add an example project with it. The example projects are available in GroIMP from the [[user-guide: | ||
| + | |||
| + | To include an example project,the gsz file needs to be placed in ' | ||
| + | |||
| + | <code xml> | ||
| + | <ref name=" | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | Where: | ||
| + | * ref name=" | ||
| + | * CATEGORYNAME is the category where the example will be grouped. | ||
| + | * PROJECTNAME is a name, that is used by default when displayed. But it can be overwritten in the properties. | ||
| + | * PROJECTVERSION is the version. One project can have several versions. They will all be available in the project explorer, by selecting them in the drop-down menu. Versions of one project need to be added within the same tag '' | ||
| + | * FACTORYNAME is the default name displayed. Can be overwritten in the properties. | ||
| + | * PROJECTFILE.gsz (and any OTHERFILE.gsz) the relative path to access the project file. Usually, both the '' | ||
| + | |||
| + | |||
| + | The displayed name can be changed in the '' | ||
| + | |||
| + | < | ||
| + | / | ||
| + | |||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| + | |||
| + | ===== Linking a Template ===== | ||
| + | |||
| + | Similar to the examples a FilterSourceFactory can be used to add new templates. Templates are the files that can be selected by creating a new project ' | ||
| + | To add a gsz file stored in ' | ||
| + | |||
| + | <code xml> | ||
| + | <ref name=" | ||
| + | <ref name=" | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | Additionally the name shown in the menu can be set in the properties file. | ||
| + | |||
| + | See more: | ||
| + | |||
| + | [[: | ||
| + | |||
| + | |||
dev-guide/creating-own-plugin.1712918739.txt.gz · Last modified: 2024/04/12 12:45 by gaetan
