Plugin development
Plugins for extending Xima® Formcycle
Many services and functions of Xima® Formcycle can be customized and extended by using plugins. Each plugin type extends a certain aspect of Xima® Formcycle, such as workflow processing or preprocessing forms. To create a custom plugin, you need to setup a Java project first of all.
API documentation
The API documentations for Xima® Formcycle can be found here: Javadocs
Project setup
Setup a new Java project with the IDE of your choice. Xima® Formcycle uses the build management system Apache Maven) to resolve dependencies. Dependencies are provided by our public artifactory http://artifactory.xima-services.de/artifactory/fc-plugin-dev. It contains all components needed for developing plugins. The main artifact you will need is the artifact fc-plugin-common, containing all Java interfaces available for plugins.
Maven uses configuration files named pom.xml (project object model). A pom for plugin development might look as follows:
Example for a pom.xml
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<properties>
<!-- Configuration -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Dependencies -->
<xfc-version>4.2.3</xfc-version>
<!-- Plugins -->
<maven-compiler-plugin-version>3.3</maven-compiler-plugin-version>
<maven-jar-plugin-version>2.4</maven-jar-plugin-version>
</properties>
<repositories>
<repository>
<id>xima</id>
<name>fc-plugin-dev</name>
<url>http://artifactory.xima-services.de/artifactory/fc-plugin-dev</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>de.xima.fc</groupId>
<artifactId>fc-plugin-common</artifactId>
<version>${xfc-version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin-version}</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin-version}</version>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<manifestEntries>
<formcycle-version-requirement>${xfc-version}</formcycle-version-requirement>
<Build-Time>${maven.build.timestamp}</Build-Time>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Certain plugins may require additional classes and functionality of the Xima® Formcycle system, which is provided by the artifact fc-logic. To add it as a dependency, modify the pom as follows:
<dependency>
<groupId>de.xima.fc</groupId>
<artifactId>fc-logic</artifactId>
<version>${xfc-version}</version>
<scope>provided</scope>
</dependency>
...
This artifact becomes necessary especially when working with databases or the workflow processing. You can also that includes the fc-logic artifact.
Furthermore, note that all dependencies must be declared with the provide scope. This prevent class path issues and keeps the plugin size small. When possible, use libraries already in use by Xima® Formcycle, eg. certain Apache Common libraries.
Developing a plugin for Xima® Formcycle can be as simple as implementing one of the plugin interfaces. To install a plugin, upload them on the administrative interface either as a client or system plugin.
Demo plugins
As an introduction and to help you getting started with developing plugins, we provide several fully commented demo maven projects for each plugin type on our download pages. After downloading them, you can import them into the IDE of your choice, compile them and upload them to Xima® Formcycle.
Special terms
Some Java methods and classes contain German technical terms as used by Xima® Formcycle. For reference, see the following list for their English counterparts.
German | English | Example |
---|---|---|
Mandant | Client | public Mandant getMandant() (get client) |
Benutzer | User | public Benutzer getCurrentBenutzer() (get user currently logged in) |
Projekt | Project, a former term for a form containing files and multiple form versions | public Projekt getProjekt() |
Aktion | Action (workflow) | public Aktion getFolgeAktion() (get next action) |
Weiterverarbeitung | Further processing | public EWeiterverarbeitung_Aktion getWeiterverarbeitungBeiFehler() (how to continue when an error has occurred) |
Bedingung | Condition (action) | public Bedingung getBedingung() (get the condition of an action) |
Datei | File | public FormEingangDatei getDatei() (get attached file) |
Textbaustein | Template | public ETextbausteinKategorie getKategorie() (get template type) |
Vorgang | Form record | public Postfach getByVorgang(UserContext uc, Vorgang vorgang) (get inbox for form record) |
Postfach | Inbox | public Postfach getCurrentPostfach() (get current inbox) |
Rolle | Role | public List<Rolle> getRollen() (get all roles for a user) |
Datenquelle | Data source | public IPluginDataSourceRetVal executeDatenquelle(...) (get serializable JSON array from a data source) |
Beschreibung | Description | public String getBeschreibung() |
Kategory | Category | public ETextbausteinKategorie getKategorie() |