Publisher and Web Interface > Publisher > Developing document definitions > Working with only part of a model > Working with only part of a large model (Publisher)
  
Working with only part of a large model (Publisher)
If you are working with a large model, you may want to generate output using only part of that model as input. Typically you would identify the parts of the model you want to use through Packages.
This topic documents three approaches:
Using a reference Tag Definition in the model to identify source Packages.
Adding source Packages to the Publisher document definition.
Using a model item or diagram as the root for extracting items and diagrams.
Using a reference Tag Definition in the model to identify source Packages
One way of identifying source items for generated output is to link the source items for the generated output to an item through a reference through a reference Tag Definition. In Publisher, you can then add the reference Tag Definition to your document definition to extract all the items that are referenced through that Tag Definition.
The advantage of this approach is that the Publisher document definition is generic and through each source model you can specify which items are included in generated output.
The following example demonstrates this approach.
In our source model we have six Packages (Package1 to Package6), but we only want to use Package1 and Package3 as inputs for our generated output.
We create a Package named Publisher Source Items and select its Profile Package check box so that it appears in the ProfilePackages folder in Publisher. The Publisher Source Items contains the items required to identify the source Packages for our generated output:
A Stereotype (Publisher Stereotype) that owns the reference Tag Definition; we apply this Stereotype to our Class.
A reference Tag Definition (Source Items For Document Generation) that can reference the source Packages for our generated output.
A Class (Publisher Source Items) from which we reference the source Packages (Package1 and Package3) through the reference Tag Definition.
In Publisher, we create the document structure as follows:
We add the Publisher Stereotype stereotype to the document structure.
We set the Generate Title and Generate Model Item Tables properties to Don't Generate so that heading are not generated for the Publisher Stereotype stereotype.
We add a Source Items For Document Generation reference tag definition as a child role.
Again, we set the Generate Title and Generate Model Item Tables properties to Don't Generate so that heading are not generated for the child role.
We add the Package child type and rename it Packages.
When we generate output, all the Packages that are referenced through the Source Items For Document Generation tag definition (Package1 and Package3) are extracted for the generated output. Through the document definition, we can extract items that are associated with the source packages, for example, their content.
Adding source Packages to the Publisher document definition
Another way of working selected source items for a generated output is to add those source items directly to the Publisher document definition. Through the document definition, you can then extract items that are associated with the source items.
The disadvantage of this approach is that the document definition is not generic and applies only to the model that contains the source items.
Using a selected model item or diagram as the source of the generated output
By default, the model is the root for extracting items and diagrams. For example, if you add a Class model item type to your document structure, Publisher will extract all Classes in the model.
However, when a model item type is assigned to a document structure item, you can specify that the selected item or diagram in Modeler is used as the assigned item for a generated output. You do this through the Use Active Model Item As Source property of a document structure item that has an assigned model item type.
If you set the Use Active Model Item As Source property to True, at the time of generation, the item or diagram that is selected (or was last selected) in Modeler is used as the assigned item or diagram for extracting items for that document structure item.
For example, you can assign a Package model item type to a document structure item, define the child roles and child types, and then set the Use Active Model Item As Source property to True. At the time of generation, you can select a Package in Modeler, and Publisher will generate the output using the selected Package as the assigned item for the document structure item.
Important: When you set the Use Active Model Item As Source property to True, the type of the item or diagram you select in Modeler must match the model item type that is assigned to the document structure item. If the type does not match, Publisher ignores the selected item or diagram in Modeler and does not generate anything for the document structure item.
Note: Use Active Model Item As Source is used only when a model item type is the assigned item. Although available for an assigned model item, the Use Active Model Item As Source property is ignored when the assigned item is a model item.