Help:- Template XML creationindexpreviousnextupside index

All Templates created under a Context are stored in their own directory under the Templates directory for the Context. (See PLCSlib structure)

The directory for an individual Template has the same name as the Template Identifier:
<<template-id>>
and will contain all of the files specific to that Template.

An ANT build script is provided as a tool to create the directory and associated file structure for a new Template

NOTE    This has been developed and tested on the Microsoft Windows operating system. Although it has not been tested on other systems it should work since the utilities used are all platform independent.

In order to use the tool for creating a new Template, first open up a command window (e.g. "cmd" on windows), navigate to the plcslib\utils\xml_templates directory in your PLCSlib installation and then run the command :

ant mk-template

You will be prompted for the Identifier of the Context that the Template is to be created in, as well as the Identifier of the Template itself.
Take careful note of the template identifier as you will need it later in the process.
The Identifier that you enter for the context will also be used as the value denoted by <<context-id>> in the examples below.
The Identifier that you enter for the Template will also be used as the value denoted by <<template-id>> in the examples below.

The ANT script will generate following folders under: plcslib\data\contexts\<<context-id>>\templates\<<template-id>>

dvlp
to hold development files that are used as part of the development of the Template
images
to hold images such as diagrams for this Template
test_data
to hold test / exemplar data for this Template

and following files:

template.xml
the main XML file that defines the Template. This will require further editing
(See Step 4)
Template.png
a file containing an image of the Block definition diagram for the template. The template creation script generates this as a placeholder file which will be overwritten when the SysML for the Template is created. (See Step 5)
<<template-id>>.png
a file containing an image of the Parametric diagram for the template. The template creation script generates this as a placeholder file which will be overwritten when the SysML for the Template is created. (See Step 5)

Once the Template been created, it will need to be inserted to the list of Templates belonging to that Context. If the Template has been created in the Context <<context-id>>, then the file to be updated is :

plcslib\data\contexts\<<context-id>>\context_index.xml

This file should be edited, preferably in an XML Editor (see PLCSlib development Tools : XML Editor).
The context_index.xml file is created by the Context creation script and contains numerous comments that are designed to aid the user in creating the documentation. The existance of the template needs to be logged in the <templates> section of the file.

Particular care needs to be taken that the template identifier inserted into the record in this file matches that given to the ANT build script for template creation

Issue reporting