{style} .panel {-moz-border-radius: 7px; border-radius: 7px;} .panelMacro table {-moz-border-radius: 15px; border-radius: 15px;} {style} |
This page describes how to build new Weasis plug-ins and how they can be incorporated to the distributions, see also this page for the IDE configuration. |
See also Weasis Architecture
File > New > Maven Project |
To load the plugin in the standard configuration of Weasis, add to the launcher the following VM argument: |
The file "/weasis/conf/ext-config.properties" must be adapted and plug-ins must be placed in the directory "/weasis/plugins".
Example with weasis-isowriter:
felix.auto.start.80= \ ${weasis.codebase.url}/plugins/weasis-isowriter-2.0.3.jar |
Build a new war file containing the plug-ins and the ext-config.properties file.
+--weasis-ext/ | +--WEB-INF/ | +--web.xml | +--conf/ | +--ext-config.properties | +--plugin1.jar | +--plugin2.jar |
felix.auto.start.80= \ ${weasis.codebase.ext.url}/plugin1.jar \ ${weasis.codebase.ext.url}/plugin2.jar |
Note: Using "${weasis.codebase.ext.url}" allows to keep the base URL abstract, so moving the package to another server won’t be a problem. Otherwise absolute URLs must be used. |
weasis.ext.url=${server.base.url}/weasis-newext |
To load plugins in the standard configuration of Weasis, add to the launcher the following VM argument: |
Example that make a package of weasis-isowriter plugin:
+--weasis-ext/ | +--WEB-INF/ | +--web.xml | +--conf/ | +--ext-config.properties | +--weasis-isowriter-2.0.3.jar |
All the plug-in type described in the list above are OSGI services that are registered and aggregated in the GUI. Building the plug-in from the Maven archetype will configure automatically the OSGI service. For adding new OSGI services, here is the procedure:
1) Create a class implementing one of the plug-in type and add at least the annotations @Component and @Service, for instance:
@Component(immediate = false) @Service public class SamplePrefFactory implements PreferencesPageFactory { ... |
For more information about annotations see the Apache Felix SCR Annotations. |
2) Add in pom.xml of the plug-in the maven-scr-plugin (to generate xml file from the Java annotations) and the property for loading any xml file in maven-bundle-plugin:
<build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-scr-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> </plugin> ... |