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 2021/01/17 07:47:37 UTC

[isis] branch ISIS-439 updated (ec2664d -> ec052f0)

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

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


 discard ec2664d  ISSI-439: renames mementoSerialization to snapshot
 discard fc661d7  ISIS-439: fully remove installing DisabledFacet for collections.
 discard b800e61  ISIS-439: completely removes the DisabledFacetForCollection
 discard 885830f  ISIS-2476: improves docs for property mementoSerialization
 discard afcdb9c  ISIS-2476: removes some redundant .gitkeep files
 discard 90213af  ISIS-439: removes @Collection#editing and makes all collections disabled always
     add 09998ef  ISIS-2481: simplify bean-type registry to collect all entity types (JDO+JPA) in a single set
     add f9d3109  ISIS-2480: SecMan/JPA: converts named query Permission.findByUser
     add 6c27f9c  ISIS-2480: SecMan/JPA: converts remaining named queries
     new 42b9723  ISIS-439: removes @Collection#editing and makes all collections disabled always
     new 381b7c0  ISIS-2476: removes some redundant .gitkeep files
     new 028c219  ISIS-2476: improves docs for property mementoSerialization
     new 4c3c5c1  ISIS-439: completely removes the DisabledFacetForCollection
     new daa7402  ISIS-439: fully remove installing DisabledFacet for collections.
     new ec052f0  ISSI-439: renames mementoSerialization to snapshot

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (ec2664d)
            \
             N -- N -- N   refs/heads/ISIS-439 (ec052f0)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../core/config/beans/IsisBeanTypeRegistry.java    |  3 +-
 .../config/beans/IsisBeanTypeRegistryDefault.java  |  5 +-
 .../specloader/SpecificationLoaderDefault.java     |  9 ++--
 .../jpa/dom/permission/ApplicationPermission.java  | 54 +++++++++++-----------
 .../secman/jpa/dom/role/ApplicationRole.java       | 22 ++++-----
 .../secman/jpa/dom/tenancy/ApplicationTenancy.java | 29 ++++++------
 .../secman/jpa/dom/user/ApplicationUser.java       | 50 ++++++++------------
 .../integration/config/JdoEntityTypeRegistry.java  | 46 +++++++++---------
 .../jdo/integration/schema/JdoSchemaService.java   |  2 +-
 .../jdo/metamodel/menu/JdoMetamodelMenu.java       |  4 +-
 10 files changed, 107 insertions(+), 117 deletions(-)


[isis] 03/06: ISIS-2476: improves docs for property mementoSerialization

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 028c219ba2fdcb57284bdfe1cba2a324093c82f6
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jan 13 07:18:10 2021 +0000

    ISIS-2476: improves docs for property mementoSerialization
---
 ...PropertyMementoSerializationVm-description.adoc | 129 ++++++---------------
 .../PropertyMementoSerializationVm.java            |  15 ++-
 ...ropertyMementoSerializationVm_takeSnapshot.java |  31 ++---
 3 files changed, 61 insertions(+), 114 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc
index a86fcdc..0c0bd9b 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc
@@ -1,135 +1,78 @@
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-The `associateWith` element specifies an action has a relationship with another property or another collection of the domain class.
+The `mementoSerialization` element of the `@Property` annotation specifies whether a property should be included in an XML snapshot, as created by the `XmlSnapshotService`:
 
-* For properties, the association (currently) is used solely for layout purposes, so that the action will by default be rendered close to the property.
-+
-This can of course be overridden using `@ActionLayout` or the layout file
-
-* For collections, the association is also used for layout purposes, rendering the action near to the collection.
-+
-However, it is also used at a deeper level, because the action may have a collection parameter which is the same type as the collection elements.
-In the Wicket viewer, the collection is rendered with checkboxes; those selected objects are used as defaults for the action collection parameter.
-
-
-== Associated with Properties
-
-The `AssociateWithVm` class defines two properties, `text` and `anotherProperty`:
-
-[source,java]
-----
-include::ActionAssociateWithVm.java[tags=class-properties]
-----
-
-The regular `updateText` action is associated with the `text` property:
-
-[source,java,indent=0]
-----
-include::ActionAssociateWithVm.java[tags=action-associateWith-property]
-----
-<.> indicates the property to associate with
-<.> if there are multiple actions associated with the property, indicates their order in the UI
-
-Meanwhile the mixin `updateOtherProperty` is associated with the `otherProperty` property:
+The `takeSnapshot` mixin action shows how this service is used:
 
 [source,java,indent=0]
 ----
-include::ActionAssociateWithVm_updateOtherProperty.java[tags=class]
+include::PropertyMementoSerializationVm_takeSnapshot.java[tags=class]
 ----
-<.> indicates the property to associate with
-<.> indicates their order in the UI
 
+There are several use cases of the resultant XML; a common one is for adhoc auditing.
+Another is when there's a need to pass the state of an object (graph) into a supporting domain service, for example to perform a mail merge.
+All that is required is the state of the object, which can then be extracted, eg using XPath.
+This allows the domain object and service to have no direct knowledge of each other; the binding is entirely configuration driven.
 
-== Collection
 
-The `AssociateWithVm` class also defines the `children` collection:
 
-[source,java]
-----
-include::ActionAssociateWithVm.java[tags=class-collections-children]
-----
+== Annotations and Meta-annotations
 
-There are three actions associated with this collection:
+The example view model indicates which properties to include or exclude from the view model:
 
-* the `addChild` action:
+* with no annotation:
 +
 [source,java,indent=0]
 ----
-include::ActionAssociateWithVm.java[tags=action-associateWith-children-1]
+include::PropertyMementoSerializationVm.java[tags=no-annotation]
 ----
-<.> associates with the "children" collection
-<.> positioned first in the UI
++
+These will be included by default.
 
-* the `removeChild` action.
+* explicitly included:
 +
 [source,java,indent=0]
 ----
-include::ActionAssociateWithVm.java[tags=action-associateWith-children-2]
+include::PropertyMementoSerializationVm.java[tags=annotated-included]
 ----
-<.> associates with the "children" collection
-<.> positioned second in the UI
-<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
-Instead, the elements in the collection are automatically used.
-
-+
-TIP: an explicit `choices()` or `autoComplete(...)` supporting method can be provided to override the default usage of the collection elements if required.
 
-* the `removeChildren` action, which allows multiple children to be removed:
+* explicitly excluded:
 +
 [source,java,indent=0]
 ----
-include::ActionAssociateWithVm.java[tags=action-associateWith-children-3]
+include::PropertyMementoSerializationVm.java[tags=annotated-excluded]
 ----
-<.> associates with the "children" collection
-<.> positioned third in the UI
-<.> again, no supporting `choices()` or `autoComplete(...)` method is required.
-Instead, the elements of the collection are used as options.
-Also, each row in the collection is rendered with a checkbox, and those selected are used as the default for the parameter.
-
-== Mixin Actions
-
-The `AssociateWithVm` class also defines the `favorites` collection:
 
-[source,java]
+* included through a meta-annotation:
++
+[source,java,indent=0]
 ----
-include::ActionAssociateWithVm.java[tags=class-collections-favorites]
+include::PropertyMementoSerializationVm.java[tags=meta-annotated-included]
 ----
-
-There are three mixin actions associated with this collection:
-
-* the `makeFavorite` action.
-This takes a element from the "children" collectio and also adds to the "favorites" collection:
 +
-[source,java]
+where the meta-annotation is:
++
+[source,java,indent=0]
 ----
-include::child/ActionAssociateWithVm_makeFavorite.java[tags=class]
+include::MementoSerializationIncludedMetaAnnotation.java[tags=class]
 ----
-<.> associates with the "favorites" collection
-<.> positioned first in the UI
-<.> choices are taken from the "children" collection
 
-* the `noLongerFavorite` action.
-This just removes a selected element from the "children" collection:
+* excluded through a meta-annotation:
 +
-[source,java]
+[source,java,indent=0]
 ----
-include::child/ActionAssociateWithVm_noLongerFavorite.java[tags=class]
+include::PropertyMementoSerializationVm.java[tags=meta-annotated-excluded]
 ----
-<.> associates with the "children" collection
-<.> positioned second in the UI
-<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
-Instead, the elements in the collection are automatically used.
-
-* the `noLongerFavorites` action.
-This is similar to the previous action, but for multiple favorite elements:
 +
-[source,java]
+where the meta-annotation is:
++
+[source,java,indent=0]
 ----
-include::child/ActionAssociateWithVm_noLongerFavorites.java[tags=class]
+include::MementoSerializationExcludedMetaAnnotation.java[tags=class]
 ----
-<.> associates with the "favorites" collection
-<.> positioned third in the UI
-<.> because this action is associated with a collection, no supporting `choices()` or `autoComplete(...)` is required to provide the parameter.
-Instead, the elements in the collection are automatically used.
 
 
+
+== Snapshot
+
+TODO: inline the resultant snapshot
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java
index a4e2f26..abb8b44 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java
@@ -32,11 +32,12 @@ import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
 
-import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
 
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+
 @XmlRootElement(name = "root")
 @XmlType
 @XmlAccessorType(XmlAccessType.FIELD)
@@ -61,12 +62,15 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
         return "PropertyMementoSerializationVm";
     }
 
+//tag::no-annotation[]
     @Property()
     @MemberOrder(name = "no-annotations", sequence = "1")
     @XmlElement(required = true)
     @Getter @Setter
     private String text;
+//end::no-annotation[]
 
+//tag::annotated-not_specified[]
     @Property(
         mementoSerialization = MementoSerialization.NOT_SPECIFIED
     )
@@ -77,7 +81,9 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
     @XmlElement(required = true)
     @Getter @Setter
     private String notSpecifiedProperty;
+//end::annotated-not_specified[]
 
+//tag::annotated-excluded[]
     @Property(
         mementoSerialization = MementoSerialization.EXCLUDED
     )
@@ -88,7 +94,9 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
     @XmlElement(required = true)
     @Getter @Setter
     private String excludedProperty;
+//end::annotated-excluded[]
 
+//tag::annotated-included[]
     @Property(
         mementoSerialization = MementoSerialization.INCLUDED
     )
@@ -99,7 +107,9 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
     @XmlElement(required = true)
     @Getter @Setter
     private String includedProperty;
+//end::annotated-included[]
 
+//tag::meta-annotated-excluded[]
     @MementoSerializationExcludedMetaAnnotation     // <.>
     @Property()
     @PropertyLayout(
@@ -109,7 +119,9 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
     @XmlElement(required = true)
     @Getter @Setter
     private String metaAnnotatedProperty;
+//end::meta-annotated-excluded[]
 
+//tag::meta-annotated-included[]
     @MementoSerializationIncludedMetaAnnotation                 // <.>
     @Property(
         mementoSerialization = MementoSerialization.EXCLUDED    // <.>
@@ -123,5 +135,6 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
     @XmlElement(required = true)
     @Getter @Setter
     private String metaAnnotatedPropertyOverridden;
+//end::meta-annotated-included[]
 
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java
index 7e97ae8..bb49d51 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java
@@ -36,33 +36,24 @@ import lombok.val;
 @RequiredArgsConstructor
 public class PropertyMementoSerializationVm_takeSnapshot {
 
-    @Inject
-    XmlSnapshotService xmlSnapshotService;
-    @Inject
-    XmlService xmlService;
-
-    // ...
-//end::class[]
-
-    private final PropertyMementoSerializationVm propertyMementoSerializationVm;
+    @Inject XmlSnapshotService xmlSnapshotService;
+    @Inject XmlService xmlService;
 
+    private final PropertyMementoSerializationVm vm;
 
 //tag::class[]
-    public Clob act() {
-        return snapshotUsing(propertyMementoSerializationVm);
-    }
-
-    private Clob snapshotUsing(
-            final Object parentVm) {
-        val builder = xmlSnapshotService.builderFor(parentVm);
+    public Clob act(String fileName) {
+        val builder = xmlSnapshotService.builderFor(vm);
         val snapshot = builder.build();
         val doc = snapshot.getXmlDocument();
-        return asClob(xmlService.asString(doc));
+        return asClob(xmlService.asString(doc), fileName);
+    }
+    public String default0Act() {
+        return "snapshot.xml";
     }
 
-
-    private static Clob asClob(final String xmlStr) {
-        return new Clob("snapshot.xml", "application/xml", xmlStr);
+    private static Clob asClob(final String xmlStr, final String fileName) {
+        return new Clob(fileName, "application/xml", xmlStr);
     }
 }
 //end::class[]


[isis] 02/06: ISIS-2476: removes some redundant .gitkeep files

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 381b7c0f3fc73ac4114968d0e9be04bc503a2735
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jan 13 06:19:10 2021 +0000

    ISIS-2476: removes some redundant .gitkeep files
---
 .../src/main/java/demoapp/dom/annotDomain/Action/restrictTo/.gitkeep      | 0
 .../src/main/java/demoapp/dom/annotDomain/Action/semantics/.gitkeep       | 0
 2 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/restrictTo/.gitkeep b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/restrictTo/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/semantics/.gitkeep b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/semantics/.gitkeep
deleted file mode 100644
index e69de29..0000000


[isis] 06/06: ISSI-439: renames mementoSerialization to snapshot

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ec052f05557285b23b68bcf40341499aa2c48939
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jan 15 17:43:00 2021 +0000

    ISSI-439: renames mementoSerialization to snapshot
---
 .../2.0.0-M1/mignotes/removed-annotations.adoc     |  4 +-
 .../2.0.0-M1/mignotes/updated-annotations.adoc     |  7 +-
 .../modules/ROOT/pages/2020/2.0.0-M5/mignotes.adoc | 43 ++++++------
 .../pages/index/applib/annotation/Property.adoc    |  4 +-
 .../userguide/modules/fun/pages/view-models.adoc   |  3 +-
 .../adoc/modules/applib-ant/pages/Property.adoc    |  4 +-
 .../{mementoSerialization.adoc => snapshot.adoc}   | 11 ++-
 .../adoc/modules/applib-ant/pages/view-models.adoc |  6 +-
 .../apache/isis/applib/annotation/Property.java    | 10 +--
 .../{MementoSerialization.java => Snapshot.java}   | 19 +++--
 ...ExcludeFacet.java => SnapshotExcludeFacet.java} |  2 +-
 ...ract.java => SnapshotExcludeFacetAbstract.java} |  6 +-
 .../property/PropertyAnnotationFacetFactory.java   |  4 +-
 ...SnapshotExcludeFacetForPropertyAnnotation.java} | 18 ++---
 .../update/PropertySetAndClearFacetFactory.java    |  2 +-
 ...rred.java => SnapshotExcludeFacetInferred.java} |  6 +-
 .../spec/feature/OneToOneAssociation.java          |  4 +-
 .../specimpl/OneToManyAssociationMixedIn.java      |  8 +--
 .../PropertyMethodsFacetFactoryTest.java           | 12 ++--
 ...sistedAnnotationOnPropertyFacetFactoryTest.java | 12 ++--
 .../PropertyAnnotationFacetFactoryTest.java        | 14 ++--
 .../specimpl/OneToOneAssociationAbstractTest.java  |  6 +-
 .../HasAsciiDocDescription_description.java        |  4 +-
 .../HasAsciiDocDescription_sources.java            |  4 +-
 .../child/ActionAssociateWithVm-description.adoc   |  2 +-
 .../dom/annotDomain/Property/PropertyMenu.java     | 22 +++---
 .../PropertySnapshotVm-description.adoc}           | 10 ++-
 .../PropertySnapshotVm.java}                       | 51 +++++++++-----
 .../PropertySnapshotVm.layout.xml}                 |  3 +-
 .../PropertySnapshotVm_takeXmlSnapshot.java}       | 35 ++++++++--
 .../SnapshotExcludedMetaAnnotation.java}           |  8 +--
 .../SnapshotIncludedMetaAnnotation.java}           |  8 +--
 .../PropertySnapshotChildVm-description.adoc}      |  4 +-
 .../snapshot/child/PropertySnapshotChildVm.java}   | 81 +++++++++++-----------
 .../child/PropertySnapshotChildVm.layout.xml}      | 15 ++--
 .../src/main/java/demoapp/dom/menubars.layout.xml  |  2 +-
 .../xmlSnapshotService/XmlSnapshotParentVm.java    |  4 +-
 .../child/XmlSnapshotChildVm-description.adoc      |  2 +-
 .../peer/XmlSnapshotPeerVm-description.adoc        |  2 +-
 39 files changed, 248 insertions(+), 214 deletions(-)

