Publisher and Web Interface > Publisher > Developing document definitions > Working with model item types and model items > Overview of working with model item types and model items (Publisher)
  
Overview of working with model item types and model items (Publisher)
Publisher uses the following assignable items to define which items are extracted from a publication model; model item types, extended model item types (Stereotypes) and model items:
A model item type provides a generic way of extracting all items or diagrams of a specified type from a publication model.
An extended model item type provides a generic way of extracting from a publication model all items and diagrams that are stereotyped by a specified Stereotype.
A model item provides a way of extracting a specified item or diagram from its source model, irrespective of which publication model is used at the time of generation.
For more information about overview of working with model item types and model items refer to worked examples for extracting items and diagram through model item types, and extended model item types and model items.
Important: Publisher uses the Modeler Automation Interface names of item and diagram properties and relationships (attributes and associations through the Modeler Automation Interface) to define how information about model items and properties are extracted from a model. To define complex outputs, you will require a good working knowledge of the Modeler meta model. The Modeler Automation Interface Help documents the attributes and associations of each item type in a model.
This topic has the following sections:
Adding assignable items to the document structure
Model item type assignable items
Extended model item type assignable items (Stereotypes)
Model Item assignable items
Finding assignable items in the document structure
Defining properties to include
Defining associated items and diagrams to extract
Repeating sections
Specifying a specific source model for model item types
Adding assignable items to the document structure
To create a document structure item from an assignable item: select the parent document structure item, and then click the appropriate button for creating an assigned document structure item.
To assign a different assignable item to an assigned document structure item: select the document structure item, in the Properties pane select the Model Item Type property, in the value cell click the arrow, and the select the assignable item you want to use.
Model Item Type assignable items
The model item types allow you to extract items and diagrams from the publication model (source model for generating output). For example, adding the Class model item type to your document structure will extract all Classes from the publication model.
Use the Add Modeler Dictionary Item Section and Add Modeler Diagram Section buttons to add model item type assignable items to the document structure.
After adding a model item type to the document structure, you can define properties to extract, and define associated items and diagrams to extract. For more information, see the sections that follow.
Notes:
To extract Activity Diagrams, use the UML Activity Diagram type.
To extract Interfaces, use the UML Interface type.
To extract Signals, use the UML Signal type.
Extended Model Item Type assignable items (steroetypes):
The extended model item types allow you to extract items and diagrams that are stereotyped by a specific Stereotype.
Extended model item types are useful when working with PTC profiles, such as the UPDM profile, because you can use the extended model item types to extract item and diagram types that are created by the profile (the profiles use Stereotypes to create new types in a model).
Note:
In the Publisher help, an extended model item type refers to any Stereotype, not just Stereotypes that have their Override Type Name check boxes selected.
Package scoped Stereotypes are shown only if the Profile Package check box is selected on the Package's Property Pages.
After adding an extended model item type to the document structure, you can define properties to extract, and define associated items and diagrams to extract. For more information, see the sections that follow.
Notes:
When defining properties to extract for an extended model item type, only those properties that are common to all the Stereotype's valid model item types are available.
When you add a child role to an extended model item type, only those roles that are common to all the Stereotype's valid model item types are available.
In the Document Structure pane, the Stereotype's icon is displayed only if that Stereotype can be found in the active model.
Model Item assignable items
Specific model items and diagrams can be made available Publisher:
In Modeler: copy the item or diagram you want to assign.
In Publisher: in the Document Structure pane select the parent item, click the Add Modeler Model Item Section button. The items and diagrams you copied in Modeler is available for selection.
Alternatively,
In Publisher: right-click the parent item in the document structure, and then click Paste.
Note that if you copy a diagram symbol that has an underlying dictionary item, the underlying dictionary item is added to the Clipboard folder.
A model item is a specific item or diagram that is extracted from its source model, irrespective of which publication model is used at the time of document generation. For example, the Kiosk class from the Filling Station model.
Important:When you add a model item to the document structure, the Database that owns the item's model must be available to any users that generate output using that document structure, that is, the database must be bookmarked in their Model Explorer.
After adding a model item to the document structure, you can define properties to extract, and define associated items and diagrams to extract. For more information, see the sections that follow.
When a document structure item references a model item in Modeler you can navigate to that model item in Modeler from the referencing document structure item: right-click the document structure item, and then click Find in Modeler.
Tip: Through the Use Active Model Item As Source property, you can set up a document structure item so that at the time of generation, the item or diagram that is selected in Modeler is used as the assigned item. For more information, refer to Using the selected item or diagram in studio as an assigned item.
Important: When Publisher generates a specific model item or diagram, the active model in Modeler determines the model version from which the model item or diagram is extracted:
Publisher searches for the model item or diagram in the active model.
If Publisher cannot find the model item or diagram in the active model, Publisher searches for the model item or diagram in the latest version of the model from which the model item or diagram was added.
If Publisher cannot find the model item or diagram in the latest version of the model from which the model item or diagram was added, Publisher searches for the model item or diagram in the specific version of the model from which the model item or diagram was added.
Finding assignable items in the document structure
You can find document structure items that use an assignable item by right-clicking the assignable item in the Modeler pane or Publisher pane, and then clicking Find in Document.
After finding a document structure item that uses the assignable item you right-clicked, you can find other document structure items that use the same assignable item by clicking the F3 key.
Defining properties to include
When Publisher extracts items and diagram from a model, by default it extracts the following properties of each item or diagram:
For dictionary items (except the Model): Name, FullScopedName, Description and DynamicUmlClassName.
For the Model: FullScopedName, Description, DynamicUmlClassName and Reference.
For diagrams (except Text Diagrams): Name, FullScopedName, Description, DynamicUmlClassName and EMFPlusOnly. The EMFPlusOnly property of a diagram extracts the diagram image
For Text Diagrams: Name, FullScopedName, Description, DynamicUmlClassName and HyperlinkedRTF. The HyperlinkedRTF property of a Text Diagram extracts its content.
For each document structure item, you can define which properties of the extracted items and diagrams are included in the generated document.
When you select a document structure item in the Document Structure pane, the Properties pane lists the properties that will be extracted below the Item Properties To Generate entry.
To add a new property: select the Item Properties To Generate entry or a property entry, and then click the New Item button. Publisher adds the first available property for the item, which you can then change to the property type you want to add through the Name property.
If you expand a property entry, you can see and set the following properties that define how the property is presented in the generated output: Generate, Generate Label and Label Text.
To delete a property: select the property entry, and then click the Delete Ite
You can change the properties that are extracted by default for items and diagrams through the Defaults pane. For more information, refer to Publisher Panes.
Tip: If you want the properties to appear in a table, set the Organize As Sections/Table property to In Table. When the Organize As Sections/Table property is set to In Table, you can include the title of the table in the List of Tables section by setting the Generate Title property to Generate (Word output format only).
Defining associated items and diagrams to extract
When you define the extraction of a model item or diagram, you will often want to extract other related items and diagrams. For example, if you extract Classes through the Class model item type, you may also want to extract the Attributes and Operations that each Class owns.
For each model item type, you can define child roles to extract associated items and diagrams; and for each child role, you can define child types to extract specific types of items and diagrams through that role. Through the child roles and child types you can define complex extractions. Note:
When you add a child role without any child types: all items and diagrams that can be extracted through that role are extracted. In the generated output, the extracted items and diagrams are arranged in alphabetical order.
Important: When using a child role with no child types, you can only extract properties that are common to all the child types that can be extracted through the child role.
When you add a child role with one or more child types: only those items and diagrams that can be extracted through the child role and match a child type are extracted. In the generated output, the extracted items and diagrams are grouped by their types. Property settings for each child type determine which properties are extracted.
For a child type you can define additional filtering, which you can define through the Filter property in the Properties pane. When you click the arrow in the Filter value cell, the dialog that is opened allows you to test the values of item properties (including the tagged values of Tag Definitions).
Note that through the dialog you can choose to ignore the type of the child type so that the filter settings apply to all items that are extracted through the parent child role.
You can use the Repeat Section property to make a child role recursive, that is, after extracting items through the child role, Publisher searches for other items that are linked to the extracted items through the same child role, and so on. For more information, see the Repeating Sections section that follows.
For more information refer to worked example that demonstrates how to define associated items and diagrams to extract.
Tip: For a diagram, you can use the Used Dictionary Item role to extract the items that appear on that diagram, or in the case of Text Diagrams, all items that are referenced through Model Object References.
After adding an assignable item to the document structure, you can define associated items and diagrams to extract:
To add a child role: select parent item in the document structure, click the Add Modeler Child Role Section button, and then select the child role you want to add.
To add a child type: select parent child role in the document structure, click the Add Modeler Child Type Section button, and then select the child type you want to add.
When you add a child role, the roles listed in the Role property are the Modeler Automation Interface associations available for the model item type. For information about the Modeler Automation Interface associations that are available for each model item type, see the topics in the Automation Interface > Object Attributes and Associations (Item Properties and Links) section of the Modeler Help.
By default, the child role selection dialog shows only public roles. You can select the Private and Tag Definition check boxes to show private roles and custom roles that are created through reference Tag Definitions.
Repeating sections
Through the Repeat Section property, you can make Publisher extract items and diagrams recursively through a child role, that is, after extracting items through the child role, Publisher searches for other items that are linked to those extracted items through that same child role, and so on.
When a child role has its Repeat Section property set to Repeat Section, a red R is shown on its icon in the document structure:
Important:
If you set up a child role to repeat and specify child types for that child role, using the same child role as a child role of any of those child types will result in items being extracted twice.
If a child role that is set up to repeat sections extracts an item that has already been extracted through that child role, no further items are extracted for that item and a message is added to the log (message is seen only when the Message level is set to Verbose).
In the following example, we show you how you can use the Repeat Section property to extract items from nested structures.
Our model contains the following nested Packages, nested Classes and Attributes.
We want to generate Publisher HTML output that shows the following:
The Package structure in the model.
For each Package, the Classes in directly owns.
For each Class, the Classes and Attributes it directly owns.
We want to extract the Package structure, so we start by extracting those Packages that are directly scoped to the model. We do this by adding the Model type to the Document Structure, adding the Package Item child role to the Model type (which relates a Model to its top-level items), and then adding the Package child type so that only Packages are extracted through the Package Item child role.
Note that we set the Generate Label properties of all the Document Structure items we create in this example to False.
We now want to extract the Package structure below the top-level Packages. A Package is related to its child items through the Package Item child role, which is the same role we used to extract the top-level Package from the model. So we can set the Package Item child role to repeat (set its Repeat Section property to Repeat Section) and again only child Packages of Packages will be extracted because of the Package child type in the Document Structure. A small red R is added to the Package Item child role icon.
We now want to extract the top-level Classes in each Package, so we add the Class child type to the Package Item child role. For each Package, its child Packages and Classes are now extracted.
To extract the Attributes of each Class, we add the Attribute child role to the Class child type.
We want to extract nested Classes, so we add the Contained Class child role to the Class child type and set its Repeat Section property to Repeat Section.
Notice that although Attributes are extracted for the top-level Classes, they are not extracted for the nested Classes. We need to also add the Attribute child role to the Class child type that extracts the nested Classes.
Through use of the Repeat Section property in the Document Structure, our example now extracts the Package Structure, the Class Structure in each Package, and the Attributes in each Class.
Specifying a specific source model for model item types
When you add a model item type or extended model item type to the document structure, the Source Model property of the document structure item is set to Publication Model.
This means that at the time of generation, Publisher extracts information from the publication model that is specified on the Generate pane in Publisher.
If required, rather than extracting information from the publication model, you can set up a document structure item to extract information from a specific model instead. This is useful if you want the generated output to include information from two or more models, for example, all Class Diagrams in two different models.
To specify the source model for a document structure item: select the document structure item, in the Properties pane select the Source Model property, click the selection button, and then select the source model you want to use.
When a user generates output, all source models must be bookmarked in their Model Explorer.