You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2015/11/25 19:23:52 UTC

[5/5] isis-site git commit: ISIS-803 custom lifecycle events; live templates

ISIS-803 custom lifecycle events; live templates


Project: http://git-wip-us.apache.org/repos/asf/isis-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis-site/commit/2d3a7aab
Tree: http://git-wip-us.apache.org/repos/asf/isis-site/tree/2d3a7aab
Diff: http://git-wip-us.apache.org/repos/asf/isis-site/diff/2d3a7aab

Branch: refs/heads/asf-site
Commit: 2d3a7aabe20e5d006f13698a4b35e3868ebb899a
Parents: c8287a0
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed Nov 25 18:23:33 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed Nov 25 18:23:33 2015 +0000

----------------------------------------------------------------------
 content/guides/cg.html                          |  109 +-
 content/guides/rg.html                          | 1398 ++++++++++++++++--
 ...-settings-file-templates-for-apache-isis.jar |  Bin 0 -> 9104 bytes
 .../resources/templates/isis-template-idea.xml  |  522 +++++++
 .../resources/templates/isis-templates-idea.xml |  804 ----------
 content/resources/templates/isis-templates2.xml |  479 ------
 6 files changed, 1869 insertions(+), 1443 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis-site/blob/2d3a7aab/content/guides/cg.html
----------------------------------------------------------------------
diff --git a/content/guides/cg.html b/content/guides/cg.html
index 05fb71f..1bf8214 100644
--- a/content/guides/cg.html
+++ b/content/guides/cg.html
@@ -1653,10 +1653,19 @@ rather than Lombok&#8217;s own <code>@Getter</code> and `@Setter.</p>
 </div>
 </div>
 <div class="sect1">
-<h2 id="_cg_ide-templates">3. IDE Templates</h2>
+<h2 id="_cg_ide-templates">3. Code and File Templates</h2>
 <div class="sectionbody">
 <div class="paragraph">
-<p>We provide IDE templates (for IntelliJ and Eclipse) for writing Apache Isis domain objects, and also for unit tests (JUnit and JMock).  We also provide them for IntelliJ for writing Asciidoc documentation (see also the <a href="#_cg_asciidoc-templates">appendix</a>).</p>
+<p>We provide parameterized templates, for both IntelliJ and Eclipse, to help you write your domain applications.</p>
+</div>
+<div class="paragraph">
+<p>On IntelliJ we provide both file templates (<code>File &gt; Settings &gt; Editor &gt; File and Code Templates</code>) and also live templates (<code>File &gt; Settings &gt; Editor &gt; Live Templates</code>).  The former are used to create new classes or files (eg a new domain entity), while the latter are intended to modify an existing file (eg create a new property or add a <code>toString()</code> method etc).</p>
+</div>
+<div class="paragraph">
+<p>On Eclipse we provide only the latter sort of template (Windows &gt; Preferences &gt; Java &gt; Editor &gt; Templates).</p>
+</div>
+<div class="paragraph">
+<p>There are templates for writing Apache Isis domain objects, for writing unit tests (JUnit and JMock), and also for writing Asciidoc documentation (see also the <a href="#_cg_asciidoc-templates">appendix</a>).</p>
 </div>
 <div class="sect2">
 <h3 id="_download">3.1. Download</h3>
@@ -1665,25 +1674,34 @@ rather than Lombok&#8217;s own <code>@Getter</code> and `@Setter.</p>
 </div>
 <table class="tableblock frame-all grid-all spread">
 <colgroup>
-<col style="width: 20%;">
-<col style="width: 20%;">
-<col style="width: 20%;">
-<col style="width: 20%;">
-<col style="width: 20%;">
+<col style="width: 22%;">
+<col style="width: 22%;">
+<col style="width: 11%;">
+<col style="width: 22%;">
+<col style="width: 22%;">
 </colgroup>
 <thead>
 <tr>