diff --git a/antora/components/relnotes/modules/ROOT/pages/2018/2.0.0-M1/mignotes/removed-annotations.adoc b/antora/components/relnotes/modules/ROOT/pages/2018/2.0.0-M1/mignotes/removed-annotations.adoc
index 71f1d6a..6b5ac86 100644
--- a/antora/components/relnotes/modules/ROOT/pages/2018/2.0.0-M1/mignotes/removed-annotations.adoc
+++ b/antora/components/relnotes/modules/ROOT/pages/2018/2.0.0-M1/mignotes/removed-annotations.adoc
@@ -67,7 +67,7 @@ Similarly, the `Bulk.InteractionContext` domain service is replaced with the lin
 
 |`@Collection`
 |`notPersisted`
-| Removed, replaced with link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant_Collection_mementoSerialization[`@Collection#mementoSerialization()`]
+| Removed, no replacement.
 
 |`@CollectionInteraction`
 |
@@ -247,7 +247,7 @@ ChangedEvent`
 
 |`@Property`
 |`notPersisted`
-| Removed, replaced with link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant_Collection_mementoSerialization[`@Collection#mementoSerialization()`]
+| Removed, replaced with link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant_Property_snapshot[`@Property#snapshot()`]
 
 |`@PropertyInteraction`
 |
diff --git a/antora/components/relnotes/modules/ROOT/pages/2018/2.0.0-M1/mignotes/updated-annotations.adoc b/antora/components/relnotes/modules/ROOT/pages/2018/2.0.0-M1/mignotes/updated-annotations.adoc
index fce030f..611524f 100644
--- a/antora/components/relnotes/modules/ROOT/pages/2018/2.0.0-M1/mignotes/updated-annotations.adoc
+++ b/antora/components/relnotes/modules/ROOT/pages/2018/2.0.0-M1/mignotes/updated-annotations.adoc
@@ -56,7 +56,7 @@ In all cases `NOT_SPECIFIED` is the new default.
 | Default changed from `BELOW` to `NOT_SPECIFIED`.
 
 
-.3+|link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant-Collection[`@Collection`]
+.2+|link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant-Collection[`@Collection`]
 
 | link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant-Collection_hidden[`hidden`]
 | Default changed from `NOWHERE` to `NOT_SPECIFIED`.
@@ -64,9 +64,6 @@ In all cases `NOT_SPECIFIED` is the new default.
 | link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant-Collection_editing[`editing`]
 | Default changed from `AS_CONFIGURED` to `NOT_SPECIFIED`.
 
-| link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant-Collection_mementoSerialization[`mementoSerialization`]
-| Replaces `notPersisted`, taking values of `INCLUDED`, `EXCLUDED` or `NOT_SPECIFIED`.
-Defaults to `NOT_SPECIFIED`.
 
 
 
@@ -125,7 +122,7 @@ Defaults to `NOT_SPECIFIED`.
 | link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant-Property_hidden[`hidden`]
 | Default changed from `NOWHERE` to `NOT_SPECIFIED`.
 
-| link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant-Property_mementoSerialization[`mementoSerialization`]
+| link:https://isis.apache.org/versions/2.0.0-M1/guides/rgant/rgant.html#_rgant-Property_snapshot[`snapshot`]
 | Replaces `notPersisted`, taking values of `INCLUDED`, `EXCLUDED` or `NOT_SPECIFIED`.
 Defaults to `NOT_SPECIFIED`.
 
diff --git a/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M5/mignotes.adoc b/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M5/mignotes.adoc
index d5548de..0c0bb1e 100644
--- a/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M5/mignotes.adoc
+++ b/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M5/mignotes.adoc
@@ -27,8 +27,8 @@ isis.core.metaModel.validator.serviceActionsOnly=true // <.>
 isis.core.metaModel.validator.mixins-only=true        // <.>
 ----
 <.> `@DomainService(natureOfService=VIEW/REST)` is now solely used for UI menu action providers and REST end-points.
-There is no longer the need to validate uses of `natureOfService=DOMAIN` as this option was removed.  
-<.> Support for services that contribute members to other `DomainObjects` was removed. Use `Mixins` instead. 
+There is no longer the need to validate uses of `natureOfService=DOMAIN` as this option was removed.
+<.> Support for services that contribute members to other `DomainObjects` was removed. Use `Mixins` instead.
 
 See the former java-doc for hints on how to migrate the previous options.
 
@@ -87,19 +87,16 @@ VIEW_CONTRIBUTIONS_ONLY,
 | was
 | now what?
 
-| `@ActionLayout(contributed=...)` 
+| `@ActionLayout(contributed=...)`
 | was only effective on mixin methods; use `@Action`, `@Property` or `@Collection` instead
 
-| `@Action/@Property(command=...)` 
+| `@Action/@Property(command=...)`
 | replaced with `commandPublishing`
 
-| `@Action/@Property(publish=...)` 
+| `@Action/@Property(publish=...)`
 | replaced with `executionPublishing`
 
-| `@Collection(mementoSerialization=...)`
-| TODO: work in progress
-
-| `@DomainObject(audit=...)` 
+| `@DomainObject(audit=...)`
 | replaced with `entityChangePublishing`
 
 | `@DomainObject(nature=...)`
@@ -108,23 +105,23 @@ VIEW_CONTRIBUTIONS_ONLY,
 * `INMEMORY_ENTITY`
 | use `@DomainObject(nature=VIEW_MODEL)` instead
 
-| `@DomainObject(publish=...)` 
+| `@DomainObject(publish=...)`
 | replaced with `entityChangePublishing`
 
 | `@DomainService(repositoryFor=...)`
-| if this domain service acts as a repository for an entity type, 
+| if this domain service acts as a repository for an entity type,
 specify that entity type (was never implemented)
 
 | `@Mixin`
-| use `@Action`, `@Property` or `@Collection` instead; 
+| use `@Action`, `@Property` or `@Collection` instead;
 
-for more fine grained control (eg. setting the mixin's method name) 
+for more fine grained control (eg. setting the mixin's method name)
 use `@DomainObject(nature=MIXIN, ...)` combined with one of the above
 
 | `@ViewModel`
 | use `@DomainObject(nature=VIEW_MODEL)` instead
 
-| `@ViewModelLayout` 
+| `@ViewModelLayout`
 | use `@DomainObjectLayout` instead
 
 |===
@@ -190,18 +187,18 @@ CommandServiceInternal -> CommandPublisher
 | new
 
 | AuthenticationSession
-| Authentication (no longer holds MessageBroker or session attributes, is now immutable) 
+| Authentication (no longer holds MessageBroker or session attributes, is now immutable)
 
-| AuthenticationSessionStrategy 
+| AuthenticationSessionStrategy
 | AuthenticationStrategy
 
-| AuthenticationSessionStrategyBasicAuth (*1*)  
-| AuthenticationStrategyBasicAuth 
+| AuthenticationSessionStrategyBasicAuth (*1*)
+| AuthenticationStrategyBasicAuth
 
-| AuthenticationSessionStrategyDefault (*1*) 
+| AuthenticationSessionStrategyDefault (*1*)
 | AuthenticationStrategyDefault
 
-| AuthenticationSessionTracker#getInteraction : Interaction  
+| AuthenticationSessionTracker#getInteraction : Interaction
 | AuthenticationContext#currentInteraction : *Optional*<Interaction>
 
 | Clock (moved from applib module to fixture-applib module)
@@ -220,10 +217,10 @@ CommandServiceInternal -> CommandPublisher
 | MessageBroker is held by InteractionSession
 
 | QueryDefault removed
-| 
+|
 [line-through]#new QueryDefault<>(CommandJdo.class, "findByParent",
                         "parent", parent));#
-                        
+
 Query.named(CommandJdo.class, "findByParent") +
     .withParameter("parent", parent));
 
@@ -248,7 +245,7 @@ Query.named(CommandJdo.class, "findByParent") +
 <T> T detachedEntity(Class<T> ofType);     // <.>
 ----
 <.> if applicable use `<T> T detachedEntity(T entity)` instead ... "new is the new new", passing
-in a new-ed up (entity) instance is more flexible and also more error prone, eg. it allows the compiler to check 
+in a new-ed up (entity) instance is more flexible and also more error prone, eg. it allows the compiler to check
 validity of the used constructor rather than doing construction reflective at runtime
 
 
diff --git a/antora/components/system/modules/generated/pages/index/applib/annotation/Property.adoc b/antora/components/system/modules/generated/pages/index/applib/annotation/Property.adoc
index ba77536..34be6e0 100644
--- a/antora/components/system/modules/generated/pages/index/applib/annotation/Property.adoc
+++ b/antora/components/system/modules/generated/pages/index/applib/annotation/Property.adoc
@@ -26,7 +26,7 @@ Domain semantics for domain object property.
 
   int maxLength() default -1; // <.>
 
-  MementoSerialization mementoSerialization() default MementoSerialization.NOT_SPECIFIED; // <.>
+  Snapshot snapshot() default Snapshot.NOT_SPECIFIED; // <.>
 
   Class<? extends Specification>[] mustSatisfy() default {}; // <.>
 
@@ -107,7 +107,7 @@ The maximum entry length of a field.
 
 The default value (-1) indicates that no maxLength has been specified.
 --
-<.> `[teal]#*_mementoSerialization_*#` : `xref:system:generated:index/applib/annotation/MementoSerialization.adoc[MementoSerialization]`
+<.> `[teal]#*_snapshot_*#` : `xref:system:generated:index/applib/annotation/MementoSerialization.adoc[MementoSerialization]`
 +
 --
 Indicates whether the property should be included or excluded from mementos.
diff --git a/api/adoc/userguide/modules/fun/pages/view-models.adoc b/api/adoc/userguide/modules/fun/pages/view-models.adoc
index a5130ba..fef7075 100644
--- a/api/adoc/userguide/modules/fun/pages/view-models.adoc
+++ b/api/adoc/userguide/modules/fun/pages/view-models.adoc
@@ -241,7 +241,8 @@ public class CustomerRecordOnSAP {
     // ...
 }
 ----
-|Annotated with xref:refguide:applib-ant:DomainObject.adoc#nature[`@DomainObject#nature`] and a nature of `EXTERNAL_ENTITY`, with memento derived automatically from the properties of the domain object.  Collections are ignored, as are any properties annotated as xref:refguide:applib-ant:Property.adoc#mementoSerialization[memento serialization].
+|Annotated with xref:refguide:applib-ant:DomainObject.adoc#nature[`@DomainObject#nature`] and a nature of `EXTERNAL_ENTITY`, with memento derived automatically from the properties of the domain object.
+Collections are ignored, as are any properties annotated as xref:refguide:applib-ant:Property.adoc#snapshot[snapshot=EXCLUDED].
 
 | In-memory entity
 | WARNING: TODO INMEMORY_ENTITY was removed, this use-case is still valid for consideration, what to do?
