Merge "Updating the documentation plugins."
diff --git a/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Gendoc_table_metamodel.png b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Gendoc_table_metamodel.png
new file mode 100644
index 0000000..06bfd67
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Gendoc_table_metamodel.png
Binary files differ
diff --git a/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Papyrus_table_sample.png b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Papyrus_table_sample.png
new file mode 100644
index 0000000..628f734
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Papyrus_table_sample.png
Binary files differ
diff --git a/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Sirius_table_sample.png b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Sirius_table_sample.png
new file mode 100644
index 0000000..76800ea
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/img/Sirius_table_sample.png
Binary files differ
diff --git a/plugins/org.eclipse.gendoc.doc.docx/html/userguide/script_papyrus_sirius_tables.html b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/script_papyrus_sirius_tables.html
new file mode 100644
index 0000000..c7fb35a
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc.docx/html/userguide/script_papyrus_sirius_tables.html
@@ -0,0 +1,305 @@
+<!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>Table generation</title>
+    <link rel="stylesheet" type="text/css" href="userguide.css">
+  </head>
+  <body>
+    <h2>Papyrus And Sirius Tables</h2>
+    <p>As tables exist in Papyrus and Sirius we want to provide a way to
+      integrate them as Word tables or LibreOffice tables.</p>
+    <p>Gendoc tag already exists, so the solution proposed is to have a pivot
+      generic Table object, offered by a dedicated Gendoc metamodel, in order to
+      generate all kinds of table the same way. Dedicated acceleo bundles,
+      already existing for Papyrus and Sirius, have a new service to transform
+      their table to the Gendoc generic table. </p>
+    <p>An overview of the Gendoc table very simple metamodel is shown in the
+      picture below.</p>
+    <p><img alt="" src="img/Gendoc_table_metamodel.png"></p>
+    <h3>Papyrus table generation (with manual configuration of the table columns
+      in the template)</h3>
+    <p>From a Papyrus model containing this table:</p>
+    <p><img alt="" src="img/Papyrus_table_sample.png"></p>
+    <p>Gendoc template fragment :</p>
+    <div class="codeBox cbBg code">
+      <p class="code">&lt;config&gt; &lt;drop/&gt;<br>
+        &nbsp;&nbsp; &lt;param key='modelPath' value='${project_loc}/...'/&gt;<br>
+        &nbsp;&nbsp; &lt;output path='...'/&gt;<br>
+        &lt;/config&gt; &lt;drop/&gt;</p>
+      &lt;context model='${modelPath}' element='RootElement/Requirements'
+      importedBundle='gmf;papyrus' searchMetamodel='true'/&gt;<br>
+      &lt;gendoc id='requirements'&gt; &lt;drop/&gt;<br>
+      &nbsp;&nbsp; [for (table: table::Table | self.getPapyrusTables())]
+      &lt;drop/&gt;<br>
+      &nbsp;&nbsp; &lt;table&gt; &lt;drop/&gt;
+      <div style="text-align: center;">[table.name/]:</div>
+      <br>
+      <table style="border-collapse:collapse;width: 929px; height: 44px;" border="1">
+        <tbody>
+          <tr>
+            <td><b>[table.tableheader.cells -&gt; at(1).label/]</b></td>
+            <td><b>[table.tableheader.cells -&gt; at(2).label/]</b></td>
+            <td><b>[table.tableheader.cells -&gt; at(3).label/]</b></td>
+          </tr>
+        </tbody>
+      </table>
+      &nbsp;&nbsp; [for (row: table::Row | table.rows)] &lt;drop/&gt;
+      <table style="border-collapse:collapse;" border="1" width="100%">
+        <tbody>
+          <tr>
+            <td>[row.cells-&gt;at(1).label/]</td>
+            <td>[row.cells-&gt;at(1).label/]</td>
+            <td>[row.cells-&gt;at(1).label/]</td>
+          </tr>
+        </tbody>
+      </table>
+      &nbsp;&nbsp; [/for] &lt;drop/&gt;<br>
+      &nbsp;&nbsp; &lt;/table&gt; &lt;drop/&gt;<br>
+      &lt;/gendoc&gt; &lt;drop/&gt;<br>
+    </div>
+    <p>In this example the service "getPapyrusTables()" will return the list of
+      tables contained in the context element.</p>
+    <p>It is possible to navigate in a table using relations “tableheader” and
+      “row”. The first relation returns the headers of a table and the latter a
+      list of row. From each of these objects we use the relation “cells” to
+      access to the list of cells composing a row or the table header. </p>
+    <p>Result in the word document produced by Gendoc :</p>
+    <table style="border-collapse: collapse;width: 929px; height: 28px;" border="1">
+      <tbody>
+        <tr>
+          <td style="width: 307.517px;"><b>id</b></td>
+          <td style="width: 309.85px;"><b>name</b></td>
+          <td style="width: 289.633px;"><b>text</b></td>
+        </tr>
+        <tr>
+          <td style="width: 307.733px;">REQ_001</td>
+          <td style="width: 308.633px;">Automated alarm clock</td>
+          <td style="width: 290.633px;">The alarm clock radio shall wake up the
+            user automatically at the right time, through radio or buzzer</td>
+        </tr>
+        <tr>
+          <td>REQ_0012</td>
+          <td>Radio management</td>
+          <td>The user shall be able to modify easily the radio station and the
+            volume.</td>
+        </tr>
+        <tr>
+          <td>REQ_003</td>
+          <td>Clock management</td>
+          <td>The user shall be able to update easily the time displayed by the
+            clock or the alarm. </td>
+        </tr>
+        <tr>
+          <td>...</td>
+          <td><br>
+          </td>
+          <td><br>
+          </td>
+        </tr>
+      </tbody>
+    </table>
+    <h3>Sirius table generation (with manual configuration of the table columns
+      in the template)</h3>
+    <p>From a Sirius model containing this table:</p>
+    <p><img alt="" src="img/Sirius_table_sample.png"> </p>
+    <p>Gendoc template fragment:</p>
+    <p> </p>
+    <div class="codeBox cbBg code">
+      <p class="code">&lt;config&gt; &lt;drop/&gt;<br>
+        &nbsp;&nbsp; &lt;param key='modelPath' value='${project_loc}/...'/&gt;<br>
+        &nbsp;&nbsp; &lt;output path='...'/&gt;<br>
+        &lt;/config&gt; &lt;drop/&gt;</p>
+      &lt;context model='${modelPath}' element='RootElement/Requirements'
+      importedBundle='gmf;sirius' searchMetamodel='true'/&gt;<br>
+      &lt;gendoc id='requirements'&gt; &lt;drop/&gt;<br>
+      &nbsp;&nbsp; [for (table: table::Table | self.getSiriusTables())]
+      &lt;drop/&gt;<br>
+      &nbsp;&nbsp; &lt;table&gt; &lt;drop/&gt;<br>
+      <div style="text-align: center;">[table.name/]:</div>
+      <br>
+      <table style="border-collapse:collapse;width: 929px; height: 44px;" border="1">
+        <tbody>
+          <tr>
+            <td><b>[table.tableheader.cells -&gt; at(1).label/]</b></td>
+            <td><b>[table.tableheader.cells -&gt; at(2).label/]</b></td>
+            <td><b>[table.tableheader.cells -&gt; at(3).label/]</b></td>
+          </tr>
+        </tbody>
+      </table>
+      &nbsp;&nbsp; [for (row: table::Row | table.rows)] &lt;drop/&gt;
+      <table style="border-collapse:collapse;" border="1" width="100%">
+        <tbody>
+          <tr>
+            <td>[row.cells-&gt;at(1).label/]</td>
+            <td>[row.cells-&gt;at(1).label/]</td>
+            <td>[row.cells-&gt;at(1).label/]</td>
+          </tr>
+        </tbody>
+      </table>
+      &nbsp;&nbsp; [/for] &lt;drop/&gt;<br>
+      &nbsp;&nbsp; &lt;/table&gt; &lt;drop/&gt;<br>
+      &lt;/gendoc&gt; &lt;drop/&gt;<br>
+    </div>
+    <p>This example is very similar to the precedent. The only notable
+      difference is how we access to the list of tables. In this case as we are
+      in a Sirius model, we use the “getSiriusTables()” service.</p>
+    <p>Result in the word document produced by Gendoc :</p>
+    <table style="border-collapse: collapse; width: 918px; height: 28px;" border="1">
+      <tbody>
+        <tr>
+          <td style="width: 307.517px;"><br>
+          </td>
+          <td style="width: 309.85px"><b>Father</b></td>
+          <td style="width: 289.633px;"><b>Mother</b></td>
+        </tr>
+        <tr>
+          <td style="width: 307.517px;">Man Paul</td>
+          <td style="width: 308.633px;"><br>
+          </td>
+          <td style="width: 290.633px;"><br>
+          </td>
+        </tr>
+        <tr>
+          <td>Woman Isa</td>
+          <td><br>
+          </td>
+          <td><br>
+          </td>
+        </tr>
+        <tr>
+          <td>Man Elias</td>
+          <td>Paul</td>
+          <td>Isa</td>
+        </tr>
+        <tr>
+          <td>Woman Lea</td>
+          <td>Paul<br>
+          </td>
+          <td>Isa<br>
+          </td>
+        </tr>
+        <tr>
+          <td>Man Dave</td>
+          <td>Elias</td>
+          <td><br>
+          </td>
+        </tr>
+        <tr>
+          <td>Man Alain</td>
+          <td>Dave</td>
+          <td>Katell</td>
+        </tr>
+        <tr>
+          <td>...</td>
+          <td><br>
+          </td>
+          <td><br>
+          </td>
+        </tr>
+      </tbody>
+    </table>
+    <h3>Example of an automated table generation from a Papyrus table</h3>
+    <p>From a Papyrus model containing several tables on a package the following
+      gendoc fragment allows a full table generation.</p>
+    <p><u><strong>Note</strong></u>: Automated mode also works with Sirius</p>
+    <p>Gendoc code:</p>
+    <div class="codeBox cbBg code">
+      <p class="code">&lt;config&gt; &lt;drop/&gt;<br>
+        &nbsp;&nbsp; &lt;param key='modelPath' value='${project_loc}/...'/&gt;<br>
+        &nbsp;&nbsp; &lt;output path='...'/&gt;<br>
+        &lt;/config&gt; &lt;drop/&gt;</p>
+      &lt;context model='${modelPath}' element='RootElement/Requirements'
+      importedBundle='gmf;papyrus' searchMetamodel='true'/&gt;<br>
+      &lt;gendoc id='requirements'&gt; &lt;drop/&gt;<br>
+      &nbsp;&nbsp; [for (table: table::Table | self.getPapyrusTables())]
+      &lt;drop/&gt;
+      <div style="text-align: center;">[table.name/]:[t.type/] <br>
+        <div style="text-align: left;"> &nbsp;&nbsp; &lt;table
+          object='[t.getTableId()/]'&gt; &lt;drop/&gt;</div>
+      </div>
+      <table style="border-collapse:collapse;" border="1" width="100%">
+        <tbody>
+          <tr>
+            <td>&nbsp;</td>
+          </tr>
+        </tbody>
+      </table>
+      &nbsp;&nbsp; &lt;/table&gt; &lt;drop/&gt;<br>
+      &lt;/gendoc&gt; &lt;drop/&gt;<br>
+    </div>
+    <p></p>
+    <p>The table tag has a new attribute “object” for the automatic generation.
+      This attribute has to be set to the identifier of the table. The service
+      “getTableId()” is used to retrieve this identifier.</p>
+    <p><u><strong>Note</strong></u>: in this mode all cells will have the same
+      style.</p>
+    <p>Gendoc result :</p>
+    <p style="text-align: center;"><strong>RequirementTable0 : PapyrusSysMLRequirementTable</strong></p>
+    <table style="border-collapse: collapse;width: 929px; height: 28px;" border="1">
+      <tbody>
+        <tr>
+          <td style="width: 307.517px; text-align: center;"><b>id : String [1]<br>
+            </b></td>
+          <td style="width: 309.85px; text-align: center;"><b>name : String
+              [0..1]<br>
+            </b></td>
+          <td style="width: 289.633px; text-align: center;"><b>text : String [1]<br>
+            </b></td>
+        </tr>
+        <tr align="center">
+          <td style="width: 307.733px;">REQ_001</td>
+          <td style="width: 308.633px;">Automated alarm clock</td>
+          <td style="width: 290.633px;">The alarm clock radio shall wake up the
+            user automatically at the right time, through radio or buzzer</td>
+        </tr>
+        <tr align="center">
+          <td>REQ_0012</td>
+          <td>Radio management</td>
+          <td>The user shall be able to modify easily the radio station and the
+            volume.</td>
+        </tr>
+        <tr align="center">
+          <td>REQ_003</td>
+          <td>Clock management</td>
+          <td>The user shall be able to update easily the time displayed by the
+            clock or the alarm. </td>
+        </tr>
+        <tr>
+          <td>...</td>
+          <td><br>
+          </td>
+          <td><br>
+          </td>
+        </tr>
+      </tbody>
+    </table>
+    <p></p>
+    <p style="text-align: center;"><strong>AllocationTable0 :
+        PapyrusSysMLAllocationTable</strong></p>
+    <p style="text-align: center;"><strong></strong></p>
+    <table style="text-align: left; margin-left: auto; margin-right: auto;" border="1"

