Configure parameters for a map template
Instead of inserting variables into which users enter data, you can configure parameters that can replace the variables with controls such as a datepicker, a select menu, or a constrained text box.
The templateparameters.xml file defines the parameters which can be used with the map templates, and it contains examples of each type of parameter. These existing examples can be changed to suit your needs.
<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"
, the user must enter or select a value before a map can be created. When it is set to "false"
, then the user can leave the value blank.
<parameter name="PubDate" label="Publication date" type="DATE" mandatory="true"/>
With this example, you can add the PubDate
parameter to your map template. When the user creates a map based on the map
template, a datepicker called Publication
date appears on the Create
Map dialog box in the Template Variables table. Since it is defined as a mandatory value, the user
must choose a date before being able to click 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"/>
With this example, you can add the BookNum
parameter to your map template. When the user creates a map based on the map
template, Serial number appears in the
Template Variables table. Before the
user can click Create, a six-digit number
must be entered in the Values column.
<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>
With this example, you can add the AuthorList
parameter to your map template. When the user creates a map
based on the map template, the Author list
appears in the Template Variables table from
which the user can select a value.
- 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>