diff --git a/api/applib/src/main/adoc/modules/applib-ant/pages/Property.adoc b/api/applib/src/main/adoc/modules/applib-ant/pages/Property.adoc
index 5f99732..b86a33c 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/pages/Property.adoc
+++ b/api/applib/src/main/adoc/modules/applib-ant/pages/Property.adoc
@@ -54,7 +54,7 @@ Maximum number of characters for string parameters; ignored otherwise +
 +
 TIP: In many/most cases you should however use xref:refguide:applib-ant:Column.adoc[`@Column#length()`]
 
-<.> xref:refguide:applib-ant:Property.adoc#mementoSerialization[`mementoSerialization()`]
+<.> xref:refguide:applib-ant:Property.adoc#snapshot[`snapshot()`]
 +
 Whether to exclude from snapshots. +
 
@@ -134,7 +134,7 @@ include::Property/fileAccept.adoc[leveloffset=+1]
 include::Property/hidden.adoc[leveloffset=+1]
 include::Property/maxLength.adoc[leveloffset=+1]
 include::Property/mustSatisfy.adoc[leveloffset=+1]
-include::Property/mementoSerialization.adoc[leveloffset=+1]
+include::Property/snapshot.adoc[leveloffset=+1]
 include::Property/optionality.adoc[leveloffset=+1]
 include::Property/projecting.adoc[leveloffset=+1]
 include::Property/regexPattern.adoc[leveloffset=+1]
