The JMap Extensiom Builder is a tool that allows you to quickly generate the source code for JMap client and server extensions. The generated source code is basic, and you must complete it in order to implement the functions of your extension. This tool helps you save time by allowing developers to focus on the real purpose of their development activity instead of dealing with the technical details of programming and deploying JMap extensions.
The tool has a GUI and may also be used in the command line, without a GUI. The parameters accepted by the extension builder are shown below. Note that they are all optional, and default values are used for the missing parameters.
The easiest way to run the extension builder is to use the Ant script provided with the tool. The parameters passed to the tool can be modified within the Ant script.
ant -f extensionbuilder.xml
The extension builder can also be executed using the command line (on Mac or Linux, replace “” with “” in the classpath).
java -classpath extensionbuilder.jar;../../lib/kheops_util.jar jmap.sdk.tools.extensionbuilder.ExtensionBuilder -name extensionname -class classname -dest destfolder -target target -gui true\false
After running the tool, the target directory contains the sources of the extension generated as well as some other files. If a client extension was requested (client or both options), there will be a JNLP file, a keystore.jks file (for your client extension’s signature), and a featureslist.properties file. If a server extension was requested (server or both options), there will be a JSP file (configuration interface of server extension). An Ant script (build.xml) is also created in the directory. This script can be used to compile the extension and generate the JAR archives for the client and server.
The following image shows the structure of the generated files.
To run the Ant script, simply run the ant command from the destination directory. After the script has been run, the dist directory will contain all the files to be deployed on JMap Server. The following image shows the structure of the generated files.
Parameter
Description
-name extensionname
The extension name as it will appear in JMap Admin. It can contain spaces. e.g. tracking goods, network analysis, etc.
-class classname
The full name (with package) of the main class of the extension. The names of the other classes needed by the extension will be derived from that name. e.g. jmap.extensions.tracking
-dest destfolder
The target directory for the generated files. If the directory already exists, it will be deleted and recreated. The default value is output.
-target target
The type of extension to generate. Valid values are client, server or both. The default is both. Different classes and packages are created according to the selected option.
-gui true\false
Determines whether the GUI should be displayed or not. Possible values are true and false. The default value is true. If the GUI is used, its fields are initialized with the values provided as parameters.