Table of Contents
A plug-in is a zipped folder (usually having a .jar extension) with a plug-in descriptor in its root directory. The
plugin-descriptor.xml defines the properties and the content of the plug-in. Usually a plug-in contains additional folders to group elements for better readability.
/ ├─ components/ ├─ plans/ ├─ resources/ └─ plugin-descriptor.xml
There is a template plug-in project for Eclipse available. Besides the basic structure it also contains some files related to the Eclipse build process. Using the Eclipse plug-in you won't need this template as the Eclipse plug-in generates it for you.
The Plug-In Descriptor
The plugin-in descriptor defines the properties of a plugin as well as its contents.
Files that are included in the plug-in zip file and are not mentioned in the plug-in descriptor will not be recognized as part of the plug-in by the automaIT server.
Adding a Component
To add a component, the .xml file defining the component needs to be placed and registered inside the plug-in.
/ ├─ components/ │ └─ Component.xml ├─ plans/ ├─ resources/ └─ plugin-descriptor.xml
The following code can be used for a simple example component.
The plug-in descriptor needs to know which .xml file to use and what type of element it describes. Therefore the plug-in descriptor gets extended by one line.
Adding a Plan
/ ├─ components/ │ └─ Component.xml ├─ plans/ │ └─ Plan.xml ├─ resources/ └─ plugin-descriptor.xml
The following example will install the above component.
Then the Plan.xml file needs to be registered inside the plug-in descriptor.
Now the plug-in contains
- a plug-in descriptor
- a component
- a plan
Currently the plug-in descriptor defines the plug-in version 1.0. It is useful to reflect this version in the plug-in file name:
info.novatec.automait.template_1.0.jar. The build script from the template project already uses the version to generate the file name. A new plug-in version always depends on an older one.
previousVersion attribute defines the version this plug-in depends on. Otherwise an error message like The plug-in cannot be imported because the plug-in info.novatec.automait.template#1.0 already exists and the new plug-in is not a patch plug-in. will be raised. Now it only can be imported into the automaIT server if version 1.0 of this plug-in is already installed. Also, it is not possible to skip a version. If a plug-in defines its version 1.3 and the previous version as 1.0 it can not be imported into a server with plug-in version 1.2.