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/06 08:43:23 UTC

isis-site git commit: ISIS-1151: defaultView

Repository: isis-site
Updated Branches:
  refs/heads/asf-site 0cd1bc39c -> 85926fc5e


ISIS-1151: defaultView


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

Branch: refs/heads/asf-site
Commit: 85926fc5e62a1b3bff533bb5820204aa4b029bf4
Parents: 0cd1bc3
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Nov 6 06:57:08 2015 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Nov 6 06:57:08 2015 +0000

----------------------------------------------------------------------
 content/guides/rg.html | 94 ++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 80 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis-site/blob/85926fc5/content/guides/rg.html
----------------------------------------------------------------------
diff --git a/content/guides/rg.html b/content/guides/rg.html
index 25da975..7520d52 100644
--- a/content/guides/rg.html
+++ b/content/guides/rg.html
@@ -4063,6 +4063,16 @@ annotation.  It is also possible to apply the annotation to actions of domain se
 </div></div></td>
 </tr>
 <tr>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_rg_annotations_manpage-CollectionLayout_defaultView"><code>defaultView()</code></a></p></td>
+<td class="tableblock halign-left valign-top"><p class="tableblock"><code>table</code>, <code>excel</code>, <code>calendar</code>, <code>map</code>, &#8230;&#8203;</p></td>
+<td class="tableblock halign-left valign-top"><div><div class="paragraph">
+<p>Which view is selected by default, if multiple views are available.</p>
+</div>
+<div class="paragraph">
+<p>See (non-ASF) <a href="http://isisaddons.org">Isis Addons</a> for further views.</p>
+</div></div></td>
+</tr>
+<tr>
 <td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_rg_annotations_manpage-CollectionLayout_describedAs"><code>describedAs()</code></a></p></td>
 <td class="tableblock halign-left valign-top"><p class="tableblock">String.</p></td>
 <td class="tableblock halign-left valign-top"><div><div class="paragraph">
@@ -4203,7 +4213,58 @@ can be used instead, eg:</p>
 </div>
 </div>
 <div class="sect3">
-<h4 id="_rg_annotations_manpage-CollectionLayout_describedAs">2.5.2. <code>describedAs()</code></h4>
+<h4 id="_rg_annotations_manpage-CollectionLayout_defaultView">2.5.2. <code>defaultView()</code></h4>
+<div class="paragraph">
+<p>The <a href="ug.html#_ug_wicket-viewer">Wicket viewer</a> allows additional views to be configured to render collections of objects; at the time of writing thesee include the (non-ASF) (non-ASF) <a href="http://isisaddons.org">Isis Addons</a>' (non-ASF) <a href="http://github.com/isisaddons/isis-wicket-excel">excel</a> view, the <a href="http://github.com/isisaddons/isis-wicket-fullcalendar2">fullcalendar2</a> view, and the <a href="http://github.com/isisaddons/isis-wicket-gmap3">gmap3</a> view.  If the objects to be rendered have the correct "shape", then the appropriate view will be made available.  For example, objects with a date can be rendered using <code>calendar</code>; objects with locations can be rendered using <code>map</code>.</p>
+</div>
+<div class="paragraph">
+<p>The <code>defaultView()</code> attribute is used to select which of these views should be used by default for a given collection.</p>
+</div>
+<div class="paragraph">
+<p>For example:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span> <span class="type">class</span> <span class="class">BusRoute</span> {
+    <span class="annotation">@CollectionLayout</span>(
+        defaultView=<span class="string"><span class="delimiter">&quot;</span><span class="content">map</span><span class="delimiter">&quot;</span></span>
+    )
+    <span class="directive">public</span> <span class="predefined-type">SortedSet</span>&lt;BusStop&gt; getStops() { ... }
+    ...
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>As an alternative to using the annotation, the dynamic <a href="#_rg_object-layout_dynamic"><code>.layout.json</code></a>
+can be used instead, eg:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="javascript"><span class="string"><span class="delimiter">&quot;</span><span class="content">dependencies</span><span class="delimiter">&quot;</span></span>: {
+    <span class="key"><span class="delimiter">&quot;</span><span class="content">collectionLayout</span><span class="delimiter">&quot;</span></span>: {
+        <span class="key"><span class="delimiter">&quot;</span><span class="content">defaultView</span><span class="delimiter">&quot;</span></span>: <span class="string"><span class="delimiter">&quot;</span><span class="content">map</span><span class="delimiter">&quot;</span></span>
+    }
+}</code></pre>
+</div>
+</div>
+<div class="admonitionblock note">
+<table>
+<tr>
+<td class="icon">
+<i class="fa icon-note" title="Note"></i>
+</td>
+<td class="content">
+<div class="paragraph">
+<p>This attribute takes precedence over any value for the <a href="#_rg_annotations_manpage-CollectionLayout_render"><code>@CollectionLayout#render()</code></a> attribute.  For example, if the
+<code>defaultView</code> attribute is defined to "table", then the table will be show even if <code>render</code> is set to <code>LAZILY</code>.</p>
+</div>
+</td>
+</tr>
+</table>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_rg_annotations_manpage-CollectionLayout_describedAs">2.5.3. <code>describedAs()</code></h4>
 <div class="paragraph">
 <p>The <code>describedAs()</code> attribute is used to provide a short description of the collection to the user.  In the <a href="ug.html#_ug_wicket-viewer">Wicket viewer</a> it is displayed as a 'tool tip'.</p>
 </div>
@@ -4217,8 +4278,9 @@ can be used instead, eg:</p>
 <div class="content">
 <pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span> <span class="type">class</span> <span class="class">ToDoItem</span> {
     <span class="annotation">@CollectionLayout</span>(
-        describedAs=<span class="string"><span class="delimiter">&quot;</span><span class="content">Other todo items that must be completed before this one</span><span class="delimiter">&quot;</span></span>)
-    <span class="directive">public</span> <span class="predefined-type">SortedSet</span>&lt;ToDoItem getDependencies() { ... }
+        describedAs=<span class="string"><span class="delimiter">&quot;</span><span class="content">Other todo items that must be completed before this one</span><span class="delimiter">&quot;</span></span>
+    )
+    <span class="directive">public</span> <span class="predefined-type">SortedSet</span>&lt;ToDoItem&gt; getDependencies() { ... }
     ...
 }</code></pre>
 </div>
