Start page
Start page

Start page / Plug-In Development / Implementation and Deployment / Module Architecture / Module Definition

Module Definition

The file module.xml defines the module structure as seen by FirstSpirit servers. It contains information about the FirstSpirit Module (FSM) itself, including name, version number and vendor, as well as segments on each individual plug-in component.

It follows a mandatory XML structure that specifies which Java classes included in the FSM file implement plug-in interfaces and will be advertised to ContentCreator. Furthermore, the XML mark-up is used to define resources that should be included in the roll-out process of plug-in code to a project-specific ContentCreator web application.

Example: module.xml

Important In the ContentCreator Example module framework, the file module.xml is stored at the module's root directory. If you wish to move this file, you must also modify the Ant build configuration so that it can be located while assembling the FSM file.
<!DOCTYPE module SYSTEM "http://www.FirstSpirit.de/module.dtd">

<module>

<name>FirstSpirit WebEdit Examples</name>
<version>5.0</version>
<description>WE5 API examples: action plugins, reports, drop executables, ...</description>
<vendor>e-Spirit AG</vendor>

<components>

<!-- Make plug-in classes known to the FirstSpirit server -->
<public>
<name>FirstSpirit WebEdit Examples - Client Action - JavaScript Example</name>
<class>de.espirit.firstspirit.opt.example.webedit.plugin.ExampleActionsPlugin</class>|
</public>

<!-- Specify a JAR file that contains plug-in and other classes for roll-out to WebClient -->
<web-app>
<name>FirstSpirit WebEdit Examples - Run-Time Library</name>
<web-xml>web.xml</web-xml>
<web-resources>
<resource>lib/fs-we5examples.jar</resource>
<resource target="/we5example">we5example/</resource>
</web-resources>
</web-app>

</components>

<resources>
<resource scope="server" name="we5examples">lib/fs-we5examples.jar</resource>
</resources>

</module>

This file, which is a shortened version of the module definition file used to build the FirstSpirit Module "WebEdit Example Plug-Ins", specifies basic information about the FSM itself (name, version, description and vendor), two plug-in components (one of type public, the other of type web-app) as well as one resource (fs-we5examples.jar, referenced both as a resource of the web-app component as well as of the FSM itself).

The component specified in the <public> block of this file will be used by the ContentCreator module manager to identify which plug-in actions are available in each user interface context, while the <web-app> block of this file specifies at least one JAR file and, optionally, further files that will be rolled out to the ContentCreator web application upon deployment. The tags available in each block are described in the section Component Model.

Mandatory XML Blocks

Block

Mandatory

Location

Description

<module></module>

yes

top-level

The top-level container.

<name></name>

yes

within <module>

The name of the FirstSpirit Module; can only contain alphanumeric as well as several punctuation marks:
A-Z a-z 0-9 ; , _ -

<version></version>

yes

within <module>

The FSM version number; this should be written in dot notation (e.g. 0.0.1) and may optionally include a revision number (e.g. 1.0.5_16).

<components></components>

yes

within <module>

The container for all plug-in components of this FSM.
While the <components> block itself is mandatory, it may be left empty if the FSM is not to have any components.

    

Optional XML Blocks

Block

Mandatory

Location

Description

<description></description>

within <module>

A short text description of the FSM's purpose and contents.

<vendor></vendor>

within <module>

The name of the module's vendor or author.

<class></class>

within <module>

Specifies a Java class that implements specific methods that react to module installation, update and deinstallation.

<resources></resources>

within <module>

The container for all resource entries of this FSM; may be specified but left empty.

<resource></resource>

within <resources>

A resource entry, containing a file system path relative to WebEdit's root directory.

<dependencies></dependencies>

within <module>

The container for all dependency entries; may be specified but left empty.

<depends></depends>

within <dependencies>

A dependency on another FirstSpirit Module; the block contains the dependency module's name (as defined in its <name> block).

    

<service>

The service component type is used to specify a server-wide service. The component definition requires specification of a Java class which implements the Service interface of the FirstSpirit Developer API.

Block

Mandatory

Location

Description

<name></name>

yes

within <service>

The component's name; will be used in module listings and dependency definitions.

<description></description>

 

within <service>

A terse descriptive text about the component's purpose.

<class></class>

 

within <service>

Specifies a Java class that implements the service interface Service.

<configurable></configurable>

 

within <service>

If this component includes a Java class that implements configuration functionality (for use in Server and Project Configuration), the full class name is specified here.

<resources></resources>

yes

within <service>

A container for resource definitions.

<resource></resource>

yes

within <resources>

Specifies the path (relative to the WebEdit web application's WEB-INF directory) and file name of one or several JAR files that contains the module's classes as resources; additionally, other application server-compatible files (such as JSP files) may be specified. All files specified here will be rolled into the WebEdit application's WAR file at server start-up or application deployment.

    

<web-app>

The web-app component type is used to specify a web application. While we are not building a full web application, this component is used to roll out plug-in components as a JAR file to a location the ContentCreator can access during server start-up (as a project-specific ContentCreator 5 application is started)--during start-up, the contents of this and other modules' JAR files are added to the ContentCreator code set that will be used by the application server.

Important At least one component of the type web-app must be specified in the module description of a FirstSpirit Module that provides ContentCreator extensions.

Component Blocks

The following component types may be specified within the XML block <component>. Each component type implies a specific use, and thus each type requires certain sets of XML tags.

<public>

The public component type is used to specify all module components that implement client extension interfaces. For each class that implements an individual plug-in, a separate <public> block is specified in module.xml.

Important At least one component of the type public must be specified in the module description of a FirstSpirit Module that provides client plug-ins.

Block

Mandatory

Location

Description

<name></name>

yes

within <public>

The component's name; will be used in module listings and dependency definitions.

<class></class>

within <public>

Specifies a Java class that implements an interface to extend client functionality.

<configurable></configurable>

within <public>

If this component includes a Java class that implements configuration functionality (for use in Server and Project Configuration), the full class name is specified here.

    

Block

Mandatory

Location

Description

<name></name>

yes

within <web-app>

The component's name; will be used in module listings and dependency definitions.

<description></description>

 

within <web-app>

A terse descriptive text about the component's purpose.

<class></class>

 

within <web-app>

Specifies a Java class that implements the web application interface AbstractWebApp; not used for components that are intended to simply provide JAR resources for WebClient use.

<web-xml></web-xml>

 

within <web-app>

Specifies the path within the FSM directory structure at which the file web.xml is located.

<configurable></configurable>

 

within <web-app>

If this component includes a Java class that implements configuration functionality (for use in Server and Project Configuration), the full class name is specified here.

<web-resources></web-resources>

yes

within <web-app>

A container for resource definitions; all files specified in <resource> tags will be included in the WebEdit web application's WAR file.

<resource></resource>

yes

within <web-resources>

Specifies the path (relative to the WebEdit web application's WEB-INF directory) and file name of one or several JAR files that contains the module's classes as resources; additionally, other application server-compatible files (such as JSP files) may be specified. All files specified here will be rolled into the WebEdit application's WAR file at server start-up or application deployment.

    

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2013-12-09