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/07/22 07:55:47 UTC

[isis] 02/02: ISIS-2222: adds @Property(editing=...)

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

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

commit 5c7aed384f12144fc3490d14bca57642881d596a
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jul 22 08:30:01 2020 +0100

    ISIS-2222: adds @Property(editing=...)
    
    Also fixes up descriptions of some of the other @Property's
---
 .../Property/editing/EditingEnabledMetaAnnotation.java   |  3 +--
 .../Property/editing/PropertyEditingVm-description.adoc  | 16 +++++++++++++++-
 .../Property/fileAccept/FileAcceptPdfMetaAnnotation.java |  3 +--
 .../fileAccept/PropertyFileAcceptVm-description.adoc     |  1 -
 .../Property/maxLength/MaxLength10MetaAnnotation.java    |  1 -
 .../maxLength/PropertyMaxLengthVm-description.adoc       |  1 -
 .../MustSatisfyOfWorkingAgeMetaAnnotation.java           |  1 -
 .../mustSatisfy/PropertyMustSatisfyVm-description.adoc   |  1 -
 .../regexPattern/PropertyRegexPatternVm-description.adoc |  1 -
 .../regexPattern/RegexPatternEmailComMetaAnnotation.java |  1 -
 .../domain/src/main/java/demoapp/dom/menubars.layout.xml |  1 +
 11 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/EditingEnabledMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/EditingEnabledMetaAnnotation.java