+      width="100%">
+      <tbody>
+        <tr align="center">
+          <td><strong>name : String [0..1]</strong></td>
+        </tr>
+        <tr align="center">
+          <td>Allocate1</td>
+        </tr>
+        <tr align="center">
+          <td>Allocate2</td>
+        </tr>
+        <tr align="center">
+          <td>Allocate3</td>
+        </tr>
+        <tr align="center">
+          <td>Allocate4</td>
+        </tr>
+        <tr align="center">
+          <td>Allocate5</td>
+        </tr>
+      </tbody>
+    </table>
+  </body>
+</html>
diff --git a/plugins/org.eclipse.gendoc.doc.docx/userguide.xml b/plugins/org.eclipse.gendoc.doc.docx/userguide.xml
index 8b24d80..4159861 100644
--- a/plugins/org.eclipse.gendoc.doc.docx/userguide.xml
+++ b/plugins/org.eclipse.gendoc.doc.docx/userguide.xml
@@ -30,6 +30,8 @@
     </topic>
     <topic href="html/userguide/reusing_scripts.html" label="Reusing gendoc scripts inside the same document : &lt;fragment&gt; tag">
     </topic>
+    <topic href="html/userguide/script_papyrus_sirius_tables.html" label="Papyrus and Sirius Tables">
+    </topic>
  </topic>
  </topic>
  </toc>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles.html
