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

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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 download a template for a pom file that includes the fc-logic artifact.

For version of Xima® Formcycle earlier than 4.1.1, you need to exclude the non-public dependency on the aspose-processor of 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.

All dependencies must be declared with the scope provided.

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.

GermanEnglishExample
MandantClientpublic Mandant getMandant() (get client)
BenutzerUserpublic Benutzer getCurrentBenutzer() (get user currently logged in)
ProjektProject, a former term for a form containing files and multiple form versionspublic Projekt getProjekt()
AktionAction (workflow)public Aktion getFolgeAktion() (get next action)
WeiterverarbeitungFurther processingpublic EWeiterverarbeitung_Aktion getWeiterverarbeitungBeiFehler() (how to continue when an error has occurred)
BedingungCondition (action)public Bedingung getBedingung() (get the condition of an action)
DateiFilepublic FormEingangDatei getDatei() (get attached file)
TextbausteinTemplatepublic ETextbausteinKategorie getKategorie() (get template type)
VorgangForm recordpublic Postfach getByVorgang(UserContext uc, Vorgang vorgang) (get inbox for form record)
PostfachInboxpublic Postfach getCurrentPostfach() (get current inbox)
RolleRolepublic List<Rolle> getRollen() (get all roles for a user)
DatenquelleData sourcepublic IPluginDataSourceRetVal executeDatenquelle(...) (get serializable JSON array from a data source)
BeschreibungDescriptionpublic String getBeschreibung()
KategoryCategorypublic ETextbausteinKategorie getKategorie()
Tags:
Copyright 2000-2024