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 2016/03/08 00:17:35 UTC

[7/9] isis git commit: ISIS-993: more documentation, some minor fixes...

ISIS-993: more documentation, some minor fixes...

fixes:
- if first property in a fieldset is invalid (was losing the actions associated with the fieldset).
- schema location in downloaded XML was missing the bootstrap3 grid.


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

Branch: refs/heads/master
Commit: 41a534db984440b3a163a1285e9f397271ecdf8c
Parents: 9194e13
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Mon Mar 7 22:32:32 2016 +0000
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Mon Mar 7 22:32:32 2016 +0000

----------------------------------------------------------------------
 .../asciidoc/guides/_rgcms_classes_layout.adoc  |   8 +-
 .../guides/_ugfun_object-layout_dynamic.adoc    |  27 ++
 .../_ugfun_object-layout_dynamic_xml.adoc       | 264 +++++++++++++++++--
 .../guides/_ugfun_object-layout_static.adoc     |   7 +-
 .../src/main/asciidoc/guides/_ugvw_layout.adoc  |  85 +-----
 .../ToDoItem.png                                | Bin 0 -> 91690 bytes
 .../src/main/asciidoc/screencasts.adoc          |   7 +-
 .../services/grid/GridServiceDefault.java       |  26 +-
 .../grid/GridSystemServiceAbstract.java         |  19 +-
 .../grid/bootstrap3/GridSystemServiceBS3.java   |   2 +-
 10 files changed, 312 insertions(+), 133 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_layout.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_layout.adoc b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_layout.adoc
index 181ad1c..4fe51fe 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_layout.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_rgcms_classes_layout.adoc
@@ -8,12 +8,14 @@
 The `org.apache.isis.applib.layout` 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:
 
- * component classes, that capture the layout metadata for an object's properties, collections and actions.  These are broadly equivalent to the "layout" annotations (xref:rgant.adoc#_rgant_PropertyLayout[`@PropertyLayout`], xref:rgant.adoc#_rgant_CollectionLayout[`@CollectionLayout`], xref:rgant.adoc#_rgant_ActionLayout[`@ActionLayout`] and xref:rgant.adoc#_rgant_DomainObjectLayout[`@DomainObjectLayout`]
+* grid classes, that define a grid structure of rows, columns, tab groups and tabs, and;
 
- * grid classes, that define a grid structure of rows, columns, tab groups and tabs, into which the components can be associated.
+* common component classes, that capture the layout metadata for an object's properties, collections and actions.  These are bound (or associated) to the regions of the grid
 
 The framework provides an implementation of the grid classes modelled closely on link:http://getbootstrap.com[Bootstrap 3], along with xref:ugvw.adoc[Wicket viewer] components capable of rendering that grid system.  In principle it is