index d34489a..e1e96e2 100644
--- a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles.html
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles.html
@@ -11,9 +11,13 @@
 		<ul>
 			<li><a href="bundles_common.html"><strong>commons</strong></a>: provides some facilities (for special characters, 
 				splitting lines, ID generation&hellip;)</li>
+			<li><a href="bundles_html.html"><strong>html</strong></a>: provides some facilities for handling HTML text and for converting from 
+			plain text to html, and from html to plain text</li>
 			<li><a href="bundles_gmf.html"><strong>gmf</strong></a>: provides some services for GMF diagrams generation</li>
 			<li><a href="bundles_papyrus.html"><strong>papyrus</strong></a>: provide services dedicated to MDT Papyrus models 
 				(diagram export, &hellip; )</li>
+			<li><a href="bundles_sirius.html"><strong>sirius</strong></a>: provide services dedicated to sirius models 
+				(diagram export, &hellip; )</li>
 		</ul>   
    </body>
 </html>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_capella.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_capella.html
deleted file mode 100644
index 0cec578..0000000
--- a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_capella.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-   <head>
-		<title>Capella</title>
-		<link rel="stylesheet" type="text/css" href="userguide.css">    
-   </head>
-
-   <body>
-		<h2>9.4 Capella</h2>
-		<p>To use Gendoc with <a href="https://www.polarsys.org/capella/">Capella</a> 1.0.X, you can use a 0.5.1 version available <a href="https://hudson.eclipse.org/gendoc/job/Gendoc-0.5-juno-maintenance/">here</a>.</p>
-		<p><strong>&nbsp;</strong></p>
-   </body>
-</html>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_html.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_html.html
new file mode 100644
index 0000000..b4da72d
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_html.html
@@ -0,0 +1,34 @@
+<!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>Papyrus</title>
+    <link rel="stylesheet" type="text/css" href="userguide.css">
+  </head>
+  <body>
+    <h2>HTML</h2>
+    <ul>
+      <li><strong>isHtml(String) : Boolean</strong></li>
+    </ul>
+    <p>&nbsp;Return if the given string contains HTML tags.</p>
+    <ul>
+      <li><strong>stripHtmlTags(String) : String&nbsp;</strong>
+      </li>
+    </ul>
+    <p>Return a string without html tags.</p>
+    <ul>
+      <li><strong>htmlToText(String) : String</strong></li>
+    </ul>
+    <p>Return a plain text string for the given html string. This provide simple
+      indentation and list marks.</p>
+    <ul>
+      <li><strong>textToHtml(String) : String</strong></li>
+    </ul>
+    <p>&nbsp;Return a html string for the given plain string. It consider list
+      marks and space and tabs to provide indentation in the HTML string, trying
+      to keep the simple format of the provided plain text.</p>
+    <p>
+    </p>
+    <p></p>
+  </body>
+</html>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_papyrus.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_papyrus.html
index c4807f6..5628566 100644
--- a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_papyrus.html
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_papyrus.html
@@ -1,15 +1,36 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 <html>
-   <head>
-		<title>Papyrus</title>
-		<link rel="stylesheet" type="text/css" href="userguide.css">    
-   </head>
-
-   <body>
-		<h2>Papyrus</h2>
-		<ul>
-		<li><strong>getPapyrusDiagrams(EObject) : Sequence(Diagram)</strong></li>
-		</ul>
-		<p>Get all the diagrams directly contained by an element.</p>
-   </body>
+  <head>
+    <meta content="text/html; charset=windows-1252" http-equiv="content-type">
+    <title>Papyrus</title>
+    <link rel="stylesheet" type="text/css" href="userguide.css">
+  </head>
+  <body>
+    <h2>Papyrus</h2>
+    <ul>
+      <li><strong>getPapyrusDiagrams(EObject) : Sequence(Diagram)</strong></li>
+    </ul>
+    <p>Get all the diagrams with the object as root object.</p>
+    <ul>
+      <li><b>getPapyrusOwnedDiagrams(EObject) : Sequence(Diagram)</b></li>
+    </ul>
+    <p>Get all the diagrams owned by the object.</p>
+    <ul>
+      <li><b>getDocumentation(EObject) : String</b></li>
+    </ul>
+    <p>Get the documentation of an object.</p>
+    <ul>
+      <li><strong>getDocumentationResources(EObject) : Sequence(String)</strong></li>
+    </ul>
+    <p>Get the documentation resources of an object.</p>
+    <ul>
+      <li><strong>replaceLinksByNameOrLabel(String, EObject) : String</strong></li>
+    </ul>
+    <p>Replace the links in the string with the name or the label of the object,
+      using the Eobject as context to resolve the link.</p>
+    <ul>
+      <li><strong>getPapyrusTables (EObject) : Sequence(Table)</strong></li>
+    </ul>
+    <p>Get the tables of an object.</p>
+  </body>
 </html>