diff --git a/api/applib/src/main/adoc/modules/applib-ant/pages/Property/mementoSerialization.adoc b/api/applib/src/main/adoc/modules/applib-ant/pages/Property/snapshot.adoc
similarity index 73%
rename from api/applib/src/main/adoc/modules/applib-ant/pages/Property/mementoSerialization.adoc
rename to api/applib/src/main/adoc/modules/applib-ant/pages/Property/snapshot.adoc
index 8b584a7..91ce4c7 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/pages/Property/mementoSerialization.adoc
+++ b/api/applib/src/main/adoc/modules/applib-ant/pages/Property/snapshot.adoc
@@ -1,12 +1,12 @@
-[#mementoSerialization]
-= `mementoSerialization()`
+[#snapshot]
+= `snapshot()`
 
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 :page-partial:
 
 CAUTION: this documentation may be inaccurate.
 
-The `mementoSerialization` attribute indicates whether the property should be included/excluded from any snapshots generated by the xref:refguide:applib-svc:XmlSnapshotService.adoc[`XmlSnapshotService`].
+The `snapshot` attribute indicates whether the property should be included/excluded from any snapshots generated by the xref:refguide:applib-svc:XmlSnapshotService.adoc[`XmlSnapshotService`].
 
 For example:
 
@@ -17,7 +17,7 @@ import lombok.Setter;
 
 public class Order {
 
-    @Property(mementoSerialization=EXCLUDED)
+    @Property(snapshot=EXCLUDED)
     @Getter @Setter
     private Order previousOrder;
 
@@ -35,7 +35,4 @@ public class Order {
 }
 ----
 
-== See also
-
-This attribute is also supported for xref:refguide:applib-ant:Collection.adoc#mementoSerialization[collections].
 
diff --git a/api/applib/src/main/adoc/modules/applib-ant/pages/view-models.adoc b/api/applib/src/main/adoc/modules/applib-ant/pages/view-models.adoc
index bcce4c8..cb115a0 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/pages/view-models.adoc
+++ b/api/applib/src/main/adoc/modules/applib-ant/pages/view-models.adoc
@@ -50,7 +50,7 @@ See this xref:userguide:btb:about.adoc#view-model-instantiation[tip] for further
 View models must have a no-arg constructor; this is used internally by the framework for subsequent "recreation".
 
 The view model's memento will be derived from the value of the view model object's properties.
-Any xref:refguide:applib-ant:Property.adoc#mementoSerialization[`@Property#mementoSerialization`] properties will be excluded from the memento, as will any properties excluded from the metamodel using xref:refguide:applib-ant:Programmatic.adoc[`@Programmatic`].
+Any properties annotated with xref:refguide:applib-ant:Programmatic.adoc[`@Programmatic`] will be excluded from the memento.
 Properties that are merely xref:refguide:applib-ant:Property.adoc#hidden[hidden] _are_ included in the memento.
 
 View models, as defined by `@DomainObject(nature=VIEW_MODEL)` have some limitations:
@@ -64,8 +64,8 @@ If you are using view models heavily, you may wish to restrict yourself to just
 
 [NOTE]
 ====
-The `@DomainObject` annotation allows the `objectType` to be specified, 
-meaning that it is compatible with the metamodel validation check enabled by the 
+The `@DomainObject` annotation allows the `objectType` to be specified,
+meaning that it is compatible with the metamodel validation check enabled by the
 xref:refguide:config:configuring-core.adoc#metamodel-validation[`explicitObjectType`] configuration property.
 
 Instead, use xref:refguide:applib-ant:DomainObject.adoc#nature[`@DomainObject#nature()`] with `Nature.VIEW_MODEL`, and specify xref:refguide:applib-ant:DomainObject.adoc#objectType[`@DomainObject#objectType()`].
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/Property.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/Property.java
index 1308583..526a68d 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/Property.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/Property.java
@@ -110,13 +110,13 @@ public @interface Property {
             default "";
 
     /**
-     * Whether {@link Interaction.Execution}s 
-     * (triggered property edits), should be dispatched to 
+     * Whether {@link Interaction.Execution}s
+     * (triggered property edits), should be dispatched to
      * {@link ExecutionSubscriber}s.
      */
     Publishing executionPublishing()
             default Publishing.NOT_SPECIFIED;
-    
+
     /**
      * For uploading {@link Blob} or {@link Clob}, optionally restrict the files accepted (eg <tt>.xslx</tt>).
      *
@@ -153,8 +153,8 @@ public @interface Property {
      *     <code>javax.jdo.annotations.NotPersistent</code>
      * </p>
      */
-    MementoSerialization mementoSerialization()
-            default MementoSerialization.NOT_SPECIFIED;
+    Snapshot snapshot()
+            default Snapshot.NOT_SPECIFIED;
 
     /**
      * The {@link org.apache.isis.applib.spec.Specification}(s) to be satisfied by this property.
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/MementoSerialization.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/Snapshot.java
similarity index 67%
rename from api/applib/src/main/java/org/apache/isis/applib/annotation/MementoSerialization.java
rename to api/applib/src/main/java/org/apache/isis/applib/annotation/Snapshot.java
index cf670a6..145951e 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/MementoSerialization.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/Snapshot.java
@@ -19,29 +19,26 @@
 package org.apache.isis.applib.annotation;
 
 /**
- * Whether the property or collection is included if the domain object is serialized into a memento.
- * @since 1.x {@index}
+ * Whether the property is included if the domain object graph is serialized
+ * into a snapshot.
+ * @since 2.x {@index}
  */
-public enum MementoSerialization {
+public enum Snapshot {
 
     /**
-     * Property or collection is included in any mementos.
+     * Property is included in any snapshots.
      * This is the fallback/default if not explicitly excluded.
      */
     INCLUDED,
 
     /**
-     * Property or collection's state is excluded from any mementos.
-     *
-     * <p>
-     *     Corresponds to <tt>@Property(notPersisted=true)</tt> or <tt>@Collection(notPersisted=true)</tt> prior to Isis 2.x
-     * </p>
+     * Property is excluded from any snapshots.
      */
     EXCLUDED,
 
     /**
-     * Ignore the value provided by this annotation (meaning that the framework will keep searching, in meta
-     * annotations or superclasses/interfaces).
+     * Ignore the value provided by this annotation (meaning that the framework
+     * will keep searching, in meta annotations or superclasses/interfaces).
      */
     NOT_SPECIFIED
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacet.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/SnapshotExcludeFacet.java
similarity index 94%
rename from core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacet.java
rename to core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/SnapshotExcludeFacet.java
index 029221c..fd3e341 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacet.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/SnapshotExcludeFacet.java
@@ -25,6 +25,6 @@ import org.apache.isis.core.metamodel.facetapi.Facet;
  * Indicates that a property should be excluded from snapshots (as per
  * <code>XmlSnapshotService</code>.
  */
-public interface MementoSerializationExcludeFacet extends Facet {
+public interface SnapshotExcludeFacet extends Facet {
 
 }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacetAbstract.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/SnapshotExcludeFacetAbstract.java
similarity index 81%
rename from core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacetAbstract.java
rename to core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/SnapshotExcludeFacetAbstract.java
index a8d17dd..5798aeb 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/MementoSerializationExcludeFacetAbstract.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/propcoll/memserexcl/SnapshotExcludeFacetAbstract.java
@@ -23,13 +23,13 @@ import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facetapi.FacetAbstract;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
 
-public abstract class MementoSerializationExcludeFacetAbstract extends FacetAbstract implements MementoSerializationExcludeFacet {
+public abstract class SnapshotExcludeFacetAbstract extends FacetAbstract implements SnapshotExcludeFacet {
 
     public static Class<? extends Facet> type() {
-        return MementoSerializationExcludeFacet.class;
+        return SnapshotExcludeFacet.class;
     }
 
-    public MementoSerializationExcludeFacetAbstract(final FacetHolder holder) {
+    public SnapshotExcludeFacetAbstract(final FacetHolder holder) {
         super(type(), holder);
     }
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactory.java
index e3d445d..57f46f1 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactory.java
@@ -55,7 +55,7 @@ import org.apache.isis.core.metamodel.facets.properties.property.modify.Property
 import org.apache.isis.core.metamodel.facets.properties.property.modify.PropertySetterFacetForDomainEventFromDefault;
 import org.apache.isis.core.metamodel.facets.properties.property.modify.PropertySetterFacetForDomainEventFromPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.mustsatisfy.MustSatisfySpecificationFacetForPropertyAnnotation;
-import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.MementoSerializationExcludeFacetForPropertyAnnotation;
+import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.SnapshotExcludeFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.regex.RegExFacetForPatternAnnotationOnProperty;
 import org.apache.isis.core.metamodel.facets.properties.property.regex.RegExFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacet;
@@ -315,7 +315,7 @@ implements MetaModelRefiner {
         val holder = processMethodContext.getFacetHolder();
 
         // search for @Property(notPersisted=...)
-        val facet = MementoSerializationExcludeFacetForPropertyAnnotation.create(propertyIfAny, holder);
+        val facet = SnapshotExcludeFacetForPropertyAnnotation.create(propertyIfAny, holder);
 
         super.addFacet(facet);
     }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/MementoSerializationExcludeFacetForPropertyAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/SnapshotExcludeFacetForPropertyAnnotation.java
similarity index 66%
rename from core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/MementoSerializationExcludeFacetForPropertyAnnotation.java
rename to core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/SnapshotExcludeFacetForPropertyAnnotation.java
index d69b5b0..494ebfc 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/MementoSerializationExcludeFacetForPropertyAnnotation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/property/notpersisted/SnapshotExcludeFacetForPropertyAnnotation.java
@@ -21,26 +21,26 @@ package org.apache.isis.core.metamodel.facets.properties.property.notpersisted;
 
 import java.util.Optional;
 
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacetAbstract;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacetAbstract;
 
-public class MementoSerializationExcludeFacetForPropertyAnnotation extends MementoSerializationExcludeFacetAbstract {
+public class SnapshotExcludeFacetForPropertyAnnotation extends SnapshotExcludeFacetAbstract {
 
-    public MementoSerializationExcludeFacetForPropertyAnnotation(final FacetHolder holder) {
+    public SnapshotExcludeFacetForPropertyAnnotation(final FacetHolder holder) {
         super(holder);
     }
 
-    public static MementoSerializationExcludeFacet create(
+    public static SnapshotExcludeFacet create(
             final Optional<Property> propertyIfAny,
             final FacetHolder holder) {
 
         return propertyIfAny
-                .map(Property::mementoSerialization)
-                .filter(mementoSerialization -> mementoSerialization == MementoSerialization.EXCLUDED)
-                .map(mementoSerialization -> new MementoSerializationExcludeFacetForPropertyAnnotation(holder))
+                .map(Property::snapshot)
+                .filter(snapshot -> snapshot == Snapshot.EXCLUDED)
+                .map(snapshot -> new SnapshotExcludeFacetForPropertyAnnotation(holder))
                 .orElse(null);
     }
 }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java
index 013bd29..0d66ed1 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/PropertySetAndClearFacetFactory.java
@@ -75,7 +75,7 @@ public class PropertySetAndClearFacetFactory extends MethodPrefixBasedFacetFacto
             FacetUtil.addFacet(new PropertySetterFacetViaSetterMethod(setMethod, property));
             FacetUtil.addFacet(new PropertyInitializationFacetViaSetterMethod(setMethod, property));
         } else {
-            FacetUtil.addFacet(new NotPersistableFacetInferred(property));
+            FacetUtil.addFacet(new SnapshotExcludeFacetInferred(property));
 
             // previously we also added the DisabledFacetAlwaysEverywhere facet here.
             // however, the PropertyModifyFacetFactory (which comes next) might install a PropertySetterFacet instead.
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/NotPersistableFacetInferred.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/SnapshotExcludeFacetInferred.java
similarity index 83%
rename from core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/NotPersistableFacetInferred.java
rename to core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/SnapshotExcludeFacetInferred.java
index 8846339..31a8ed8 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/NotPersistableFacetInferred.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/properties/update/SnapshotExcludeFacetInferred.java
@@ -20,11 +20,11 @@
 package org.apache.isis.core.metamodel.facets.properties.update;
 
 import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacetAbstract;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacetAbstract;
 
-public class NotPersistableFacetInferred extends MementoSerializationExcludeFacetAbstract {
+public class SnapshotExcludeFacetInferred extends SnapshotExcludeFacetAbstract {
 
-    public NotPersistableFacetInferred(final FacetHolder holder) {
+    public SnapshotExcludeFacetInferred(final FacetHolder holder) {
         super(holder);
     }
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java
index b6861c7..9f184c4 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/OneToOneAssociation.java
@@ -21,7 +21,7 @@ package org.apache.isis.core.metamodel.spec.feature;
 
 import org.apache.isis.core.metamodel.consent.Consent;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacet;
 import org.apache.isis.core.metamodel.spec.ManagedObject;
 
 /**
@@ -56,7 +56,7 @@ public interface OneToOneAssociation extends ObjectAssociation, OneToOneFeature,
      * not be persisted.
      */
     default boolean isNotPersisted() {
-        return containsFacet(MementoSerializationExcludeFacet.class);
+        return containsFacet(SnapshotExcludeFacet.class);
     }
 
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationMixedIn.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationMixedIn.java
index b42e35f..3b1c6a4 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationMixedIn.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToManyAssociationMixedIn.java
@@ -33,8 +33,8 @@ import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacetAbstract;
 import org.apache.isis.core.metamodel.facets.all.named.NamedFacetInferred;
 import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
 import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetForContributee;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacetAbstract;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacetAbstract;
 import org.apache.isis.core.metamodel.interactions.InteractionHead;
 import org.apache.isis.core.metamodel.services.publishing.ExecutionPublisher;
 import org.apache.isis.core.metamodel.spec.ManagedObject;
@@ -100,11 +100,11 @@ public class OneToManyAssociationMixedIn extends OneToManyAssociationDefault imp
         //
         // ensure the mixedIn collection cannot be modified, and derive its TypeOfFaccet
         //
-        final MementoSerializationExcludeFacet mementoSerializationExcludeFacet = new MementoSerializationExcludeFacetAbstract(this) {};
+        final SnapshotExcludeFacet snapshotExcludeFacet = new SnapshotExcludeFacetAbstract(this) {};
         final DisabledFacet disabledFacet = disabledFacet();
         final TypeOfFacet typeOfFacet = new TypeOfFacetAbstract(getSpecification().getCorrespondingClass(), this) {};
 
-        FacetUtil.addFacet(mementoSerializationExcludeFacet);
+        FacetUtil.addFacet(snapshotExcludeFacet);
         FacetUtil.addFacet(disabledFacet);
         FacetUtil.addFacet(typeOfFacet);
 
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
index a22194b..161abeb 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/PropertyMethodsFacetFactoryTest.java
@@ -35,7 +35,7 @@ import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContex
 import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.members.hidden.method.HideForContextFacetViaMethodFactory;
 import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacet;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacet;
 import org.apache.isis.core.metamodel.facets.properties.accessor.PropertyAccessorFacetViaAccessor;
 import org.apache.isis.core.metamodel.facets.properties.accessor.PropertyAccessorFacetViaAccessorFactory;
 import org.apache.isis.core.metamodel.facets.properties.autocomplete.PropertyAutoCompleteFacet;
@@ -48,7 +48,7 @@ import org.apache.isis.core.metamodel.facets.properties.defaults.PropertyDefault
 import org.apache.isis.core.metamodel.facets.properties.defaults.method.PropertyDefaultFacetViaMethod;
 import org.apache.isis.core.metamodel.facets.properties.defaults.method.PropertyDefaultFacetViaMethodFactory;
 import org.apache.isis.core.metamodel.facets.properties.disabled.inferred.DisabledFacetOnPropertyInferredFactory;
-import org.apache.isis.core.metamodel.facets.properties.update.NotPersistableFacetInferred;
+import org.apache.isis.core.metamodel.facets.properties.update.SnapshotExcludeFacetInferred;
 import org.apache.isis.core.metamodel.facets.properties.update.PropertyModifyFacetFactory;
 import org.apache.isis.core.metamodel.facets.properties.update.PropertySetAndClearFacetFactory;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacet;
@@ -175,8 +175,8 @@ public class PropertyMethodsFacetFactoryTest extends AbstractFacetFactoryTest {
 
         facetFactory.process(new FacetFactory.ProcessMethodContext(Customer.class, null, propertyAccessorMethod, methodRemover, facetedMethod));
 
-        assertNull(facetedMethod.getFacet(MementoSerializationExcludeFacet.class));
-        assertNull(facetedMethod.getFacet(MementoSerializationExcludeFacet.class));
+        assertNull(facetedMethod.getFacet(SnapshotExcludeFacet.class));
+        assertNull(facetedMethod.getFacet(SnapshotExcludeFacet.class));
     }
 
     public void testSetterFacetIsInstalledForModifyMethodAndMethodRemoved() {
@@ -239,9 +239,9 @@ public class PropertyMethodsFacetFactoryTest extends AbstractFacetFactoryTest {
         facetFactoryForModify.process(processMethodContext);
         disabledFacetOnPropertyInferredFactory.process(processMethodContext);
 
-        Facet facet = facetedMethod.getFacet(MementoSerializationExcludeFacet.class);
+        Facet facet = facetedMethod.getFacet(SnapshotExcludeFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof NotPersistableFacetInferred);
+        assertTrue(facet instanceof SnapshotExcludeFacetInferred);
 
         facet = facetedMethod.getFacet(DisabledFacet.class);
         assertNull(facet);
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/NotPersistedAnnotationOnPropertyFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/NotPersistedAnnotationOnPropertyFacetFactoryTest.java
index d38495d..b19f01a 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/NotPersistedAnnotationOnPropertyFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/NotPersistedAnnotationOnPropertyFacetFactoryTest.java
@@ -21,13 +21,13 @@ package org.apache.isis.core.metamodel.facets.properties.property;
 
 import java.lang.reflect.Method;
 
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
 import org.apache.isis.core.metamodel.facets.FacetFactory;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
-import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.MementoSerializationExcludeFacetForPropertyAnnotation;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacet;
+import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.SnapshotExcludeFacetForPropertyAnnotation;
 
 import lombok.val;
 
@@ -51,7 +51,7 @@ public class NotPersistedAnnotationOnPropertyFacetFactoryTest extends AbstractFa
 
         class Customer {
             @SuppressWarnings("unused")
-            @Property(mementoSerialization = MementoSerialization.EXCLUDED)
+            @Property(snapshot = Snapshot.EXCLUDED)
             public String getFirstName() {
                 return null;
             }
@@ -60,9 +60,9 @@ public class NotPersistedAnnotationOnPropertyFacetFactoryTest extends AbstractFa
 
         processNotPersisted(facetFactory, new FacetFactory.ProcessMethodContext(Customer.class, null, method, methodRemover, facetedMethod));
 
-        final Facet facet = facetedMethod.getFacet(MementoSerializationExcludeFacet.class);
+        final Facet facet = facetedMethod.getFacet(SnapshotExcludeFacet.class);
         assertNotNull(facet);
-        assertTrue(facet instanceof MementoSerializationExcludeFacetForPropertyAnnotation);
+        assertTrue(facet instanceof SnapshotExcludeFacetForPropertyAnnotation);
 
         assertNoMethodsRemoved();
     }
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactoryTest.java
index 8a636e1..0692b73 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/properties/property/PropertyAnnotationFacetFactoryTest.java
@@ -33,7 +33,7 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.junit.Assert.assertTrue;
 
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Optionality;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.Where;
@@ -54,7 +54,7 @@ import org.apache.isis.core.metamodel.facets.objectvalue.maxlen.MaxLengthFacet;
 import org.apache.isis.core.metamodel.facets.objectvalue.mustsatisfyspec.MustSatisfySpecificationFacet;
 import org.apache.isis.core.metamodel.facets.objectvalue.regex.RegExFacet;
 import org.apache.isis.core.metamodel.facets.propcoll.accessor.PropertyOrCollectionAccessorFacetAbstract;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacet;
 import org.apache.isis.core.metamodel.facets.properties.property.disabled.DisabledFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.hidden.HiddenFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.mandatory.MandatoryFacetForPropertyAnnotation;
@@ -67,7 +67,7 @@ import org.apache.isis.core.metamodel.facets.properties.property.modify.Property
 import org.apache.isis.core.metamodel.facets.properties.property.modify.PropertySetterFacetForDomainEventFromDefault;
 import org.apache.isis.core.metamodel.facets.properties.property.modify.PropertySetterFacetForDomainEventFromPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.mustsatisfy.MustSatisfySpecificationFacetForPropertyAnnotation;
-import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.MementoSerializationExcludeFacetForPropertyAnnotation;
+import org.apache.isis.core.metamodel.facets.properties.property.notpersisted.SnapshotExcludeFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.property.regex.RegExFacetForPropertyAnnotation;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacet;
 import org.apache.isis.core.metamodel.facets.properties.update.clear.PropertyClearFacetAbstract;
@@ -581,7 +581,7 @@ public class PropertyAnnotationFacetFactoryTest extends AbstractFacetFactoryJUni
         public void withAnnotation() {
 
             class Customer {
-                @Property(mementoSerialization = MementoSerialization.EXCLUDED)
+                @Property(snapshot = Snapshot.EXCLUDED)
                 @Getter @Setter private String name;
             }
 
@@ -595,9 +595,9 @@ public class PropertyAnnotationFacetFactoryTest extends AbstractFacetFactoryJUni
             processNotPersisted(facetFactory, processMethodContext);
 
             // then
-            final MementoSerializationExcludeFacet mementoSerializationExcludeFacet = facetedMethod.getFacet(MementoSerializationExcludeFacet.class);
-            Assert.assertNotNull(mementoSerializationExcludeFacet);
-            Assert.assertTrue(mementoSerializationExcludeFacet instanceof MementoSerializationExcludeFacetForPropertyAnnotation);
+            final SnapshotExcludeFacet snapshotExcludeFacet = facetedMethod.getFacet(SnapshotExcludeFacet.class);
+            Assert.assertNotNull(snapshotExcludeFacet);
+            Assert.assertTrue(snapshotExcludeFacet instanceof SnapshotExcludeFacetForPropertyAnnotation);
         }
 
     }
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationAbstractTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationAbstractTest.java
index d22993d..79716b5 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationAbstractTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/specloader/specimpl/OneToOneAssociationAbstractTest.java
@@ -36,7 +36,7 @@ import org.apache.isis.core.internaltestsupport.jmocking.JUnitRuleMockery2.Mode;
 import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.core.metamodel.facetapi.Facet;
 import org.apache.isis.core.metamodel.facets.FacetedMethod;
-import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.MementoSerializationExcludeFacet;
+import org.apache.isis.core.metamodel.facets.propcoll.memserexcl.SnapshotExcludeFacet;
 import org.apache.isis.core.metamodel.interactions.UsabilityContext;
 import org.apache.isis.core.metamodel.interactions.VisibilityContext;
 import org.apache.isis.core.metamodel.spec.ManagedObject;
@@ -148,14 +148,14 @@ public class OneToOneAssociationAbstractTest {
 
     @Test
     public void notPersistedWhenDerived() throws Exception {
-        final MementoSerializationExcludeFacet mockFacet = mockFacetIgnoring(MementoSerializationExcludeFacet.class);
+        final SnapshotExcludeFacet mockFacet = mockFacetIgnoring(SnapshotExcludeFacet.class);
         facetedMethod.addFacet(mockFacet);
         assertTrue(objectAssociation.isNotPersisted());
     }
 
     @Test
     public void notPersistedWhenFlaggedAsNotPersisted() throws Exception {
-        final MementoSerializationExcludeFacet mockFacet = mockFacetIgnoring(MementoSerializationExcludeFacet.class);
+        final SnapshotExcludeFacet mockFacet = mockFacetIgnoring(SnapshotExcludeFacet.class);
         facetedMethod.addFacet(mockFacet);
         assertTrue(objectAssociation.isNotPersisted());
     }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java
index edcbff2..1ba84b8 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_description.java
@@ -22,7 +22,7 @@ import javax.inject.Inject;
 
 import org.apache.isis.applib.annotation.LabelPosition;
 import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
 import org.apache.isis.applib.annotation.Where;
@@ -33,7 +33,7 @@ import lombok.RequiredArgsConstructor;
 import demoapp.dom._infra.resources.AsciiDocReaderService;
 
 @SuppressWarnings("CdiManagedBeanInconsistencyInspection")
-@Property(mementoSerialization = MementoSerialization.EXCLUDED)
+@Property(snapshot = Snapshot.EXCLUDED)
 @RequiredArgsConstructor
 public class HasAsciiDocDescription_description {
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java b/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java
index 9aec142..1f0a24b 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/_infra/asciidocdesc/HasAsciiDocDescription_sources.java
@@ -22,7 +22,7 @@ import javax.inject.Inject;
 
 import org.apache.isis.applib.annotation.LabelPosition;
 import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
 import org.apache.isis.applib.annotation.Where;
@@ -33,7 +33,7 @@ import lombok.val;
 
 import demoapp.dom._infra.resources.MarkupVariableResolverService;
 
-@Property(mementoSerialization = MementoSerialization.EXCLUDED)
+@Property(snapshot = Snapshot.EXCLUDED)
 @RequiredArgsConstructor @SuppressWarnings("CdiManagedBeanInconsistencyInspection")
 public class HasAsciiDocDescription_sources {
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
index e755465..e781e8d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Action/associateWith/child/ActionAssociateWithVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-This child object exists just to act as the element of the two collections of the `PropertyMementoSerializationVm` demo object.
+This child object exists just to act as the element of the two collections of the `PropertySnapshotVm` demo object.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
index aaf17a7..e284d38 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/PropertyMenu.java
@@ -30,7 +30,7 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.value.Blob;
 import org.apache.isis.applib.value.Clob;
 
-import demoapp.dom.annotDomain.Property.mementoSerialization.PropertyMementoSerializationVm;
+import demoapp.dom.annotDomain.Property.snapshot.PropertySnapshotVm;
 import lombok.RequiredArgsConstructor;
 import lombok.val;
 
@@ -50,6 +50,7 @@ import demoapp.dom.annotDomain.Property.projecting.PropertyProjectingVm;
 import demoapp.dom.annotDomain.Property.projecting.child.PropertyProjectingChildVm;
 import demoapp.dom.annotDomain.Property.projecting.jdo.PropertyProjectingChildJdoEntities;
 import demoapp.dom.annotDomain.Property.regexPattern.PropertyRegexPatternVm;
+import demoapp.dom.annotDomain.Property.snapshot.child.PropertySnapshotChildVm;
 import demoapp.dom.types.Samples;
 
 @DomainService(nature=NatureOfService.VIEW, objectType = "demo.PropertyMenu")
@@ -132,13 +133,6 @@ public class PropertyMenu {
     }
 
     @Action(semantics = SemanticsOf.SAFE)
-    @ActionLayout(cssClassFa="fa-camera", describedAs = "Snapshot inclusion/exclusion")
-    public PropertyMementoSerializationVm mementoSerialization(){
-        val vm = new PropertyMementoSerializationVm("value");
-        return new PropertyMementoSerializationVm("value");
-    }
-
-    @Action(semantics = SemanticsOf.SAFE)
     @ActionLayout(cssClassFa="fa-star-half-alt", describedAs = "Regular expressions, such as email")
     public PropertyMustSatisfyVm mustSatisfy(){
         val vm = new PropertyMustSatisfyVm();
@@ -182,6 +176,18 @@ public class PropertyMenu {
         return vm;
     }
 
+    @Action(semantics = SemanticsOf.SAFE)
+    @ActionLayout(cssClassFa="fa-camera", describedAs = "Snapshot inclusion/exclusion")
+    public PropertySnapshotVm snapshot(){
+        val vm = new PropertySnapshotVm("value");
+
+        vm.getChildren().add(new PropertySnapshotChildVm("child 1"));
+        vm.getChildren().add(new PropertySnapshotChildVm("child 2"));
+        vm.getChildren().add(new PropertySnapshotChildVm("child 3"));
+
+        return new PropertySnapshotVm("value");
+    }
+
     private void setSampleBlob(String suffix, Consumer<Blob> blobConsumer) {
         blobSamples.stream()
                 .filter(x -> x.getName().endsWith(suffix))
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm-description.adoc
similarity index 92%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc
rename to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm-description.adoc
index 0c0bd9b..ff7689d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm-description.adoc
@@ -1,6 +1,6 @@
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-The `mementoSerialization` element of the `@Property` annotation specifies whether a property should be included in an XML snapshot, as created by the `XmlSnapshotService`:
+The `snapshot` element of the `@Property` annotation specifies whether a property should be included in an XML snapshot, as created by the `XmlSnapshotService`:
 
 The `takeSnapshot` mixin action shows how this service is used:
 
@@ -76,3 +76,11 @@ include::MementoSerializationExcludedMetaAnnotation.java[tags=class]
 == Snapshot
 
 TODO: inline the resultant snapshot
+
+[source,xml]
+.snapshot.xml
+----
+----
+
+
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm.java
similarity index 72%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm.java
index abb8b44..370e279 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm.java
@@ -16,18 +16,23 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.annotDomain.Property.mementoSerialization;
+package demoapp.dom.annotDomain.Property.snapshot;
+
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
+import org.apache.isis.applib.annotation.Collection;
 import org.apache.isis.applib.annotation.DomainObject;
 import org.apache.isis.applib.annotation.Editing;
 import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.Property;
 import org.apache.isis.applib.annotation.PropertyLayout;
@@ -37,19 +42,20 @@ import lombok.NoArgsConstructor;
 import lombok.Setter;
 
 import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom.annotDomain.Property.snapshot.child.PropertySnapshotChildVm;
 
 @XmlRootElement(name = "root")
 @XmlType
 @XmlAccessorType(XmlAccessType.FIELD)
 @DomainObject(
     nature=Nature.VIEW_MODEL,
-    objectType = "demo.PropertyMementoSerializationVm",
+    objectType = "demo.PropertySnapshotVm",
     editing = Editing.ENABLED
 )
 @NoArgsConstructor
-public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
+public class PropertySnapshotVm implements HasAsciiDocDescription {
 
-    public PropertyMementoSerializationVm(String text) {
+    public PropertySnapshotVm(String text) {
         this.text = text;
         this.excludedProperty = text;
         this.includedProperty = text;
@@ -59,7 +65,7 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
     }
 
     public String title() {
-        return "PropertyMementoSerializationVm";
+        return "PropertySnapshotVm";
     }
 
 //tag::no-annotation[]
@@ -72,10 +78,10 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
 
 //tag::annotated-not_specified[]
     @Property(
-        mementoSerialization = MementoSerialization.NOT_SPECIFIED
+        snapshot = Snapshot.NOT_SPECIFIED
     )
     @PropertyLayout(
-        describedAs = "@Property(mementoSerialization = NOT_SPECIFIED)"
+        describedAs = "@Property(snapshot = NOT_SPECIFIED)"
     )
     @MemberOrder(name = "annotations", sequence = "1")
     @XmlElement(required = true)
@@ -85,10 +91,10 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
 
 //tag::annotated-excluded[]
     @Property(
-        mementoSerialization = MementoSerialization.EXCLUDED
+        snapshot = Snapshot.EXCLUDED
     )
     @PropertyLayout(
-        describedAs = "@Property(mementoSerialization = EXCLUDED)"
+        describedAs = "@Property(snapshot = EXCLUDED)"
     )
     @MemberOrder(name = "annotations", sequence = "2")
     @XmlElement(required = true)
@@ -98,10 +104,10 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
 
 //tag::annotated-included[]
     @Property(
-        mementoSerialization = MementoSerialization.INCLUDED
+        snapshot = Snapshot.INCLUDED
     )
     @PropertyLayout(
-        describedAs = "@Property(mementoSerialization = INCLUDED)"
+        describedAs = "@Property(snapshot = INCLUDED)"
     )
     @MemberOrder(name = "annotations", sequence = "2")
     @XmlElement(required = true)
@@ -110,10 +116,10 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
 //end::annotated-included[]
 
 //tag::meta-annotated-excluded[]
-    @MementoSerializationExcludedMetaAnnotation     // <.>
+    @SnapshotExcludedMetaAnnotation     // <.>
     @Property()
     @PropertyLayout(
-        describedAs = "@MementoSerializationExcludedMetaAnnotation "
+        describedAs = "@SnapshotExcludedMetaAnnotation "
     )
     @MemberOrder(name = "meta-annotations", sequence = "1")
     @XmlElement(required = true)
@@ -122,14 +128,14 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
 //end::meta-annotated-excluded[]
 
 //tag::meta-annotated-included[]
-    @MementoSerializationIncludedMetaAnnotation                 // <.>
+    @SnapshotIncludedMetaAnnotation                 // <.>
     @Property(
-        mementoSerialization = MementoSerialization.EXCLUDED    // <.>
+        snapshot = Snapshot.EXCLUDED    // <.>
     )
     @PropertyLayout(
         describedAs =
-            "@MementoSerializationIncludedMetaAnnotation "
-            + "@Property(mementoSerialization = EXCLUDED)"
+            "@SnapshotIncludedMetaAnnotation "
+            + "@Property(snapshot = EXCLUDED)"
     )
     @MemberOrder(name = "meta-annotations-overridden", sequence = "1")
     @XmlElement(required = true)
@@ -137,4 +143,13 @@ public class PropertyMementoSerializationVm implements HasAsciiDocDescription {
     private String metaAnnotatedPropertyOverridden;
 //end::meta-annotated-included[]
 
+//tag::children[]
+    @Getter @Setter
+    @Collection
+    @XmlElementWrapper(name = "children")
+    @XmlElement(name = "child")
+    private List<PropertySnapshotChildVm> children = new ArrayList<>();
+//end::children[]
+
+
 }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm.layout.xml
similarity index 97%
copy from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml
copy to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm.layout.xml
index 8c2abe6..82a1249 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm.layout.xml
@@ -18,7 +18,7 @@
 	<bs3:row>
 		<bs3:col span="10" unreferencedActions="true">
 			<cpt:domainObject />
-			<cpt:action id="takeSnapshot"/>
+			<cpt:action id="takeXmlSnapshot"/>
 		</bs3:col>
 		<bs3:col span="2">
 			<cpt:fieldSet name="" id="sources" />
@@ -34,6 +34,7 @@
 					<cpt:fieldSet name="Meta-annotated" id="meta-annotations"/>
 					<cpt:fieldSet name="Meta-annotated overrriden" id="meta-annotated-overrriden"/>
 					<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+					<cpt:collection id="children"/>
 				</bs3:col>
 			</bs3:row>
 		</bs3:col>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm_takeXmlSnapshot.java
similarity index 65%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm_takeXmlSnapshot.java
index bb49d51..7843394 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm_takeSnapshot.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/PropertySnapshotVm_takeXmlSnapshot.java
@@ -16,7 +16,9 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.annotDomain.Property.mementoSerialization;
+package demoapp.dom.annotDomain.Property.snapshot;
+
+import java.util.Locale;
 
 import javax.inject.Inject;
 
@@ -34,22 +36,41 @@ import lombok.val;
     semantics = SemanticsOf.SAFE
 )
 @RequiredArgsConstructor
-public class PropertyMementoSerializationVm_takeSnapshot {
+public class PropertySnapshotVm_takeXmlSnapshot {
 
     @Inject XmlSnapshotService xmlSnapshotService;
     @Inject XmlService xmlService;
 
-    private final PropertyMementoSerializationVm vm;
+    private final PropertySnapshotVm vm;
+
+    public static enum FileType {
+        XML,
+        XSD
+    }
 
 //tag::class[]
-    public Clob act(String fileName) {
+    public Clob act(
+            final FileType fileType,
+            final String fileName,
+            final boolean includeChildren,
+            final boolean forceIncludeExcluded) {
         val builder = xmlSnapshotService.builderFor(vm);
+        if(includeChildren) {
+            builder.includePath("children");
+        }
+        if(forceIncludeExcluded) {
+            builder.includePath("excludedProperty");
+        }
         val snapshot = builder.build();
-        val doc = snapshot.getXmlDocument();
+        val doc = fileType == FileType.XML
+                ? snapshot.getXmlDocument() : snapshot.getXsdDocument();
         return asClob(xmlService.asString(doc), fileName);
     }
-    public String default0Act() {
-        return "snapshot.xml";
+    public FileType default0Act() {
+        return FileType.XML;
+    }
+    public String default1Act(final FileType fileType) {
+        return "snapshot." + fileType.name().toLowerCase();
     }
 
     private static Clob asClob(final String xmlStr, final String fileName) {
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationIncludedMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/SnapshotExcludedMetaAnnotation.java
similarity index 82%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationIncludedMetaAnnotation.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/SnapshotExcludedMetaAnnotation.java
index c7725c1..1312704 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationIncludedMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/SnapshotExcludedMetaAnnotation.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.annotDomain.Property.mementoSerialization;
+package demoapp.dom.annotDomain.Property.snapshot;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
@@ -24,17 +24,17 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Property;
 
 //tag::class[]
-@Property(mementoSerialization = MementoSerialization.INCLUDED) // <.>
+@Property(snapshot = Snapshot.EXCLUDED) // <.>
 @Inherited
 @Target({
         ElementType.METHOD, ElementType.FIELD                   // <.>
 })
 @Retention(RetentionPolicy.RUNTIME)
-public @interface MementoSerializationIncludedMetaAnnotation {
+public @interface SnapshotExcludedMetaAnnotation {
 
 }
 //end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationExcludedMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/SnapshotIncludedMetaAnnotation.java
similarity index 82%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationExcludedMetaAnnotation.java
rename to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/SnapshotIncludedMetaAnnotation.java
index e8d399c..abcf653 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/MementoSerializationExcludedMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/SnapshotIncludedMetaAnnotation.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.annotDomain.Property.mementoSerialization;
+package demoapp.dom.annotDomain.Property.snapshot;
 
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
@@ -24,17 +24,17 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Property;
 
 //tag::class[]
-@Property(mementoSerialization = MementoSerialization.EXCLUDED) // <.>
+@Property(snapshot = Snapshot.INCLUDED) // <.>
 @Inherited
 @Target({
         ElementType.METHOD, ElementType.FIELD                   // <.>
 })
 @Retention(RetentionPolicy.RUNTIME)
-public @interface MementoSerializationExcludedMetaAnnotation {
+public @interface SnapshotIncludedMetaAnnotation {
 
 }
 //end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm-description.adoc
similarity index 89%
copy from examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc
copy to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm-description.adoc
index a2f1be1..d34d5a3 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm-description.adoc
@@ -1,3 +1,5 @@
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-This object exists just to be referenced by the `PropertyMementoSerializationVm` demo object.
+TODO
+
+This (child) object ...
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/XmlSnapshotParentVm.java b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm.java
similarity index 52%
copy from examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/XmlSnapshotParentVm.java
copy to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm.java
index cacc2f6..6f2cf9d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/XmlSnapshotParentVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package demoapp.dom.services.core.xmlSnapshotService;
+package demoapp.dom.annotDomain.Property.snapshot.child;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -24,76 +24,73 @@ import java.util.List;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
 import javax.xml.bind.annotation.XmlRootElement;
 import javax.xml.bind.annotation.XmlType;
 
 import org.apache.isis.applib.annotation.Collection;
-import org.apache.isis.applib.annotation.CollectionLayout;
 import org.apache.isis.applib.annotation.DomainObject;
-import org.apache.isis.applib.annotation.Editing;
 import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MementoSerialization;
 import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Snapshot;
 
-import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom.services.core.xmlSnapshotService.child.XmlSnapshotChildVm;
-import demoapp.dom.services.core.xmlSnapshotService.peer.XmlSnapshotPeerVm;
 import lombok.Getter;
 import lombok.NoArgsConstructor;
 import lombok.Setter;
-import lombok.val;
 
-@XmlRootElement(name = "root")
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom.annotDomain.Property.hidden.PropertyHiddenVm;
+import demoapp.dom.annotDomain.Property.snapshot.SnapshotExcludedMetaAnnotation;
+import demoapp.dom.annotDomain.Property.snapshot.SnapshotIncludedMetaAnnotation;
+
+//tag::class[]
+@XmlRootElement(name = "child")
 @XmlType
 @XmlAccessorType(XmlAccessType.FIELD)
 @DomainObject(
-    nature=Nature.VIEW_MODEL,
-    objectType = "demo.XmlSnapshotParentVm"
+        nature=Nature.VIEW_MODEL,
+        objectType = "demo.PropertyHiddenChildVm"
 )
 @NoArgsConstructor
-public class XmlSnapshotParentVm implements HasAsciiDocDescription {
+public class PropertySnapshotChildVm implements HasAsciiDocDescription {
 
-    public XmlSnapshotParentVm(String text) {
-        this.text = text;
-        this.otherText = text;
+    public PropertySnapshotChildVm(String value) {
+        excludedProperty = value;
+        includedProperty = value;
     }
 
     public String title() {
-        return "XmlSnapshotService parent VM";
+        return "Property#xmlSnapshot (child object)";
     }
 
-    @Property(editing = Editing.ENABLED)
-    @MemberOrder(name = "properties", sequence = "1")
+//tag::annotated-excluded[]
+    @Property(
+        snapshot = Snapshot.EXCLUDED
+    )
+    @PropertyLayout(
+        describedAs = "@Property(snapshot = EXCLUDED)"
+    )
+    @MemberOrder(name = "annotations", sequence = "2")
     @XmlElement(required = true)
     @Getter @Setter
-    private String text;
+    private String excludedProperty;
+//end::annotated-excluded[]
 
-    @Property(editing = Editing.ENABLED, mementoSerialization = MementoSerialization.EXCLUDED)
-    @MemberOrder(name = "properties", sequence = "2")
+//tag::annotated-included[]
+    @Property(
+            snapshot = Snapshot.INCLUDED
+    )
+    @PropertyLayout(
+            describedAs = "@Property(snapshot = INCLUDED)"
+    )
+    @MemberOrder(name = "annotations", sequence = "2")
     @XmlElement(required = true)
     @Getter @Setter
-    private String otherText;
-
-    @Property(editing = Editing.ENABLED)
-    @MemberOrder(name = "properties", sequence = "3")
-    @XmlElement(required = false)
-    @Getter @Setter
-    private XmlSnapshotPeerVm peer;
-
-//tag::class-collections-children[]
-    @Collection()
-    @CollectionLayout()
-    @Getter
-    private List<XmlSnapshotChildVm> children = new ArrayList<>();
+    private String includedProperty;
+//end::annotated-included[]
 
-    // ...
-//end::class-collections-children[]
-
-    public XmlSnapshotParentVm addChild(final String value) {
-        val childVm = new XmlSnapshotChildVm(value);
-        getChildren().add(childVm);
-        return this;
-    }
 
 }
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm.layout.xml
similarity index 83%
rename from examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml
rename to examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm.layout.xml
index 8c2abe6..70f0ba4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/mementoSerialization/PropertyMementoSerializationVm.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Property/snapshot/child/PropertySnapshotChildVm.layout.xml
@@ -15,10 +15,10 @@
         xmlns:cpt="http://isis.apache.org/applib/layout/component"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
+
 	<bs3:row>
 		<bs3:col span="10" unreferencedActions="true">
 			<cpt:domainObject />
-			<cpt:action id="takeSnapshot"/>
 		</bs3:col>
 		<bs3:col span="2">
 			<cpt:fieldSet name="" id="sources" />
@@ -27,15 +27,10 @@
 
 	<bs3:row>
 		<bs3:col span="6">
-			<bs3:row>
-				<bs3:col span="12">
-					<cpt:fieldSet name="Not annotated" id="no-annotations"/>
-					<cpt:fieldSet name="Annotated" id="annotations"/>
-					<cpt:fieldSet name="Meta-annotated" id="meta-annotations"/>
-					<cpt:fieldSet name="Meta-annotated overrriden" id="meta-annotated-overrriden"/>
-					<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
-				</bs3:col>
-			</bs3:row>
+			<cpt:fieldSet name="Properties" id="variants"/>
+			<cpt:fieldSet name="Meta-annotated" id="meta-annotated"/>
+			<cpt:fieldSet name="Meta-annotated Overridden" id="meta-annotated-overridden"/>
+			<cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
 		</bs3:col>
 		<bs3:col span="6">
 			<cpt:fieldSet name="Description" id="description" >
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 c2e5bb1..9154ba2 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
@@ -153,11 +153,11 @@ For latest we use: https://raw.githubusercontent.com/apache/isis/master/antora/s
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="fileAccept"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="hidden"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="maxLength"/>
-                <mb3:serviceAction objectType="demo.PropertyMenu" id="mementoSerialization"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="mustSatisfy"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="optionality"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="projecting"/>
                 <mb3:serviceAction objectType="demo.PropertyMenu" id="regexPattern"/>
+                <mb3:serviceAction objectType="demo.PropertyMenu" id="snapshot"/>
             </mb3:section>
         </mb3:menu>
 
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/XmlSnapshotParentVm.java b/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/XmlSnapshotParentVm.java
index cacc2f6..f887f87 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/XmlSnapshotParentVm.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/XmlSnapshotParentVm.java
@@ -32,7 +32,7 @@ import org.apache.isis.applib.annotation.CollectionLayout;
 import org.apache.isis.applib.annotation.DomainObject;
 import org.apache.isis.applib.annotation.Editing;
 import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.MementoSerialization;
+import org.apache.isis.applib.annotation.Snapshot;
 import org.apache.isis.applib.annotation.Nature;
 import org.apache.isis.applib.annotation.Property;
 
@@ -69,7 +69,7 @@ public class XmlSnapshotParentVm implements HasAsciiDocDescription {
     @Getter @Setter
     private String text;
 
-    @Property(editing = Editing.ENABLED, mementoSerialization = MementoSerialization.EXCLUDED)
+    @Property(editing = Editing.ENABLED, snapshot = Snapshot.EXCLUDED)
     @MemberOrder(name = "properties", sequence = "2")
     @XmlElement(required = true)
     @Getter @Setter
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
index e755465..e781e8d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/child/XmlSnapshotChildVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-This child object exists just to act as the element of the two collections of the `PropertyMementoSerializationVm` demo object.
+This child object exists just to act as the element of the two collections of the `PropertySnapshotVm` demo object.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc
index a2f1be1..063e761 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/services/core/xmlSnapshotService/peer/XmlSnapshotPeerVm-description.adoc
@@ -1,3 +1,3 @@
 :Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
 
-This object exists just to be referenced by the `PropertyMementoSerializationVm` demo object.
+This object exists just to be referenced by the `PropertySnapshotVm` demo object.


[isis] 01/06: ISIS-439: removes @Collection#editing and makes all collections disabled always

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 42b9723a35a3c9196fc3d262a5798f4fd0621272
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Tue Jan 12 08:47:04 2021 +0000

    ISIS-439: removes @Collection#editing and makes all collections disabled always
---
 .../pages/2020/2.0.0-M3/migrating-to-2.0.0.adoc    |  6 ++
 .../pages/index/applib/annotation/Collection.adoc  | 16 -----
 .../applib-ant/examples/annotation/Collection.java | 21 -------
 .../adoc/modules/applib-ant/pages/Collection.adoc  |  9 ---
 .../applib-ant/pages/Collection/editing.adoc       | 63 --------------------
 .../modules/applib-ant/pages/Property/editing.adoc |  1 -
 .../apache/isis/applib/annotation/Collection.java  | 10 +---
 .../isis/applib/domain/DomainObjectList.java       |  3 +-
 .../CollectionAnnotationFacetFactory.java          | 10 ++--
 .../disabled/DisabledFacetForCollection.java       | 37 ++++++++++++
 .../DisabledFacetForCollectionAnnotation.java      | 69 ----------------------
 .../CollectionAnnotationFacetFactoryTest.java      | 29 ++++-----
 ...bledAnnotationOnCollectionFacetFactoryTest.java |  8 +--
 .../dom/annotDomain/Collection/editing/.gitkeep    |  0
 .../secman/jdo/dom/role/ApplicationRole.java       |  7 +--
 .../secman/jdo/dom/tenancy/ApplicationTenancy.java |  3 +-
 .../secman/jdo/dom/user/ApplicationUser.java       |  7 +--
 17 files changed, 72 insertions(+), 227 deletions(-)

diff --git a/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M3/migrating-to-2.0.0.adoc b/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M3/migrating-to-2.0.0.adoc
index a902707..9c18943 100644
--- a/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M3/migrating-to-2.0.0.adoc
+++ b/antora/components/relnotes/modules/ROOT/pages/2020/2.0.0-M3/migrating-to-2.0.0.adoc
@@ -724,6 +724,12 @@ isis.value-types. +
 
 
 
+=== Annotations
+
+Collections are no longer editable.
+The `@Collection#editing()` and `@Collection#editingDisabledReason()` members have been removed.
+
+
 === No longer any archetypes
 
 The archetypes have been replaced by starter apps.
diff --git a/antora/components/system/modules/generated/pages/index/applib/annotation/Collection.adoc b/antora/components/system/modules/generated/pages/index/applib/annotation/Collection.adoc
index 3fa05c7..352b425 100644
--- a/antora/components/system/modules/generated/pages/index/applib/annotation/Collection.adoc
+++ b/antora/components/system/modules/generated/pages/index/applib/annotation/Collection.adoc
@@ -10,10 +10,6 @@ Domain semantics for domain object collection.
 
   Class<? extends CollectionDomainEvent<?, ?>> domainEvent() default CollectionDomainEvent.Default.class; // <.>
 
-  Editing editing() default Editing.NOT_SPECIFIED; // <.>
-
-  String editingDisabledReason() default ""; // <.>
-
   Where hidden() default Where.NOT_SPECIFIED; // <.>
 
   Class<?> typeOf() default Object.class; // <.>
@@ -39,18 +35,6 @@ public class Order {
 
 This subclass must provide a no-arg constructor; the fields are set reflectively.
 --
-<.> `[teal]#*_editing_*#` : `xref:system:generated:index/applib/annotation/Editing.adoc[Editing]`
-+
---
-Whether the properties of this domain object can be edited, or collections of this object be added to/removed from.
-
-Note that non-editable objects can nevertheless have actions invoked upon them.
---
-<.> `[teal]#*_editingDisabledReason_*#` : `String`
-+
---
-If _#editing()_ is set to _Editing#DISABLED_ , then the reason to provide to the user as to why this property cannot be edited.
---
 <.> `[teal]#*_hidden_*#` : `xref:system:generated:index/applib/annotation/Where.adoc[Where]`
 +
 --
diff --git a/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Collection.java b/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Collection.java
index 33aeaf3..30e790e 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Collection.java
+++ b/api/applib/src/main/adoc/modules/applib-ant/examples/annotation/Collection.java
@@ -69,27 +69,6 @@ public @interface Collection {
 
     // end::refguide[]
     /**
-     * Whether the properties of this domain object can be edited, or collections of this object be added to/removed from.
-     *
-     * <p>
-     *     Note that non-editable objects can nevertheless have actions invoked upon them.
-     * </p>
-     */
-    // tag::refguide[]
-    Editing editing()                                           // <.>
-            default Editing.NOT_SPECIFIED;
-
-    // end::refguide[]
-    /**
-     * If {@link #editing()} is set to {@link Editing#DISABLED},
-     * then the reason to provide to the user as to why this property cannot be edited.
-     */
-    // tag::refguide[]
-    String editingDisabledReason()                              // <.>
-            default "";
-
-    // end::refguide[]
-    /**
      * Indicates when the collection is not visible to the user.
      */
     // tag::refguide[]
diff --git a/api/applib/src/main/adoc/modules/applib-ant/pages/Collection.adoc b/api/applib/src/main/adoc/modules/applib-ant/pages/Collection.adoc
index 0fc7006..3bbd45f 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/pages/Collection.adoc
+++ b/api/applib/src/main/adoc/modules/applib-ant/pages/Collection.adoc
@@ -14,14 +14,6 @@ include::refguide:applib-ant:example$annotation/Collection.java[tags="refguide"]
 +
 The event type to be posted to the xref:refguide:applib-svc:EventBusService.adoc[`EventBusService`] to broadcast the collection's business rule checking (hide, disable, validate) and its modification (before and after).
 
-<.> xref:refguide:applib-ant:Collection.adoc#editing[`editing()`]
-+
-Whether a collection can be added to or removed from within the UI
-
-<.> `editingDisabledReason()`
-+
-If `editing()` is `DISABLED`, provides a reason as to why.
-
 <.> xref:refguide:applib-ant:Collection.adoc#hidden[`hidden()`]
 +
 Indicates where (in the UI) the collection should be hidden from the user.
@@ -70,6 +62,5 @@ so that boilerplate-busting tools such as link:https://projectlombok.org/[Projec
 
 
 include::Collection/domainEvent.adoc[leveloffset=+1]
-include::Collection/editing.adoc[leveloffset=+1]
 include::Collection/hidden.adoc[leveloffset=+1]
 include::Collection/typeOf.adoc[leveloffset=+1]
diff --git a/api/applib/src/main/adoc/modules/applib-ant/pages/Collection/editing.adoc b/api/applib/src/main/adoc/modules/applib-ant/pages/Collection/editing.adoc
deleted file mode 100644
index 4b30d3e..0000000
--- a/api/applib/src/main/adoc/modules/applib-ant/pages/Collection/editing.adoc
+++ /dev/null
@@ -1,63 +0,0 @@
-[#editing]
-= `editing()`
-
-:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or ag [...]
-:page-partial:
-
-
-
-The `editing()` annotation indicates whether a collection can be added to or removed from within the UI.
-
-The related `editingDisabledReason` attribute specifies the a hard-coded reason why the collection cannot be modified directly.
-
-[WARNING]
-====
-The xref:vw:ROOT:about.adoc[Wicket viewer] does *not* currently support the modification of collections; they are rendered read-only.
-
-The workaround is to create add/remove actions and use xref:refguide:applib-ant:MemberOrder.adoc[UI hints] to render them close to the collection.
-====
-
-Whether a collection is enabled or disabled depends upon these factors:
-
-* whether the domain object has been configured as immutable through the xref:refguide:applib-ant:DomainObject.adoc#editing[`@DomainObject#editing()`] attribute
-
-* else (that is, if the domain object's editability is specified as being `AS_CONFIGURED`), then the value of the
-xref:refguide:config:sections/isis.applib.adoc#isis.applib.annotation.domain-object.editing['isis.applib.annotation.domain-object.editing'] configuration property.
-If set to `false`, then the object's collections (and properties) are *not* editable
-
-* else, then the value of the `@Collection(editing=...)` attribute itself.
-
-* else, the result of invoking any supporting xref:refguide:applib-methods:prefixes.adoc#disable[`disable...()`] supporting methods
-
-
-Thus, to make a collection read-only even if the object would otherwise be editable, use:
-
-[source,java]
-----
-import lombok.Getter;
-import lombok.Setter;
-
-public class ToDoItem {
-
-    @Collection(
-        editing=Editing.DISABLED,
-        editingDisabledReason="Use the add and remove actions to modify"
-    )
-    @Getter @Setter
-    private SortedSet<ToDoItem> dependencies = ...
-
-}
-----
-
-[NOTE]
-====
-To reiterate, it is _not_ possible to enable editing for a collection if editing has been disabled at the object-level.
-====
-
-== See also
-
-This attribute can also be specified for:
-
-* xref:refguide:applib-ant:Property.adoc#editing[properties]
-* xref:refguide:applib-ant:DomainObject.adoc#editing[domain object]
-
diff --git a/api/applib/src/main/adoc/modules/applib-ant/pages/Property/editing.adoc b/api/applib/src/main/adoc/modules/applib-ant/pages/Property/editing.adoc
index 97a865b..b949914 100644
--- a/api/applib/src/main/adoc/modules/applib-ant/pages/Property/editing.adoc
+++ b/api/applib/src/main/adoc/modules/applib-ant/pages/Property/editing.adoc
@@ -44,5 +44,4 @@ public class Customer {
 
 This attribute can also be specified for:
 
-* xref:refguide:applib-ant:Collection.adoc#editing[collections]
 * xref:refguide:applib-ant:DomainObject.adoc#editing[domain object].
diff --git a/api/applib/src/main/java/org/apache/isis/applib/annotation/Collection.java b/api/applib/src/main/java/org/apache/isis/applib/annotation/Collection.java
index eeec4a6..86cdc89 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/annotation/Collection.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/annotation/Collection.java
@@ -29,7 +29,7 @@ import org.apache.isis.applib.events.domain.CollectionDomainEvent;
 
 /**
  * Domain semantics for domain object collection.
- * 
+ *
  * @since 1.x {@index}
  */
 @Inherited
@@ -75,14 +75,6 @@ public @interface Collection {
      */
     Editing editing()
             default Editing.NOT_SPECIFIED;
-
-    /**
-     * If {@link #editing()} is set to {@link Editing#DISABLED},
-     * then the reason to provide to the user as to why this property cannot be edited.
-     */
-    String editingDisabledReason()
-            default "";
-
     /**
      * Indicates when the collection is not visible to the user.
      */
diff --git a/api/applib/src/main/java/org/apache/isis/applib/domain/DomainObjectList.java b/api/applib/src/main/java/org/apache/isis/applib/domain/DomainObjectList.java
index 7dfe76a..97072ae 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/domain/DomainObjectList.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/domain/DomainObjectList.java
@@ -164,8 +164,7 @@ public class DomainObjectList {
     private List<Object> objects = new ArrayList<>();
 
     @Collection(
-            domainEvent = ObjectsDomainEvent.class,
-            editing = Editing.DISABLED
+            domainEvent = ObjectsDomainEvent.class
             )
     public List<Object> getObjects() {
         return objects;
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactory.java
index ee2bfea..84fdca4 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactory.java
@@ -37,7 +37,7 @@ import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacetInferredF
 import org.apache.isis.core.metamodel.facets.actions.contributing.ContributingFacetAbstract;
 import org.apache.isis.core.metamodel.facets.actions.contributing.ContributingFacet.Contributing;
 import org.apache.isis.core.metamodel.facets.actions.semantics.ActionSemanticsFacetAbstract;
-import org.apache.isis.core.metamodel.facets.collections.collection.disabled.DisabledFacetForCollectionAnnotation;
+import org.apache.isis.core.metamodel.facets.collections.collection.disabled.DisabledFacetForCollection;
 import org.apache.isis.core.metamodel.facets.collections.collection.hidden.HiddenFacetForCollectionAnnotation;
 import org.apache.isis.core.metamodel.facets.collections.collection.modify.CollectionAddToFacetForDomainEventFromAbstract;
 import org.apache.isis.core.metamodel.facets.collections.collection.modify.CollectionAddToFacetForDomainEventFromCollectionAnnotation;
@@ -73,7 +73,7 @@ public class CollectionAnnotationFacetFactory extends FacetFactoryAbstract {
 
         processModify(processMethodContext, collectionIfAny);
         processHidden(processMethodContext, collectionIfAny);
-        processEditing(processMethodContext, collectionIfAny);
+        processEditing(processMethodContext);
         processTypeOf(processMethodContext, collectionIfAny);
     }
 
@@ -208,11 +208,9 @@ public class CollectionAnnotationFacetFactory extends FacetFactoryAbstract {
         super.addFacet(facet);
     }
 
-    void processEditing(final ProcessMethodContext processMethodContext, Optional<Collection> collectionIfAny) {
+    void processEditing(final ProcessMethodContext processMethodContext) {
         val holder = processMethodContext.getFacetHolder();
-
-        // check for @Collection(editing=...)
-        val facet = DisabledFacetForCollectionAnnotation.create(collectionIfAny, holder);
+        val facet = DisabledFacetForCollection.create(holder);
 
         super.addFacet(facet);
     }
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollection.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollection.java
new file mode 100644
index 0000000..b99e1b1
--- /dev/null
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollection.java
@@ -0,0 +1,37 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.metamodel.facets.collections.collection.disabled;
+
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.core.metamodel.facetapi.FacetHolder;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
+import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAbstractImpl;
+
+public class DisabledFacetForCollection extends DisabledFacetAbstractImpl {
+
+    public static DisabledFacet create(final FacetHolder holder) {
+        return new DisabledFacetForCollection(holder);
+    }
+
+    private DisabledFacetForCollection(final FacetHolder holder) {
+        super(Where.EVERYWHERE, "Always disabled", holder);
+    }
+
+}
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollectionAnnotation.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollectionAnnotation.java
deleted file mode 100644
index 39faaf0..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollectionAnnotation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.collection.disabled;
-
-import java.util.Optional;
-
-import org.apache.isis.applib.annotation.Collection;
-import org.apache.isis.applib.annotation.Editing;
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAbstractImpl;
-
-public class DisabledFacetForCollectionAnnotation extends DisabledFacetAbstractImpl {
-
-    public static DisabledFacet create(
-            final Optional<Collection> collectionIfAny,
-            final FacetHolder holder) {
-
-        return collectionIfAny
-                .filter(collection -> collection.editing() != Editing.NOT_SPECIFIED)
-                .map(collection -> {
-                    final Editing editing = collection.editing();
-                    final String disabledReason = collection.editingDisabledReason();
-
-                    switch (editing) {
-                    case AS_CONFIGURED:
-
-                        // nothing needs to be done here; the DomainObjectFactory (processing @DomainObject annotation)
-                        // will install an ImmutableFacetForDomainObjectAnnotation on the domain object and then a
-                        // DisabledFacetOnCollectionDerivedFromImmutable facet will be installed.
-
-                        return null;
-
-                    case DISABLED:
-                        return (DisabledFacet)new DisabledFacetForCollectionAnnotation(disabledReason, holder);
-
-                    case ENABLED:
-                        return null;
-                    default:
-                        break;
-                    }
-                    throw new IllegalStateException("editing '" + editing + "' not recognised");
-                })
-                .orElse(null);
-    }
-
-    private DisabledFacetForCollectionAnnotation(final String reason, final FacetHolder holder) {
-        super(Where.EVERYWHERE, reason, holder);
-    }
-
-}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactoryTest.java
index 5405423..18657e1 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactoryTest.java
@@ -5,9 +5,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License. You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -43,7 +43,6 @@ import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacetInferredFromArray;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacetInferredFromGenerics;
 import org.apache.isis.core.metamodel.facets.all.hide.HiddenFacet;
-import org.apache.isis.core.metamodel.facets.collections.collection.disabled.DisabledFacetForCollectionAnnotation;
 import org.apache.isis.core.metamodel.facets.collections.collection.hidden.HiddenFacetForCollectionAnnotation;
 import org.apache.isis.core.metamodel.facets.collections.collection.modify.CollectionAddToFacetForDomainEventFromCollectionAnnotation;
 import org.apache.isis.core.metamodel.facets.collections.collection.modify.CollectionAddToFacetForDomainEventFromDefault;
@@ -94,13 +93,13 @@ public class CollectionAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
             }
         });
     }
-    
+
     private static void processModify(
             CollectionAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val collectionIfAny = processMethodContext.synthesizeOnMethod(Collection.class);
         facetFactory.processModify(processMethodContext, collectionIfAny);
     }
-    
+
     private static void processHidden(
             CollectionAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val collectionIfAny = processMethodContext.synthesizeOnMethod(Collection.class);
@@ -110,16 +109,16 @@ public class CollectionAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
     private static void processEditing(
             CollectionAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val collectionIfAny = processMethodContext.synthesizeOnMethod(Collection.class);
-        facetFactory.processEditing(processMethodContext, collectionIfAny);
+        facetFactory.processEditing(processMethodContext);
     }
-    
+
     private static void processTypeOf(
             CollectionAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val collectionIfAny = processMethodContext.synthesizeOnMethod(Collection.class);
         facetFactory.processTypeOf(processMethodContext, collectionIfAny);
     }
 
-    
+
     @Before
     public void setUp() throws Exception {
         facetFactory = new CollectionAnnotationFacetFactory();
@@ -432,6 +431,9 @@ public class CollectionAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
 
     }
 
+    /**
+     * This feature has been removed, so this is a negative test
+     */
     public static class Editing extends CollectionAnnotationFacetFactoryTest {
 
         @Test
@@ -440,10 +442,7 @@ public class CollectionAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
             class Order {
             }
             class Customer {
-                @Collection(
-                        editing = org.apache.isis.applib.annotation.Editing.DISABLED,
-                        editingDisabledReason = "you cannot edit the orders collection"
-                        )
+                @Collection()
                 public List<Order> getOrders() {
                     return null;
                 }
@@ -464,10 +463,6 @@ public class CollectionAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
             // then
             final DisabledFacet disabledFacet = facetedMethod.getFacet(DisabledFacet.class);
             Assert.assertNotNull(disabledFacet);
-            Assert.assertTrue(disabledFacet instanceof DisabledFacetForCollectionAnnotation);
-            final DisabledFacetForCollectionAnnotation disabledFacetImpl = (DisabledFacetForCollectionAnnotation) disabledFacet;
-            assertThat(disabledFacet.where(), is(Where.EVERYWHERE));
-            assertThat(disabledFacetImpl.getReason(), is("you cannot edit the orders collection"));
         }
     }
 
@@ -567,4 +562,4 @@ public class CollectionAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
 
     }
 
-}
\ No newline at end of file
+}
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/DisabledAnnotationOnCollectionFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/DisabledAnnotationOnCollectionFacetFactoryTest.java
index 9556f33..51082ec 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/DisabledAnnotationOnCollectionFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/DisabledAnnotationOnCollectionFacetFactoryTest.java
@@ -50,17 +50,17 @@ public class DisabledAnnotationOnCollectionFacetFactoryTest extends AbstractFace
         facetFactory = null;
         super.tearDown();
     }
-    
+
     private static void processEditing(
             CollectionAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
         val collectionIfAny = processMethodContext.synthesizeOnMethod(Collection.class);
-        facetFactory.processEditing(processMethodContext, collectionIfAny);
+        facetFactory.processEditing(processMethodContext);
     }
 
 
-    public void testDisabledAnnotationPickedUpOnCollection() {
+    public void testDisabledFacetPickedUpOnCollection() {
         class Customer {
-            @org.apache.isis.applib.annotation.Collection(editing = Editing.DISABLED)
+            @org.apache.isis.applib.annotation.Collection()
             public java.util.Collection<?> getOrders() {
                 return null;
             }
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Collection/editing/.gitkeep b/examples/demo/domain/src/main/java/demoapp/dom/annotDomain/Collection/editing/.gitkeep
deleted file mode 100644
index e69de29..0000000
diff --git a/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/role/ApplicationRole.java b/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/role/ApplicationRole.java
index d4f5e5e..9355370 100644
--- a/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/role/ApplicationRole.java
+++ b/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/role/ApplicationRole.java
@@ -87,12 +87,12 @@ import lombok.Setter;
 @DomainObjectLayout(
         bookmarking = BookmarkPolicy.AS_ROOT
         )
-public class ApplicationRole 
+public class ApplicationRole
 implements org.apache.isis.extensions.secman.api.role.ApplicationRole, Comparable<ApplicationRole> {
 
     @Inject private ApplicationFeatureRepository applicationFeatureRepository;
     @Inject private ApplicationPermissionRepository applicationPermissionRepository;
-    
+
     // -- name (property)
 
     public static class NameDomainEvent extends PropertyDomainEvent<String> {}
@@ -167,8 +167,7 @@ implements org.apache.isis.extensions.secman.api.role.ApplicationRole, Comparabl
 
     @javax.jdo.annotations.Persistent(mappedBy = "roles")
     @Collection(
-            domainEvent = UsersDomainEvent.class,
-            editing = Editing.DISABLED
+            domainEvent = UsersDomainEvent.class
             )
     @CollectionLayout(
             defaultView="table"
diff --git a/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/tenancy/ApplicationTenancy.java b/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/tenancy/ApplicationTenancy.java
index 6e0dd1b..21b371c 100644
--- a/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/tenancy/ApplicationTenancy.java
+++ b/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/tenancy/ApplicationTenancy.java
@@ -143,8 +143,7 @@ org.apache.isis.extensions.secman.api.tenancy.ApplicationTenancy {
 
     @javax.jdo.annotations.Persistent(mappedBy = "parent")
     @Collection(
-            domainEvent = ChildrenDomainEvent.class,
-            editing = Editing.DISABLED
+            domainEvent = ChildrenDomainEvent.class
             )
     @CollectionLayout(
             defaultView="table"
diff --git a/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/user/ApplicationUser.java b/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/user/ApplicationUser.java
index a71ebae..85d6c20 100644
--- a/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/user/ApplicationUser.java
+++ b/extensions/security/secman/persistence-jdo/src/main/java/org/apache/isis/extensions/secman/jdo/dom/user/ApplicationUser.java
@@ -124,7 +124,7 @@ import lombok.val;
 //    middle= {"Contact Details"},
 //    right= {"Status", "AtPath"}
 //)
-public class ApplicationUser implements Comparable<ApplicationUser>, 
+public class ApplicationUser implements Comparable<ApplicationUser>,
 org.apache.isis.extensions.secman.api.user.ApplicationUser {
 
     @Inject private ApplicationUserRepository applicationUserRepository;
@@ -371,8 +371,7 @@ org.apache.isis.extensions.secman.api.user.ApplicationUser {
     @javax.jdo.annotations.Join(column="userId")
     @javax.jdo.annotations.Element(column="roleId")
     @Collection(
-            domainEvent = RolesDomainEvent.class,
-            editing = Editing.DISABLED
+            domainEvent = RolesDomainEvent.class
             )
     @CollectionLayout(
             defaultView="table"
@@ -431,7 +430,7 @@ org.apache.isis.extensions.secman.api.user.ApplicationUser {
     // -- equals, hashCode, compareTo, toString
     private static final String propertyNames = "username";
 
-    private static final ObjectContract<ApplicationUser> contract = 
+    private static final ObjectContract<ApplicationUser> contract =
             ObjectContracts.parse(ApplicationUser.class, propertyNames);
 
 


[isis] 05/06: ISIS-439: fully remove installing DisabledFacet for collections.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit daa74024f9b91f9aa63896de95423a28d37438e6
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jan 14 18:38:26 2021 +0000

    ISIS-439: fully remove installing DisabledFacet for collections.
    
    Also potential fixes for XmlSnapshotService to honour @Property(mementoSerialization=...)
---
 .../core/metamodel/util/snapshot/XmlSnapshot.java  |  3 +
 .../CollectionAnnotationFacetFactoryTest.java      | 40 -----------
 ...bledAnnotationOnCollectionFacetFactoryTest.java | 82 ----------------------
 3 files changed, 3 insertions(+), 122 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/snapshot/XmlSnapshot.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/snapshot/XmlSnapshot.java
index 6c72124..c3bd5ee 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/snapshot/XmlSnapshot.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/util/snapshot/XmlSnapshot.java
@@ -695,6 +695,9 @@ public class XmlSnapshot implements Snapshot {
                 }
 
                 final OneToOneAssociation valueAssociation = ((OneToOneAssociation) field);
+                if(valueAssociation.isNotPersisted()) {
+                    continue eachField;
+                }
                 final Element xmlValueElement = xmlFieldElement; // more meaningful locally scoped name
 
                 ManagedObject value;
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactoryTest.java
index 18657e1..ba5dbf0 100644
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactoryTest.java
+++ b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactoryTest.java
@@ -106,11 +106,6 @@ public class CollectionAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
         facetFactory.processHidden(processMethodContext, collectionIfAny);
     }
 
-    private static void processEditing(
-            CollectionAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
-        val collectionIfAny = processMethodContext.synthesizeOnMethod(Collection.class);
-        facetFactory.processEditing(processMethodContext);
-    }
 
     private static void processTypeOf(
             CollectionAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
@@ -431,41 +426,6 @@ public class CollectionAnnotationFacetFactoryTest extends AbstractFacetFactoryJU
 
     }
 
-    /**
-     * This feature has been removed, so this is a negative test
-     */
-    public static class Editing extends CollectionAnnotationFacetFactoryTest {
-
-        @Test
-        public void withAnnotation() {
-
-            class Order {
-            }
-            class Customer {
-                @Collection()
-                public List<Order> getOrders() {
-                    return null;
-                }
-
-                public void setOrders(final List<Order> orders) {
-                }
-            }
-
-            // given
-            final Class<?> cls = Customer.class;
-            collectionMethod = findMethod(Customer.class, "getOrders");
-
-            // when
-            final FacetFactory.ProcessMethodContext processMethodContext = new FacetFactory.ProcessMethodContext(cls,
-                    null, collectionMethod, mockMethodRemover, facetedMethod);
-            processEditing(facetFactory, processMethodContext);
-
-            // then
-            final DisabledFacet disabledFacet = facetedMethod.getFacet(DisabledFacet.class);
-            Assert.assertNotNull(disabledFacet);
-        }
-    }
-
     public static class TypeOf extends CollectionAnnotationFacetFactoryTest {
 
 
diff --git a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/DisabledAnnotationOnCollectionFacetFactoryTest.java b/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/DisabledAnnotationOnCollectionFacetFactoryTest.java
deleted file mode 100644
index 51082ec..0000000
--- a/core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/collections/collection/DisabledAnnotationOnCollectionFacetFactoryTest.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.collection;
-
-import java.lang.reflect.Method;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import org.apache.isis.applib.annotation.Collection;
-import org.apache.isis.applib.annotation.Editing;
-import org.apache.isis.core.metamodel.facetapi.Facet;
-import org.apache.isis.core.metamodel.facets.AbstractFacetFactoryTest;
-import org.apache.isis.core.metamodel.facets.FacetFactory;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAbstract;
-
-import lombok.val;
-
-public class DisabledAnnotationOnCollectionFacetFactoryTest extends AbstractFacetFactoryTest {
-
-    private CollectionAnnotationFacetFactory facetFactory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        facetFactory = new CollectionAnnotationFacetFactory();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        facetFactory = null;
-        super.tearDown();
-    }
-
-    private static void processEditing(
-            CollectionAnnotationFacetFactory facetFactory, FacetFactory.ProcessMethodContext processMethodContext) {
-        val collectionIfAny = processMethodContext.synthesizeOnMethod(Collection.class);
-        facetFactory.processEditing(processMethodContext);
-    }
-
-
-    public void testDisabledFacetPickedUpOnCollection() {
-        class Customer {
-            @org.apache.isis.applib.annotation.Collection()
-            public java.util.Collection<?> getOrders() {
-                return null;
-            }
-        }
-        final Method actionMethod = findMethod(Customer.class, "getOrders");
-
-        processEditing(facetFactory, new FacetFactory.ProcessMethodContext(Customer.class, null, actionMethod, methodRemover, facetedMethod));
-
-        final Facet facet = facetedMethod.getFacet(DisabledFacet.class);
-        assertNotNull(facet);
-        assertTrue(facet instanceof DisabledFacetAbstract);
-
-        final DisabledFacet disabledFacet = (DisabledFacet) facet;
-        assertThat(disabledFacet.disabledReason(null), is("Always disabled"));
-
-        assertNoMethodsRemoved();
-    }
-
-}


[isis] 04/06: ISIS-439: completely removes the DisabledFacetForCollection

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4c3c5c182f6127e65aa0dfa68800c703f3ce4f3b
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Wed Jan 13 18:39:33 2021 +0000

    ISIS-439: completely removes the DisabledFacetForCollection
    
    what I had before wasn't quite right - was making _everything_ immutable!
---
 .../CollectionAnnotationFacetFactory.java          | 11 +------
 .../disabled/DisabledFacetForCollection.java       | 37 ----------------------
 2 files changed, 1 insertion(+), 47 deletions(-)

diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactory.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactory.java
index 84fdca4..c9dea13 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactory.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/CollectionAnnotationFacetFactory.java
@@ -34,10 +34,9 @@ import org.apache.isis.core.metamodel.facets.FacetFactoryAbstract;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacet;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacetInferredFromArray;
 import org.apache.isis.core.metamodel.facets.actcoll.typeof.TypeOfFacetInferredFromGenerics;
-import org.apache.isis.core.metamodel.facets.actions.contributing.ContributingFacetAbstract;
 import org.apache.isis.core.metamodel.facets.actions.contributing.ContributingFacet.Contributing;
+import org.apache.isis.core.metamodel.facets.actions.contributing.ContributingFacetAbstract;
 import org.apache.isis.core.metamodel.facets.actions.semantics.ActionSemanticsFacetAbstract;
-import org.apache.isis.core.metamodel.facets.collections.collection.disabled.DisabledFacetForCollection;
 import org.apache.isis.core.metamodel.facets.collections.collection.hidden.HiddenFacetForCollectionAnnotation;
 import org.apache.isis.core.metamodel.facets.collections.collection.modify.CollectionAddToFacetForDomainEventFromAbstract;
 import org.apache.isis.core.metamodel.facets.collections.collection.modify.CollectionAddToFacetForDomainEventFromCollectionAnnotation;
@@ -73,7 +72,6 @@ public class CollectionAnnotationFacetFactory extends FacetFactoryAbstract {
 
         processModify(processMethodContext, collectionIfAny);
         processHidden(processMethodContext, collectionIfAny);
-        processEditing(processMethodContext);
         processTypeOf(processMethodContext, collectionIfAny);
     }
 
@@ -208,13 +206,6 @@ public class CollectionAnnotationFacetFactory extends FacetFactoryAbstract {
         super.addFacet(facet);
     }
 
-    void processEditing(final ProcessMethodContext processMethodContext) {
-        val holder = processMethodContext.getFacetHolder();
-        val facet = DisabledFacetForCollection.create(holder);
-
-        super.addFacet(facet);
-    }
-
 
     void processTypeOf(final ProcessMethodContext processMethodContext, Optional<Collection> collectionIfAny) {
 
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollection.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollection.java
deleted file mode 100644
index b99e1b1..0000000
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/facets/collections/collection/disabled/DisabledFacetForCollection.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-
-package org.apache.isis.core.metamodel.facets.collections.collection.disabled;
-
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.core.metamodel.facetapi.FacetHolder;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacet;
-import org.apache.isis.core.metamodel.facets.members.disabled.DisabledFacetAbstractImpl;
-
-public class DisabledFacetForCollection extends DisabledFacetAbstractImpl {
-
-    public static DisabledFacet create(final FacetHolder holder) {
-        return new DisabledFacetForCollection(holder);
-    }
-
-    private DisabledFacetForCollection(final FacetHolder holder) {
-        super(Where.EVERYWHERE, "Always disabled", holder);
-    }
-
-}