Custom templates allow you to customize the appearance and content of a Cameo Collaborator document. You can specify which model elements are published, what element information is displayed, and the format in which it is displayed. A custom template can be stored in one of two ways depending on how you intend to use it:
- In a specific model - use this method if you intend to use the template to publish only one specific model.
- Stored as a separate .mdzip file - use this method if you intend to apply the template to multiple models.
You can create a custom document template as described below.
To create a custom document template
Open your modeling tool, and create a new model.
Creating a template in the model to be published
If you want to store your document template in the model you intend to publish, skip the first step and create a dedicated Package for the template inside the model. Such a template can only be used to publish the model it is stored in.
- Use the Document View Collaborator Profile in the model. Select it from the list in the <install.root>\profiles predefined location.
Create a Collaborator View Diagram:
- Right-click the route Package of the model (or the Package dedicated for storing the template) and in the menu select Create Diagram.
- In the open dialog, click Collaborator View Diagram and enter the diagram name.
- In the Collaborator View Diagram, create the Document element which is the root element of the template. The name of the Document is also the name of your custom template.
- In the same diagram, create one or multiple View elements to represent different types of content.
- Create Directed Composition relationships from the Document to each of the Views.
- In the Collaborator View diagram, create the Viewpoint element for each of the Views created in step 5.
- Create Conform relationships from each of the Views to its Viewpoint.
- Create a Collaborator Viewpoint Method Diagram for each Viewpoint element created in the previous step:
- In the Collaborator View Diagram (created in step 3), right-click the Viewpoint shape and in the menu select Create Diagram.
- In the open dialog, click Collaborator Viewpoint Method Diagram and enter the diagram name.
- In each Collaborator Viewpoint Method Diagram, use different types of operators (Collect, Filter, and Sort) to define how model information should be collected and displayed in each view of the document.
- Save the model. If you have created the template as a separate file, it is recommended to save it in the modelLibraries folder of the installation directory of your modeling tool or another location dedicated for storing custom templates.
Customizing the copy of a predefined template
Although you can create a completely new custom template, it is highly recommended that you modify the copy of a predefined template instead. It is a quicker method since you can reuse the elements that are already created, and easily remove the elements that you don't need.
However DO NOT change a predefined template. If you want to customize a predefined template, first create a copy of this template with a different name, and then modify the newly created template file.
To create the copy of a predefined template for customization
- Open the desired predefined template from the modelLibriaries folder located in the installation directory of your modeling tool.
Clear the Standard/System Profile checkbox in the Project Properties dialog, since it is not recommended to change system files:
- In the main menu, go to File > Project Properties.
- In the Project Properties dialog, select the Shared Packages tab.
Clear the Standard/System Profile check box.
In the main menu, select File > Save Project As, enter a new name for your template and click the Save button.