-also possible to extend the layout architecture for other grid systems.  The components are intended to be reusable across all grid systems.
+also possible to extend the layout architecture for other grid systems.  The component classes, though, are intended to be reusable across all grid systems.
+
+The component classes, meanwhile, are broadly equivalent to the "layout" annotations (xref:rgant.adoc#_rgant_PropertyLayout[`@PropertyLayout`], xref:rgant.adoc#_rgant_CollectionLayout[`@CollectionLayout`], xref:rgant.adoc#_rgant_ActionLayout[`@ActionLayout`] and xref:rgant.adoc#_rgant_DomainObjectLayout[`@DomainObjectLayout`]
 
 All of the classes in this package are JAXB-annotated, meaning that they can be serialized to/from XML (the `component` classes in the `http://isis.apache.org/applib/layout/component` XSD namespace, the bootstrap 3 grid classes in the `http://isis.apache.org/applib/layout/grid/bootstrap3` XSD namespace).  This ability to serialize to/from XML is used by the xref:rgsvc.adoc#_rgsvc_spi_GridLoaderService[`GridLoaderService`], the default implementation of which reads the grid layout for a domain class from a `.layout.xml` file on the classpath.
 

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic.adoc
index e2379c8..205abc7 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic.adoc
@@ -122,3 +122,30 @@ The fastest way to get started is to use the (non-ASF) link:http://github.com/is
 
 
 
+== Required updates to the dom project's pom.xml
+
+Any `.layout.json` files must be compiled and available in the classpath.  Ensure the following is defined in the dom project's `pom.xml`:
+
+[source.xml]
+----
+<resources>
+    <resource>
+        <filtering>false</filtering>
+        <directory>src/main/resources</directory>
+    </resource>
+    <resource>
+        <filtering>false</filtering>
+        <directory>src/main/java</directory>
+        <includes>
+            <include>**</include>
+        </includes>
+        <excludes>
+            <exclude>**/*.java</exclude>
+        </excludes>
+    </resource>
+</resources>
+----
+
+If using an Apache Isis xref:ugfun.adoc#_ugfun_getting-started_simpleapp-archetype[SimpleApp archetype], then the POM is already correctly configured.
+
+

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic_xml.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic_xml.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic_xml.adoc
index 911e9b2..86816b7 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic_xml.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_dynamic_xml.adoc
@@ -8,65 +8,291 @@
 
 Metadata providing UI hints can be specified either xref:ugfun.adoc#_ugfun_object-layout_static[statically], using annotations, or dynamically using an `Xxx.layout.xml` file (where `Xxx` is the entity or view model object to be rendered).
 
-A corresponding XSD schema for the XML file makes it easy to author such layout files.  It is also possible to download an initial `.layout.xml` - capturing any existing layout metadata using the xref:rgsvc.adoc#_rgsvc_api_MetamodelService[`MetamodelService`] (exposed on the prototyping menu).
+The `Xxx.layout.xml` file is just the serialized form of a xref:rgcms.adoc#_rgcms_classes_layout[`Grid`] layout class defined within Apache Isis' applib.  These are JAXB-annotated classes with corresponding XSD schemas; the upshot of that
+is that IDEs such as IntelliJ and Eclipse can provide "intellisense", making iteasy to author such layout files.
+
+It is also possible to download an initial `.layout.xml` - capturing any existing layout metadata - using the xref:rgsvc.adoc#_rgsvc_api_LayoutService[`LayoutService`] (exposed on the prototyping menu) or using a xref:rgcms.adoc#_rgcms_classes_mixins_Object[mixin action] contributed to every domain object.
 
 [NOTE]
 ====
-It is also possible to describe dynamic layouts using a `.layout.json` file, as discussed xref:ugfun.adoc#_ugfun_object-layout_dynamic[here].  As of `1.12.0-SNAPSHOT` the `.layout.json` file should be considered as deprecated: the ``.layout.xml`` file also allows enables much more sophisticated custom layouts than those afforded by ``.layout.json``, and the layout files are easier to write due to the presence of an XSD schema file which ensures that the file is syntactically correct.
+It is also possible to describe dynamic layouts using a `.layout.json` file, as discussed xref:ugfun.adoc#_ugfun_object-layout_dynamic[here].  As of `1.12.0-SNAPSHOT` the `.layout.json` file should be considered as deprecated: the ``.layout.xml`` file also allows enables much more sophisticated custom layouts than those afforded by ``.layout.json``.
 ====
 
 == Grids vs Components
 
 The XML file distinguishes between two types of element:
 
-* those that define a grid structure, of: rows, columns, tabgroups and tabs. +
+* those that define a grid structure, of: rows, columns, tab groups and tabs. +
 +
-The rows and columns are closely modelled on link:getbootstrap.com[bootstrap 3] (used in the implementation of the xref:ugvw.adoc[Wicket viewer]).
+The rows and columns are closely modelled on link:getbootstrap.com[Bootstrap 3] (used in the implementation of the xref:ugvw.adoc[Wicket viewer]).
 
 * those that defines common components, of: fieldsets (previously called member groups or property groups), properties, collections, actions and also the title/icon of the domain object itself.
 
-These two different element types have their own XSD namespaces, the rationale being that in the future there may be alternative
-grid structures defined that use the same common components, eg link:http://foundation.zurb.com/[Zurb Foundation], or perhaps
-a set of proprietary and more opinionated grids, eg 3 column or master/detail.  For the moment however the Bootstrap3
-grid provides a great deal of flexibility while being one of the most commonly used grid frameworks.  
+More information about these classes can be found in xref:rgcms.adoc#_rgcms_classes_layout[the reference guide].  More information on Bootstrap 3's grid system can be found link:http://getbootstrap.com/css/#grid[here].
+
+
+== Screencast
+
+The following screencast describes the feature:
+
+video::MxewC5Pve5k[youtube,width="800px",height="534px"]
+
 
-[TIP]
-====
-More information on Bootstrap 3's grid system can be found link:http://getbootstrap.com/css/#grid[here].
-====
 
 == Examples
 
-Probably the easiest way to understand dynamic XML layouts is to see some examples.
+Probably the easiest way to understand dynamic XML layouts is by example.  For this we'll use the `ToDoItem` from the
+(non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp]:
 
+image::{_imagesdir}ugfun/_ugfun_object-layout_dynamic_xml/ToDoItem.png[width="940px",link="{_imagesdir}ugfun/_ugfun_object-layout_dynamic_xml/ToDoItem.png"]
 
-== Syntax
 
 === Namespaces
 
-=== Unreferenced
+First things first; every `.layout.xml` file must properly declare the XSD namespaces and schemas.  There are two: one for the grid classes, and one for the common component classes:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<bs3:grid
+  xsi:schemaLocation="http://isis.apache.org/applib/layout/component
+                      http://isis.apache.org/applib/layout/component/component.xsd
+                      http://isis.apache.org/applib/layout/grid/bootstrap3
+                      http://isis.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd"
+  xmlns:bs3="http://isis.apache.org/applib/layout/grid/bootstrap3"
+  xmlns:c="http://isis.apache.org/applib/layout/component"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    ...
+</bs3:grid>
+----
+
+Most IDEs will automatically download the XSD schemas from the specified schema locations, thereby providing
+"intellisense" help as you edit the file.
+
+
+=== Rows, full-width cols, and tabs
+
+The example layout consists of three rows: a row for the object/icon, a row containing a properties, and a row containing collections.   In all three cases the row contains a single column spanning the full width of the page.  For the property and collection rows, the column contains a tab group.
+
+This corresponds to the following XML:
+
+[source,xml]
+----
+    <bs3:row>
+        <bs3:col span="12" unreferencedActions="true">
+            <c:domainObject bookmarking="AS_ROOT"/>
+        </bs3:col>
+    </bs3:row>
+    <bs3:row>
+        <bs3:col span="12">
+            <bs3:tabGroup>
+                <bs3:tab name="Properties">...</bs3:tab>
+                <bs3:tab name="Other">...</bs3:tab>
+                <bs3:tab name="Metadata">...</bs3:tab>
+            </bs3:tabGroup>
+        </bs3:col>
+    </bs3:row>
+    <bs3:row>
+        <bs3:col span="12">
+            <bs3:tabGroup unreferencedCollections="true">
+                <bs3:tab name="Similar to">...</bs3:tab>
+                <bs3:tab name="Dependencies">...</bs3:tab>
+            </bs3:tabGroup>
+        </bs3:col>
+    </bs3:row>
+----
+
+
+You will notice that one of the ``col``umns has an ``unreferencedActions`` attribute, while one of the ``tabGroup``s has a similar ``unreferencedCollections`` attribute.  This topic is discussed in more detail xref:rgcms.adoc#_ugfun_object-layout_dynamic_xml-unreferenced[below].
+
+
+
+=== Fieldsets
+
+The first tab containing properties is divided into two columns, each of which holds a single fieldset of multiple properties.  Those properties in turn can have associated actions.
+
+This corresponds to the following XML:
+
+[source,xml]
+----
+            <bs3:tab name="Properties">
+                <bs3:row>
+                    <bs3:col span="6">
+                        <c:fieldSet name="General" id="general" unreferencedProperties="true">
+                            <c:action id="duplicate" position="PANEL_DROPDOWN"/>
+                            <c:action id="delete"/>
+                            <c:property id="description"/>
+                            <c:property id="category"/>
+                            <c:property id="subcategory">
+                                <c:action id="updateCategory"/>
+                                <c:action id="analyseCategory" position="RIGHT"/>
+                            </c:property>
+                            <c:property id="complete">
+                                <c:action id="completed" cssClassFa="fa-thumbs-up"/>
+                                <c:action id="notYetCompleted" cssClassFa="fa-thumbs-down"/>
+                            </c:property>
+                        </c:fieldSet>
+                    </bs3:col>
+                    <bs3:col span="6">
+                        ...
+                    </bs3:col>
+                </bs3:row>
+            </bs3:tab>
+----
+
+The tab defines two columns, each span of 6 (meaning half the width of the page).
+
+In the first column there is a single fieldset.  Notice how actions - such as `duplicate` and `delete` - can be associated with this fieldset directly, meaning that they should be rendered on the fieldset's top panel.
+
+Thereafter the fieldset lists the properties in order.  Actions can be associated with properties too; here they are rendered underneath or to the right of the field.
+
+Note also the `unreferencedProperties` attribute for the fieldset; this topic is discussed in more detail xref:rgcms.adoc#_ugfun_object-layout_dynamic_xml-unreferenced[below].
+
+
+=== Collections
+
+In the final row the collections are placed in tabs, simply one collection per tab.  This corresponds to the following XML:
+
+[source,xml]
+----
+                <bs3:tab name="Similar to">
+                    <bs3:row>
+                        <bs3:col span="12">
+                            <c:collection defaultView="table" id="similarTo"/>
+                        </bs3:col>
+                    </bs3:row>
+                </bs3:tab>
+                <bs3:tab name="Dependencies">
+                    <bs3:row>
+                        <bs3:col span="12">
+                            <c:collection defaultView="table" id="dependencies">
+                                <c:action id="add"/>
+                                <c:action id="remove"/>
+                            </c:collection>
+                        </bs3:col>
+                    </bs3:row>
+                </bs3:tab>
+----
+
+As with properties, actions can be associated with collections; this indicates that they should be rendered in the collection's header.
+
+
+
+[[_ugfun_object-layout_dynamic_xml-unreferenced]]
+== Unreferenced Members
+
+As noted in the preceding discussion, several of the grid's regions have either an ``unreferencedActions``, ``unreferencedCollections`` or ``unreferencedProperties`` attribute.
+
+The rules are:
+
+* `unreferencedActions` attribute can be specified either on a column or on a fieldset.  +
++
+It would normally be typical to use the column holding the `<domainObject/>` icon/title, that is as shown in the example.  The unreferenced actions then appear as top-level actions for the domain object.
+
+* `unreferencedCollections` attribute can be specified either on a column or on a tabgroup. +
++
+If specified on a column, then that column will contain each of the unreferenced collections, stacked one on top of the other.  If specified on a tab group, then a separate tab will be created for each collection, with that tab containing only that single collection.
+
+* `unreferencedProperties` attribute can be specified only on a fieldset.
+
+The purpose of these attributes is to indicate where in the layout any unreferenced members should be rendered.  Every grid _must_ nominate one region for each of these three member types, the reason being that to ensure that the layout can be used even if it is incomplete with respect to the object members inferred from the Java source code.  This might be because the developer forgot to update the layout, or it might be because of a new mixin (property, collection or action) contributed to many objects.
+
+
+The framework ensures that in any given grid exactly one region is specified for each of the three `unreferenced...` attributes.  If the grid fails this validation, then a warning message will be displayed, and the invalid XML logged.  The layout XML will then be ignored.
+
 
 
 == Migrating from earlier versions
 
+As noted earlier on, it is possible to download layout XML files using the xref:rgsvc.adoc#_rgsvc_api_LayoutService[`LayoutService`] (exposed on the prototyping menu); this will download a ZIP file of layout XML files for all domain entities and view models.  Alternatively the layout XML for a single domain object can be downloaded using the xref:rgcms.adoc#_rgcms_classes_mixins_Object[mixin action] (contributed to every domain object).
 
-There are three levels:
+There are four "styles":
 
+* current
 * complete
 * normalized
 * minimal
 
 
+Ignorig the "current" style (which merely downloads the currently cached layout), the other three styles allow the
+developer to choose how much metadata is to be specified in the XML, and how much (if any) will be obtained
+elsewhere, either from annotations in the metamodel or from an earlier `.layout.json` file if present.  The table
+below summarises the choices:
+
+.Table caption
+[cols="<.>,^.>,^.>,^.>", options="header"]
+|===
+
+| Style
+|xref:rgant.adoc#_rgant_MemberGroupLayout[`@MemberGroupLayout`]
+| xref:rgant.adoc#_rgant_MemberOrder[`@MemberOrder`]
+| xref:rgant.adoc#_rgant_ActionLayout[`@ActionLayout`], xref:rgant.adoc#_rgant_PropertyLayout[`@PropertyLayout`], xref:rgant.adoc#_rgant_CollectionLayout[`@CollectionLayout`]
+
+
+|`COMPLETE`
+|serialized as XML
+|serialized as XML
+|serialized as XML
+
+
+|`NORMALIZED`
+|serialized as XML
+|serialized as XML
+|not in the XML
+
+
+|`MINIMAL`
+|serialized as XML
+|not in the XML
+|not in the XML
+
+|===
+
+As a developer, you therefore have a choice as to how you provide the metadata required for customised layouts:
+
+* if you want all layout metadata to be read from the `.layout.xml` file, then download the "complete" version, and copy the file alongside the domain class.  You can then remove all `@MemberGroupLayout`, `@MemberOrder`, `@ActionLayout`, `@PropertyLayout` and `@CollectionLayout` annotations from the source code of the domain class.
+
+* if you want to use layout XML file to describe the grid (columns, tabs etc) and specify which object members are associated with those regions of the grid, then download the "normalized" version.  You can then remove the `@MemberGroupLayout` and `@MemberOrder` annotations from the source code of the domain class, but retain the `@ActionLayout`, `@PropertyLayout` and `@CollectionLayout` annotations.
+
+* if you want to use layout XML file ONLY to describe the grid, then download the "minimal" version.  The grid regions will be empty in this version, and the framework will use the `@MemberOrder` annotation to bind object members to those regions.  The only annotation that can be safely removed from the source code with this style is the `@MemberGroupLayout` annotation.
+
+
 Download either for a single domain object, or download all domain objects (entities and view models).
 
 
 == Domain Services
 
-GridService and GridNormalizerService.
+For more information about layouts, see:
+
+* xref:rgsvc.adoc#_rgsvc_api_LayoutService[`LayoutService`] (whose functionality is exposed on the prototyping menu as an action) and lso the a xref:rgcms .adoc#_rgcms_classes_mixins_Object[mixin action]
+
+* xref:rgsvc.adoc#_rgsvc_spi_GridService[`GridService`] and its supporting services, xref:rgsvc.adoc#_rgsvc_spi_GridLoaderService[`GridLoaderService`] and xref:rgsvc.adoc#_rgsvc_spi_GridSystemService[`GridSystemService`]
+
+* xref:rgcms.adoc#_rgcms_classes_layout[grid layout classes], defined in the Apache Isis applib
 
-LayoutService
 
-LayoutServiceMenu
+== Required updates to the dom project's pom.xml
 
+Any `.layout.xml` files must be compiled and available in the classpath.  Ensure the following is defined in the dom project's `pom.xml`:
 
+[source.xml]
+----
+<resources>
+    <resource>
+        <filtering>false</filtering>
+        <directory>src/main/resources</directory>
+    </resource>
+    <resource>
+        <filtering>false</filtering>
+        <directory>src/main/java</directory>
+        <includes>
+            <include>**</include>
+        </includes>
+        <excludes>
+            <exclude>**/*.java</exclude>
+        </excludes>
+    </resource>
+</resources>
+----
 
+If using an Apache Isis xref:ugfun.adoc#_ugfun_getting-started_simpleapp-archetype[SimpleApp archetype], then the POM is already correctly configured.

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_static.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_static.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_static.adoc
index 79b3b4d..00057d7 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_static.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugfun_object-layout_static.adoc
@@ -5,10 +5,15 @@
 :_imagesdir: images/
 
 
-Metadata providing UI hints can be specified either statically, using annotations, or dynamically, using either a `layout.xml` file (`1.12.0-SNAPSHOT`) or a `.layout.json` file.
+Metadata providing UI hints can be specified either statically, using annotations, or dynamically, using either a xref:ugfun.adoc#_ugfun_object-layout_dynamic_xml[`layout.xml`] file (`1.12.0-SNAPSHOT`) or a xref:ugfun.adoc#_ugfun_object-layout_dynamic[`.layout.json`] file.
 
 This section describes the static approach, using annotations.
 
+[NOTE]
+====
+Tabs and tabgroups are only supported using xref:ugfun.adoc#_ugfun_object-layout_dynamic_xml[`layout.xml`] files (`1.12.0-SNAPSHOT`); they are not supported by annotations.
+====
+
 
 
 == `@MemberOrder`

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/adocs/documentation/src/main/asciidoc/guides/_ugvw_layout.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/_ugvw_layout.adoc b/adocs/documentation/src/main/asciidoc/guides/_ugvw_layout.adoc
index bc2a1ea..07ee5ad 100644
--- a/adocs/documentation/src/main/asciidoc/guides/_ugvw_layout.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/_ugvw_layout.adoc
@@ -8,90 +8,15 @@
 
 The wicket viewer has full support for the various methods of specifying the xref:ugfun.adoc#_ugfun_object-layout[layout of objects], either statically or dynamically.
 
-Dynamic reloading is automatically supported when running in xref:rgcfg.adoc#_rgcfg_deployment-types[prototype (development) mode], the Wicket viewer automatically rebuilds the metamodel for each class as it is rendered.    Conversely, do note that the Wicket viewer will *not* pick up new metadata if running in production/server mode.
+For more information, see:
 
+* the xref:ugfun.adoc#_ugfun_object-layout[user guide fundamentals] (layout chapter);
 
-[TIP]
-====
-To pick up a change, edit the `.layout.json` file in the IDE and rebuild.  Then click on the title of the object _*twice*_.
+* xref:rgsvc.adoc#_rgsvc_api_LayoutService[`LayoutService`] (whose functionality is exposed on the prototyping menu as an action) and lso the a xref:rgcms .adoc#_rgcms_classes_mixins_Object[mixin action]
 
-The first click will cause Apache Isis to pick up the new metadata, but too late in the process to adjust the rendering.  The second click will re-render the object with the new metadata.
-====
+* xref:rgsvc.adoc#_rgsvc_spi_GridService[`GridService`] and its supporting services, xref:rgsvc.adoc#_rgsvc_spi_GridLoaderService[`GridLoaderService`] and xref:rgsvc.adoc#_rgsvc_spi_GridSystemService[`GridSystemService`]
 
+* xref:rgcms.adoc#_rgcms_classes_layout[grid layout classes], defined in the Apache Isis applib
 
-The screenshots below show some of the effects that can be accomplished, for the open source link:https://github.com/estatio/estatio[Estatio] app.
-
-
-
-First, an `Invoice`.  This places the properties in three equal-sized columns, with collections underneath:
-
-image::{_imagesdir}wicket-viewer/layouts/estatio-Invoice.png[width="800px",link="{_imagesdir}wicket-viewer/layouts/estatio-Invoice.png"]
-
-
-
-Next, `Lease`.  This places its properties in two columns (one wide, one narrow), with its collections shown in the right-most column:
-
-image::{_imagesdir}wicket-viewer/layouts/estatio-Lease.png[width="800px",link="{_imagesdir}wicket-viewer/layouts/estatio-Lease.png"]
-
-
-
-Next, `LeaseItem`.  This is similar to `Lease`, with two columns for properties and the third column for collections:
-
-image::{_imagesdir}wicket-viewer/layouts/estatio-LeaseItem.png[width="800px",link="{_imagesdir}wicket-viewer/layouts/estatio-LeaseItem.png"]
-
-
-
-And finally, from the (non-ASF) http://github.com/isisaddons/isis-app-todoapp[Isis addons' todoapp], its `ToDoItem`.  This puts its properties in two columns; the collections (not visible in the screenshot below) are underneath (like Estatio's `Invoice`):
-
-image::{_imagesdir}wicket-viewer/layouts/todoapp-ToDoItem.png[width="800px",link="{_imagesdir}wicket-viewer/layouts/todoapp-ToDoItem.png"]
-
-
-To learn more about how to configure these types of layout, see the xref:ugfun.adoc#_ugfun_object-layout[object layout] chapter.
-
-
-
-== Screencast
-
-How to layout properties and collections dynamically, in the Wicket viewer.
-
-video::zmrg49WeEPc[youtube,width="530px",height="354px"]
-
-
-
-[NOTE]
-====
-Note that this screencast shows an earlier version of the xref:ugvw.adoc#[Wicket viewer] UI (specifically, pre 1.8.0).
-====
-
-
-
-
-== Required updates to the dom project's pom.xml
-
-If using the `.layout.json` files, these must be compiled and available in the classpath. When using an IDE such as Eclipse+M2E, any `.layout.json` files in `src/main/java` or `src/main/resources` will be part of the classpath automatically. However, unless the `pom.xml` is changed, these will not be part of the compiled WAR.
-
-Therefore, make sure the following is added to the dom project's `pom.xml`:
-
-[source.xml]
-----
-<resources>
-    <resource>
-        <filtering>false</filtering>
-        <directory>src/main/resources</directory>
-    </resource>
-    <resource>
-        <filtering>false</filtering>
-        <directory>src/main/java</directory>
-        <includes>
-            <include>**</include>
-        </includes>
-        <excludes>
-            <exclude>**/*.java</exclude>
-        </excludes>
-    </resource>
-</resources>
-----
-
-If using an Apache Isis xref:ugfun.adoc#_ugfun_getting-started_simpleapp-archetype[SimpleApp archetype], then the POM is already correctly configured.
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/adocs/documentation/src/main/asciidoc/guides/images/ugfun/_ugfun_object-layout_dynamic_xml/ToDoItem.png
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/images/ugfun/_ugfun_object-layout_dynamic_xml/ToDoItem.png b/adocs/documentation/src/main/asciidoc/guides/images/ugfun/_ugfun_object-layout_dynamic_xml/ToDoItem.png
new file mode 100644
index 0000000..c47d52f
Binary files /dev/null and b/adocs/documentation/src/main/asciidoc/guides/images/ugfun/_ugfun_object-layout_dynamic_xml/ToDoItem.png differ

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/adocs/documentation/src/main/asciidoc/screencasts.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/screencasts.adoc b/adocs/documentation/src/main/asciidoc/screencasts.adoc
index a90eb66..3c27b6a 100644
--- a/adocs/documentation/src/main/asciidoc/screencasts.adoc
+++ b/adocs/documentation/src/main/asciidoc/screencasts.adoc
@@ -128,13 +128,13 @@ _Using the (non-ASF) http://github.com/isisaddons/isis-module-excel[Isis addons'
 |===
 
 
-|Dynamic layouts in the Wicket viewer +
+|Dynamic (XML) layouts in the Wicket viewer (v1.12.0) +
 
 _How to layout properties and collections dynamically_ +
 
-Learn more link:./user-guide/rg.html#_rg-object-layout[here]
+Learn more link:./guides/ugfun.html#_ugfun_object-layout_dynamic_xml[here]
 
-|video::zmrg49WeEPc[youtube,width="420px",height="236px"]
+|video::MxewC5Pve5k[youtube,width="420px",height="236px"]
 
 
   
@@ -147,7 +147,6 @@ _How to customize the Wicket viewer, integrating the (non-ASF) http://github.com
 
 
 
-
 |===
 
 

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridServiceDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridServiceDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridServiceDefault.java
index 9c116f7..087f5e4 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridServiceDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridServiceDefault.java
@@ -21,7 +21,6 @@ import java.util.List;
 import javax.annotation.Nullable;
 import javax.inject.Inject;
 
-import com.google.common.base.Function;
 import com.google.common.base.Joiner;
 import com.google.common.base.Predicate;
 import com.google.common.collect.FluentIterable;
@@ -34,9 +33,9 @@ import org.apache.isis.applib.annotation.DomainService;
 import org.apache.isis.applib.annotation.NatureOfService;
 import org.apache.isis.applib.annotation.Programmatic;
 import org.apache.isis.applib.layout.component.Grid;
-import org.apache.isis.applib.services.grid.GridSystemService;
 import org.apache.isis.applib.services.grid.GridLoaderService;
 import org.apache.isis.applib.services.grid.GridService;
+import org.apache.isis.applib.services.grid.GridSystemService;
 
 @DomainService(
         nature = NatureOfService.DOMAIN
@@ -135,22 +134,13 @@ public class GridServiceDefault implements GridService {
         final List<String> parts = Lists.newArrayList();
         parts.add(COMMON_TNS);
         parts.add(COMMON_SCHEMA_LOCATION);
-        FluentIterable.from(gridSystemServices)
-                .filter(new Predicate<GridSystemService>() {
-                    @Override
-                    public boolean apply(final GridSystemService gridSystemService) {
-                        final Class<? extends Grid> gridImpl = gridSystemService.gridImplementation();
-                        return gridImpl.isAssignableFrom(grid.getClass());
-                    }
-                })
-                .transform(new Function<GridSystemService, Void>() {
-                    @Nullable @Override
-                    public Void apply(final GridSystemService gridSystemService) {
-                        parts.add(gridSystemService.tns());
-                        parts.add(gridSystemService.schemaLocation());
-                        return null;
-                    }
-                });
+        for (GridSystemService gridSystemService : gridSystemServices) {
+            final Class<? extends Grid> gridImpl = gridSystemService.gridImplementation();
+            if(gridImpl.isAssignableFrom(grid.getClass())) {
+                parts.add(gridSystemService.tns());
+                parts.add(gridSystemService.schemaLocation());
+            }
+        }
         return Joiner.on(" ").join(parts);
     }
 

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridSystemServiceAbstract.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridSystemServiceAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridSystemServiceAbstract.java
index f0deaa6..3b25c17 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridSystemServiceAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/GridSystemServiceAbstract.java
@@ -224,13 +224,19 @@ public abstract class GridSystemServiceAbstract<G extends Grid>
                     return;
                 }
 
-                final String memberOrderName;
-                final int memberOrderSequence;
+                String memberOrderName = null;
+                int memberOrderSequence;
                 if(actionLayoutDataOwner instanceof FieldSet) {
                     final FieldSet fieldSet = (FieldSet) actionLayoutDataOwner;
                     final List<PropertyLayoutData> properties = fieldSet.getProperties();
-                    final PropertyLayoutData propertyLayoutData = properties.get(0); // any will do
-                    memberOrderName = propertyLayoutData.getId();
+                    for (PropertyLayoutData propertyLayoutData : properties) {
+                        final String propertyId = propertyLayoutData.getId();
+                        // any will do; choose the first one that we know is valid
+                        if(oneToOneAssociationById.containsKey(propertyId)) {
+                            memberOrderName = propertyLayoutData.getId();
+                            break;
+                        }
+                    }
                     memberOrderSequence = actionPropertyGroupSequence++;
                 } else if(actionLayoutDataOwner instanceof PropertyLayoutData) {
                     final PropertyLayoutData propertyLayoutData = (PropertyLayoutData) actionLayoutDataOwner;
@@ -241,14 +247,13 @@ public abstract class GridSystemServiceAbstract<G extends Grid>
                     memberOrderName = collectionLayoutData.getId();
                     memberOrderSequence = actionCollectionSequence++;
                 } else {
-                    // means' don't add: any existing metadata should be preserved
+                    // don't add: any existing metadata should be preserved
                     memberOrderName = null;
                     memberOrderSequence = actionDomainObjectSequence++;
                 }
                 if(memberOrderName != null) {
                     FacetUtil.addOrReplaceFacet(
-                            new MemberOrderFacetXml(memberOrderName, "" + memberOrderSequence, translationService,
-                                    objectAction));
+                            new MemberOrderFacetXml(memberOrderName, "" + memberOrderSequence, translationService, objectAction));
                 }
 
                 // fix up the action position if required

http://git-wip-us.apache.org/repos/asf/isis/blob/41a534db/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/bootstrap3/GridSystemServiceBS3.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/bootstrap3/GridSystemServiceBS3.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/bootstrap3/GridSystemServiceBS3.java
index 8130066..2efa284 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/bootstrap3/GridSystemServiceBS3.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/services/grid/bootstrap3/GridSystemServiceBS3.java
@@ -530,7 +530,7 @@ public class GridSystemServiceBS3 extends GridSystemServiceAbstract<BS3Grid> {
                                     return;
                                 }
                                 // if the @MemberOrder for the action references a field set (that has bound
-                                // associations), then don't mark it as missing, butinstead explicitly add it to the
+                                // associations), then don't mark it as missing, but instead explicitly add it to the
                                 // list of actions of that fieldset.
                                 final Set<String> boundAssociationIds = boundAssociationIdsByFieldSetId.get(id);
                                 if(boundAssociationIds != null && !boundAssociationIds.isEmpty()) {