Configure parameters for a map template
Instead of inserting variables that require a user to enter a value, you can configure parameters that can replace the variables with controls to select dates, to add a select menu, or to add a character-constrained text box.
The templateparameters.xml file defines the parameters for use in map templates with examples of each parameter type. You can alter default examples to suit your requirements.
<parameter name="[name]" label="[display label]" type="[DATE|TEXT|LIST]" mandatory="[true|false]"/>
Where you replace: [name]
with a name for the parameter.[display label]
with the text that you want seen by the users in the Create Map dialog box.
To specify whether the parameter is mandatory or optional, set the mandatory
attribute. When the mandatory
attribute value is set to "true"
, a user must enter or select a value during map creation. When
it is set to "false"
, a user can leave the value
blank.
<parameter name="PubDate" label="Publication date" type="DATE" mandatory="true"/>
In this instance, you can add the PubDate
parameter to a map template. When a user creates a map based on the map template,
the Publication date appears on the
Create Map dialog box for the Template Variables table. Since it is defined as
mandatory, a user must choose a date before clicking Create.
regex
attribute. The regex
attribute allows you to use regular expressions (regex) to
control what is accepted as a valid value. For example:
<parameter name="BookNum" label="Serial number" type="TEXT" regex="[0-9]{6}" mandatory="true"/>
In this instance, you can add the BookNum
parameter to your map template. When a user creates a map based on the map template,
Serial number appears in the Template Variables table. A user must enter a
six-digit number in the Values column before
clicking Create, .
<parameter name="AuthorList" label="Author" type="LIST" mandatory="false">
<value>Doe, John</value>
<value>Smith, Jane</value>
<value>Petit, Eve</value>
<value>Tremblay, Joseph</value>
</parameter>
In this instance, you can add the AuthorList
parameter to your map template. When a user creates a map
based on the map template, the Author list
appears in the Template Variables table. A
user may or may not choose to select a value from the Author list.
To configure parameters for a map template:
- Replace the existing map ID attribute value with
{{ixia.id}}
. - Replace the existing xml:lang attribute value with
{{ixia.xml:lang}}
. - Replace the existing title with
{{ixia.title}}
.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//IXIA//DTD IXIA DITA Map//EN" "../../system/dtd/ixia/IxiaMap.dtd">
<map id="{{ixia.id}}" xml:lang="{{ixia.xml:lang}}">
<title>{{ixia.title}}</title>