Documentation Center

Prevent automatic document title overwriting during import

The SETTITLE plugin configuration has been modified, and an <?ish-replace-title?> processing instruction has been added to the Editor templates. This prevents the title of a document from being automatically replaced with the metadata title during a BatchImport or Content Importer operation.

About this task

When a user manually creates a new object based on editor templates, the SETTITLE plugin inserts the FTITLE value in the <title> element. This is normal behavior. However, the same would occur when importing content with BatchImport or Content Importer. This is unwanted behavior, since it would overwrite a longer and usually correct title with a shorter file name acquired from the metadata. The SETTITLE plugin configuration modification addresses this issue.

Procedure

Modify the SETTITLE plugin configuration in the database through the Content Manager web client:

  1. In the web client, select Settings > XML Write Plug-In Settings.
  2. In the XML plugin configuration file, browse to the SETTITLE plugin XML definition.
  3. In the SETTITLE plugin XML definition, look for the OnNodeXPath parameter. In this parameter, replace any occurrence of the [title] text part with [title[child::processing-instruction('ish-replace-title')]], then save your changes.

    After implementing these plugin configuration changes, the original document title should remain unchanged, also when performing Duplicate or Check In As operations in the Client Tools.

    The modified SETTITLE plugin configuration should be similar to the following example:

    <plugin name="SETTITLE" handler="BlobSetXmlNode" ishcondition="EDT='EDTXML' and VERSION='1' and CurrentAction='Create'">
      <description>Set the title for new objects using the metadata title</description>
      <workingset>
        <ishfields>
          <ishfield name="FTITLE" level="logical" />
        </ishfields>
      </workingset>
      <initialize>
        <parameters>
          <parameter name="OnNodeXPath">(/*[contains(@class,' map/map ')][title[child::processing-instruction('ish-replace-title')]]) | (/*[contains(@class,' topic/topic ')][title[child::processing-instruction('ish-replace-title')]])</parameter>
          <parameter name="NodeType">node</parameter>
          <parameter name="NodeName">title</parameter>
          <parameter name="OverwriteExisting">Yes</parameter>
          <parameter name="Value">
            <value type="MetadataField">
              <parameter name="MetadataField">FTITLE</parameter>
              <parameter name="MetadataFieldLevel">logical</parameter>
            </value>
          </parameter>
        </parameters>
      </initialize>
    </plugin>

Modify all Editor templates in the database through the Content Manager web client:

  1. In the web client, select Repository.
  2. In the folder tree structure on the left pane, browse to the ../System/Editor template/Topics folder.
  3. For each object in this folder, carry out the following steps:
    1. Select the version of the object you want to modify, click Download to download the current content of the object, then click Save in the Save As dialog window to save it locally.
    2. Open the object in a text editor, for example Notepad, insert or append the text <?ish-replace-title?> to the title text of the <title> element, then Save the file.
    3. In the web client, create a new version of the object.
    4. In the pop-up dialog window, associate the appropriate language to the new version of the object, and fill out the input fields as necessary.
    5. Upload the object by clicking File > Choose File on the dialog window, and then by selecting the file you edited in the text editor.
    6. Release the object. If the object has multiple languages, for example en-us, ru-ru, and ja-jp, repeat these steps for each language.
  4. Repeat these steps with any other objects in the folders under ../System/Editor template where your topic, map and library templates are stored.
    The modified templates for topics, maps and library topics should be similar to the following topic template example:
    <?xml version="1.0" encoding="utf-16"?>
    <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
    <topic>
      <title>Enter the title of your topic here<?ish-replace-title?><title>
      <shortdesc>Enter a short description of your topic here (optional).</shortdesc>
      <body>
        <p>Your topic begins here.</p>
      </body>
    </topic>