diff --git a/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_sirius.html b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_sirius.html
new file mode 100644
index 0000000..ebd1e3a
--- /dev/null
+++ b/plugins/org.eclipse.gendoc.doc/html/userguide/bundles_sirius.html
@@ -0,0 +1,23 @@
+<!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>Capella</title>
+    <link rel="stylesheet" type="text/css" href="userguide.css">
+  </head>
+  <body>
+    <h2>Sirius</h2>
+    <ul>
+      <li><strong>getSiriusDiagrams(EObject) : Sequence(Diagram)</strong></li>
+    </ul>
+    <p>Get the diagrams of an object.</p>
+    <ul>
+      <li><strong>getSiriusDiagramName(Diagram) : String</strong></li>
+    </ul>
+    <p>Get the name of the diagram.</p>
+    <ul>
+      <li><strong> getSiriusTables(EObject) : Sequence(Table)</strong></li>
+    </ul>
+    <p>Get the tables of an object</p>
+  </body>
+</html>
diff --git a/plugins/org.eclipse.gendoc.doc/userguide.xml b/plugins/org.eclipse.gendoc.doc/userguide.xml
index 482dd20..89b7174 100644
--- a/plugins/org.eclipse.gendoc.doc/userguide.xml
+++ b/plugins/org.eclipse.gendoc.doc/userguide.xml
@@ -14,11 +14,13 @@
  <topic href="html/userguide/bundles.html" label="Gendoc Bundles">
 	<topic href="html/userguide/bundles_common.html" label="Common">
  	</topic>
+ <topic href="html/userguide/bundles_html.html" label="HTML">
+ </topic>
 	<topic href="html/userguide/bundles_gmf.html" label="Gmf">
  	</topic>
 	<topic href="html/userguide/bundles_papyrus.html" label="Papyrus">
  	</topic>
-	<topic href="html/userguide/bundles_capella.html" label="Capella">
+	<topic href="html/userguide/bundles_sirius.html" label="Sirius">
  	</topic>
  </topic>
 <topic href="html/userguide/appendix.html" label="Appendix: Overview of all Gendoc tags and attributes">