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 2017/11/08 06:30:32 UTC
[03/15] isis-site git commit: updating content (built from
adocs/documentation in isis.git repo)
http://git-wip-us.apache.org/repos/asf/isis-site/blob/a73614c6/content/guides/rgcms/rgcms.html
----------------------------------------------------------------------
diff --git a/content/guides/rgcms/rgcms.html b/content/guides/rgcms/rgcms.html
index da8eebf..c1bf126 100644
--- a/content/guides/rgcms/rgcms.html
+++ b/content/guides/rgcms/rgcms.html
@@ -6204,7 +6204,7 @@ table.CodeRay td.code>pre{padding:0}
</div>
</div>
<div class="sect2">
- <h3 id="_rgcms_classes_layout">3.13. Layout</h3>
+ <h3 id="_rgcms_classes_layout">3.13. (Object) Layout</h3>
<div class="btn-group" style="float: right; font-size: small; padding: 6px; margin-top: -55px; ">
<button type="button" class="btn btn-xs btn-default" onclick="window.location.href="https://github.com/apache/isis/edit/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_layout.adoc""><i class="fa fa-pencil-square-o"></i> Edit</button>
<button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span><span class="sr-only">Toggle Dropdown</span></button>
@@ -6216,7 +6216,7 @@ table.CodeRay td.code>pre{padding:0}
</ul>
</div>
<div class="paragraph">
- <p>The <code>org.apache.isis.applib.layout</code> package defines a number of classes that allow the layout of domain objects (entities and view models) to be customized. These classes fall into two main categories:</p>
+ <p>The <code>org.apache.isis.applib.layout.grid</code> and <code>org.apache.isis.applib.layout.component</code> packages together define a number of classes that allow the layout of domain objects (entities and view models) to be customized. These classes fall into two main categories:</p>
</div>
<div class="ulist">
<ul>
@@ -6231,7 +6231,10 @@ table.CodeRay td.code>pre{padding:0}
<p>The component classes, meanwhile, are broadly equivalent to the "layout" annotations (<a href="../rgant/rgant.html#_rgant-PropertyLayout"><code>@PropertyLayout</code></a>, <a href="../rgant/rgant.html#_rgant-CollectionLayout"><code>@CollectionLayout</code></a>, <a href="../rgant/rgant.html#_rgant-ActionLayout"><code>@ActionLayout</code></a> and <a href="../rgant/rgant.html#_rgant-DomainObjectLayout"><code>@DomainObjectLayout</code></a></p>
</div>
<div class="paragraph">
- <p>All of the classes in this package are JAXB-annotated, meaning that they can be serialized to/from XML (the <code>component</code> classes in the <code><a href="http://isis.apache.org/applib/layout/component" class="bare">http://isis.apache.org/applib/layout/component</a></code> XSD namespace, the bootstrap 3 grid classes in the <code><a href="http://isis.apache.org/applib/layout/grid/bootstrap3" class="bare">http://isis.apache.org/applib/layout/grid/bootstrap3</a></code> XSD namespace). This ability to serialize to/from XML is used by the <a href="../rgsvc/rgsvc.html#_rgsvc_presentation-layer-spi_GridLoaderService"><code>GridLoaderService</code></a>, the default implementation of which reads the grid layout for a domain class from a <code>.layout.xml</code> file on the classpath.</p>
+ <p>All of the classes in this package are JAXB-annotated, meaning that they can be serialized to/from XML (the <code>component</code> classes in the <code><a href="http://isis.apache.org/applib/layout/component" class="bare">http://isis.apache.org/applib/layout/component</a></code> XSD namespace, the bootstrap 3 grid classes in the <code><a href="http://isis.apache.org/applib/layout/grid/bootstrap3" class="bare">http://isis.apache.org/applib/layout/grid/bootstrap3</a></code> XSD namespace). This ability to serialize to/from XML is used by the <a href="../rgsvc/rgsvc.html#_rgsvc_presentation-layer-spi_GridLoaderService"><code>GridLoaderService</code></a>, the default implementation of which reads the grid layout for a domain class from a <code>.layout.xml</code> file on the classpath. It also allows the grid to be exposed through the REST API provided by the <a href="../ugvro/ugvro.html">Restful Objects viewer</a>, as either XML or (as of <code>1.16.0-SNAPSHOT</code>) JSON.
</p>
+ </div>
+ <div class="paragraph">
+ <p>(Also as of <code>1.16.0-SNAPSHOT</code>), the various components (properties, collections, actions and domain object) also allow a link to be associated with each. These links are populated by the framework automatically when exposing the object layout grid through the REST API, pointing back to the standard Restful Objects resources. This design greatly assists in the implementation of generic REST clients.</p>
</div>
<div class="sect3">
<h4 id="__rgcms_classes_layout_component">3.13.1. Component</h4>
@@ -6242,7 +6245,7 @@ table.CodeRay td.code>pre{padding:0}
<ul>
<li> <p><code>FieldSet</code><br></p>
<div class="paragraph">
- <p>A fieldset (previously also called a property group or member group) of a number of the domain object’s properties (along with any associationed actions of those properties).</p>
+ <p>A fieldset (sometimes also called a property group or member group) of a number of the domain object’s properties (along with any associationed actions of those properties).</p>
</div> </li>
<li> <p>layout data classes, which correspond to the similarly named annotations:</p>
<div class="ulist">
@@ -6258,11 +6261,14 @@ table.CodeRay td.code>pre{padding:0}
<div class="paragraph">
<p>In addition, the component package includes <code>Grid</code>, representing the top level container for a custom layout for a domain object. <code>Grid</code> itself is merely an interface, but it also defines the visitor pattern to make it easy for validate and normalize the grid layouts. The <code>GridAbstract</code> convenience superclass provides a partial implementation of this visitor pattern.</p>
</div>
+ <div class="paragraph">
+ <p>The XSD for these classes is available at <a href="http://isis.apache.org/applib/layout/component/component.xsd" class="bare">http://isis.apache.org/applib/layout/component/component.xsd</a>.</p>
+ </div>
</div>
<div class="sect3">
<h4 id="__rgcms_classes_layout_grid-bootstrap3">3.13.2. Bootstrap3 Grid</h4>
<div class="paragraph">
- <p>As noted above, the default bootstrap3 grid classes are modelled closely on <a href="http://getbootstrap.com">Bootstrap 3</a>. Bootstrap’s <a href="http://getbootstrap.com/css/#grid">grid system</a> divides the page width equally into 12 columns, and so each column spans 1 or more of these widths. Thus, a column with a span of 12 is the full width, one with a span of 6 is half the width, one with a span of 4 is a third of the width, and so on.</p>
+ <p>The bootstrap3 grid classes are modelled closely on <a href="http://getbootstrap.com">Bootstrap 3</a>. Bootstrap’s <a href="http://getbootstrap.com/css/#grid">grid system</a> divides the page width equally into 12 columns, and so each column spans 1 or more of these widths. Thus, a column with a span of 12 is the full width, one with a span of 6 is half the width, one with a span of 4 is a third of the width, and so on.</p>
</div>
<div class="paragraph">
<p>When specifying the span of a column, Bootstrap also allows a size to be specified (<code>XS</code>, <code>SM</code>, <code>MD</code>, <code>LG</code>). The size determines the rules for responsive design. Apache Isis defaults to <code>MD</code> but this can be overridden. It is also possible to specify multiple size/spans for a given column.</p>
@@ -6274,7 +6280,7 @@ table.CodeRay td.code>pre{padding:0}
<ul>
<li> <p><code>BS3Grid</code><br></p>
<div class="paragraph">
- <p>Consists of a number of <code>BS3Row</code>s. <br></p>
+ <p>Consists of a number of <code>BS3Row</code>s.</p>
</div>
<div class="paragraph">
<p>This class is the concrete implementation of <code>Grid</code> interface, discussed previously. As such, it extends the <code>Grid.Visitor</code> to iterate over all of the <code>Row</code>s of the grid.</p>
@@ -6285,10 +6291,10 @@ table.CodeRay td.code>pre{padding:0}
</div> </li>
<li> <p><code>BS3Col</code><br></p>
<div class="paragraph">
- <p>A container of almost everything else. A column most commonly contains properties (grouped into <code>FieldSet</code>s, described above) or collections (specified by <code>CollectionLayoutData</code>, also above). However, a <code>Col</code> might instead contain a <code>BS3TabGroup</code> (described below) in order that the object members is arranged into tabs. <br></p>
+ <p>A container of almost everything else. A column most commonly contains properties (grouped into <code>FieldSet</code>s, described above) or collections (specified by <code>CollectionLayoutData</code>, also above). However, a <code>Col</code> might instead contain a <code>BS3TabGroup</code> (described below) in order that the object members is arranged into tabs.</p>
</div>
<div class="paragraph">
- <p>It is also possible for a <code>Col</code> to contain the object’s title/icon (using <code>DomainObjectLayoutData</code>) or indeed arbitrary actions (using <code>`ActionLayoutData</code>).<br></p>
+ <p>It is also possible for a <code>Col</code> to contain the object’s title/icon (using <code>DomainObjectLayoutData</code>) or indeed arbitrary actions (using <code>`ActionLayoutData</code>).</p>
</div>
<div class="paragraph">
<p>Finally, a <code>BS3Col</code> can also contain other <code>BS3Row</code>s, allowing arbitrarily deep hierarchies of containers as required.</p>
@@ -6315,6 +6321,173 @@ table.CodeRay td.code>pre{padding:0}
<div class="paragraph">
<p>All of these classes also allow custom CSS to be specified; these are added to the CSS classes for the corresponding <code><div</code>> in the rendered page. The <a href="../ugvw/ugvw.html#_ugvw_customisation_tweaking-css-classes"><code>application.css</code></a> file can then be used for application-specific CSS, allowing arbitrary fine-tuning of the layout of the page.</p>
</div>
+ <div class="paragraph">
+ <p>The XSD for these classes is available at <a href="http://isis.apache.org/applib/layout/menus/menubars.xsd" class="bare">http://isis.apache.org/applib/layout/menus/menubars.xsd</a>.</p>
+ </div>
+ </div>
+ <div class="sect3">
+ <h4 id="__rgcms_classes_layout_link">3.13.3. Link (<code>1.16.0-SNAPSHOT</code>)</h4>
+ <div class="paragraph">
+ <p>The link classes reside in the <code>org.apache.isis.applib.layout.links</code> package, and consist of just the <code>Link</code> class:</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">Link</span> {
+ <span class="directive">public</span> <span class="predefined-type">String</span> getRel() { ... } <i class="conum" data-value="1"></i><b>(1)</b>
+ <span class="directive">public</span> <span class="predefined-type">String</span> getMethod() { ... } <i class="conum" data-value="2"></i><b>(2)</b>
+ <span class="directive">public</span> <span class="predefined-type">String</span> getHref() { ... } <i class="conum" data-value="3"></i><b>(3)</b>
+ <span class="directive">public</span> <span class="predefined-type">String</span> getType() { ... } <i class="conum" data-value="4"></i><b>(4)</b>
+ ...
+}</code></pre>
+ </div>
+ </div>
+ <div class="colist arabic">
+ <table>
+ <tbody>
+ <tr>
+ <td><i class="conum" data-value="1"></i><b>1</b></td>
+ <td>an "rel" (as defined by section 2.7.1.2 of the RO spec v1.0), identifying the nature of the link.</td>
+ </tr>
+ <tr>
+ <td><i class="conum" data-value="2"></i><b>2</b></td>
+ <td>the HTTP method to access the link. This is always "GET".</td>
+ </tr>
+ <tr>
+ <td><i class="conum" data-value="3"></i><b>3</b></td>
+ <td>The (absolute) URL to access the Restful Objects resource.</td>
+ </tr>
+ <tr>
+ <td><i class="conum" data-value="4"></i><b>4</b></td>
+ <td>The media type (<code>Accept</code> header) that will be returned by the URL.</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="paragraph">
+ <p>The XSD for these classes is available at <a href="http://isis.apache.org/applib/layout/links/links.xsd" class="bare">http://isis.apache.org/applib/layout/links/links.xsd</a>.</p>
+ </div>
+ </div>
+ </div>
+ <div class="sect2">
+ <h3 id="_rgcms_classes_menubars">3.14. MenuBars Layout (<code>1.16.0-SNAPSHOT</code>)</h3>
+ <div class="btn-group" style="float: right; font-size: small; padding: 6px; margin-top: -55px; ">
+ <button type="button" class="btn btn-xs btn-default" onclick="window.location.href="https://github.com/apache/isis/edit/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc""><i class="fa fa-pencil-square-o"></i> Edit</button>
+ <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span><span class="sr-only">Toggle Dropdown</span></button>
+ <ul class="dropdown-menu">
+ <li><a href="https://github.com/apache/isis/edit/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc" target="_blank"><i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i> Edit</a></li>
+ <li><a href="https://github.com/apache/isis/commits/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc" target="_blank"><i class="fa fa-clock-o fa-fw" aria-hidden="true"></i> History</a></li>
+ <li><a href="https://github.com/apache/isis/raw/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc" target="_blank"><i class="fa fa-file-text-o fa-fw" aria-hidden="true"></i> Raw</a></li>
+ <li><a href="https://github.com/apache/isis/blame/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc" target="_blank"><i class="fa fa-hand-o-right fa-fw" aria-hidden="true"></i> Blame</a></li>
+ </ul>
+ </div>
+ <div class="paragraph">
+ <p>The <code>org.apache.isis.applib.layout.menus</code> package defines a number of classes that allow the layout of domain service actions to be organised across menu bars, menus and menu sections.</p>
+ </div>
+ <div class="paragraph">
+ <p>These classes fall into two main categories:</p>
+ </div>
+ <div class="ulist">
+ <ul>
+ <li> <p>menu classes, that define a hierarchical structure of menu bars, menus and menu sections, and;</p>
+ <div class="paragraph">
+ <p>Unlike the <a href="#_rgcms_classes_layout">object layout</a> classes, the menu classes have no dependency on any particular layout architecture (that is, they don’t attempt to model some particular grid system such as bootstrap3).</p>
+ </div> </li>
+ <li> <p>a component class <code>(ServiceActionLayoutData</code>) that captures the layout metadata for a domain services action. These are grouped into menu sections.</p>
+ <div class="paragraph">
+ <p>The component class is broadly equivalent to the "layout" annotations for actions, ie <a href="../rgant/rgant.html#_rgant-ActionLayout"><code>@ActionLayout</code></a>.</p>
+ </div> </li>
+ </ul>
+ </div>
+ <div class="paragraph">
+ <p>The menu classes and the component class should be reusable across all any and all UI implementations, so this is a less abstract (though equally general) design as compared to the <a href="#_rgcms_classes_layout">object layout</a> design.</p>
+ </div>
+ <div class="paragraph">
+ <p>All of the classes in this package are JAXB-annotated, meaning that they can be serialized to/from XML (in the <code><a href="http://isis.apache.org/applib/layout/menus" class="bare">http://isis.apache.org/applib/layout/menus</a></code> XSD namespace). This ability to serialize to/from XML is used by the <a href="../rgsvc/rgsvc.html#_rgsvc_presentation-layer-spi_MenuBarsLoaderService"><code>MenuBarsLoaderService</code></a>, the default implementation of which reads the grid layout for a domain class from a <code>.layout.xml</code> file on the classpath. It also allows the menu bars to be exposed through the REST API provided by the <a href="../ugvro/ugvro.html">Restful Objects viewer</a>, as either XML or JSON.</p>
+ </div>
+ <div class="paragraph">
+ <p>The service action component also allow a link to be associated with it. Each such link is populated by the framework automatically when exposing the menu bars layout through the REST API, pointing back to the standard Restful Objects resources. This design greatly assists in the implementation of generic REST clients.</p>
+ </div>
+ <div class="sect3">
+ <h4 id="_rgcms_classes_menubars">3.14.1. Menus</h4>
+ <div class="btn-group" style="float: right; font-size: small; padding: 6px; margin-top: -55px; ">
+ <button type="button" class="btn btn-xs btn-default" onclick="window.location.href="https://github.com/apache/isis/edit/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc""><i class="fa fa-pencil-square-o"></i> Edit</button>
+ <button type="button" class="btn btn-xs btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span><span class="sr-only">Toggle Dropdown</span></button>
+ <ul class="dropdown-menu">
+ <li><a href="https://github.com/apache/isis/edit/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc" target="_blank"><i class="fa fa-pencil-square-o fa-fw" aria-hidden="true"></i> Edit</a></li>
+ <li><a href="https://github.com/apache/isis/commits/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc" target="_blank"><i class="fa fa-clock-o fa-fw" aria-hidden="true"></i> History</a></li>
+ <li><a href="https://github.com/apache/isis/raw/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc" target="_blank"><i class="fa fa-file-text-o fa-fw" aria-hidden="true"></i> Raw</a></li>
+ <li><a href="https://github.com/apache/isis/blame/master/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_menubars.adoc" target="_blank"><i class="fa fa-hand-o-right fa-fw" aria-hidden="true"></i> Blame</a></li>
+ </ul>
+ </div>
+ <div class="paragraph">
+ <p>Both the menu and component classes reside in the <code>org.apache.isis.applib.layout.menus</code> package, consisting of:</p>
+ </div>
+ <div class="ulist">
+ <ul>
+ <li> <p><code>MenuBars</code></p>
+ <div class="paragraph">
+ <p>The top-level structure that define three fields: a primary <code>MenuBar</code>, secondary <code>MenuBar</code> and tertiary <code>MenuBar</code>. The <a href="../ugvw/ugvw.html">Wicket viewer</a> places the primary bar to the left, the secondary bar aligned right, and the tertiary bar (expected to consist of just one <code>Menu</code>) under the user names.</p>
+ </div> </li>
+ <li> <p><code>MenuBar</code></p>
+ <div class="paragraph">
+ <p>consisting of one or many <code>Menu</code>s.</p>
+ </div> </li>
+ <li> <p><code>Menu</code></p>
+ <div class="paragraph">
+ <p>consisting of one or many <code>MenuSection</code>s. The <a href="../ugvw/ugvw.html">Wicket viewer</a> renders a separator between each section.</p>
+ </div> </li>
+ <li> <p><code>MenuSection</code></p>
+ <div class="paragraph">
+ <p>consisting of one or many actions (<code>ServiceActionLayoutData</code>s)</p>
+ </div> </li>
+ <li> <p><code>ServiceActionLayoutData</code> class, which correspond to the <a href="../rgant/rgant.html#_rgant-ActionLayout"><code>@ActionLayout</code></a> annotation.</p>
+ <div class="paragraph">
+ <p>This is similar to <code>ActionLayoutData</code> (of the <a href="#_rgcms_classes_layout">object layout</a> classes), however it also identifies the domain service to which it belongs. (This isn’t required for the object layouts because that is implicit).</p>
+ </div> </li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect3">
+ <h4 id="__rgcms_classes_layout_link">3.14.2. Link</h4>
+ <div class="paragraph">
+ <p>The link classes reside in the <code>org.apache.isis.applib.layout.links</code> package, and consist of just the <code>Link</code> class:</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">Link</span> {
+ <span class="directive">public</span> <span class="predefined-type">String</span> getRel() { ... } <i class="conum" data-value="1"></i><b>(1)</b>
+ <span class="directive">public</span> <span class="predefined-type">String</span> getMethod() { ... } <i class="conum" data-value="2"></i><b>(2)</b>
+ <span class="directive">public</span> <span class="predefined-type">String</span> getHref() { ... } <i class="conum" data-value="3"></i><b>(3)</b>
+ <span class="directive">public</span> <span class="predefined-type">String</span> getType() { ... } <i class="conum" data-value="4"></i><b>(4)</b>
+ ...
+}</code></pre>
+ </div>
+ </div>
+ <div class="colist arabic">
+ <table>
+ <tbody>
+ <tr>
+ <td><i class="conum" data-value="1"></i><b>1</b></td>
+ <td>an "rel" (as defined by section 2.7.1.2 of the RO spec v1.0), identifying the nature of the link.</td>
+ </tr>
+ <tr>
+ <td><i class="conum" data-value="2"></i><b>2</b></td>
+ <td>the HTTP method to access the link. This is always "GET".</td>
+ </tr>
+ <tr>
+ <td><i class="conum" data-value="3"></i><b>3</b></td>
+ <td>The (absolute) URL to access the Restful Objects resource.</td>
+ </tr>
+ <tr>
+ <td><i class="conum" data-value="4"></i><b>4</b></td>
+ <td>The media type (<code>Accept</code> header) that will be returned by the URL.</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <div class="paragraph">
+ <p>The XSD for these classes is available at <a href="http://isis.apache.org/applib/layout/links/links.xsd" class="bare">http://isis.apache.org/applib/layout/links/links.xsd</a>.</p>
+ </div>
</div>
</div>
</div>