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 2020/06/27 14:01:43 UTC

[isis] 03/03: ISIS-2222: fixes .adoc for Wrapper Character

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2222
in repository https://gitbox.apache.org/repos/asf/isis.git

commit c95b79d1aced8d13dd6e3376bdc113b1e7c8dff4
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sat Jun 27 15:01:14 2020 +0100

    ISIS-2222: fixes .adoc for Wrapper Character
---
 .../dom/homepage/DemoHomePage-description.adoc     |  9 ---
 .../shorts/PrimitiveShorts-description.adoc        |  2 +-
 .../characters/WrapperCharacters-description.adoc  | 82 ++--------------------
 .../characters/holder/WrapperCharacterHolder.java  | 10 +++
 .../WrapperCharacterHolder_actionReturning.java    |  6 +-
 ...rCharacterHolder_mixinPropertyWithCssClass.java |  4 +-
 ...er_updateReadOnlyPropertyPromptStyleInline.java |  3 +-
 .../jdo/WrapperCharacterJdoEntity-description.adoc | 28 +-------
 .../characters/jdo/WrapperCharacterJdoEntity.java  | 15 ++--
 .../vm/WrapperCharacterViewModel-description.adoc  |  2 +-
 .../characters/vm/WrapperCharacterViewModel.java   |  9 +--
 11 files changed, 40 insertions(+), 130 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage-description.adoc
index db42992..0f390d7 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/homepage/DemoHomePage-description.adoc
@@ -17,12 +17,3 @@ Such a home page would have a number of repository services injected into it, in
 It would probably also have the framework's link:https://isis.apache.org/refguide/${ISIS_VERSION}/applib-svc/UserService.html[`UserService`] injected, in order that the information displayed is relevant to the current user.
 As you can see, this app's home page does actually do this, in order to "personalise" the title.
 
-NOTE: this is a note!
-
-TIP: this is a tip!
-
-CAUTION: this is a caution!
-
-IMPORTANT: this is important!
-
-WARNING: this is a warning!
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/PrimitiveShorts-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/PrimitiveShorts-description.adoc
index 9344af8..248a7cd 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/PrimitiveShorts-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/primitive/shorts/PrimitiveShorts-description.adoc
@@ -25,7 +25,7 @@ Using `@MemberOrder` positions the properties into the appropriate `<field-set>`
 A number of mixin actions contribute through this interface, demonstrate the use of `short` as a parameter and as a return type.
 For example:
 
-* the `updateReadOnlyProperty` action is:
+* the `updateReadOnlyPropertyPromptStyleInline` action is:
 +
 [source,java]
 ----
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters-description.adoc
index 8c4749e..aae8446 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/WrapperCharacters-description.adoc
@@ -13,38 +13,7 @@ These objects both implement a common interface, `WrapperCharacterHolder`:
 
 [source,java]
 ----
-public interface WrapperCharacterHolder {
-
-    Character getReadOnlyProperty();
-    void setReadOnlyProperty(Character c);
-
-    Character getReadOnlyProperty2();
-    void setReadOnlyProperty2(Character c);
-
-    Character getReadWriteProperty();
-    void setReadWriteProperty(Character c);
-
-    @MemberOrder(name = "label-positions", sequence = "1")
-    @Property
-    @PropertyLayout(labelPosition = LabelPosition.LEFT, describedAs = "labelPosition=LEFT", hidden = Where.ALL_TABLES)
-    default Character getReadOnlyPropertyDerivedLabelPositionLeft() { return getReadOnlyProperty(); }
-
-    @MemberOrder(name = "label-positions", sequence = "2")
-    @Property
-    @PropertyLayout(labelPosition = LabelPosition.TOP, describedAs = "labelPosition=TOP", hidden = Where.ALL_TABLES)
-    default Character getReadOnlyPropertyDerivedLabelPositionTop() { return getReadOnlyProperty(); }
-
-    @MemberOrder(name = "label-positions", sequence = "3")
-    @Property
-    @PropertyLayout(labelPosition = LabelPosition.RIGHT, describedAs = "labelPosition=RIGHT", hidden = Where.ALL_TABLES)
-    default Character getReadOnlyPropertyDerivedLabelPositionRight() { return getReadOnlyProperty(); }
-
-    @MemberOrder(name = "label-positions", sequence = "4")
-    @Property
-    @PropertyLayout(labelPosition = LabelPosition.NONE, describedAs = "labelPosition=NONE", hidden = Where.ALL_TABLES)
-    default Character getReadOnlyPropertyDerivedLabelPositionNone() { return getReadOnlyProperty(); }
-
-}
+include::holder/WrapperCharacterHolder.java[tags=class]
 ----
 
 The default methods have annotations that automatically inherited.
@@ -56,28 +25,11 @@ Using `@MemberOrder` positions the properties into the appropriate `<field-set>`
 A number of mixin actions contribute through this interface, demonstrate the use of `Character` as a parameter and as a return type.
 For example:
 
-* the `updateReadOnlyProperty` action is:
+* the `updateReadOnlyPropertyPromptStyleInline` action is:
 +
 [source,java]
 ----
