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
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
images
test_data
and following files:
template.xml
Template.png
<<template-id>>.png
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