@@ -4238,7 +4300,7 @@ can be used instead, eg:</p>
 </div>
 </div>
 <div class="sect3">
-<h4 id="_rg_annotations_manpage-CollectionLayout_hidden">2.5.3. <code>hidden()</code></h4>
+<h4 id="_rg_annotations_manpage-CollectionLayout_hidden">2.5.4. <code>hidden()</code></h4>
 <div class="paragraph">
 <p>The <code>hidden()</code> attribute indicates where (in the UI) the collection should be hidden from the user.  This attribute can also be applied to <a href="#_rg_annotations_manpage-ActionLayout_hidden">actions</a> and <a href="#_rg_annotations_manpage-PropertyLayout_hidden">properties</a>.</p>
 </div>
@@ -4316,7 +4378,7 @@ can be used instead, eg:</p>
 </div>
 </div>
 <div class="sect3">
-<h4 id="_rg_annotations_manpage-CollectionLayout_named">2.5.4. <code>named()</code></h4>
+<h4 id="_rg_annotations_manpage-CollectionLayout_named">2.5.5. <code>named()</code></h4>
 <div class="paragraph">
 <p>The <code>named()</code> attribute explicitly specifies the collection&#8217;s name, overriding the name that would normally be inferred from the Java source code.  This attribute can also be specified for <a href="#_rg_annotations_manpage-ActionLayout_named">actions</a>, <a href="#_rg_annotations_manpage-PropertyLayout_named">properties</a>, <a href="#_rg_annotations_manpage-ParameterLayout_named">parameters</a>, <a href="#_rg_annotations_manpage-DomainObjectLayout_named">domain objects</a>, <a href="#_rg_annotations_manpage-ViewModelLayout_named">view models</a> and <a href="#_rg_annotations_manpage-DomainServiceLayout_named">domain services</a>.</p>
 </div>
@@ -4382,7 +4444,7 @@ can be used instead, eg:</p>
 </div>
 </div>
 <div class="sect3">
-<h4 id="_rg_annotations_manpage-CollectionLayout_paged">2.5.5. <code>paged()</code></h4>
+<h4 id="_rg_annotations_manpage-CollectionLayout_paged">2.5.6. <code>paged()</code></h4>
 <div class="paragraph">
 <p>The <code>paged()</code> attribute specifies the number of rows to display in a (parented) collection. This attribute can also be applied to <a href="#_rg_annotations_manpage-DomainObjectLayout_paged">domain objects</a> and <a href="#_rg_annotations_manpage-ViewModelLayout_paged">view models</a>.</p>
 </div>