-@Action(
-        semantics = SemanticsOf.IDEMPOTENT,
-        associateWith = "readOnlyProperty",
-        associateWithSequence = "1"
-)
-@RequiredArgsConstructor
-public class WrapperCharacterHolder_updateReadOnlyProperty {
-
-    private final WrapperCharacterHolder wrapperCharacterHolder;
-
-    public WrapperCharacterHolder act(Character newValue) {
-        wrapperCharacterHolder.setReadOnlyProperty(newValue);
-        return wrapperCharacterHolder;
-    }
-    public Character default0Act() {
-        return wrapperCharacterHolder.getReadOnlyProperty();
-    }
-}
+include::holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.java[tags=class]
 ----
 +
 There are a number of variants of this action, to demonstrate different prompt layouts.
@@ -86,20 +38,7 @@ There are a number of variants of this action, to demonstrate different prompt l
 +
 [source,java]
 ----
-@Action(
-        semantics = SemanticsOf.SAFE,
-        associateWith = "readOnlyProperty",
-        associateWithSequence = "3"
-)
-@RequiredArgsConstructor
-public class WrapperCharacterHolder_actionReturning {
-
-    private final WrapperCharacterHolder wrapperCharacterHolder;
-
-    public Character act() {
-        return wrapperCharacterHolder.getReadOnlyProperty();
-    }
-}
+include::holder/WrapperCharacterHolder_actionReturning.java[tags=class]
 ----
 
 == Mixin properties
@@ -110,18 +49,7 @@ We also use the interface to contribute a number of mixin properties:
 +
 [source,java]
 ----
-@Property()
-@PropertyLayout(cssClass = "red", describedAs = "cssClass = \"red\" ")
-@RequiredArgsConstructor
-public class WrapperCharacterHolder_mixinPropertyWithCssClass {
-
-    private final WrapperCharacterHolder wrapperCharacterHolder;
-
-    @MemberOrder(name = "contributed", sequence = "1")
-    public Character prop() {
-        return wrapperCharacterHolder.getReadOnlyProperty();
-    }
-}
+include::holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java[tags=class]
 ----
 +
 TIP: the styling is provided from the `application.css` static resource.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder.java
index 16ce512..978e993 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder.java
@@ -42,29 +42,38 @@ import lombok.extern.log4j.Log4j2;
 
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
 
+//tag::class[]
 public interface WrapperCharacterHolder {
 
+//end::class[]
     @MemberOrder(name = "action-prompt-styles", sequence = "1") // TODO: doesn't seem to get picked up
     @Property
     @PropertyLayout
+//tag::class[]
     Character getReadOnlyProperty();
     void setReadOnlyProperty(Character c);
 
+//end::class[]
     @MemberOrder(name = "action-prompt-styles", sequence = "1") // TODO: doesn't seem to get picked up
     @Property
     @PropertyLayout(describedAs = "associated action uses promptStyle=INLINE_AS_IF_EDIT", hidden = Where.ALL_TABLES) // TODO: doesn't seem to get picked up
+//tag::class[]
     Character getReadOnlyProperty2();
     void setReadOnlyProperty2(Character c);
 
+//end::class[]
     @MemberOrder(name = "editable-properties", sequence = "1") // TODO: doesn't seem to get picked up
     @Property
     @PropertyLayout
+//tag::class[]
     Character getReadWriteProperty();
     void setReadWriteProperty(Character c);
 
+//end::class[]
     @MemberOrder(name = "editable-properties", sequence = "2") // TODO: doesn't seem to get picked up
     @Property(optionality = Optionality.OPTIONAL)
     @PropertyLayout
+//tag::class[]
     Character getReadWriteOptionalProperty();
     void setReadWriteOptionalProperty(Character c);
 
@@ -89,3 +98,4 @@ public interface WrapperCharacterHolder {
     default Character getReadOnlyPropertyDerivedLabelPositionNone() { return getReadOnlyProperty(); }
 
 }
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturning.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturning.java
index 4a3617e..cd79f51 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturning.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_actionReturning.java
@@ -24,9 +24,8 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import lombok.RequiredArgsConstructor;
 
 
-@Action(
-        semantics = SemanticsOf.SAFE
-)
+//tag::class[]
+@Action(semantics = SemanticsOf.SAFE)
 @RequiredArgsConstructor
 public class WrapperCharacterHolder_actionReturning {
 
@@ -37,3 +36,4 @@ public class WrapperCharacterHolder_actionReturning {
     }
 
 }
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java
index a950970..7ad81bb 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_mixinPropertyWithCssClass.java
@@ -25,7 +25,7 @@ import org.apache.isis.applib.annotation.Where;
 
 import lombok.RequiredArgsConstructor;
 
-
+//tag::class[]
 @Property()
 @PropertyLayout(cssClass = "red", describedAs = "cssClass = \"red\" ", hidden = Where.ALL_TABLES)
 @RequiredArgsConstructor
@@ -37,4 +37,6 @@ public class WrapperCharacterHolder_mixinPropertyWithCssClass {
     public Character prop() {
         return wrapperCharacterHolder.getReadOnlyProperty();
     }
+
 }
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.java
index 36ee0b5..9a0f1da 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/holder/WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline.java
@@ -26,6 +26,7 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import lombok.RequiredArgsConstructor;
 
 
+//tag::class[]
 @Action(
         semantics = SemanticsOf.IDEMPOTENT,
         associateWith = "readOnlyProperty",
@@ -45,5 +46,5 @@ public class WrapperCharacterHolder_updateReadOnlyPropertyPromptStyleInline {
         return wrapperCharacterHolder.getReadOnlyProperty();
     }
 
-
 }
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity-description.adoc
index 204249d..3e07343 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity-description.adoc
@@ -2,33 +2,7 @@ JDO supports `Character` out-of-the-box, so no special annotations are required.
 
 [source,java]
 ----
-@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
-@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
-@DomainObject(
-        objectType = "demo.WrapperCharacterJdoEntity"
-)
-public class WrapperCharacterJdoEntity
-    implements HasAsciiDocDescription, WrapperCharacterHolder {              // <.>
-
-    public WrapperCharacterJdoEntity(Character initialValue) { ... }         // <.>
-
-    @Title(prepend = "Character (wrapper) JDO entity: ")
-    @Getter @Setter
-    private Character readOnlyProperty;                                      // <.>
-
-    @Getter @Setter
-    private Character readOnlyProperty2;
-
-    @Property(editing = Editing.ENABLED)
-    @Getter @Setter
-    private Character readWriteProperty;
-
-    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL) // <.>
-    @Column(allowsNull = "true")                                             // <.>
-    @Getter @Setter
-    private Character readWriteOptionalProperty;
-
-}
+include::WrapperCharacterJdoEntity.java[tags=class]
 ----
 <.> a no-arg constructor is introduced by JDO enhancer
 <.> no additional annotations required.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.java
