Reusing gendoc scripts inside the same document: <fragment>
tag
If a script section is used several times in a same document template,
tag <fragment> can be used to define the
script section and its attributes.
It can then be called from <gendoc> tags
inside the same template document
<fragment> tag can contain the following
attributes:
- name (Mandatory) : the name to call to use the
fragment
- importedBundles (Optional) : the external
bundles needed in the fragment code (separated by ;)
- removeClosingLine(Optional) : when this attribute is
set to ‘true’ the line containing the closing tag (</fragment>)
is removed during the generation
<dropSlide/>
<fragment name=’displayDiagram’
importedBundles=’commons;gmf;papyrus’>
<arg name=’element’ type=’uml::Element’/>
<dropSlide/>
[for (d:Diagram|element.getPapyrusDiagrams())] |
|
Diagram [d.name/]: |
<image object=’[d.getDiagram()/]’
maxH=’true’/> |
|
[/for]
<dropSlide/>
</fragment>
<dropSlide/>
|
|
<gendoc>
[for(p:Package|Package.allInstances())]
<dropSlide/>
|
|
<dropSlide/>
[/for]
</gendoc> |
|