Configure the AddIds trigger to automatically assign IDs to elements

The AddIds trigger automatically assigns IDs to specified elements when you release maps and topics.

To apply the trigger, you specify in a configuration file (xpathforids.xml) the elements of a map or topic for which you want automatic IDs. For example, the following code specifies that IDs will be generated for sections, figures, and tables when a user releases a topic and for topic groups when a user releases a map:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xpaths PUBLIC "-//ixiasoft.com//cms//config//idsxpath" "xpathforids.dtd">

<!-- Defines the list of Xpath for elements that must have an ID -->

<xpaths>
	<xpath value="//*[contains(@class, ' topic/section ')]"/>
	<xpath value="//*[contains(@class, ' topic/fig ')]"/>
	<xpath value="//*[contains(@class, ' topic/table ')]"/>
	<xpath value="//*[contains(@class, ' map/topicgroup ')]"/>
</xpaths>

When a user releases a map or topic, the CCMS checks whether the elements configured in the xpathforids.xml file have an ID. If an ID is already assigned, it is kept as is. Otherwise, the CCMS generates a unique ID and assigns it to the element.

To enable this trigger:

  1. Open the TEXTML Administration perspective by clicking the TEXTML Administration shortcut on the tool bar. If the shortcut is not displayed, follow these steps:
    1. Select Window > Open Perspective > Other
    2. Click TEXTML Administration.
    3. Click OK.
  2. In the TEXTML Administration view, double-click the server. If your server is not displayed in the view, you must add it to the view.
  3. When the Connect as dialog opens, type your username and password and click OK.
  4. Double-click the name of your docbase to open a connection to the Content Store.
  5. Locate the xpathforids.xml file in the repository's /system/conf collection.
  6. Right-click the file and click Check Out.
  7. Double-click the file to open it in the editor.
  8. In the xpathforids.xml file, specify the elements of the map or topic for which you want to generate automatic IDs.
    Note: If you do not have this file, contact IXIASOFT.
  9. When you are done, save, close, and check in the xpathforids.xml file.
  10. Locate the triggers.xml file in the repository's /system/conf collection.
  11. Right-click the file and click Check Out.
  12. Double-click the file to open it in the editor.
  13. Add a trigger to the triggers.xml file as described in Enable triggers, using the values described below. To generate IDs for elements in both maps and topics, you must create two triggers, one for the map and one for the topic.
    apply-to
    Release
    class
    com.ixiasoft.cms.triggers.AddIds
    objtype
    topic or map
    schedule
    before
    Example
    <trigger apply-to="Release" class="com.ixiasoft.cms.triggers.AddIds" name="AddIds" objtype="topic" schedule="before">         
                                    </trigger>   
                                    <trigger apply-to="Release" class="com.ixiasoft.cms.triggers.AddIds" name="AddIds" objtype="map" schedule="before">         
                                    </trigger>   
  14. When you are done, save, close, and check in the triggers.xml file.
  15. Inform users of the changes.
    The changes will be applied automatically once users close and then reopen their . Users can also apply the changes without restarting their IXIASOFT CCMS Desktop by clicking DITA CMS > Synchronize Configuration.