Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-09-13 17:12:28 +0000
committerEike Stepper2011-09-13 17:12:28 +0000
commitec23c7f362fb47fa13352410f30219386a0da7b0 (patch)
treed45175109326d9b830d97b709903d7074225bee8
parentcd2968b94c59357f73e441c30f43595ac597c634 (diff)
downloadcdo-ec23c7f362fb47fa13352410f30219386a0da7b0.tar.gz
cdo-ec23c7f362fb47fa13352410f30219386a0da7b0.tar.xz
cdo-ec23c7f362fb47fa13352410f30219386a0da7b0.zip
tutorials
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/connectors/CreatingTransportConnections.html129
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-1.pngbin0 -> 682 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-2.pngbin0 -> 764 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-3.pngbin0 -> 735 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-4.pngbin0 -> 718 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-5.pngbin0 -> 735 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-6.pngbin0 -> 753 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-7.pngbin0 -> 726 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-8.pngbin0 -> 746 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/callout-9.pngbin0 -> 751 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom-left.pngbin0 -> 236 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom-right.pngbin0 -> 298 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom.pngbin0 -> 169 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-close.pngbin0 -> 484 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-left.pngbin0 -> 138 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-right.pngbin0 -> 165 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top-left.pngbin0 -> 689 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top-right.pngbin0 -> 258 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top1.pngbin0 -> 164 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top2.pngbin0 -> 142 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/html/sessions/ConnectingToRepositories.html6
-rw-r--r--plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/connectors/CreatingTransportConnections.java1
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/META-INF/MANIFEST.MF3
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecore6
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecorediag28
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java94
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/BodyElement.java17
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Embedding.java14
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java39
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ChapterImpl.java35
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java38
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/EmbeddingImpl.java61
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java29
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java71
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java113
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java71
-rw-r--r--plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java153
39 files changed, 712 insertions, 227 deletions
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/connectors/CreatingTransportConnections.html b/plugins/org.eclipse.emf.cdo.doc/html/connectors/CreatingTransportConnections.html
index 1904fd5e48..ce5e736448 100644
--- a/plugins/org.eclipse.emf.cdo.doc/html/connectors/CreatingTransportConnections.html
+++ b/plugins/org.eclipse.emf.cdo.doc/html/connectors/CreatingTransportConnections.html
@@ -1,6 +1,6 @@
<h1>Creating Transport Connections</h1>
-<a name="CreatingTransportConnections"/><p>
- This tutorial outlines the steps needed to create a Net4j <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b> and connect it to an <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b>.
+<a name="CreatingTransportConnections.html"/><p>
+ This tutorial outlines the steps needed to create a Net4j <b><code><font color="#ff000000">{@link:IConnector}</font></code></b> and connect it to an <b><code><font color="#ff000000">{@link:IAcceptor}</font></code></b>.
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu nibh in erat dapibus accumsan. Aenean cursus
lacinia dictum. Mauris non sem sapien. Vivamus sem ante, posuere a rhoncus ac, varius in nisi. Sed pulvinar urna ac
@@ -9,24 +9,77 @@
risus ultricies mattis vel nec nunc. Proin venenatis tellus sit amet dui congue nec vehicula urna sollicitudin. Donec
porta, risus eu auctor semper, ante lectus lobortis sem, a luctus diam dui eu sapien. Sed at metus et dolor tincidunt
convallis id a est. Donec quam nisl, scelerisque a feugiat id, mattis vel urna. Suspendisse facilisis, libero ac
- ultricies dictum, mi sem feugiat purus, ac aliquam metus purus sed leo. Sed a viverra metus.<b><i>UNRESOLVED</i></b>
+ ultricies dictum, mi sem feugiat purus, ac aliquam metus purus sed leo. Sed a viverra metus.
<h1>Select a Transport Type</h1>
-<a name="CreatingTransportConnections.SelectTransportType"/><p>
+<a name="SelectTransportType"/><p>
Currently supported transport types are:
<ul>
- <li><b>JVM</b> to connect to an <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b> in the same Java Virtual Machine.
- <li><b>TCP</b> to connect to an <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b> by means of a <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b>.
+ <li><b>JVM</b> to connect to an <b><code><font color="#ff000000">{@link:IJVMAcceptor}</font></code></b> in the same Java Virtual Machine.
+ <li><b>TCP</b> to connect to an <b><code><font color="#ff000000">{@link:ITCPAcceptor}</font></code></b> by means of a <b><code><font color="#ff000000">{@link:SocketChannel}</font></code></b>.
<li><b>SSL</b> an extension to the TCP transport that adds TLS/SSL security.
- <li><b>HTTP</b> to connect to an <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b> that is made available by a servlet.
+ <li><b>HTTP</b> to connect to an <b><code><font color="#ff000000">{@link:IHTTPAcceptor}</font></code></b> that is made available by a servlet.
</ul>
- Continue with <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b>.<b><i>UNRESOLVED</i></b>
+ Continue with <a href="../sessions/ConnectingToRepositories.html#SetConnectionTimeout">SetConnectionTimeout</a>.
<h1>Setup a Wiring Container</h1>
-<a name="CreatingTransportConnections.SetupWiringContainer"/><p>
+<a name="SetupWiringContainer"/><p>
Ut eget massa felis, nec volutpat purus. In id aliquet mi. Duis euismod sapien sollicitudin nisi vestibulum nec
vulputate urna euismod. Proin pulvinar ornare nunc, ac auctor elit placerat eget. Integer eu erat ac risus
- ultricies mattis vel nec nunc. <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b> Lorem ipsum dolor sit amet,
+ ultricies mattis vel nec nunc.
+
+<div class="snippet" style="margin-left:24px;" align="left">
+ <a name="snippet_snippet1"/>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><img src="../resources/editor-top-left.png"/></td>
+ <td style="background-image:url(../resources/editor-top1.png); background-repeat:repeat-x;" width="1px"><font face="Segoe UI,Arial" size="-1">ContainerSetup.java</font></td>
+ <td width="1px"><img src="../resources/editor-close.png"/></td>
+ <td style="background-image:url(../resources/editor-top2.png); background-repeat:repeat-x;">&nbsp;</td>
+ <td><img src="../resources/editor-top-right.png"/></td>
+ </tr>
+ <tr>
+ <td style="background-image:url(../resources/editor-left.png); background-repeat:repeat-y;">&nbsp;</td>
+ <td colspan="3" align="left" valign="top" nowrap>
+ <div style="margin:10px 0px 10px 0px;">
+ <code>
+ <font color="#3f7f5f">//&nbsp;Create&nbsp;a&nbsp;dedicated&nbsp;container&nbsp;instance</font><br/>
+ IManagedContainer&nbsp;container&nbsp;=&nbsp;<a name="callout_snippet1_1_code" href="#callout_snippet1_1" alt="Create a separate IManagedContainer." title="Create a separate IManagedContainer."><img src="../resources/callout-1.png" width="16" height="16" border="0" align="top"/></a>&nbsp;<font color="#7f0055"><b>new&nbsp;</b></font>ManagedContainer();<br/>
+ <br/>
+ <font color="#3f7f5f">//&nbsp;Register&nbsp;your&nbsp;custom&nbsp;factories</font><br/>
+ container.registerFactory(&nbsp;<a name="callout_snippet1_2_code" href="#callout_snippet1_2" alt="Create a factory of type &quot;jms&quot; in the productGroup &quot;org.eclipse.net4j.connectors&quot;." title="Create a factory of type &quot;jms&quot; in the productGroup &quot;org.eclipse.net4j.connectors&quot;."><img src="../resources/callout-2.png" width="16" height="16" border="0" align="top"/></a>&nbsp;<font color="#7f0055"><b>new&nbsp;</b></font>Factory(<font color="#2a00ff">&#34;org.eclipse.net4j.connectors&#34;</font>,&nbsp;<font color="#2a00ff">&#34;jms&#34;</font>)<br/>
+ {<br/>
+ &nbsp;&nbsp;<font color="#7f0055"><b>public&nbsp;</b></font>IConnector&nbsp;create(String&nbsp;description)&nbsp;<font color="#7f0055"><b>throws&nbsp;</b></font>ProductCreationException<br/>
+ &nbsp;&nbsp;{<br/>
+ &nbsp;&nbsp;&nbsp;&nbsp;<font color="#7f0055"><b>return&nbsp;</b></font><a name="callout_snippet1_3_code" href="#callout_snippet1_3" alt="Create a JMS connector." title="Create a JMS connector."><img src="../resources/callout-3.png" width="16" height="16" border="0" align="top"/></a>&nbsp;<font color="#7f0055"><b>new&nbsp;</b></font>JMSConnector(description);<br/>
+ &nbsp;&nbsp;}<br/>
+ });<br/>
+ <br/>
+ <font color="#3f7f5f">//&nbsp;Use&nbsp;utility&nbsp;classes&nbsp;to&nbsp;register&nbsp;additional&nbsp;factories</font><br/>
+ Net4jUtil.prepareContainer(container);<br/>
+ TCPUtil.prepareContainer(container);<br/>
+ <br/>
+ <font color="#3f7f5f">//&nbsp;Do&nbsp;not&nbsp;forget&nbsp;to&nbsp;activate&nbsp;the&nbsp;container&nbsp;before&nbsp;you&nbsp;use&nbsp;it</font><br/>
+ <a name="callout_snippet1_4_code" href="#callout_snippet1_4" alt="The new container can not be used when inactive." title="The new container can not be used when inactive."><img src="../resources/callout-4.png" width="16" height="16" border="0" align="top"/></a>&nbsp;container.activate();
+ </code>
+ </div>
+ </td>
+ <td style="background-image:url(../resources/editor-right.png); background-repeat:repeat-y;">&nbsp;</td>
+ </tr>
+ <tr>
+ <td><img src="../resources/editor-bottom-left.png"/></td>
+ <td style="background-image:url(../resources/editor-bottom.png); background-repeat:repeat-x;" colspan="3">&nbsp;</td>
+ <td><img src="../resources/editor-bottom-right.png"/></td>
+ </tr>
+ </table>
+</div>
+<p/>
+<div style="margin-left:24px;"><a name="callout_snippet1_1" href="#callout_snippet1_1_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../resources/callout-1.png" width="16" height="16" border="0" align="top"/></a>&nbsp;Create a separate IManagedContainer.</div>
+<div style="margin-left:24px;"><a name="callout_snippet1_2" href="#callout_snippet1_2_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../resources/callout-2.png" width="16" height="16" border="0" align="top"/></a>&nbsp;Create a factory of <i>type</i> "jms" in the <i>productGroup</i> "org.eclipse.net4j.connectors".</div>
+<div style="margin-left:24px;"><a name="callout_snippet1_3" href="#callout_snippet1_3_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../resources/callout-3.png" width="16" height="16" border="0" align="top"/></a>&nbsp;Create a JMS connector.</div>
+<div style="margin-left:24px;"><a name="callout_snippet1_4" href="#callout_snippet1_4_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../resources/callout-4.png" width="16" height="16" border="0" align="top"/></a>&nbsp;The new container can not be used when inactive.</div>
+<p/>
+ Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Etiam eu nibh in erat dapibus accumsan. Aenean cursus lacinia dictum. Mauris non sem
sapien. Vivamus sem ante, posuere a rhoncus ac, varius in nisi. Sed pulvinar urna ac est iaculis mattis. Ut eget
massa felis, nec volutpat purus. In id aliquet mi. Duis euismod sapien sollicitudin nisi vestibulum nec vulputate
@@ -34,17 +87,61 @@
vel nec nunc. Proin venenatis tellus sit amet dui congue nec vehicula urna sollicitudin. Donec porta, risus eu
auctor semper, ante lectus lobortis sem, a luctus diam dui eu sapien. Sed at metus et dolor tincidunt convallis id
a est. Donec quam nisl, scelerisque a feugiat id, mattis vel urna. Suspendisse facilisis, libero ac ultricies
- dictum, mi sem feugiat purus, ac aliquam metus purus sed leo. Sed a viverra metus.<b><i>UNRESOLVED</i></b>
+ dictum, mi sem feugiat purus, ac aliquam metus purus sed leo. Sed a viverra metus.
<h1>Add Configuration Parameters</h1>
-<a name="CreatingTransportConnections.AddConfigurationParameters"/>
+<a name="AddConfigurationParameters"/>
<h1>Set the Buffer Capacity</h1>
-<a name="CreatingTransportConnections.AddConfigurationParameters.SetBufferCapacity"/><p>
- <b><i>UNRESOLVED</i></b><b><i>UNRESOLVED</i></b>
+<a name="SetBufferCapacity"/><p>
+
+
+<div class="snippet" style="margin-left:24px;" align="left">
+ <a name="snippet_JMSConnector"/>
+ <table border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td><img src="../resources/editor-top-left.png"/></td>
+ <td style="background-image:url(../resources/editor-top1.png); background-repeat:repeat-x;" width="1px"><font face="Segoe UI,Arial" size="-1"></font></td>
+ <td width="1px"><img src="../resources/editor-close.png"/></td>
+ <td style="background-image:url(../resources/editor-top2.png); background-repeat:repeat-x;">&nbsp;</td>
+ <td><img src="../resources/editor-top-right.png"/></td>
+ </tr>
+ <tr>
+ <td style="background-image:url(../resources/editor-left.png); background-repeat:repeat-y;">&nbsp;</td>
+ <td colspan="3" align="left" valign="top" nowrap>
+ <div style="margin:10px 0px 10px 0px;">
+ <code>
+ <font color="#7f0055"><b>public&nbsp;class&nbsp;</b></font>JMSConnector&nbsp;<font color="#7f0055"><b>extends&nbsp;</b></font>Connector<br/>
+ {<br/>
+ &nbsp;&nbsp;<font color="#7f0055"><b>public&nbsp;</b></font>JMSConnector(String&nbsp;description)<br/>
+ &nbsp;&nbsp;{<br/>
+ &nbsp;&nbsp;}<br/>
+ <br/>
+ &nbsp;&nbsp;<font color="#7f0055"><b>public&nbsp;</b></font><font color="#7f0055"><b>void&nbsp;</b></font>multiplexChannel(InternalChannel&nbsp;<a name="callout_JMSConnector_1_code" href="#callout_JMSConnector_1" alt="The channel must not be null." title="The channel must not be null."><img src="../resources/callout-1.png" width="16" height="16" border="0" align="top"/></a>&nbsp;channel)<br/>
+ &nbsp;&nbsp;{<br/>
+ &nbsp;&nbsp;}<br/>
+ <br/>
+ &nbsp;&nbsp;&hellip;<br/>
+ }
+ </code>
+ </div>
+ </td>
+ <td style="background-image:url(../resources/editor-right.png); background-repeat:repeat-y;">&nbsp;</td>
+ </tr>
+ <tr>
+ <td><img src="../resources/editor-bottom-left.png"/></td>
+ <td style="background-image:url(../resources/editor-bottom.png); background-repeat:repeat-x;" colspan="3">&nbsp;</td>
+ <td><img src="../resources/editor-bottom-right.png"/></td>
+ </tr>
+ </table>
+</div>
+<p/>
+<div style="margin-left:24px;"><a name="callout_JMSConnector_1" href="#callout_JMSConnector_1_code" alt="Jump to snippet..." title="Jump to snippet..."><img src="../resources/callout-1.png" width="16" height="16" border="0" align="top"/></a>&nbsp;The channel must not be <code>null</code>.</div>
+<p/>
+
<h1>Set the Connection Timeout</h1>
-<a name="CreatingTransportConnections.AddConfigurationParameters.SetConnectionTimeout"/><p>
+<a name="SetConnectionTimeout"/><p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu nibh in erat dapibus accumsan. Aenean cursus
lacinia dictum. Mauris non sem sapien. Vivamus sem ante, posuere a rhoncus ac, varius in nisi. Sed pulvinar urna
ac est iaculis mattis. Ut eget massa felis, nec volutpat purus. In id aliquet mi. Duis euismod sapien
@@ -53,5 +150,5 @@
vehicula urna sollicitudin. Donec porta, risus eu auctor semper, ante lectus lobortis sem, a luctus diam dui eu
sapien. Sed at metus et dolor tincidunt convallis id a est. Donec quam nisl, scelerisque a feugiat id, mattis vel
urna. Suspendisse facilisis, libero ac ultricies dictum, mi sem feugiat purus, ac aliquam metus purus sed leo.
- Sed a viverra metus.<b><i>UNRESOLVED</i></b>
+ Sed a viverra metus.
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-1.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-1.png
new file mode 100644
index 0000000000..0004903274
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-1.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-2.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-2.png
new file mode 100644
index 0000000000..f9a3551bbe
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-2.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-3.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-3.png
new file mode 100644
index 0000000000..21509aef17
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-3.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-4.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-4.png
new file mode 100644
index 0000000000..0379ed4a26
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-4.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-5.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-5.png
new file mode 100644
index 0000000000..a93fcd190f
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-5.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-6.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-6.png
new file mode 100644
index 0000000000..3f8c29ceaf
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-6.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-7.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-7.png
new file mode 100644
index 0000000000..fc720403f3
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-7.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-8.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-8.png
new file mode 100644
index 0000000000..a7e561ab2e
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-8.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-9.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-9.png
new file mode 100644
index 0000000000..64488ba11a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/callout-9.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom-left.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom-left.png
new file mode 100644
index 0000000000..b83e03e381
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom-left.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom-right.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom-right.png
new file mode 100644
index 0000000000..fcb0ca0aab
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom-right.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom.png
new file mode 100644
index 0000000000..2eff3fd18b
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-bottom.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-close.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-close.png
new file mode 100644
index 0000000000..0832edf95a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-close.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-left.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-left.png
new file mode 100644
index 0000000000..4c6bd28b84
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-left.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-right.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-right.png
new file mode 100644
index 0000000000..1d81d36527
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-right.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top-left.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top-left.png
new file mode 100644
index 0000000000..3405aff3b1
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top-left.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top-right.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top-right.png
new file mode 100644
index 0000000000..b7b4236d4b
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top-right.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top1.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top1.png
new file mode 100644
index 0000000000..54a6ced3b9
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top1.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top2.png b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top2.png
new file mode 100644
index 0000000000..4e358b20f6
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.doc/html/resources/editor-top2.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.doc/html/sessions/ConnectingToRepositories.html b/plugins/org.eclipse.emf.cdo.doc/html/sessions/ConnectingToRepositories.html
index fa7a0e4efc..4eb1e7b8b4 100644
--- a/plugins/org.eclipse.emf.cdo.doc/html/sessions/ConnectingToRepositories.html
+++ b/plugins/org.eclipse.emf.cdo.doc/html/sessions/ConnectingToRepositories.html
@@ -1,9 +1,9 @@
<h1>Connecting To Repositories</h1>
-<a name="ConnectingToRepositories"/>
+<a name="ConnectingToRepositories.html"/>
<h1>Set Buffer Capacity</h1>
-<a name="ConnectingToRepositories.SetBufferCapacity"/>
+<a name="SetBufferCapacity"/>
<h1>Set Connection Timeout</h1>
-<a name="ConnectingToRepositories.SetConnectionTimeout"/>
+<a name="SetConnectionTimeout"/>
diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/connectors/CreatingTransportConnections.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/connectors/CreatingTransportConnections.java
index 47da9d30ec..eacc62dbf9 100644
--- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/connectors/CreatingTransportConnections.java
+++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/connectors/CreatingTransportConnections.java
@@ -148,7 +148,6 @@ class Snippets
}
/**
- * @snippet
* @callout The channel must not be <code>null</code>.
*/
public class JMSConnector extends Connector
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.releng.doc/META-INF/MANIFEST.MF
index b4173b59b7..58561da65a 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/META-INF/MANIFEST.MF
@@ -7,7 +7,8 @@ Bundle-Vendor: Eclipse Modeling Project
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.osgi.util;bundle-version="[3.0.0,4.0.0)",
org.eclipse.osgi;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.emf.ecore;bundle-version="[2.7.0,3.0.0)"
+ org.eclipse.emf.ecore;bundle-version="[2.7.0,3.0.0)",
+ org.eclipse.emf.cdo.releng.doc.supplemental;bundle-version="[1.0.0,2.0.0)";resolution:=optional
Export-Package: org.eclipse.emf.cdo.releng.doc;version="4.1.0";x-internal:=true,
org.eclipse.emf.cdo.releng.doc.article;version="4.1.0";x-internal:=true,
org.eclipse.emf.cdo.releng.doc.article.impl;version="4.1.0";x-internal:=true,
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecore b/plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecore
index 380bea1122..b44833e291 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecore
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecore
@@ -100,6 +100,8 @@
<eClassifiers xsi:type="ecore:EClass" name="BodyElement" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="body" eType="#//Body" resolveProxies="false"
eOpposite="#//Body/elements"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="tag" eType="#//Tag" changeable="false"
+ volatile="true" transient="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="html" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
changeable="false" volatile="true" transient="true" derived="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="callout" eType="#//Callout"
@@ -112,7 +114,9 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Embedding" eSuperTypes="#//BodyElement">
<eStructuralFeatures xsi:type="ecore:EReference" name="element" lowerBound="1"
- eType="#//EmbeddableElement" resolveProxies="false"/>
+ eType="#//EmbeddableElement" changeable="false" resolveProxies="false"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="SourceCode" eSuperTypes="#//ExternalTarget"/>
+ <eClassifiers xsi:type="ecore:EDataType" name="Tag" instanceClassName="com.sun.javadoc.Tag"
+ serializable="false"/>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecorediag b/plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecorediag
index 8b1363ad81..25586a97a3 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecorediag
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/model/article.ecorediag
@@ -307,6 +307,14 @@
<children xmi:type="notation:Node" xmi:id="_yWi_ANxZEeCpIJpgvmzkYA" type="1001">
<children xmi:type="notation:Node" xmi:id="_yWkNINxZEeCpIJpgvmzkYA" type="4001"/>
<children xmi:type="notation:Node" xmi:id="_yWkNIdxZEeCpIJpgvmzkYA" type="5001">
+ <children xmi:type="notation:Node" xmi:id="_q0yXoN4jEeC57Lb1Yvbj7Q" type="2001">
+ <element xmi:type="ecore:EAttribute" href="article.ecore#//BodyElement/tag"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_q0yXod4jEeC57Lb1Yvbj7Q"/>
+ </children>
+ <children xmi:type="notation:Node" xmi:id="_YMRGgN3lEeC57Lb1Yvbj7Q" type="2001">
+ <element xmi:type="ecore:EAttribute" href="article.ecore#//BodyElement/html"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_YMRGgd3lEeC57Lb1Yvbj7Q"/>
+ </children>
<styles xmi:type="notation:DrawerStyle" xmi:id="_yWkNItxZEeCpIJpgvmzkYA"/>
<styles xmi:type="notation:SortingStyle" xmi:id="_yWkNI9xZEeCpIJpgvmzkYA"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_yWkNJNxZEeCpIJpgvmzkYA"/>
@@ -318,7 +326,7 @@
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_yWi_AdxZEeCpIJpgvmzkYA" fontColor="4210752" fontName="Segoe UI" fontHeight="10" fillColor="13761016" lineColor="8421504"/>
<element xmi:type="ecore:EClass" href="article.ecore#//BodyElement"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_yWi_AtxZEeCpIJpgvmzkYA" x="250" y="673"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_yWi_AtxZEeCpIJpgvmzkYA" x="250" y="661"/>
</children>
<children xmi:type="notation:Node" xmi:id="_hvZKENxaEeCpIJpgvmzkYA" type="1001">
<children xmi:type="notation:Node" xmi:id="_hvZxINxaEeCpIJpgvmzkYA" type="4001"/>
@@ -581,9 +589,9 @@
<styles xmi:type="notation:ConnectorStyle" xmi:id="_LHP4gdxaEeCpIJpgvmzkYA" routing="Rectilinear" lineColor="4210752"/>
<styles xmi:type="notation:FontStyle" xmi:id="_LHP4gtxaEeCpIJpgvmzkYA" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/>
<element xmi:type="ecore:EReference" href="article.ecore#//Body/elements"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_LHP4g9xaEeCpIJpgvmzkYA" points="[8, 21, -237, 21]$[195, 4, -50, 4]"/>
- <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hJGMgN3CEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
- <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hJGMgd3CEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_LHP4g9xaEeCpIJpgvmzkYA" points="[-53, 0, 424, 3]$[-424, 0, 53, 3]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OPLzsN4kEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OPLzsd4kEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
</edges>
<edges xmi:type="notation:Edge" xmi:id="_OGa_YNxaEeCpIJpgvmzkYA" type="3002" source="_yWi_ANxZEeCpIJpgvmzkYA" target="_OGiwoNxZEeCpIJpgvmzkYA">
<children xmi:type="notation:Node" xmi:id="_OGa_ZNxaEeCpIJpgvmzkYA" type="4011">
@@ -595,7 +603,7 @@
<styles xmi:type="notation:ConnectorStyle" xmi:id="_OGa_YdxaEeCpIJpgvmzkYA" routing="Rectilinear" lineColor="4210752"/>
<styles xmi:type="notation:FontStyle" xmi:id="_OGa_YtxaEeCpIJpgvmzkYA" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/>
<element xmi:type="ecore:EReference" href="article.ecore#//BodyElement/body"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OGa_Y9xaEeCpIJpgvmzkYA" points="[-50, 4, 195, 4]$[-237, 21, 8, 21]"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OGa_Y9xaEeCpIJpgvmzkYA" points="[53, 3, -424, 0]$[424, 3, -53, 0]"/>
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hJGzkN3CEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hJGzkd3CEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
</edges>
@@ -603,7 +611,7 @@
<styles xmi:type="notation:ConnectorStyle" xmi:id="_pSB1EdxaEeCpIJpgvmzkYA" routing="Rectilinear" lineColor="4210752"/>
<styles xmi:type="notation:FontStyle" xmi:id="_pSB1EtxaEeCpIJpgvmzkYA" fontName="Segoe UI"/>
<element xsi:nil="true"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_pSB1E9xaEeCpIJpgvmzkYA" points="[-1, -20, -188, 80]$[-1, -47, -188, 53]$[183, -47, -4, 53]$[183, -75, -4, 25]"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_pSB1E9xaEeCpIJpgvmzkYA" points="[-1, -20, -188, 83]$[-1, -48, -188, 55]$[186, -48, -1, 55]$[186, -70, -1, 33]"/>
</edges>
<edges xmi:type="notation:Edge" xmi:id="_p1VWcNxaEeCpIJpgvmzkYA" type="3003" source="_Bj9lYNxPEeCpIJpgvmzkYA" target="_yWi_ANxZEeCpIJpgvmzkYA">
<styles xmi:type="notation:ConnectorStyle" xmi:id="_p1VWcdxaEeCpIJpgvmzkYA" routing="Rectilinear" lineColor="4210752"/>
@@ -716,9 +724,9 @@
<styles xmi:type="notation:ConnectorStyle" xmi:id="_6d0Ogd3BEeC57Lb1Yvbj7Q" routing="Rectilinear" lineColor="4210752"/>
<styles xmi:type="notation:FontStyle" xmi:id="_6d0Ogt3BEeC57Lb1Yvbj7Q" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/>
<element xmi:type="ecore:EReference" href="article.ecore#//Callout/elements"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6d0Og93BEeC57Lb1Yvbj7Q" points="[50, 4, -148, 0]$[145, 4, -53, 0]"/>
- <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_EkFT4d3CEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
- <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_EkFT4t3CEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6d0Og93BEeC57Lb1Yvbj7Q" points="[50, 4, -148, 3]$[145, 4, -53, 3]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OxDKoN4kEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OxDKod4kEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
</edges>
<edges xmi:type="notation:Edge" xmi:id="_9AjRAN3BEeC57Lb1Yvbj7Q" type="3002" source="_yWi_ANxZEeCpIJpgvmzkYA" target="_VHuYkNxSEeCpIJpgvmzkYA">
<children xmi:type="notation:Node" xmi:id="_9Aj4EN3BEeC57Lb1Yvbj7Q" type="4011">
@@ -730,7 +738,7 @@
<styles xmi:type="notation:ConnectorStyle" xmi:id="_9AjRAd3BEeC57Lb1Yvbj7Q" routing="Rectilinear" lineColor="4210752"/>
<styles xmi:type="notation:FontStyle" xmi:id="_9AjRAt3BEeC57Lb1Yvbj7Q" fontColor="4210752" fontName="Segoe UI" fontHeight="10"/>
<element xmi:type="ecore:EReference" href="article.ecore#//BodyElement/callout"/>
- <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_9AjRA93BEeC57Lb1Yvbj7Q" points="[-53, 0, 145, 4]$[-148, 0, 50, 4]"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_9AjRA93BEeC57Lb1Yvbj7Q" points="[-53, 3, 145, 4]$[-148, 3, 50, 4]"/>
<sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_clY5UN3ZEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
<targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_clY5Ud3ZEeC57Lb1Yvbj7Q" id="(0.5,0.5)"/>
</edges>
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java
index b7fe2f6f15..edf0610a34 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/ArticlePackage.java
@@ -1013,12 +1013,20 @@ public interface ArticlePackage extends EPackage
int BODY_ELEMENT__BODY = 0;
/**
+ * The feature id for the '<em><b>Tag</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int BODY_ELEMENT__TAG = 1;
+
+ /**
* The feature id for the '<em><b>Html</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
* @ordered
*/
- int BODY_ELEMENT__HTML = 1;
+ int BODY_ELEMENT__HTML = 2;
/**
* The feature id for the '<em><b>Callout</b></em>' container reference. <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -1026,7 +1034,7 @@ public interface ArticlePackage extends EPackage
* @generated
* @ordered
*/
- int BODY_ELEMENT__CALLOUT = 2;
+ int BODY_ELEMENT__CALLOUT = 3;
/**
* The number of structural features of the '<em>Body Element</em>' class. <!-- begin-user-doc --> <!-- end-user-doc
@@ -1035,7 +1043,7 @@ public interface ArticlePackage extends EPackage
* @generated
* @ordered
*/
- int BODY_ELEMENT_FEATURE_COUNT = 3;
+ int BODY_ELEMENT_FEATURE_COUNT = 4;
/**
* The meta object id for the '{@link org.eclipse.emf.cdo.releng.doc.article.impl.DiagramImpl <em>Diagram</em>}'
@@ -1056,6 +1064,14 @@ public interface ArticlePackage extends EPackage
int DIAGRAM__BODY = BODY_ELEMENT__BODY;
/**
+ * The feature id for the '<em><b>Tag</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int DIAGRAM__TAG = BODY_ELEMENT__TAG;
+
+ /**
* The feature id for the '<em><b>Html</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -1238,6 +1254,14 @@ public interface ArticlePackage extends EPackage
int TEXT__BODY = BODY_ELEMENT__BODY;
/**
+ * The feature id for the '<em><b>Tag</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int TEXT__TAG = BODY_ELEMENT__TAG;
+
+ /**
* The feature id for the '<em><b>Html</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -1280,6 +1304,14 @@ public interface ArticlePackage extends EPackage
int LINK__BODY = BODY_ELEMENT__BODY;
/**
+ * The feature id for the '<em><b>Tag</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int LINK__TAG = BODY_ELEMENT__TAG;
+
+ /**
* The feature id for the '<em><b>Html</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -1330,6 +1362,14 @@ public interface ArticlePackage extends EPackage
int EMBEDDING__BODY = BODY_ELEMENT__BODY;
/**
+ * The feature id for the '<em><b>Tag</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ * @ordered
+ */
+ int EMBEDDING__TAG = BODY_ELEMENT__TAG;
+
+ /**
* The feature id for the '<em><b>Html</b></em>' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated
@@ -1424,6 +1464,15 @@ public interface ArticlePackage extends EPackage
int DOC = 23;
/**
+ * The meta object id for the '<em>Tag</em>' data type. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see com.sun.javadoc.Tag
+ * @see org.eclipse.emf.cdo.releng.doc.article.impl.ArticlePackageImpl#getTag()
+ * @generated
+ */
+ int TAG = 24;
+
+ /**
* Returns the meta object for class '{@link org.eclipse.emf.cdo.releng.doc.article.Documentation
* <em>Documentation</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -1907,6 +1956,17 @@ public interface ArticlePackage extends EPackage
EReference getBodyElement_Body();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.doc.article.BodyElement#getTag
+ * <em>Tag</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @return the meta object for the attribute '<em>Tag</em>'.
+ * @see org.eclipse.emf.cdo.releng.doc.article.BodyElement#getTag()
+ * @see #getBodyElement()
+ * @generated
+ */
+ EAttribute getBodyElement_Tag();
+
+ /**
* Returns the meta object for the attribute '{@link org.eclipse.emf.cdo.releng.doc.article.BodyElement#getHtml
* <em>Html</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -2025,6 +2085,17 @@ public interface ArticlePackage extends EPackage
EDataType getDoc();
/**
+ * Returns the meta object for data type '{@link com.sun.javadoc.Tag <em>Tag</em>}'. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @return the meta object for data type '<em>Tag</em>'.
+ * @see com.sun.javadoc.Tag
+ * @model instanceClass="com.sun.javadoc.Tag" serializeable="false"
+ * @generated
+ */
+ EDataType getTag();
+
+ /**
* Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @return the factory that creates the instances of the model.
@@ -2433,6 +2504,14 @@ public interface ArticlePackage extends EPackage
EReference BODY_ELEMENT__BODY = eINSTANCE.getBodyElement_Body();
/**
+ * The meta object literal for the '<em><b>Tag</b></em>' attribute feature. <!-- begin-user-doc --> <!--
+ * end-user-doc -->
+ *
+ * @generated
+ */
+ EAttribute BODY_ELEMENT__TAG = eINSTANCE.getBodyElement_Tag();
+
+ /**
* The meta object literal for the '<em><b>Html</b></em>' attribute feature. <!-- begin-user-doc --> <!--
* end-user-doc -->
*
@@ -2531,6 +2610,15 @@ public interface ArticlePackage extends EPackage
*/
EDataType DOC = eINSTANCE.getDoc();
+ /**
+ * The meta object literal for the '<em>Tag</em>' data type. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see com.sun.javadoc.Tag
+ * @see org.eclipse.emf.cdo.releng.doc.article.impl.ArticlePackageImpl#getTag()
+ * @generated
+ */
+ EDataType TAG = eINSTANCE.getTag();
+
}
} // ArticlePackage
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/BodyElement.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/BodyElement.java
index da9c0470c2..e30f9ca85b 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/BodyElement.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/BodyElement.java
@@ -8,12 +8,15 @@ package org.eclipse.emf.cdo.releng.doc.article;
import org.eclipse.emf.ecore.EObject;
+import com.sun.javadoc.Tag;
+
/**
* <!-- begin-user-doc --> A representation of the model object '<em><b>Body Element</b></em>'. <!-- end-user-doc -->
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.doc.article.BodyElement#getBody <em>Body</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.doc.article.BodyElement#getTag <em>Tag</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.doc.article.BodyElement#getHtml <em>Html</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.doc.article.BodyElement#getCallout <em>Callout</em>}</li>
* </ul>
@@ -55,6 +58,20 @@ public interface BodyElement extends EObject
void setBody(Body value);
/**
+ * Returns the value of the '<em><b>Tag</b></em>' attribute. <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Tag</em>' attribute isn't clear, there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ *
+ * @return the value of the '<em>Tag</em>' attribute.
+ * @see org.eclipse.emf.cdo.releng.doc.article.ArticlePackage#getBodyElement_Tag()
+ * @model dataType="org.eclipse.emf.cdo.releng.doc.article.Tag" transient="true" changeable="false" volatile="true"
+ * @generated
+ */
+ Tag getTag();
+
+ /**
* Returns the value of the '<em><b>Html</b></em>' attribute. <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Html</em>' attribute isn't clear, there really should be more of a description here...
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Embedding.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Embedding.java
index 2f107babb8..7931cea0c9 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Embedding.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/Embedding.java
@@ -30,22 +30,10 @@ public interface Embedding extends BodyElement
* <!-- end-user-doc -->
*
* @return the value of the '<em>Element</em>' reference.
- * @see #setElement(EmbeddableElement)
* @see org.eclipse.emf.cdo.releng.doc.article.ArticlePackage#getEmbedding_Element()
- * @model resolveProxies="false" required="true"
+ * @model resolveProxies="false" required="true" changeable="false"
* @generated
*/
EmbeddableElement getElement();
- /**
- * Sets the value of the '{@link org.eclipse.emf.cdo.releng.doc.article.Embedding#getElement <em>Element</em>}'
- * reference. <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Element</em>' reference.
- * @see #getElement()
- * @generated
- */
- void setElement(EmbeddableElement value);
-
} // Embedding
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java
index d2df8183d2..a09a4427b8 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ArticlePackageImpl.java
@@ -40,6 +40,7 @@ import org.eclipse.emf.ecore.impl.EPackageImpl;
import com.sun.javadoc.Doc;
import com.sun.javadoc.RootDoc;
+import com.sun.javadoc.Tag;
import java.io.File;
@@ -219,6 +220,13 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
private EDataType docEDataType = null;
/**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
+ private EDataType tagEDataType = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry
* EPackage.Registry} by the package package URI value.
* <p>
@@ -725,7 +733,7 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
*
* @generated
*/
- public EAttribute getBodyElement_Html()
+ public EAttribute getBodyElement_Tag()
{
return (EAttribute)bodyElementEClass.getEStructuralFeatures().get(1);
}
@@ -735,9 +743,19 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
*
* @generated
*/
+ public EAttribute getBodyElement_Html()
+ {
+ return (EAttribute)bodyElementEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public EReference getBodyElement_Callout()
{
- return (EReference)bodyElementEClass.getEStructuralFeatures().get(2);
+ return (EReference)bodyElementEClass.getEStructuralFeatures().get(3);
}
/**
@@ -835,6 +853,16 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
*
* @generated
*/
+ public EDataType getTag()
+ {
+ return tagEDataType;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated
+ */
public ArticleFactory getArticleFactory()
{
return (ArticleFactory)getEFactoryInstance();
@@ -920,6 +948,7 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
bodyElementEClass = createEClass(BODY_ELEMENT);
createEReference(bodyElementEClass, BODY_ELEMENT__BODY);
+ createEAttribute(bodyElementEClass, BODY_ELEMENT__TAG);
createEAttribute(bodyElementEClass, BODY_ELEMENT__HTML);
createEReference(bodyElementEClass, BODY_ELEMENT__CALLOUT);
@@ -937,6 +966,7 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
rootDocEDataType = createEDataType(ROOT_DOC);
fileEDataType = createEDataType(FILE);
docEDataType = createEDataType(DOC);
+ tagEDataType = createEDataType(TAG);
}
/**
@@ -1108,6 +1138,8 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
initEReference(getBodyElement_Body(), this.getBody(), this.getBody_Elements(), "body", null, 0, 1,
BodyElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES,
!IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getBodyElement_Tag(), this.getTag(), "tag", null, 0, 1, BodyElement.class, IS_TRANSIENT,
+ IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getBodyElement_Html(), ecorePackage.getEString(), "html", null, 0, 1, BodyElement.class,
IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEReference(getBodyElement_Callout(), this.getCallout(), this.getCallout_Elements(), "callout", null, 0, 1,
@@ -1123,7 +1155,7 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
initEClass(embeddingEClass, Embedding.class, "Embedding", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getEmbedding_Element(), this.getEmbeddableElement(), null, "element", null, 1, 1, Embedding.class,
- !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
+ !IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEClass(sourceCodeEClass, SourceCode.class, "SourceCode", !IS_ABSTRACT, !IS_INTERFACE,
@@ -1133,6 +1165,7 @@ public class ArticlePackageImpl extends EPackageImpl implements ArticlePackage
initEDataType(rootDocEDataType, RootDoc.class, "RootDoc", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
initEDataType(fileEDataType, File.class, "File", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
initEDataType(docEDataType, Doc.class, "Doc", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
+ initEDataType(tagEDataType, Tag.class, "Tag", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS);
// Create resource
createResource(eNS_URI);
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java
index 4f6894ce34..abc309c392 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyElementImpl.java
@@ -27,6 +27,7 @@ import com.sun.javadoc.Tag;
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.emf.cdo.releng.doc.article.impl.BodyElementImpl#getBody <em>Body</em>}</li>
+ * <li>{@link org.eclipse.emf.cdo.releng.doc.article.impl.BodyElementImpl#getTag <em>Tag</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.doc.article.impl.BodyElementImpl#getHtml <em>Html</em>}</li>
* <li>{@link org.eclipse.emf.cdo.releng.doc.article.impl.BodyElementImpl#getCallout <em>Callout</em>}</li>
* </ul>
@@ -37,6 +38,15 @@ import com.sun.javadoc.Tag;
public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
{
/**
+ * The default value of the '{@link #getTag() <em>Tag</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @see #getTag()
+ * @generated
+ * @ordered
+ */
+ protected static final Tag TAG_EDEFAULT = null;
+
+ /**
* The default value of the '{@link #getHtml() <em>Html</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc
* -->
*
@@ -65,11 +75,6 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
this.tag = tag;
}
- public Tag getTag()
- {
- return tag;
- }
-
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -146,6 +151,16 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
*
* @generated NOT
*/
+ public Tag getTag()
+ {
+ return tag;
+ }
+
+ /**
+ * <!-- begin-user-doc --> <!-- end-user-doc -->
+ *
+ * @generated NOT
+ */
public abstract String getHtml();
/**
@@ -283,6 +298,8 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
{
case ArticlePackage.BODY_ELEMENT__BODY:
return getBody();
+ case ArticlePackage.BODY_ELEMENT__TAG:
+ return getTag();
case ArticlePackage.BODY_ELEMENT__HTML:
return getHtml();
case ArticlePackage.BODY_ELEMENT__CALLOUT:
@@ -343,6 +360,8 @@ public abstract class BodyElementImpl extends EObjectImpl implements BodyElement
{
case ArticlePackage.BODY_ELEMENT__BODY:
return getBody() != null;
+ case ArticlePackage.BODY_ELEMENT__TAG:
+ return TAG_EDEFAULT == null ? getTag() != null : !TAG_EDEFAULT.equals(getTag());
case ArticlePackage.BODY_ELEMENT__HTML:
return HTML_EDEFAULT == null ? getHtml() != null : !HTML_EDEFAULT.equals(getHtml());
case ArticlePackage.BODY_ELEMENT__CALLOUT:
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyImpl.java
index a4373463e2..371619ef2b 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/BodyImpl.java
@@ -334,9 +334,7 @@ public abstract class BodyImpl extends StructuralElementImpl implements Body
public String toString()
{
if (eIsProxy())
- {
return super.toString();
- }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (html: ");
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ChapterImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ChapterImpl.java
index 778caf8136..f69ed27e99 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ChapterImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/ChapterImpl.java
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EClass;
import com.sun.javadoc.ClassDoc;
+import java.io.File;
import java.io.IOException;
/**
@@ -43,11 +44,15 @@ public class ChapterImpl extends BodyImpl implements Chapter
ChapterImpl(StructuralElement parent, ClassDoc classDoc)
{
- super(parent, classDoc.containingClass() == null ? classDoc.simpleTypeName() + ".html" : "#"
- + classDoc.simpleTypeName(), classDoc);
+ super(parent, makePath(classDoc), classDoc);
getDocumentation().getContext().register(getId(), this);
}
+ private static String makePath(ClassDoc classDoc)
+ {
+ return classDoc.simpleTypeName() + (classDoc.containingClass() == null ? ".html" : "");
+ }
+
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -113,13 +118,33 @@ public class ChapterImpl extends BodyImpl implements Chapter
}
@Override
- public void generate(HtmlWriter out) throws IOException
+ protected String createFullPath()
{
- ClassDoc classDoc = getDoc();
+ if (this instanceof Article)
+ {
+ return super.createFullPath();
+ }
+ return getArticle().getFullPath() + "#" + getPath();
+ }
+
+ @Override
+ protected File createOutputFile()
+ {
+ // if (this instanceof Article)
+ {
+ return super.createOutputFile();
+ }
+
+ // return getArticle().getOutputFile();
+ }
+
+ @Override
+ public void generate(HtmlWriter out) throws IOException
+ {
out.writeHeading(1, getTitle());
out.write("<a name=\"");
- out.write(classDoc.typeName());
+ out.write(getPath());
out.write("\"/>");
super.generate(out);
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java
index 98b72ddde2..ec45a5fa5b 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/DocumentationImpl.java
@@ -180,17 +180,23 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
return;
}
- if (ArticleUtil.isSnippet(classDoc))
+ if (ArticleUtil.isSnippet(getContext().getRoot(), classDoc))
{
new SnippetImpl(this, classDoc);
+ analyzeClassChildren(this, classDoc);
}
else
{
Chapter chapter = createChapter(parent, classDoc);
- for (ClassDoc child : classDoc.innerClasses())
- {
- analyzeClass(chapter, child);
- }
+ analyzeClassChildren(chapter, classDoc);
+ }
+ }
+
+ private void analyzeClassChildren(StructuralElement parent, ClassDoc classDoc)
+ {
+ for (ClassDoc child : classDoc.innerClasses())
+ {
+ analyzeClass(parent, child);
}
for (MethodDoc methodDoc : classDoc.methods())
@@ -216,7 +222,7 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
return;
}
- if (ArticleUtil.isSnippet(methodDoc))
+ if (ArticleUtil.isSnippet(getContext().getRoot(), methodDoc))
{
new SnippetImpl(this, methodDoc);
}
@@ -246,7 +252,9 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
public Context getContext()
{
if (eContainerFeatureID() != ArticlePackage.DOCUMENTATION__CONTEXT)
+ {
return null;
+ }
return (Context)eContainer();
}
@@ -268,24 +276,34 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
*/
public void setContext(Context newContext)
{
- if (newContext != eInternalContainer()
- || (eContainerFeatureID() != ArticlePackage.DOCUMENTATION__CONTEXT && newContext != null))
+ if (newContext != eInternalContainer() || eContainerFeatureID() != ArticlePackage.DOCUMENTATION__CONTEXT
+ && newContext != null)
{
if (EcoreUtil.isAncestor(this, newContext))
+ {
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ }
NotificationChain msgs = null;
if (eInternalContainer() != null)
+ {
msgs = eBasicRemoveFromContainer(msgs);
+ }
if (newContext != null)
+ {
msgs = ((InternalEObject)newContext).eInverseAdd(this, ArticlePackage.CONTEXT__DOCUMENTATIONS, Context.class,
msgs);
+ }
msgs = basicSetContext(newContext, msgs);
if (msgs != null)
+ {
msgs.dispatch();
+ }
}
else if (eNotificationRequired())
+ {
eNotify(new ENotificationImpl(this, Notification.SET, ArticlePackage.DOCUMENTATION__CONTEXT, newContext,
newContext));
+ }
}
/**
@@ -341,7 +359,9 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
{
case ArticlePackage.DOCUMENTATION__CONTEXT:
if (eInternalContainer() != null)
+ {
msgs = eBasicRemoveFromContainer(msgs);
+ }
return basicSetContext((Context)otherEnd, msgs);
case ArticlePackage.DOCUMENTATION__EMBEDDABLE_ELEMENTS:
return ((InternalEList<InternalEObject>)(InternalEList<?>)getEmbeddableElements()).basicAdd(otherEnd, msgs);
@@ -485,7 +505,9 @@ public class DocumentationImpl extends StructuralElementImpl implements Document
public String toString()
{
if (eIsProxy())
+ {
return super.toString();
+ }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (project: ");
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/EmbeddingImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/EmbeddingImpl.java
index 2da9123935..c3ec91f43f 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/EmbeddingImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/EmbeddingImpl.java
@@ -7,12 +7,13 @@
package org.eclipse.emf.cdo.releng.doc.article.impl;
import org.eclipse.emf.cdo.releng.doc.article.ArticlePackage;
+import org.eclipse.emf.cdo.releng.doc.article.Body;
import org.eclipse.emf.cdo.releng.doc.article.EmbeddableElement;
import org.eclipse.emf.cdo.releng.doc.article.Embedding;
-import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
+
+import com.sun.javadoc.SeeTag;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Embedding</b></em>'. <!-- end-user-doc -->
@@ -47,6 +48,12 @@ public class EmbeddingImpl extends BodyElementImpl implements Embedding
super();
}
+ EmbeddingImpl(Body body, SeeTag tag, EmbeddableElement element)
+ {
+ super(body, tag);
+ this.element = element;
+ }
+
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -73,19 +80,6 @@ public class EmbeddingImpl extends BodyElementImpl implements Embedding
*
* @generated
*/
- public void setElement(EmbeddableElement newElement)
- {
- EmbeddableElement oldElement = element;
- element = newElement;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, ArticlePackage.EMBEDDING__ELEMENT, oldElement, element));
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType)
{
@@ -103,40 +97,6 @@ public class EmbeddingImpl extends BodyElementImpl implements Embedding
* @generated
*/
@Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case ArticlePackage.EMBEDDING__ELEMENT:
- setElement((EmbeddableElement)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case ArticlePackage.EMBEDDING__ELEMENT:
- setElement((EmbeddableElement)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc --> <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
public boolean eIsSet(int featureID)
{
switch (featureID)
@@ -150,8 +110,7 @@ public class EmbeddingImpl extends BodyElementImpl implements Embedding
@Override
public String getHtml()
{
- // TODO: implement EmbeddingImpl.getHtml()
- throw new UnsupportedOperationException();
+ return element.getHtml(this);
}
} // EmbeddingImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java
index ec11185665..fe5c9e3d8b 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/LinkImpl.java
@@ -7,13 +7,17 @@
package org.eclipse.emf.cdo.releng.doc.article.impl;
import org.eclipse.emf.cdo.releng.doc.article.ArticlePackage;
+import org.eclipse.emf.cdo.releng.doc.article.Body;
import org.eclipse.emf.cdo.releng.doc.article.Link;
import org.eclipse.emf.cdo.releng.doc.article.LinkTarget;
+import org.eclipse.emf.cdo.releng.doc.article.StructuralElement;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import com.sun.javadoc.SeeTag;
+
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Link</b></em>'. <!-- end-user-doc -->
* <p>
@@ -47,6 +51,12 @@ public class LinkImpl extends BodyElementImpl implements Link
super();
}
+ LinkImpl(Body body, SeeTag tag, StructuralElement target)
+ {
+ super(body, tag);
+ this.target = target;
+ }
+
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -148,10 +158,25 @@ public class LinkImpl extends BodyElementImpl implements Link
}
@Override
+ public SeeTag getTag()
+ {
+ return (SeeTag)super.getTag();
+ }
+
+ @Override
public String getHtml()
{
- // TODO: implement LinkImpl.getHtml()
- throw new UnsupportedOperationException();
+ Body body = getBody();
+ SeeTag tag = getTag();
+
+ String href = target.linkFrom(body);
+ String label = tag.label();
+ if (label == null || label.length() == 0)
+ {
+ label = tag.text();
+ }
+
+ return "<a href=\"" + href + "\">" + label + "</a>";
}
} // LinkImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java
index 5c8f7cb5cf..0475e1d35f 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/SnippetImpl.java
@@ -11,6 +11,7 @@ import org.eclipse.emf.cdo.releng.doc.article.Callout;
import org.eclipse.emf.cdo.releng.doc.article.Documentation;
import org.eclipse.emf.cdo.releng.doc.article.Embedding;
import org.eclipse.emf.cdo.releng.doc.article.Snippet;
+import org.eclipse.emf.cdo.releng.doc.article.util.ArticleUtil;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
@@ -19,9 +20,18 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
+import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.Doc;
+import com.sun.javadoc.SeeTag;
+import java.io.CharArrayWriter;
+import java.io.File;
+import java.io.PrintWriter;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Snippet</b></em>'. <!-- end-user-doc -->
@@ -36,6 +46,10 @@ import java.util.Collection;
*/
public class SnippetImpl extends EmbeddableElementImpl implements Snippet
{
+ private static Constructor<?> snippet;
+
+ private static Method write;
+
/**
* The cached value of the '{@link #getCallouts() <em>Callouts</em>}' containment reference list. <!-- begin-user-doc
* --> <!-- end-user-doc -->
@@ -193,15 +207,62 @@ public class SnippetImpl extends EmbeddableElementImpl implements Snippet
}
@Override
- public String getHtml(Embedding embedder)
+ public Object getId()
{
- // TODO: implement SnippetImpl.getHtml(embedder)
- throw new UnsupportedOperationException();
+ return doc;
}
@Override
- public Object getId()
+ public String getHtml(Embedding embedder)
{
- return doc;
+ CharArrayWriter result = new CharArrayWriter();
+
+ PrintWriter out = new PrintWriter(result);
+ out.write("\n\n");
+ writeHtml(embedder, out);
+ out.flush();
+
+ return result.toString();
+ }
+
+ private void writeHtml(Embedding embedder, PrintWriter out)
+ {
+ File source = embedder.getBody().getOutputFile();
+ File target = new File(getDocumentation().getOutputFile(), "resources");
+ String imagePath = ArticleUtil.createLink(source, target) + "/";
+
+ Map<String, Object> options = new HashMap<String, Object>();
+ String label = ((SeeTag)embedder.getTag()).label();
+ if (label != null)
+ {
+ options.put("title", label);
+ }
+
+ options.put("includeSignature", doc instanceof ClassDoc);
+ options.put("imagePath", imagePath);
+
+ try
+ {
+ Object instance = snippet.newInstance(doc, options);
+ write.invoke(instance, out);
+ }
+ catch (Throwable ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+
+ static
+ {
+ try
+ {
+ Class<?> c = Class.forName("de.escnet.CodeSnippet");
+ snippet = c.getConstructor(Doc.class, Map.class);
+ write = c.getMethod("write", PrintWriter.class);
+ }
+ catch (Throwable ex)
+ {
+ ex.printStackTrace();
+ }
}
} // SnippetImpl
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java
index ea38293374..c35e4dbf3e 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/StructuralElementImpl.java
@@ -9,6 +9,7 @@ package org.eclipse.emf.cdo.releng.doc.article.impl;
import org.eclipse.emf.cdo.releng.doc.article.ArticlePackage;
import org.eclipse.emf.cdo.releng.doc.article.Documentation;
import org.eclipse.emf.cdo.releng.doc.article.StructuralElement;
+import org.eclipse.emf.cdo.releng.doc.article.util.ArticleUtil;
import org.eclipse.emf.cdo.releng.doc.article.util.HtmlWriter;
import org.eclipse.emf.common.notify.Notification;
@@ -25,9 +26,7 @@ import com.sun.javadoc.Doc;
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Collection;
-import java.util.List;
/**
* <!-- begin-user-doc --> An implementation of the model object '<em><b>Structural Element</b></em>'. <!-- end-user-doc
@@ -189,7 +188,9 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
public StructuralElement getParent()
{
if (eContainerFeatureID() != ArticlePackage.STRUCTURAL_ELEMENT__PARENT)
+ {
return null;
+ }
return (StructuralElement)eContainer();
}
@@ -211,24 +212,34 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
*/
public void setParent(StructuralElement newParent)
{
- if (newParent != eInternalContainer()
- || (eContainerFeatureID() != ArticlePackage.STRUCTURAL_ELEMENT__PARENT && newParent != null))
+ if (newParent != eInternalContainer() || eContainerFeatureID() != ArticlePackage.STRUCTURAL_ELEMENT__PARENT
+ && newParent != null)
{
if (EcoreUtil.isAncestor(this, newParent))
+ {
throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
+ }
NotificationChain msgs = null;
if (eInternalContainer() != null)
+ {
msgs = eBasicRemoveFromContainer(msgs);
+ }
if (newParent != null)
+ {
msgs = ((InternalEObject)newParent).eInverseAdd(this, ArticlePackage.STRUCTURAL_ELEMENT__CHILDREN,
StructuralElement.class, msgs);
+ }
msgs = basicSetParent(newParent, msgs);
if (msgs != null)
+ {
msgs.dispatch();
+ }
}
else if (eNotificationRequired())
+ {
eNotify(new ENotificationImpl(this, Notification.SET, ArticlePackage.STRUCTURAL_ELEMENT__PARENT, newParent,
newParent));
+ }
}
/**
@@ -256,39 +267,47 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
*
* @generated NOT
*/
- public String getFullPath()
+ public final String getFullPath()
{
if (fullPath == null)
{
- StructuralElement parent = getParent();
- if (parent != null)
- {
- fullPath = parent.getFullPath() + "/" + path;
- }
- else
- {
- fullPath = path;
- }
+ fullPath = createFullPath();
}
return fullPath;
}
+ protected String createFullPath()
+ {
+ StructuralElement parent = getParent();
+ if (parent != null)
+ {
+ return parent.getFullPath() + "/" + path;
+ }
+
+ return path;
+ }
+
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
* @generated NOT
*/
- public File getOutputFile()
+ public final File getOutputFile()
{
if (outputFile == null)
{
- outputFile = new File(getDocumentation().getContext().getBaseFolder(), getFullPath());
+ outputFile = createOutputFile();
}
return outputFile;
}
+ protected File createOutputFile()
+ {
+ return new File(getDocumentation().getContext().getBaseFolder(), getFullPath());
+ }
+
/**
* <!-- begin-user-doc --> <!-- end-user-doc -->
*
@@ -323,63 +342,7 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
@Override
public String linkFrom(StructuralElement source)
{
- List<String> sourceSegments = getSegments(source.getOutputFile());
- List<String> targetSegments = getSegments(getOutputFile());
-
- int minSize = Math.min(sourceSegments.size(), targetSegments.size());
- for (int i = 0; i < minSize; i++)
- {
- if (sourceSegments.get(0).equals(targetSegments.get(0)))
- {
- sourceSegments.remove(0);
- targetSegments.remove(0);
- }
- else
- {
- break;
- }
- }
-
- StringBuilder builder = new StringBuilder();
- for (int i = 0; i < sourceSegments.size(); i++)
- {
- builder.append("../");
- }
-
- boolean first = true;
- for (String segment : targetSegments)
- {
- if (first)
- {
- first = false;
- }
- else
- {
- builder.append("/");
- }
-
- builder.append(segment);
- }
-
- return builder.toString();
- }
-
- private static List<String> getSegments(File file)
- {
- List<String> result = new ArrayList<String>();
- getSegments(file, result);
- return result;
- }
-
- private static void getSegments(File file, List<String> result)
- {
- File parent = file.getParentFile();
- if (parent != null)
- {
- getSegments(parent, result);
- }
-
- result.add(file.getName());
+ return ArticleUtil.createLink(source.getOutputFile(), getOutputFile());
}
/**
@@ -397,7 +360,9 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
return ((InternalEList<InternalEObject>)(InternalEList<?>)getChildren()).basicAdd(otherEnd, msgs);
case ArticlePackage.STRUCTURAL_ELEMENT__PARENT:
if (eInternalContainer() != null)
+ {
msgs = eBasicRemoveFromContainer(msgs);
+ }
return basicSetParent((StructuralElement)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
@@ -549,7 +514,9 @@ public abstract class StructuralElementImpl extends LinkTargetImpl implements St
public String toString()
{
if (eIsProxy())
+ {
return super.toString();
+ }
StringBuffer result = new StringBuffer(super.toString());
result.append(" (title: ");
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java
index b56f1bda49..c26cd6c215 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/impl/UnresolvedBodyElement.java
@@ -13,9 +13,15 @@ package org.eclipse.emf.cdo.releng.doc.article.impl;
import org.eclipse.emf.cdo.releng.doc.article.Body;
import org.eclipse.emf.cdo.releng.doc.article.BodyElement;
import org.eclipse.emf.cdo.releng.doc.article.Context;
+import org.eclipse.emf.cdo.releng.doc.article.EmbeddableElement;
+import org.eclipse.emf.cdo.releng.doc.article.StructuralElement;
+import org.eclipse.emf.cdo.releng.doc.article.util.ArticleUtil;
import org.eclipse.emf.common.util.EList;
+import com.sun.javadoc.ClassDoc;
+import com.sun.javadoc.MemberDoc;
+import com.sun.javadoc.SeeTag;
import com.sun.javadoc.Tag;
/**
@@ -30,7 +36,7 @@ public class UnresolvedBodyElement extends BodyElementImpl
public final String getText()
{
- return "<b><i>UNRESOLVED</i></b>";
+ return "<b><code><font color=\"#ff000000\">{" + getTag() + "}</font></code></b>";
}
@Override
@@ -41,6 +47,56 @@ public class UnresolvedBodyElement extends BodyElementImpl
public BodyElement resolve(Context context)
{
+ Tag tag = getTag();
+ if (tag instanceof SeeTag)
+ {
+ SeeTag seeTag = (SeeTag)tag;
+ return resolveSeeTag(context, seeTag);
+ }
+
+ System.err.println(ArticleUtil.makeConsoleLink("Warning: Unresolved link " + tag + " in ", tag.position()));
+ return this;
+ }
+
+ private BodyElement resolveSeeTag(Context context, SeeTag tag)
+ {
+ MemberDoc referencedMember = tag.referencedMember();
+ if (referencedMember != null)
+ {
+ Object target = context.lookup(referencedMember);
+ if (target != null)
+ {
+ return createBodyElement(tag, target);
+ }
+
+ return this;
+ }
+
+ ClassDoc referencedClass = tag.referencedClass();
+ if (referencedClass != null)
+ {
+ Object target = context.lookup(referencedClass);
+ if (target != null)
+ {
+ return createBodyElement(tag, target);
+ }
+ }
+
+ return this;
+ }
+
+ private BodyElement createBodyElement(SeeTag tag, Object target)
+ {
+ if (target instanceof StructuralElement)
+ {
+ return new LinkImpl(null, tag, (StructuralElement)target);
+ }
+
+ if (target instanceof EmbeddableElement)
+ {
+ return new EmbeddingImpl(null, tag, (EmbeddableElement)target);
+ }
+
return null;
}
@@ -53,7 +109,18 @@ public class UnresolvedBodyElement extends BodyElementImpl
{
UnresolvedBodyElement unresolved = (UnresolvedBodyElement)element;
BodyElement resolved = unresolved.resolve(context);
- elements.set(i, resolved);
+ if (resolved != unresolved)
+ {
+ try
+ {
+ elements.set(i, resolved);
+ }
+ catch (Exception ex)
+ {
+ resolved = unresolved.resolve(context);
+ ex.printStackTrace();
+ }
+ }
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java
index 8b998cdb4b..9dc33eb34c 100644
--- a/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java
+++ b/plugins/org.eclipse.emf.cdo.releng.doc/src/org/eclipse/emf/cdo/releng/doc/article/util/ArticleUtil.java
@@ -14,12 +14,15 @@ import com.sun.javadoc.ClassDoc;
import com.sun.javadoc.Doc;
import com.sun.javadoc.MethodDoc;
import com.sun.javadoc.PackageDoc;
+import com.sun.javadoc.ProgramElementDoc;
import com.sun.javadoc.RootDoc;
import com.sun.javadoc.SourcePosition;
import com.sun.javadoc.Tag;
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
/**
* @author Eike Stepper
@@ -30,27 +33,6 @@ public final class ArticleUtil
{
}
- public static boolean containsFile(File folder, File file)
- {
- if (!folder.isDirectory())
- {
- return false;
- }
-
- File parent = file.getParentFile();
- if (parent == null)
- {
- return false;
- }
-
- if (parent.equals(folder))
- {
- return true;
- }
-
- return containsFile(folder, parent);
- }
-
public static boolean isDocumented(Doc doc)
{
Tag[] tags = doc.inlineTags();
@@ -68,9 +50,52 @@ public final class ArticleUtil
return isTagged(doc, "@ignore");
}
- public static boolean isSnippet(Doc doc)
+ public static boolean isSnippet(RootDoc root, Doc doc)
{
- return isTagged(doc, "@snippet");
+ boolean snippet = isTagged(doc, "@snippet");
+ if (snippet)
+ {
+ return true;
+ }
+
+ if (doc instanceof ProgramElementDoc)
+ {
+ ProgramElementDoc programElementDoc = (ProgramElementDoc)doc;
+ ClassDoc containingClass = programElementDoc.containingClass();
+ if (containingClass != null)
+ {
+ snippet = isSnippet(root, containingClass);
+ if (snippet)
+ {
+ return true;
+ }
+ }
+
+ PackageDoc containingPackage = programElementDoc.containingPackage();
+ if (containingPackage != null)
+ {
+ snippet = isSnippet(root, containingPackage);
+ if (snippet)
+ {
+ return true;
+ }
+ }
+ }
+ else if (doc instanceof PackageDoc)
+ {
+ PackageDoc packageDoc = (PackageDoc)doc;
+ PackageDoc parentPackage = getParentPackage(root, packageDoc);
+ if (parentPackage != null)
+ {
+ snippet = isSnippet(root, parentPackage);
+ if (snippet)
+ {
+ return true;
+ }
+ }
+ }
+
+ return false;
}
public static boolean isFactory(MethodDoc doc)
@@ -102,6 +127,27 @@ public final class ArticleUtil
return null;
}
+ public static boolean containsFile(File folder, File file)
+ {
+ if (!folder.isDirectory())
+ {
+ return false;
+ }
+
+ File parent = file.getParentFile();
+ if (parent == null)
+ {
+ return false;
+ }
+
+ if (parent.equals(folder))
+ {
+ return true;
+ }
+
+ return containsFile(folder, parent);
+ }
+
public static File canonify(File file)
{
try
@@ -114,6 +160,67 @@ public final class ArticleUtil
}
}
+ public static String createLink(File source, File target)
+ {
+ List<String> sourceSegments = getSegments(source);
+ List<String> targetSegments = getSegments(target);
+
+ int minSize = Math.min(sourceSegments.size(), targetSegments.size());
+ for (int i = 0; i < minSize; i++)
+ {
+ if (sourceSegments.get(0).equals(targetSegments.get(0)))
+ {
+ sourceSegments.remove(0);
+ targetSegments.remove(0);
+ }
+ else
+ {
+ break;
+ }
+ }
+
+ StringBuilder builder = new StringBuilder();
+ for (int i = 0; i < sourceSegments.size() - 1; i++)
+ {
+ builder.append("../");
+ }
+
+ boolean first = true;
+ for (String segment : targetSegments)
+ {
+ if (first)
+ {
+ first = false;
+ }
+ else
+ {
+ builder.append("/");
+ }
+
+ builder.append(segment);
+ }
+
+ return builder.toString();
+ }
+
+ private static List<String> getSegments(File file)
+ {
+ List<String> result = new ArrayList<String>();
+ getSegments(file, result);
+ return result;
+ }
+
+ private static void getSegments(File file, List<String> result)
+ {
+ File parent = file.getParentFile();
+ if (parent != null)
+ {
+ getSegments(parent, result);
+ }
+
+ result.add(file.getName());
+ }
+
public static String makeConsoleLink(Doc doc)
{
SourcePosition position = doc.position();

Back to the top