index c9a91c7..a189deb 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/EditingEnabledMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/EditingEnabledMetaAnnotation.java
@@ -14,8 +14,7 @@ import org.apache.isis.applib.annotation.Property;
 @Property(editing = Editing.ENABLED)                // <.>
 @Inherited
 @Target({
-        ElementType.METHOD, ElementType.FIELD,      // <.>
-        ElementType.TYPE                            // <.>
+        ElementType.METHOD, ElementType.FIELD       // <.>
 })
 @Retention(RetentionPolicy.RUNTIME)
 public @interface EditingEnabledMetaAnnotation {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm-description.adoc
index 8f4dd1e..492105b 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/editing/PropertyEditingVm-description.adoc
@@ -4,6 +4,21 @@ The "editing" semantic specifies that a property's value can be changed through
 
 There is no corresponding semantic for parameters, parameters are implicitly editable.
 
+== Class Level
+
+Usually editing of properties is discouraged; it is usually better to modify state through an explicit action instead.
+For that reason, editing of properties is disabled by default (though that can be changed globally if necessary using the `isis.applib.annotation.domain-object.editing` configuration property).
+
+Editing can also be specified at the class level.
+This will override any configured defaults, but just for the properties of that class:
+
+[source,java,indent=0]
+----
+include::PropertyEditingVm.java[tags=class]
+----
+
+The property-level semantic can, in turn, overrides the configured or class-level default.
+
 
 == Annotated
 
@@ -31,7 +46,6 @@ include::EditingEnabledMetaAnnotation.java[tags=class]
 ----
 <.> annotated for property ...
 <.> annotation can be applied to a property (either its getter or the field directly)
-<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
 
 * and can be applied to a property:
 +
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/FileAcceptPdfMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/FileAcceptPdfMetaAnnotation.java
index 23b84de..8adb147 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/FileAcceptPdfMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/FileAcceptPdfMetaAnnotation.java
@@ -15,8 +15,7 @@ import org.apache.isis.applib.annotation.Property;
 @Inherited
 @Target({
         ElementType.METHOD, ElementType.FIELD,      // <.>
-        ElementType.PARAMETER,                      // <.>
-        ElementType.TYPE                            // <.>
+        ElementType.PARAMETER                       // <.>
 })
 @Retention(RetentionPolicy.RUNTIME)
 public @interface FileAcceptPdfMetaAnnotation {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/PropertyFileAcceptVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/PropertyFileAcceptVm-description.adoc
index 9de8afe..ba1df21 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/PropertyFileAcceptVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/fileAccept/PropertyFileAcceptVm-description.adoc
@@ -61,7 +61,6 @@ include::FileAcceptPdfMetaAnnotation.java[tags=class]
 <.> \... and also for parameter.
 <.> annotation can be applied to a property (either its getter or the field directly)
 <.> annotation can be applied to a parameter
-<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
 
 * and can be applied to a property:
 +
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/MaxLength10MetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/MaxLength10MetaAnnotation.java
index 9c99871..f22a312 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/MaxLength10MetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/MaxLength10MetaAnnotation.java
@@ -18,7 +18,6 @@ import org.apache.isis.applib.annotation.PropertyLayout;
 @Target({
         ElementType.METHOD, ElementType.FIELD,      // <.>
         ElementType.PARAMETER,                      // <.>
-        ElementType.TYPE                            // <.>
 })
 @Retention(RetentionPolicy.RUNTIME)
 public @interface MaxLength10MetaAnnotation {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm-description.adoc
index 26cece0..c0fbeb5 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/maxLength/PropertyMaxLengthVm-description.adoc
@@ -55,7 +55,6 @@ include::MaxLength10MetaAnnotation.java[tags=class]
 <.> \... and also for parameter.
 <.> annotation can be applied to a property (either its getter or the field directly)
 <.> annotation can be applied to a parameter
-<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
 
 * and can be applied to a property:
 +
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/MustSatisfyOfWorkingAgeMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/MustSatisfyOfWorkingAgeMetaAnnotation.java
index ca8a3bc..fe752f2 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/MustSatisfyOfWorkingAgeMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/MustSatisfyOfWorkingAgeMetaAnnotation.java
@@ -20,7 +20,6 @@ import org.apache.isis.applib.annotation.Property;
 @Target({
     ElementType.METHOD, ElementType.FIELD,          // <.>
     ElementType.PARAMETER,                          // <.>
-    ElementType.TYPE                                // <.>
 })
 @Retention(RetentionPolicy.RUNTIME)
 public @interface MustSatisfyOfWorkingAgeMetaAnnotation {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm-description.adoc
index a924f16..42bc1f1 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mustSatisfy/PropertyMustSatisfyVm-description.adoc
@@ -62,7 +62,6 @@ include::MustSatisfyOfWorkingAgeMetaAnnotation.java[tags=class]
 <.> \... and also for parameter.
 <.> annotation can be applied to a property (either its getter or the field directly)
 <.> annotation can be applied to a parameter
-<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
 
 * and can be applied to a property:
 +
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm-description.adoc
index 406a520..f9787a6 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/PropertyRegexPatternVm-description.adoc
@@ -42,7 +42,6 @@ include::RegexPatternEmailComMetaAnnotation.java[tags=class]
 <.> \... and also for parameter.
 <.> annotation can be applied to a property (either its getter or the field directly)
 <.> annotation can be applied to a parameter
-<.> annotation can be applied to a type (ie, meta-meta annotations recursively)
 
 * and can be applied to a property:
 +
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternEmailComMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternEmailComMetaAnnotation.java
index 454f6eb..f1e28e5 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternEmailComMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/regexPattern/RegexPatternEmailComMetaAnnotation.java
@@ -25,7 +25,6 @@ import org.apache.isis.applib.annotation.Property;
 @Target({
     ElementType.METHOD, ElementType.FIELD,                      // <.>
     ElementType.PARAMETER,                                      // <.>
-    ElementType.TYPE                                            // <.>
 })
 @Retention(RetentionPolicy.RUNTIME)
 public @interface RegexPatternEmailComMetaAnnotation {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
index e74d400..a1ddf72 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
@@ -108,6 +108,7 @@ as a replacement for
             <mb3:named>Domain Annotations</mb3:named>
             <mb3:section>
                 <mb3:named>@Property</mb3:named>
+                <mb3:serviceAction objectType="demo.PropertyMenu" id="editing"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="fileAccept"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="maxLength"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="mustSatisfy"/>