| <!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: <fragment> tag</title> |
| <link rel="stylesheet" type="text/css" href="userguide.css"> |
| </head> |
| <body> |
| <h1>Reusing gendoc scripts inside the same document: <span class="codeHeading"><fragment></span> |
| tag</h1> |
| <p>If a script section is used several times in a same document template, |
| tag <span class="code"><fragment></span> can be used to define the |
| script section and its attributes.</p> |
| <p>It can then be called from <span class="code"><gendoc></span> tags |
| <strong><u>inside the same template document</u></strong></p> |
| <p><span class="code"><fragment></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"></fragment></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><dropSlide/><br> |
| <span class="blue"><fragment name=displayDiagram |
| importedBundles=commons;gmf;papyrus><br> |
|  <arg name=element type=uml::Element/><br> |
| </span><br> |
| <dropSlide/><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"> <image object=[d.getDiagram()/] |
| maxH=true/> </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>  [/for]<br> |
| <span class="blue"></span><dropSlide/><br> |
| <span class="blue"></fragment><br> |
| </span><dropSlide/><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> <gendoc><br> |
| [for(p:Package|Package.allInstances())]<br> |
| <dropSlide/><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> <dropSlide/><br> |
|  [/for] <br> |
| </gendoc> </td> |
| </tr> |
| </tbody> |
| </table> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </body> |
| </html> |