-<th class="tableblock halign-left valign-top">Template</th>
+<th class="tableblock halign-left valign-top">Purpose</th>
+<th class="tableblock halign-left valign-top">IntelliJ<br>
+file template</th>
 <th class="tableblock halign-left valign-top">Prefix</th>
-<th class="tableblock halign-left valign-top">IntelliJ</th>
-<th class="tableblock halign-left valign-top">Eclipse</th>
-<th class="tableblock halign-left valign-top">Apache Isis Domain Objects</th>
+<th class="tableblock halign-left valign-top">IntelliJ<br>
+live template</th>
+<th class="tableblock halign-left valign-top">Eclipse<br>
+template</th>
 </tr>
 </thead>
 <tbody>
 <tr>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
-<p>is</p>
+<p>Domain Objects</p>
+</div></div></td>
+<td class="tableblock halign-left valign-top"><div><div class="paragraph">
+<p><a href="../resources/templates/intellij-settings-file-templates-for-apache-isis.jar">Download</a></p>
+</div></div></td>
+<td class="tableblock halign-left valign-top"><div><div class="paragraph">
+<p><code>is</code></p>
 </div></div></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p><a href="../resources/templates/isis-templates-idea.xml">Download</a></p>
@@ -1691,51 +1709,62 @@ rather than Lombok&#8217;s own <code>@Getter</code> and `@Setter.</p>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p><a href="../resources/templates/isis-templates.xml">Download</a></p>
 </div></div></td>
+</tr>
+<tr>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p>JUnit tests</p>
 </div></div></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
-<p>ju</p>
+<p>(none)</p>
+</div></div></td>
+<td class="tableblock halign-left valign-top"><div><div class="paragraph">
+<p><code>ju</code></p>
 </div></div></td>
-</tr>
-<tr>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p><a href="../resources/templates/junit4-templates-idea.xml">Download</a></p>
 </div></div></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p><a href="../resources/templates/junit4-templates.xml">Download</a></p>
 </div></div></td>
+</tr>
+<tr>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p>JMock tests</p>
 </div></div></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
-<p>jm</p>
+<p>(none)</p>
+</div></div></td>
+<td class="tableblock halign-left valign-top"><div><div class="paragraph">
+<p><code>jm</code></p>
 </div></div></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p><a href="../resources/templates/jmock2-templates-idea.xml">Download</a></p>
 </div></div></td>
-</tr>
-<tr>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p><a href="../resources/templates/jmock2-templates.xml">Download</a></p>
 </div></div></td>
+</tr>
+<tr>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p>Asciidoc</p>
 </div></div></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
-<p>ad</p>
+<p>(none)</p>
+</div></div></td>
+<td class="tableblock halign-left valign-top"><div><div class="paragraph">
+<p><code>ad</code></p>
 </div></div></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
 <p><a href="../resources/templates/isis-asciidoc-templates-idea.xml">Download</a></p>
 </div></div></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
-<p>(none )</p>
+<p>(none)</p>
 </div></div></td>
 </tr>
 </tbody>
 </table>
 <div class="paragraph">
-<p>The most commonly used Apache Isis domain objects templates are also listed on the <a href="../cheat-sheet.html">Apache Isis cheat sheet</a>.</p>
+<p>The most commonly used domain objects (live) templates are also listed on the <a href="../cheat-sheet.html">Apache Isis cheat sheet</a>.</p>
 </div>
 </div>
 <div class="sect2">
@@ -1743,24 +1772,27 @@ rather than Lombok&#8217;s own <code>@Getter</code> and `@Setter.</p>
 <div class="sect3">
 <h4 id="_intellij">3.2.1. IntelliJ</h4>
 <div class="paragraph">
-<p>To install in IntelliJ (Community edition 15), copy to the relevant <code>config/templates</code> directory, eg:</p>
+<p>To install in the live templates IntelliJ (Community edition 15), copy to the relevant <code>config/templates</code> directory, eg:</p>
 </div>
 <div class="ulist">
 <ul>
 <li>
