blob: a5df43e23cca5d347a565127332b37d3e5d96322 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
<title>Reusing gendoc scripts inside the same document: &lt;fragment&gt; tag</title>
<link rel="stylesheet" type="text/css" href="userguide.css">
</head>
<body>
<h1>Reusing gendoc scripts inside the same document: <span class="codeHeading">&lt;fragment&gt;</span>
tag</h1>
<p>If a script section is used several times in a same document template,
tag <span class="code">&lt;fragment&gt;</span> can be used to define the
script section and its attributes.</p>
<p>It can then be called from <span class="code">&lt;gendoc&gt;</span> tags
<strong><u>inside the same template document</u></strong></p>
<p><span class="code">&lt;fragment&gt;</span> tag can contain the following
attributes:</p>
<ul>
<li><strong>name (Mandatory)</strong> : the name to call to use the
fragment</li>
<li><strong>importedBundles</strong> (Optional) : the <a href="bundles.html">external
bundles</a> needed in the fragment code (separated by <strong>;</strong>)</li>
<li><strong>removeClosingLine</strong>(Optional) : when this attribute is
set to ‘true’ the line containing the closing tag (<span class="code">&lt;/fragment&gt;</span>)
is removed during the generation</li>
</ul>
<br>
<table class="pptx" border="solid" height="320" width="540">
<tbody>
<tr height="140px" valign="top">
<td>
<table class="pptx" width="100%">
<tbody>
<tr height="75">
<td>&lt;dropSlide/&gt;<br>
<span class="blue">&lt;fragment name=’displayDiagram’
importedBundles=’commons;gmf;papyrus’&gt;<br>
&#8195;&lt;arg name=’element’ type=’uml::Element’/&gt;<br>
</span><br>
&lt;dropSlide/&gt;<br>
[for (d:Diagram|element.getPapyrusDiagrams())]</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<table class="pptx" border="solid" height="320" width="540">
<tbody>
<tr height="140px" valign="top">
<td>
<table class="pptx" width="100%">
<tbody>
<tr>
<td> Diagram [d.name/]: </td>
</tr>
<tr height="200">
<td valign="top"> &lt;image object=’[d.getDiagram()/]’
maxH=’true’/&gt; </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<table class="pptx" border="solid" height="320" width="540">
<tbody>
<tr height="140px" valign="top">
<td>
<table class="pptx" width="100%">
<tbody>
<tr>
<td> &#8195;[/for]<br>
<span class="blue"></span>&lt;dropSlide/&gt;<br>
<span class="blue">&lt;/fragment&gt;<br>
</span>&lt;dropSlide/&gt;<br>
<span class="blue"></span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<table class="pptx" border="solid" height="320" width="540">
<tbody>
<tr height="140px" valign="top">
<td>
<table class="pptx" width="100%">
<tbody>
<tr>
<td> &lt;gendoc&gt;<br>
[for(p:Package|Package.allInstances())]<br>
&lt;dropSlide/&gt;<br>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<table class="pptx" border="solid" height="320" width="540">
<tbody>
<tr height="140px" valign="center">
<td>
<table class="pptx" width="100%">
<tbody>
<tr>
<td> <span class="blue">[p.displayDiagram()/]</span> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<table class="pptx" border="solid" height="320" width="540">
<tbody>
<tr height="140px" valign="top">
<td>
<table class="pptx" width="100%">
<tbody>
<tr>
<td> &lt;dropSlide/&gt;<br>
&nbsp;&#8195;[/for] <br>
&lt;/gendoc&gt; </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>