@@ -4432,7 +4494,7 @@ can be used instead, eg:</p>
 </div>
 </div>
 <div class="sect3">
-<h4 id="_rg_annotations_manpage-CollectionLayout_render">2.5.6. <code>render()</code></h4>
+<h4 id="_rg_annotations_manpage-CollectionLayout_render">2.5.7. <code>render()</code></h4>
 <div class="paragraph">
 <p>The <code>render()</code> attribute specifies that the collection be rendered either "eagerly" (shown open, displaying its contents) or "lazily" (shown closed, hiding its contents). The terminology here is based on the similar concept of lazy loading of collections in the domain/persistence layer boundary (except that the rendering relates to the presentation/domain layer boundary).</p>
 </div>
@@ -4471,13 +4533,16 @@ can be used instead, eg:</p>
 <div class="paragraph">
 <p>Note that <a href="ug.html#_ug_how-tos_contributed-members">contributed collections</a> (which, under the covers are just action invocations against a domain service) are always rendered eagerly.</p>
 </div>
+<div class="paragraph">
+<p>Also, if a <a href="#_rg_annotations_manpage-CollectionLayout_defaultView"><code>@CollectionLayout#defaultView()</code></a> attribute has been specified then that will take precedence over the value of the <code>render()</code> attribute.</p>
+</div>
 </td>
 </tr>
 </table>
 </div>
 </div>
 <div class="sect3">
-<h4 id="_rg_annotations_manpage-CollectionLayout_sortedBy">2.5.7. <code>sortedBy()</code></h4>
+<h4 id="_rg_annotations_manpage-CollectionLayout_sortedBy">2.5.8. <code>sortedBy()</code></h4>
 <div class="paragraph">
 <p>The <code>sortedBy()</code> attribute specifies that the collection be ordered using the specified comparator, rather than the natural ordering of the entity (as would usually be the case).</p>
 </div>
@@ -23831,12 +23896,13 @@ determines which additional configuration files to search for
 <li><a href="#_rg_annotations_manpage-CollectionLayout">2.5. <code>@CollectionLayout</code></a>
 <ul class="sectlevel3">
 <li><a href="#_rg_annotations_manpage-CollectionLayout_cssClass">2.5.1. <code>cssClass()</code></a></li>
-<li><a href="#_rg_annotations_manpage-CollectionLayout_describedAs">2.5.2. <code>describedAs()</code></a></li>
-<li><a href="#_rg_annotations_manpage-CollectionLayout_hidden">2.5.3. <code>hidden()</code></a></li>
-<li><a href="#_rg_annotations_manpage-CollectionLayout_named">2.5.4. <code>named()</code></a></li>
-<li><a href="#_rg_annotations_manpage-CollectionLayout_paged">2.5.5. <code>paged()</code></a></li>
-<li><a href="#_rg_annotations_manpage-CollectionLayout_render">2.5.6. <code>render()</code></a></li>
-<li><a href="#_rg_annotations_manpage-CollectionLayout_sortedBy">2.5.7. <code>sortedBy()</code></a></li>
+<li><a href="#_rg_annotations_manpage-CollectionLayout_defaultView">2.5.2. <code>defaultView()</code></a></li>
+<li><a href="#_rg_annotations_manpage-CollectionLayout_describedAs">2.5.3. <code>describedAs()</code></a></li>
+<li><a href="#_rg_annotations_manpage-CollectionLayout_hidden">2.5.4. <code>hidden()</code></a></li>
+<li><a href="#_rg_annotations_manpage-CollectionLayout_named">2.5.5. <code>named()</code></a></li>
+<li><a href="#_rg_annotations_manpage-CollectionLayout_paged">2.5.6. <code>paged()</code></a></li>
+<li><a href="#_rg_annotations_manpage-CollectionLayout_render">2.5.7. <code>render()</code></a></li>
+<li><a href="#_rg_annotations_manpage-CollectionLayout_sortedBy">2.5.8. <code>sortedBy()</code></a></li>
 </ul>
 </li>
 <li><a href="#_rg_annotations_manpage-Column">2.6. <code>@Column</code> (<code>javax.jdo</code>)</a>