Enable triggers

You enable triggers by configuring them in the triggers.xml file.

Note: You should make these configuration changes in the Test environment and test them before copying them to the Production environment. In a dedicated SaaS deployment, after testing the changes, ask IXIASOFT Customer Support to copy the changes to the Production environment.
  1. In the TEXTML Administration perspective, connect to your server.
  2. Locate the triggers.xml file in the repository's /system/conf collection.
  3. Check out the file and open it for editing.
  4. Add a new <trigger> element, as follows:
    <trigger apply-to="cms-action" class="trigger-class" name="trigger-name" objtype="type-of-object" schedule="before|after"> 
       <parameters>
          <param name="initial-status" value"initial-status-value">
          <param name="end-status" value"end_status-value">
       </parameters>
    </trigger>   

    where:

    OptionDescription
    cms-action Name of the action that will execute the trigger; for example, "Release". Valid values depend on the trigger.
    trigger-class Name of the Java class that defines the trigger; for example, "com.ixiasoft.cms.triggers.AddIds".

    Enter one of the preconfigured triggers (see the links at the end of this topic for the set of valid trigger classes) or enter the name of the trigger class that you created.

    trigger-name Name of the trigger as it will be displayed to the users in status windows; for example, "Add Ids". Select a name that will be meaningful to your users.
    type-of-object Type of the object to which the trigger will be applied; for example, "image", "map", or "topic". If a trigger applies to more than one object type, you must create one trigger per object type. For example, if a trigger applies to releasing maps and releasing topics, then you create a trigger for the Release command with an objtype="map" and another trigger with an objtype="topic".
    before|after Specifies whether the trigger will be executed before or after the action is performed. Valid values are:
    • before: The trigger is executed before the action. If the trigger fails, then the action is not performed. For example, the CheckSvgContent trigger—which validates that Scalable Vector Graphics (SVG) images do not contain external links—should be executed before the Release action. If the trigger fails, then the document should not be released.
    • after: The trigger is executed after the action, so the action is performed even if the trigger fails. For example, a trigger that sends notifications to users should be executed after the action, since it should not block the action if it fails.
    initial-status-value and end-status-value Apply to status triggers only. Specify the initial status and end status that will prompt the trigger. For example, to specify a trigger that is executed when the status goes from Authoring:Draft to Authoring:Edit review, enter:
    <parameters>
          <param name="initial-status" value"Authoring:Draft">
          <param name="end-status" value"Authoring:Edit review">
    </parameters>
    Do not include the <parameters> element for action triggers.
    For example, the following code creates an AddIds trigger that will be executed when a user releases a topic. The trigger is executed before the Release action. See the AddIds trigger documentation for more information.
    <trigger apply-to="Release" class="com.ixiasoft.cms.triggers.AddIds" name="AddIds" objtype="topic" schedule="before">         
    </trigger>   
    The following code shows how to enable a trigger that you created yourself (for example, AddPrepublishFlagTrigger):
    <trigger apply-to="changeStatus"
       class="com.ixiasoft.cms.triggers.AddPrepublishFlagTrigger" name="Add Prepublish Flag" objtype="map" schedule="after">
         <parameters>
            <param name="initial-status" value="Authoring:review"/>
            <param name="end-status" value="Authoring:accepted"/>
        </parameters>
    </trigger>
  5. Inform users of the changes.
    The changes will be applied automatically once users close and then reopen their IXIASOFT CCMS Desktop. Users can also apply the changes without restarting their CCMS Desktop by clicking IXIASOFT CCMS > Synchronize Configuration.