Publisher and Web Interface > Publisher > Developing document definitions > Overview of developing document definitions (Publisher) > Worked example: extracting specific items (Publisher)
  
Worked example: extracting specific items (Publisher)
This is one of five worked examples that relate to developing document structures:
Worked example: extracting items through model item types
Worked example: extracting items through child roles and child types
Worked example: extracting items through extended model item types (stereotypes)
Worked example: extracting diagrams and their items
Worked example: extracting specific items
Often you will want to include specific items and diagrams from a specific model in a document.
You can add specific items and diagrams to a document definition; at the time of generation Publisher extracts the items and diagrams from the appropriate model, irrespective of which publication model is used for a generated document.
In this worked example, we create a document definition that extracts copyright text from a Text Diagram that resides in a shared model named Resources. The name of the Text Diagram is 'Copyright for Software - US'. This example uses the Word output format.
The source model contains Text Diagrams that contain different copyright text.
Defining the extraction of a specific Text Diagram:
In this example, we start by creating a new empty Document Definition.
We ensure that Publisher is showing all the panes required to define a Document Definition by clicking the Full Editor Layout toolbar button.
We want our generated document to contain the copyright text from the 'Copyright for Software - US' text diagram.
In Modeler, we copy the 'Copyright for Software - US' text diagram.
We return to Publisher. In the document structure, we select the Body item, click the Add Modeler model item section and select the item under Clipboard.
Note that after copying the item in Modeler, we could have pasted it directly to the Body icon in the document structure.
The section is going to include the copyright and disclaimers, so we select the Copyright for Software - US item in the document structure, and in the Properties pane we change the Title Text property to Copyright and Disclaimers.
In the Properties pane, we can see that the Name, FullScopedName, Description, DynamicUmlClassName and HyperlinkedRTF properties are extracted.
We remove the Name property by selecting it and clicking the
Delete Item button. We remove the FullScopedName, Description and DynamicUmlClassName properties in the same way.
We keep the HyperlinkedRTF property as this is the content of the Text Diagram, but do not require a label for the property when generated, so we set the Generate Label property to Don't Generate.
We save the changes and then generate the document. The Word document includes the following text.
Whenever a user generates a document using this document definition, the document will include the text from the Copyright Software - US text diagram in the Resources model, irrespective of which model is chosen as the publication model for generated document.
In this worked example we have demonstrated how to use a specific item in a document definition.