[quote=LilianWong]Hi user,
Thanks for your post. For having your own template to create tables of parent, attributes, operation…, there are 2 ways:
-
(easier) create a new template and copy all template content you want to the new template file.
-
(better on maintenance) create sub-templates for each template files, then change all template file to refer to its sub-template file. And create the new template to refer to the sub-templates.
** Sub-template (stored inside VPSuite/resources/Report/Default/Subtemplate folder) is used to be referred by a template for reduce the “content” of template.
e.g. both the Class and Actor has attribute(s) as children.
There are 2 Attributes.xml in Class’s and Actor’s template folder. However, the 2 Attributes.xml’s content should be equals.
The 2 Attributes.xml refer to one sub-template of Attributes, you just need to change the sub-template of Attributes to change content of both Attributes in Class and Actor.
For example, if you want to have a new template to generate attributes and operations of a class in the report:
I) open VPSuite/resources/Report/Default/Subtemplate folder
II) create sub-templates “Attributes.xml” and "Operations.xml"
III) edit the sub-templates content to fit your needs
IV) open VPSuite/resources/Report/Default/Class folder
V) edit the template “Attributes.xml” and “Operations.xml” to refer to the corresponding sub-template
For example, for the “Attributes.xml”:
VI) create your own template, say “AttributesAndOperations.xml”, and refer it to the sub-templates
After these, when you drag the template “AttributesAndOperations” to the report in Report Writer, you will get the combined contents of “Attributes.xml” + “Operations.xml”.
About customizing template of report, please refer to the following link:
http://oldresources.visual-paradigm.com/tips_and_tricks/general/defining_templates_for_report_writer.html
Hope these help. If there is any further inquiry, please feel free to contact me.
Best regards,
Lilian Wong[/quote]
for the customizing template, the link helps a lot.
i choose the first method :
in the default/class folder, i create a MyTemplate.xml with all i want to use :
<?xml version="1.0" encoding="UTF-8"?>
<Template>
<TemplateInformationHeader name = "MyInformation" description = "/" type = "table" default = "true"/>
<ElementBaseInitiationBlock>
<StaticText content = "Class : " style = "Heading 1"/><StringPropertyText propertyText = "name" style = "Heading 1"/>
<ParagraphBreak/>
<!--CHANGE LOG-->
<StaticText content = "ChangeLogs" style = "Heading 2"/>
<ParagraphBreak/>
<TableBlock colWidths = "1000,1100,5000,2950" tableWidth = "15500" alignment = "right">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Version" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Date" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Comments" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Authors" style = "Column header 1"/>
</TableCell>
</TableRow>
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StaticText content = "1.0" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StaticText content = "12/01/09" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StaticText content = "Initial Documentation" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StaticText content = "Firtname Name" style = "Table Contents"/>
</TableCell>
</TableRow>
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StaticText content = "" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StaticText content = "" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StaticText content = "" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StaticText content = "" style = "Table Contents"/>
</TableCell>
</TableRow>
</TableBlock>
<ParagraphBreak/>
<!--END OF CHANGE LOG-->
<!--DOCUMENTATION-->
<StaticText content = "Documentation" style = "Heading 2"/>
<ParagraphBreak/>
<TableBlock colWidths = "15000" tableWidth = "15500" alignment = "right">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "documentation" style = "Default"/>
</TableCell>
</TableRow>
</TableBlock>
<ParagraphBreak/>
<!--END OF DOCUMENTATION-->
<!--PARENT-->
<StaticText content = "Parent" style = "Heading 2"/>
<ParagraphBreak/>
<TableBlock colWidths="5000,5000" tableWidth="15500" alignment="right">
<TableRow>
<TableCell leftBorderEnable="false" rightBorderEnable="false" color="230, 230, 230">
<StaticText content="Name" style="Column header 1"/>
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false" color="230, 230, 230">
<StaticText content="Type" style="Column header 1"/>
</TableCell>
</TableRow>
<ParentModel>
<TableRow>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="fullName" style="Table Contents"/>
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="modelType" style="Table Contents"/>
</TableCell>
</TableRow>
</ParentModel>
</TableBlock>
<ParagraphBreak/>
<!--END OF PARENT-->
<!--ATTRIBUTES-->
<StaticText content = "Attributes" style = "Heading 2"/>
<ParagraphBreak/>
<HasChildElementChecker type = "Attribute" flag = "true">
<TableBlock colWidths = "2700,1600,2600,1800" tableWidth = "15500" alignment = "right">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Name" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Visibility" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Type" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Initial Value" style = "Column header 1"/>
</TableCell>
</TableRow>
<IterationBlock elementType = "Attribute">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "name" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "visibility" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "type" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "initialValue" style = "Table Contents"/>
</TableCell>
</TableRow>
</IterationBlock>
</TableBlock>
</HasChildElementChecker>
<ParagraphBreak/>
<!--END OF ATTRIBUTES-->
<!--ATTRIBUTES SUMMARY-->
<StaticText content = "Attributes Summary" style = "Heading 3"/>
<ParagraphBreak/>
<HasChildElementChecker type = "Attribute" flag = "true">
<TableBlock colWidths = "2100,13320" tableWidth = "15500" alignment = "right">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Name" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Documentation" style = "Column header 1"/>
</TableCell>
</TableRow>
<IterationBlock elementType = "Attribute">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "name" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "documentation" style = "Table Contents"/>
</TableCell>
</TableRow>
</IterationBlock>
</TableBlock>
</HasChildElementChecker>
<ParagraphBreak/>
<!--END OF ATTRIBUTES SUMMARY-->
<!--OPERATIONS-->
<StaticText content = "Operations" style = "Heading 2"/>
<ParagraphBreak/>
<HasChildElementChecker type = "Operation" flag = "true">
<TableBlock colWidths = "3000,3000,2000,2000" tableWidth = "15500" alignment = "right">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Name" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Parameters" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Visibility" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Return Type" style = "Column header 1"/>
</TableCell>
</TableRow>
<IterationBlock elementType = "Operation">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "name" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<IterationBlock elementType = "Parameter" ignoreParagraphBreakForLastModel = "true">
<StringPropertyText propertyText = "name" style = "Table Contents"/>
<StaticText content = " : " style = "Table Contents"/>
<StringPropertyText propertyText = "type" style = "Table Contents"/>
<StaticText content = "\n" style = "Table Contents"/>
</IterationBlock>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "visibility" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "returnType" style = "Table Contents"/>
</TableCell>
</TableRow>
</IterationBlock>
</TableBlock>
</HasChildElementChecker>
<ParagraphBreak/>
<!--END OF OPERATIONS -->
<!--OPERATIONS SUMMARY-->
<StaticText content = "Operations summary" style = "Heading 3"/>
<ParagraphBreak/>
<HasChildElementChecker type = "Operation" flag = "true">
<IterationBlock elementType = "Operation">
<!--OPERATIONS SUMMARY : DOCUMENTATION-->
<StaticText content = "Documentation of " style = "Heading 4"/><StringPropertyText propertyText = "name" style = "Heading 4"/>
<ParagraphBreak/>
<TableBlock colWidths = "2100,13320" tableWidth = "15500" alignment = "right">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Name" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Documentation" style = "Column header 1"/>
</TableCell>
</TableRow>
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "name" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "documentation" style = "Table Contents"/>
</TableCell>
</TableRow>
</TableBlock>
<ParagraphBreak/>
<!--END OF OPERATIONS SUMMARY : DOCUMENTATION-->
<!--OPERATIONS SUMMARY : PARAMETERS-->
<StaticText content = "Parameters of " style = "Heading 4"/><StringPropertyText propertyText = "name" style = "Heading 4"/>
<ParagraphBreak/>
<TableBlock colWidths = "5000,5000" tableWidth = "15500" alignment = "right">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Name" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Type" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Direction" style = "Column header 1"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false" color = "230, 230, 230">
<StaticText content = "Documentation" style = "Column header 1"/>
</TableCell>
</TableRow>
<IterationBlock elementType = "Parameter">
<TableRow>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "name" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "type" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "direction" style = "Table Contents"/>
</TableCell>
<TableCell leftBorderEnable = "false" rightBorderEnable = "false">
<StringPropertyText propertyText = "documentation" style = "Table Contents"/>
</TableCell>
</TableRow>
</IterationBlock>
</TableBlock>
<StaticText content = "" style = "Text body"/>
<ParagraphBreak/>
<!--END OF OPERATIONS SUMMARY : PARAMETERS-->
<!--OPERATIONS SUMMARY : RAISED EXCEPTION-->
<StaticText content = "Raised Exceptions of " style = "Heading 4"/><StringPropertyText propertyText = "name" style = "Heading 4"/>
<ParagraphBreak/>
<TableBlock colWidths="5000,5000" tableWidth="15500" alignment="right">
<TableRow>
<TableCell leftBorderEnable="false" rightBorderEnable="false" color="230, 230, 230">
<StaticText content="Value" style="Column header 1"/>
</TableCell>
</TableRow>
<ForEach property="raisedExceptions">
<TableRow>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="value" style="Table Contents"/>
</TableCell>
</TableRow>
</ForEach>
</TableBlock>
<ParagraphBreak/>
<!--END OF OPERATIONS SUMMARY RAISED EXCEPTION-->
<!--OPERATIONS SUMMARY : REFERENCE-->
<StaticText content = "Reference of " style = "Heading 4"/> <StringPropertyText propertyText = "name" style = "Heading 4"/>
<ParagraphBreak/>
<TableBlock colWidths="5000,5000" tableWidth="15500" alignment="right">
<TableRow>
<TableCell leftBorderEnable="false" rightBorderEnable="false" color="230, 230, 230">
<StaticText content="Name" style="Column header 1"/>
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false" color="230, 230, 230">
<StaticText content="Path" style="Column header 1"/>
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false" color="230, 230, 230">
<StaticText content="Description" style="Column header 1"/>
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false" color="230, 230, 230">
<StaticText content="Type" style="Column header 1"/>
</TableCell>
</TableRow>
<ForEach property="references" ignoreParagraphBreakForLastModel="false">
<TableRow>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="name" style="Table Contents"/>
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="path" style="Table Contents"/>
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="description" style="Table Contents"/>
</TableCell>
<TableCell leftBorderEnable="false" rightBorderEnable="false">
<StringPropertyText propertyText="type" style="Table Contents"/>
</TableCell>
</TableRow>
</ForEach>
</TableBlock>
<ParagraphBreak/>
<!--END OF OPERATIONS SUMMARY : REFERENCE-->
<!--OPERATIONS SUMMARY : diagram-->
<include template="ProcessDiagram.xml"/>
<include template="SubDiagrams.xml"/>
<!--END OF OPERATIONS SUMMARY : diagram-->
</IterationBlock>
</HasChildElementChecker>
<StaticText content = "" style = "Text body"/>
<!--END OF OPERATIONS SUMMARY-->
</ElementBaseInitiationBlock>
</Template>
but the diagram for each operation isn’t present in the report.
so how i put the associed diagram for each operation ?
The activity diagram was in reference in the operation.
Thanks