Importing a template

You can import an entire template or a section of a template by physically embedding elements into another template. You can also import a template into another template during document generation by dynamically linking to it instead of physically embedding it.

Before you begin

For more information about how user names and passwords are stored, see Security considerations for IBM® Rational® Publishing Engine.

About this task

You can import templates with their data sources, master pages, styles, and variables. If the imported content matches the contents of the template, you receive a conflict notification. Edit the content or replace the content to resolve the conflict.

Procedure

  1. In Document Studio, select one of these options:
    • To insert a template into an existing element or to the end of your template, click Template > Import Template.
      • If an existing element is selected in the template and that element can contain imports, Import Template is enabled so that the imported content can be inserted into the selected element.
      • If an existing element is selected in the template and that element cannot contain imports, Import Template is disabled.
      • If no existing elements are selected, Import Template is enabled so that the imported content can be inserted to the end of the template.
    • To add a template before or after an element that is selected in the template content editor, click Template > Import Template Special and then select Before selection or After selection.
    In the Import template wizard, click Next.
  2. In the Select Template window, select a template.
  3. Select the importing type:
    • Physical embedding: Inserts the template elements into the current template.
    • Dynamic referencing: Template elements are linked and loaded during document generation into the output.
      Important: Use physical embedding instead of dynamic referencing when:
      • A template or snippet is designed to extract information from a data source.
      • A template or snippet contains a dynamic reference in it.
  4. If there are any conflicting information for master pages, styles, and variables, the Conflicting content Conflicting content icon displays in front of the conflicting content. Edit the conflicting contents:
    • To use the information from existing template, click Use Existing Item For Conflicts As Allowed.
    • To edit the conflicting content with the new content, click Edit, modify the value and then click OK.
      Note: If you first imported a template by dynamically referencing it, and then imported another template by physically embedding it, none of the conflicts can be resolved by reusing the values for the dynamically referenced template. You must edit each conflict to resolve it.
    Click Next.
  5. Review the summary and click Finish. If authentication credentials were provided in the imported template and display in the summary, those credentials are also stored in the host template. You can revise those credentials after the import.
  6. Optional: If necessary, reorder the elements in your template. If you imported several templates or elements in succession, each item you added displays above the last item. The latest import displays first. In the template content editor, you can drag the imported templates to a specific location to reorder the template.
    Note: In the Outline view, you can drag elements to a specific location to reorder the template, but you cannot drag imported templates to reorder the template.

Results

The template content or template link is inserted into your host template.

If you selected Dynamic referencing for the importing type, the styles, master pages, data sources, and variables from the imported template display in the Outline view with (referenced) after the name. These references are for viewing purposes only. They are not editable, not usable directly in expressions, and cannot be dragged into template elements.

What to do next

  1. If you chose to dynamically reference the file, you might be prompted to change the file path to be relative to the host template.
    If you are prompted to use relative paths:
    • Remember that the relative path that is specified is relative to the host template, not the document specification.
    • If you move one of the templates from its original location and the relative path changes, you must remove the referenced template from the host template and import the template again.
    If you are not prompted to use relative paths, verify that:
    • The host template is saved.
    • Both the host and imported templates are version 2 templates.
  2. If necessary, revise the authentication credentials stored in the host template from the imported template.

Feedback