Writing Your Template

Although Doc. Composer comes with a complete set of built-in element templates, you may still want to customize or even to write your own templates for maximizing the efficiency of document design. You can accomplish this by writing and programming your own element templates.

To create a template:

  1. Open Doc. Composer.
  2. Select the type of element to create template. For example, select ANY use case diagram in Diagram Navigator if you want to create a template to list specific shapes in use case diagram. You can select project / diagram / model element / diagram element in Diagram Navigator and Model Explorer.
    Selecting a diagram
    Selecting a diagram
  3. The Element Template Pane lists the templates available for the selected element type. If your Template pane is hidden, select View > Panes > Property in the toolbar (or press Ctrl+Shift+P) to show it.
  4. To simplify the programming of template, you are suggested to duplicate an existing template and start editing it, rather than do everything from scratch. Target on a template that gives the closest outcome to what you want to show in document. If you want to start from an empty document, select any templates. Right click on your selection and select Duplicate... from the popup menu.
    Duplicate an element template
    Duplicate an element template
  5. In the Edit Template window, specify the following information and click OK to continue.
    URI: A unique URL of the template, used in plugin development
    Name: The name of the element template, which is the name that shown under the Element Template Pane.
    Icon: An icon that best represent the layout of content that will be produced by using this template.
    Set as Default Template: Check this option if you want Doc. Composer to apply this template automatically when dragging elements directly from Diagram Navigator / Model Explorer onto document.
    Template content: Editor for programming the template.
    Editing an element template
    Editing an element template
  6. Customize your template and click OK to apply the changes. To learn how to write a template, click here.

Go to line

If your template contains invalid content, by performing a validation (by clicking Validate), the line number of the problem content will be displayed in the log pane. To view the problem content, you can use the 'Go to line' function.

  1. Click on the tiny arrow button next to the current line number.
    To use 'Go to line'
    To use 'Go to line'
  2. Enter the line number in the Input dialog box and click OK.
    Entering line number
    Entering line number

Related Resources

The following resources may help you to learn more about the topic discussed in this page.

 
16. Keeping Your Document Updated Table of Contents 18. Exporting a document

We use cookies to offer you a better experience. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.OK