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/08/01 15:30:39 UTC

[6/7] isis git commit: ISIS-1676: fixes up some docs for standardisation of use of framework-provided mixins

ISIS-1676: fixes up some docs for standardisation of use of framework-provided mixins

nb: changes to the mixins themselves were accidentally included in an ISIS-1674 commit.


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

Branch: refs/heads/master
Commit: 3f07ea2a7c7572369c3e5fd8eb080098e612f827
Parents: 91b9cb8
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Tue Aug 1 16:24:38 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Tue Aug 1 16:24:38 2017 +0100

----------------------------------------------------------------------
 .../guides/rgcms/_rgcms_classes_mixins_Dto.adoc        | 12 ++++++------
 .../_ugfun_programming-model_mixins_inferred-name.adoc |  8 +++-----
 ...programming-model_mixins_nested-static-classes.adoc | 13 +++++--------
 3 files changed, 14 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/3f07ea2a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_mixins_Dto.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_mixins_Dto.adoc b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_mixins_Dto.adoc
index cda020a..8d799e3 100644
--- a/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_mixins_Dto.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/rgcms/_rgcms_classes_mixins_Dto.adoc
@@ -20,15 +20,15 @@ The `Dto_downloadXml` mixin defines the following action:
 
 [source,java]
 ----
-@Mixin
+@Mixin(method="act")
 public class Dto_downloadXml {
     public Dto_downloadXml(final Dto dto) { ... }     // <1>
-    public Object $$(final String fileName) { ... }   // <2>
+    public Object act(final String fileName) { ... }   // <2>
     ...
 }
 ----
 <1> provided as an action to any class that (trivially) implements the `Dto` interface
-<2> The '$$' name is a "special case", indicating the the action's name be derived from the class name.
+<2> The action's name is derived from the class name.
 
 This will return the XML text wrapped up in a xref:../rgcms/rgcms.adoc#_rgcms_classes_value-types_Clob[`Clob`].
 
@@ -36,14 +36,14 @@ The `Dto_downloadXsd` mixin is similar:
 
 [source,java]
 ----
-@Mixin
+@Mixin(method="act")
 public class Dto_downloadXsd {
     public Dto_downloadXsd(final Dto dto) { ... }                                             // <1>
-    public Object $$(final String fileName, final IsisSchemes isisSchemas) { ... }   // <2>
+    public Object act(final String fileName, final IsisSchemes isisSchemas) { ... }   // <2>
 }
 ----
 <1> provided as an action to any class that (trivially) implements the `Dto` interface
-<2> The '$$' name is a "special case", indicating the the action's name be derived from the class name.
+<2> The action's name be derived from the class name.
 
 If the domain object's JAXB annotations reference only a single XSD schema then this will return that XML text as a xref:../rgcms/rgcms.adoc#_rgcms_classes_value-types_Clob[`Clob`] of that XSD.
 If there are multiple XSD schemas referenced then the action will return a zip of those schemas, wrapped up in a xref:../rgcms/rgcms.adoc#_rgcms_classes_value-types_Blob[`Blob`].

http://git-wip-us.apache.org/repos/asf/isis/blob/3f07ea2a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc
index 9306218..b84c247 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_inferred-name.adoc
@@ -16,7 +16,7 @@ For example:
 
 [source,java]
 ----
-@Mixin
+@Mixin(method="act")
 public class DocumentHolder_documents {
 
     private final DocumentHolder holder;
@@ -25,14 +25,12 @@ public class DocumentHolder_documents {
     @Action(semantics=SemanticsOf.SAFE)
     @ActionLayout(contributed = Contributed.AS_ASSOCIATION)
     @CollectionLayout(render = RenderType.EAGERLY)
-    public List<Document> $$() {                                    // <1>
+    public List<Document> act() {
         ...
     }
-    public boolean hide$$() { ... }                                 // <2>
+    public boolean hideAct() { ... }
 }
 ----
-<1> using "$$" as the reserved method name
-<2> supporting methods as usual
 
 
 Alternatively, if the xref:../rgant/rgant.adoc#_rgant_Mixin_method[`@Mixin#method()`] attribute is specified, then this can nominate a different abbreviation.

http://git-wip-us.apache.org/repos/asf/isis/blob/3f07ea2a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_nested-static-classes.adoc
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_nested-static-classes.adoc b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_nested-static-classes.adoc
index 4596a2c..0dfa536 100644
--- a/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_nested-static-classes.adoc
+++ b/adocs/documentation/src/main/asciidoc/guides/ugfun/_ugfun_programming-model_mixins_nested-static-classes.adoc
@@ -36,8 +36,7 @@ public class Customer {
 ----
 <1> Prior to `1.13.2`, had to be prefixed by an "_"; this is no longer required because "$" is also recognized as a way of parsing the class name in order to infer the mixin's name (eg `Customer$placeOrder`).
 <2> typically contributed to concrete class
-<3> using the "$$" reserved name
-<4> supporting methods as usual
+<3> supporting methods as usual
 
 
 The mixin class can also be capitalized if desired.
@@ -48,17 +47,16 @@ Thus:
 public class Customer {
 
     @Mixin(method="act")
-    public static class PlaceOrder {                                            // <1>
-
+    public static class PlaceOrder {
         private final Customer customer;
-        public documents(Customer customer) { this.customer = customer; }       // <2>
+        public documents(Customer customer) { this.customer = customer; }
 
         @Action
         @ActionLayout(contributed = Contributed.AS_ACTION)
-        public List<Order> act(Product p, int quantity) {                        // <3>
+        public List<Order> act(Product p, int quantity) {
             ...
         }
-        public boolean hideAct() { ... }                                         // <4>
+        public boolean hideAct() { ... }
         public String validate0Act(Product p) { ...  }
     }
 }
@@ -72,7 +70,6 @@ In other words, all of the following are allowed:
 * `public static class _Documents { ... }`
 * `public static class _documents { ... }`
 
-The reserved method name "$$" can also be changed using xref:../rgant/rgant.adoc#_rgant_Mixin_method[`@Mixin#method()`] or xref:../rgant/rgant.adoc#_rgant_DomainObject_mixinMethod[`@DomainObject#mixinMethod()`].