index e2f4a61..fb46577 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/jdo/WrapperCharacterJdoEntity.java
@@ -38,24 +38,26 @@ import lombok.Setter;
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
 import demoapp.dom.types.wrapper.characters.holder.WrapperCharacterHolder;
 
+//tag::class[]
 @PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
 @DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
 @DomainObject(
         objectType = "demo.WrapperCharacterJdoEntity"
 )
-public class WrapperCharacterJdoEntity
-        implements HasAsciiDocDescription,
-        WrapperCharacterHolder {
+public class WrapperCharacterJdoEntity                                          // <.>
+        implements HasAsciiDocDescription, WrapperCharacterHolder {
 
+//end::class[]
     public WrapperCharacterJdoEntity(Character initialValue) {
         this.readOnlyProperty = initialValue;
         this.readOnlyProperty2 = initialValue;
         this.readWriteProperty = initialValue;
     }
 
+//tag::class[]
     @Title(prepend = "Character (wrapper) JDO entity: ")
     @Getter @Setter
-    private Character readOnlyProperty;
+    private Character readOnlyProperty;                                         // <.>
 
     @Property
     @PropertyLayout(hidden = Where.ALL_TABLES)
@@ -66,9 +68,10 @@ public class WrapperCharacterJdoEntity
     @Getter @Setter
     private Character readWriteProperty;
 
-    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
-    @Column(allowsNull = "true")
+    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)    // <.>
+    @Column(allowsNull = "true")                                                // <.>
     @Getter @Setter
     private Character readWriteOptionalProperty;
 
 }
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.adoc
index 1ce108c..55b26f3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel-description.adoc
@@ -2,7 +2,7 @@ JAXB supports `Character` out-of-the-box, so no special annotations are required
 
 [source,java]
 ----
-include::WrapperCharacterViewModel.java[tag="class"]
+include::WrapperCharacterViewModel.java[tags=class]
 ----
 <.> a no-arg constructor is required by JAXB
 <.> no additional annotations required.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.java b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.java
index 3c51ec4..532fee7 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/types/wrapper/characters/vm/WrapperCharacterViewModel.java
@@ -50,15 +50,16 @@ import demoapp.dom.types.wrapper.characters.holder.WrapperCharacterHolder;
 )
 @lombok.NoArgsConstructor                                                       // <.>
 public class WrapperCharacterViewModel
-        implements HasAsciiDocDescription,
-        WrapperCharacterHolder {
+        implements HasAsciiDocDescription, WrapperCharacterHolder {
 
-    public WrapperCharacterViewModel(Character initialValue) {                  // <.>
+//end::class[]
+    public WrapperCharacterViewModel(Character initialValue) {
         this.readOnlyProperty = initialValue;
         this.readOnlyProperty2 = initialValue;
         this.readWriteProperty = initialValue;
     }
 
+//tag::class[]
     @Title(prepend = "Character (wrapper) view model: ")
     @XmlElement(required = true)
     @Getter @Setter
@@ -71,7 +72,7 @@ public class WrapperCharacterViewModel
     private Character readOnlyProperty2;
 
     @Property(editing = Editing.ENABLED)
-    @XmlElement(required = true)                                               // <.>
+    @XmlElement(required = true)                                                // <.>
     @Getter @Setter
     private Character readWriteProperty;