To create a new (.jar) module
You can create your own custom modules. This allows you to save copies of your work for future use in the compressed (jar) module form. Palette and lexicon files may be customized and included as part of the modules. Typically, if you choose to create a palette and a lexicon file, you select these options in the New Module Wizard, which creates an empty “module.lexicon” and “module.palette” file that you edit, as desired.
For convenience, it is a good idea to create a “working” folder under the station directory (as described in step 1, below)
to hold all your custom files source material You can leave this folder in your station and use it to hold source files for
any modules that you create.
To create a new module using Workbench, follow these steps:
Connect to the station that you want to work with and, in the nav side bar, expand the nodes. The station installation directory appears under this node.
Right-click on the node in the tree and select -> from the popup menu to create a “working folder”. Give the folder a generic name, such as “ModuleSource” or “workingModule”.
Use the New Module Wizard to create the directory and files required for a new module. Refer to New Module wizard for more information about using the New Module Wizard. The wizard creates a new folder under a directory that you specify (typically, you want to specify the “working directory” that you create in step 1, above).
In the nav side bar, create a new folder named “src” under the newly created module folder.
In the nav tree you should now have a folder structure similar to the following:
My File System/Sys Home/<workingDirectory>/<newModuleName>/src
Add items to the src folder, as desired. Copy and paste components or files from your file system or from the station database. You can add subfolders under the src folder to organize data, as desired, or you can put everything directly into the src folder.
In the <newModuleName> folder, double-click the “build.xml” file. It opens in Workbench text file editor.
In the “build.xml” file, after the last <dependency/> element, type in one or more <resources/> elements to define the location of your source files.
For example, if you want to include all the “gif” files that are in an “images” folder under your “src” folder, you type the following line in the “build.xml” file:
<resources name=”/images/*.gif”/>
The following listing is an example of how your “build.xml” file might look.
<!-- Module Build File -->
<module
name = "newModuleName"
bajaVersion = "0"
preferredSymbol = "nM"
description = "My new graphic files"
vendor = "Acme"
>
<!-- Dependencies --> <dependency name="baja" vendor="Tridium"
vendorVersion="3.4" bajaVersion="0" />
<resources name="/images/*.*"/></module>
Save and close the “build.xml” file.
From the console command line in Workbench (press F3 to open console window) navigate to the working directory and type the build command followed by a space and then the name of the module folder. For example:
C:\Niagara\Niagara-3.x.xx\workingDirectory> build moduleName
Press the Return key to initiate the build process. If the build is successful, the new jar file is built and located in the modules folder. If the build is not successful, no jar file is built and error messages are generated to help you troubleshoot the problem.
You must restart workbench to see the new module in the modules directory.
If you chose to create a palette during the build process (using the New Module Wizard) an empty palette is available with
the new module. Refer to To add a new component to a palette (module.palette) for instructions about adding components to the palette.
Copyright © 2000-2014 Tridium Inc. All rights reserved.