-<p>Windows <code>&lt;User home&gt;\.IdeaIC14\config\templates</code></p>
+<p>Windows <code>&lt;User home&gt;\.IdeaIC15\config\templates</code></p>
 </li>
 <li>
 <p>Linux <code>~/.IdeaIC14/config/templates</code></p>
 </li>
 <li>
-<p>Mac OS <code>~/Library/Preferences/IdeaIC14/templates</code></p>
+<p>Mac OS <code>~/Library/Preferences/IdeaIC15/templates</code></p>
 </li>
 </ul>
 </div>
 <div class="paragraph">
 <p>If using the Ultimate edition, the directory is <code>.IntelliJIdea15</code> rather than <code>IdeaIC15</code>.</p>
 </div>
+<div class="paragraph">
+<p>To install the file templates, use <code>File &gt; Import Settings</code>.</p>
+</div>
 </div>
 <div class="sect3">
 <h4 id="_eclipse">3.2.2. Eclipse</h4>
@@ -1772,7 +1804,11 @@ rather than Lombok&#8217;s own <code>@Getter</code> and `@Setter.</p>
 <div class="sect2">
 <h3 id="_usage">3.3. Usage</h3>
 <div class="paragraph">
-<p>Enter the prefix (<code>is</code>, <code>ju</code>, <code>jm</code>) and the IDE will list all available templates in that category.</p>
+<p>For the live templates, enter the prefix in the editor (<code>is</code>, <code>ju</code>, <code>jm</code>) and the IDE will list all available templates
+in that category.</p>
+</div>
+<div class="paragraph">
+<p>For the file templates (IntelliJ only), these are available from <code>File &gt; New</code>.</p>
 </div>
 </div>
 </div>
@@ -2215,15 +2251,9 @@ within the Isis application (they may reference underlying domain entities) wher
 XSDs can be used standalone, eg by a Java subscriber running on an ESB such as Apache Camel.</p>
 </div>
 <div class="paragraph">
-<p>The diagram below shows how these different plugins fit together:</p>
-</div>
-<div class="imageblock">
-<div class="content">
-<a class="image" href="images/maven-plugin/xsd-goal.png"><img src="images/maven-plugin/xsd-goal.png" alt="xsd goal" width="800px"></a>
-</div>
-</div>
-<div class="paragraph">
-<p>The sections below explain in more detail how to configure the <code>xsd</code> plugin (and other plugins).</p>
+<p>The rest of this section explains how to configure a new <code>xsd</code> submodule that uses the <code>isis-maven-plugin</code> along with
+other standard plugins in order to generate both XSDs and DTOs.  The <code>pom.xml</code> described below uses Maven profiles
+to separate out these two responsibilities.</p>
 </div>
 <div class="sect3">
 <h4 id="_cg_isis-maven-plugin_xsd">5.3.1. <code>xsd</code> submodule</h4>
@@ -2248,6 +2278,15 @@ generated XSD files into a zip file.</p>
 </ul>
 </div>
 <div class="paragraph">
+<p>These two main responsibilities can then be placed into separate Maven profiles, for better modularity.  The diagram
+below shows the overall design:</p>
+</div>
+<div class="imageblock">
+<div class="content">
+<a class="image" href="images/maven-plugin/xsd-goal.png"><img src="images/maven-plugin/xsd-goal.png" alt="xsd goal" width="800px"></a>
+</div>
+</div>
+<div class="paragraph">
 <p>For example, here is the <code>pom.xml</code> file for the (non-ASF)
 <a href="http://github.com/isisaddons/isis-app-todoapp">Isis addons' todoapp</a> example app&#8217;s <code>todoapp-xsd</code> submodule.</p>
 </div>
@@ -8251,7 +8290,7 @@ xxx<br>
 </li>
 </ul>
 </li>
-<li><a href="#_cg_ide-templates">3. IDE Templates</a>
+<li><a href="#_cg_ide-templates">3. Code and File Templates</a>
 <ul class="sectlevel2">
 <li><a href="#_download">3.1. Download</a></li>
 <li><a href="#_installation">3.2. Installation</a>