Configuring dialogs for adding attribute values
The map editor changes the underlying XML. Therefore it must be aware of all elements that can be added at all possible locations. A number of elements and attributes have been pre-configured for DITA users. All possible attributes have not been configured, only those that are the most used.
The configuration of the map editor is done in two different files located on the server:
| Configuration file | Purpose |
|---|---|
| $\Author\ASP\ClientConfig\TemplateSpecification.xml | Configure which elements can be inserted. |
| $\Author\ASP\ClientConfig\MetadataConfig.xml | Configure the dialog that will appear when inserting an element. |
Example
When you insert a
<topicref> in a DITA map, the following dialog is generated:
The following illustrates how this is configured in the file TemplateSpecification.xml:
<template id="Dita.TopicRef.Template.Update" name="topicref">
<label resourceref="Dita.TopicRef.Form.Label">Topic Ref</label>
<labelXPath>{$labelxpath-section-default}</labelXPath>
<linkXPath>{$linkxpath-section-default}</linkXPath>
<form ref="Dita.TopicRef.Form.Update" />
<documentFragment linkFieldName="HRefField">
<topicref href="contentitem:HRefField" keys="contentitem:KeysField" format="contentitem:FormatField" linking="contentitem:LinkingField" ishcondition="contentitem:ConditionField">
<topicmeta>
<navtitle>contentitem:NavTitleField</navtitle>
</topicmeta>
</topicref>
</documentFragment>
</template>
The following illustrates how this is configured in the file MetadataConfig.xml:
<ishfrm id="Dita.TopicRef.Form.Update" validating="Form_Validating()">
<label resourceref="Dita.TopicRef.Form.Label">Topic Ref</label>
<ishfrmgroup>
<label resourceref="Dita.TopicRef.Group.Label">Topic ref</label>
<ishfrmfield id="HRefField" name="HRefField" ishfieldref="XMLID" level="content" ishfielddatatype="typereference" load="Field_Load()" valuechanged="Field_ValueChanged()">
<label resourceref="Dita.HRefField.Label">&HRef</label>
<description resourceref="Dita.HRefField.Description">Reference to the object you want to add.</description>
<typereference assist="yes" dialogmode="link">
<selectabletypes>
<type>ISHModule</type>
<type>ISHMasterDoc</type>
<type>ISHLibrary</type>
<type>ISHTemplate</type>
<type>ISHIllustration</type>
</selectabletypes>
</typereference>
<script language="Visual Basic">
<![CDATA[
Public Sub Field_Load(ByVal sender As Object, ByVal e As EventArgs)
...
End Sub
]]>
</script>
</ishfrmfield>
<ishfrmfield id="KeysField" name="KeysField" ishfieldref="KeysId" level="content" valuechanged="KeysField_ValueChanged()">
<label resourceref="Dita.KeysField.Label">Key definition</label>
<description resourceref="Dita.KeysField.Description">Key definition (Key for use in keyref).</description>
<!-- Comment out next line to enable keydef/keyref support. -->
<hidden />
<script language="CSharp">
<using namespace="System.Text.RegularExpressions" />
<![CDATA[
public void KeysField_ValueChanged(Object sender, EventArgs e)
{
...
}
]]>
</script>
</ishfrmfield>
<ishfrmfield id="NavTitleField" name="NavTitleField" ishfieldref="XMLNAVTITLE" level="content">
<label resourceref="Dita.NavTitleField.Label">&Navigation title</label>
<description resourceref="Dita.NavTitleField.Description">Short title used in the map.</description>
<typetext />
</ishfrmfield>
<ishfrmfield id="ConditionField" name="ConditionField" ishfieldref="XMLCONDITION" level="content">
<label resourceref="Dita.ConditionField.Label">&Condition</label>
<description resourceref="Dita.ConditionField.Description">Condition.</description>
<typecondition assist="yes" />
</ishfrmfield>
<ishfrmfield id="FormatField" name="FormatField" ishfieldref="XMLFORMAT" level="content">
<label resourceref="Dita.FormatField.Label">Format</label>
<description resourceref="Dita.FormatField.Description">Supply the format.</description>
<typetext />
<hidden />
</ishfrmfield>
<ishfrmfield id="LinkingField" name="LinkingField" ishfieldref="XMLLINKING" level="content">
<label resourceref="Dita.LinkingField.Label">&Linking</label>
<description resourceref="Dita.LinkingField.Description">Supply 'normal' in case the link is bi-directional.</description>
<typepulldown>
<valuelist>
<enumlist>
<item>
<value>sourceonly</value>
<label resourceref="Dita.LinkingField.ValueList.SourceOnly.Text">Source only</label>
</item>
<item>
<value>targetonly</value>
<label resourceref="Dita.LinkingField.ValueList.TargetOnly.Text">Target only</label>
</item>
<item>
<value>normal</value>
<label resourceref="Dita.LinkingField.ValueList.Normal.Text">Normal</label>
</item>
</enumlist>
</valuelist>
</typepulldown>
</ishfrmfield>
</ishfrmgroup>
<behavior showmode="optional" />
<script id="Dita.TopicRef.Form.Update.Script" language="Visual Basic">
<![CDATA[
Public Sub Form_Validating(ByVal sender As Object, ByVal e As EventArgs)
...
End Sub
]]>
</script>
</ishfrm>
Explanation
| Element | Description |
|---|---|
ishfrm | Definition of the dialog. Make sure to specify an id on the element. The id is used in the file TemplateSpecification.xml that defines which dialog to open when an element is inserted at a given location in the DITA map. |
ishfrmfield | Definition of an attribute for the element.
|