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/26 15:57:14 UTC

[isis-app-simpleapp] branch ISIS-1628 updated (60b948b -> 9b30204)

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

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


 discard 60b948b  rebase on jdo, add title() inheritance test
 discard d3f6c92  ISIS-1628: adds example
     add ddf5559  fixes webapp launch with build against current Apache Isis 'master'
     add c392af1  fixes tests
     add 3e21ec0  Merge branch 'jdo' into v2.0.0-jdo-SNAPSHOT
     add f1d87a6  Merge pull request #3 from apache/v2.0.0-jdo-SNAPSHOT
     new 4b4ab51  ISIS-1628: adds example
     new 8b6c78b  ISIS-1628: no longer requires method to be overridden in mixin subclass.
     new 2cd4389  ISIS-1628: no longer requires method to be overridden in mixin subclass.
     new b958b6c  rebase on jdo, add title() inheritance test
     new 9b30204  adds test to throw an exception

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   (60b948b)
            \
             N -- N -- N   refs/heads/ISIS-1628 (9b30204)

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 5 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:
 .../domainapp/modules/simple/SimpleModule.java     |  9 ++--
 .../modules/simple/dom/so/SimpleObject.java        | 10 ++--
 .../modules/simple/dom/so/SimpleObject.layout.xml  | 25 +++++++---
 .../simple/mixins/CollectionCountSubscriber.java   | 34 +++++++++++++
 .../modules/simple/mixins/Collection_count.java    | 19 ++++++--
 .../mixins/SimpleObject_numberOfChildren.java      | 11 +++--
 .../simple/mixins/SimpleObject_throwException.java | 21 ++++++++
 .../integtests/SimpleModuleIntegTestAbstract.java  | 29 +----------
 .../SimpleModuleTestConfiguration_usingJdo.java    | 56 ++++++++++++++++++++++
 webapp/pom.xml                                     |  8 ++++
 .../main/java/domainapp/webapp/AppManifest.java    |  5 +-
 .../integtests/ApplicationIntegTestAbstract.java   | 41 +++-------------
 .../metamodel/SwaggerExport_IntegTest.java         | 12 ++---
 13 files changed, 184 insertions(+), 96 deletions(-)
 create mode 100644 module-simple/src/main/java/domainapp/modules/simple/mixins/CollectionCountSubscriber.java
 create mode 100644 module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_throwException.java
 create mode 100644 module-simple/src/test/java/domainapp/modules/simple/integtests/SimpleModuleTestConfiguration_usingJdo.java


[isis-app-simpleapp] 01/05: ISIS-1628: adds example

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

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

commit 4b4ab516c8a5fe18a384077c8c2ae9b2ba8c31ad
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jan 21 18:33:45 2021 +0000

    ISIS-1628: adds example
---
 .../modules/simple/dom/co/SimpleChildObject.java   | 47 ++++++++++++++++++++++
 .../modules/simple/dom/so/SimpleObject.java        | 15 +++++++
 .../modules/simple/dom/so/SimpleObject.layout.xml  |  5 +++
 .../modules/simple/mixins/Collection_count.java    | 20 +++++++++
 .../mixins/SimpleObject_numberOfChildren.java      | 30 ++++++++++++++
 5 files changed, 117 insertions(+)

diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/co/SimpleChildObject.java b/module-simple/src/main/java/domainapp/modules/simple/dom/co/SimpleChildObject.java
new file mode 100644
index 0000000..3bc605a
--- /dev/null
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/co/SimpleChildObject.java
@@ -0,0 +1,47 @@
+package domainapp.modules.simple.dom.co;
+
+import java.util.Comparator;
+
+import javax.jdo.annotations.IdGeneratorStrategy;
+import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.VersionStrategy;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.isis.applib.annotation.DomainObject;
+import org.apache.isis.applib.annotation.DomainObjectLayout;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.annotation.Where;
+import org.apache.isis.applib.jaxb.PersistentEntityAdapter;
+
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import domainapp.modules.simple.dom.so.SimpleObject;
+
+@javax.jdo.annotations.PersistenceCapable(identityType=IdentityType.DATASTORE, schema = "simple")
+@javax.jdo.annotations.DatastoreIdentity(strategy=IdGeneratorStrategy.IDENTITY, column="id")
+@javax.jdo.annotations.Version(strategy= VersionStrategy.DATE_TIME, column="version")
+@javax.jdo.annotations.Unique(name="SimpleChildObject_name_UNQ", members = {"simpleObject", "name"})
+@DomainObject()
+@DomainObjectLayout()
+@XmlJavaTypeAdapter(PersistentEntityAdapter.class)
+@ToString(onlyExplicitlyIncluded = true)
+public class SimpleChildObject implements Comparable<SimpleChildObject> {
+
+	@PropertyLayout(hidden = Where.PARENTED_TABLES)
+	@Getter @Setter
+	private SimpleObject simpleObject;
+
+	@Getter @Setter
+	private String name;
+
+	private final static Comparator<SimpleChildObject> comparator =
+            Comparator.comparing(SimpleChildObject::getName);
+
+    @Override
+    public int compareTo(final SimpleChildObject other) {
+        return comparator.compare(this, other);
+    }
+
+}
diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
index 8fbf95a..0db79b9 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
@@ -1,10 +1,12 @@
 package domainapp.modules.simple.dom.so;
 
 import java.util.Comparator;
+import java.util.Set;
 
 import javax.inject.Inject;
 import javax.jdo.annotations.IdGeneratorStrategy;
 import javax.jdo.annotations.IdentityType;
+import javax.jdo.annotations.Persistent;
 import javax.jdo.annotations.VersionStrategy;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
@@ -21,6 +23,7 @@ import static org.apache.isis.applib.annotation.SemanticsOf.IDEMPOTENT;
 import static org.apache.isis.applib.annotation.SemanticsOf.NON_IDEMPOTENT_ARE_YOU_SURE;
 
 import domainapp.modules.simple.SimpleModule;
+import domainapp.modules.simple.dom.co.SimpleChildObject;
 import domainapp.modules.simple.types.Name;
 import domainapp.modules.simple.types.Notes;
 
@@ -66,6 +69,18 @@ public class SimpleObject implements Comparable<SimpleObject> {
     @Getter @Setter
     private String notes;
 
+    @Persistent(mappedBy = "simpleObject")
+    @Getter @Setter
+    private Set<SimpleChildObject> children;
+
+    @Action
+    public SimpleObject addChild(String name) {
+    	SimpleChildObject child = new SimpleChildObject();
+    	child.setName(name);
+    	child.setSimpleObject(this);
+    	repositoryService.persist(child);
+    	return this;
+    }
 
     public static class UpdateNameActionDomainEvent extends ActionDomainEvent {}
     @Action(semantics = IDEMPOTENT,
diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml
index a970956..0bd636d 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml
@@ -21,6 +21,11 @@
                                 </c:property>
                                 <c:property id="notes"/>
                             </c:fieldSet>
+                            <c:fieldSet name="Contributed by Collection_count Mixin" id="other" unreferencedProperties="true">
+                                <c:property id="numberOfChildren">
+                                    <c:named>Number Of Children</c:named>
+                                </c:property>
+                            </c:fieldSet>
                         </bs3:col>
                     </bs3:row>
                 </bs3:tab>
diff --git a/module-simple/src/main/java/domainapp/modules/simple/mixins/Collection_count.java b/module-simple/src/main/java/domainapp/modules/simple/mixins/Collection_count.java
new file mode 100644
index 0000000..861ac47
--- /dev/null
+++ b/module-simple/src/main/java/domainapp/modules/simple/mixins/Collection_count.java
@@ -0,0 +1,20 @@
+package domainapp.modules.simple.mixins;
+
+import java.util.Collection;
+
+import org.apache.isis.applib.annotation.Property;
+
+@Property
+public abstract class Collection_count {
+	
+	private final Collection<?> collection;
+	public Collection_count(Collection<?> collection) {
+		super();
+		this.collection = collection;
+	}
+	
+	public int prop() {
+		return collection.size();
+	}
+
+}
diff --git a/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_numberOfChildren.java b/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_numberOfChildren.java
new file mode 100644
index 0000000..c4d810a
--- /dev/null
+++ b/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_numberOfChildren.java
@@ -0,0 +1,30 @@
+package domainapp.modules.simple.mixins;
+
+import org.apache.isis.applib.annotation.Property;
+
+import domainapp.modules.simple.dom.so.SimpleObject;
+
+/*
+ * ISIS-1628: the @Property mixin annotation of the abstract super class is ignored and
+ * needs to be duplicated on the concrete sub class.
+ * 
+ * To replicate the problem remove this annotation and see how the contribution disappears from the UI.
+ */
+@Property
+public class SimpleObject_numberOfChildren extends Collection_count {
+
+	public SimpleObject_numberOfChildren(SimpleObject simpleObject) {
+		super(simpleObject.getChildren());
+	}
+
+	/*
+	 * ISIS-1628: the prop() method of the abstract super class needs to
+	 * be overridden in the concrete sub class.
+	 * 
+	 * To replicate the problem remove this method and see how the contribution disappears from the UI.
+	 */
+	@Override
+	public int prop() {
+		return super.prop();
+	}	
+}


[isis-app-simpleapp] 04/05: rebase on jdo, add title() inheritance test

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

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

commit b958b6cdeaf59278a1c68e7faaae8c1b4e6e61aa
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Jan 22 11:23:07 2021 +0100

    rebase on jdo, add title() inheritance test
---
 .../src/main/java/domainapp/modules/simple/SimpleModule.java  |  1 -
 .../main/java/domainapp/modules/simple/dom/so/HasName.java    | 11 +++++++++++
 .../java/domainapp/modules/simple/dom/so/SimpleObject.java    |  9 +++++----
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/module-simple/src/main/java/domainapp/modules/simple/SimpleModule.java b/module-simple/src/main/java/domainapp/modules/simple/SimpleModule.java
index 02e1d55..c5d7aee 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/SimpleModule.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/SimpleModule.java
@@ -7,7 +7,6 @@ import org.springframework.validation.annotation.Validated;
 
 import org.apache.isis.testing.fixtures.applib.fixturescripts.FixtureScript;
 import org.apache.isis.testing.fixtures.applib.modules.ModuleWithFixtures;
-import org.apache.isis.testing.fixtures.applib.teardown.jdo.TeardownFixtureJdoAbstract;
 
 import lombok.Data;
 
diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/HasName.java b/module-simple/src/main/java/domainapp/modules/simple/dom/so/HasName.java
new file mode 100644
index 0000000..31c7288
--- /dev/null
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/HasName.java
@@ -0,0 +1,11 @@
+package domainapp.modules.simple.dom.so;
+
+abstract class HasName {
+
+    public abstract String getName();
+    
+    public String title() {
+        return "Name: " + getName();
+    }
+    
+}
diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
index 0db79b9..caa7a12 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
@@ -40,7 +40,8 @@ import lombok.val;
 @DomainObjectLayout()
 @XmlJavaTypeAdapter(PersistentEntityAdapter.class)
 @ToString(onlyExplicitlyIncluded = true)
-public class SimpleObject implements Comparable<SimpleObject> {
+public class SimpleObject extends HasName 
+implements Comparable<SimpleObject> {
 
     public static SimpleObject withName(String name) {
         val simpleObject = new SimpleObject();
@@ -57,9 +58,9 @@ public class SimpleObject implements Comparable<SimpleObject> {
     private SimpleObject() {
     }
 
-    public String title() {
-        return "Object: " + getName();
-    }
+//    public String title() {
+//        return "Object: " + getName();
+//    }
 
     @Name
     @Getter @Setter @ToString.Include


[isis-app-simpleapp] 02/05: ISIS-1628: no longer requires method to be overridden in mixin subclass.

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

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

commit 8b6c78b44633af8ca399db77f08ac2f749b23573
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jan 21 23:11:27 2021 +0000

    ISIS-1628: no longer requires method to be overridden in mixin subclass.
---
 .../simple/mixins/CollectionCountSubscriber.java   | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/module-simple/src/main/java/domainapp/modules/simple/mixins/CollectionCountSubscriber.java b/module-simple/src/main/java/domainapp/modules/simple/mixins/CollectionCountSubscriber.java
new file mode 100644
index 0000000..e8211fa
--- /dev/null
+++ b/module-simple/src/main/java/domainapp/modules/simple/mixins/CollectionCountSubscriber.java
@@ -0,0 +1,22 @@
+package domainapp.modules.simple.mixins;
+
+import org.springframework.stereotype.Component;
+
+import org.apache.isis.applib.annotation.Property;
+
+import domainapp.modules.simple.dom.so.SimpleObject;
+
+/*
+ * ISIS-1628: the @Property mixin annotation of the abstract super class is ignored and
+ * needs to be duplicated on the concrete sub class.
+ *
+ * To replicate the problem remove this annotation and see how the contribution disappears from the UI.
+ */
+@Component
+public class SimpleObject_numberOfChildren extends Collection_count {
+
+	public SimpleObject_numberOfChildren(SimpleObject simpleObject) {
+		super(simpleObject.getChildren());
+	}
+
+}


[isis-app-simpleapp] 05/05: adds test to throw an exception

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

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

commit 9b30204a7812f3feb9c3522c18f1cb5df23bbfc2
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Jan 24 17:14:23 2021 +0000

    adds test to throw an exception
---
 .../modules/simple/dom/so/SimpleObject.java         |  6 +-----
 .../simple/mixins/SimpleObject_throwException.java  | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
index caa7a12..34c283c 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.java
@@ -40,7 +40,7 @@ import lombok.val;
 @DomainObjectLayout()
 @XmlJavaTypeAdapter(PersistentEntityAdapter.class)
 @ToString(onlyExplicitlyIncluded = true)
-public class SimpleObject extends HasName 
+public class SimpleObject extends HasName
 implements Comparable<SimpleObject> {
 
     public static SimpleObject withName(String name) {
@@ -58,10 +58,6 @@ implements Comparable<SimpleObject> {
     private SimpleObject() {
     }
 
-//    public String title() {
-//        return "Object: " + getName();
-//    }
-
     @Name
     @Getter @Setter @ToString.Include
     private String name;
diff --git a/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_throwException.java b/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_throwException.java
new file mode 100644
index 0000000..66b7538
--- /dev/null
+++ b/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_throwException.java
@@ -0,0 +1,21 @@
+package domainapp.modules.simple.mixins;
+
+import org.springframework.stereotype.Component;
+
+import org.apache.isis.applib.annotation.Action;
+
+import lombok.RequiredArgsConstructor;
+
+import domainapp.modules.simple.dom.so.SimpleObject;
+
+@Component
+@Action()
+@RequiredArgsConstructor
+public class SimpleObject_throwException {
+
+	private final SimpleObject simpleObject;
+
+	public void act(String errorText) {
+		throw new RuntimeException(errorText);
+	}
+}


[isis-app-simpleapp] 03/05: ISIS-1628: no longer requires method to be overridden in mixin subclass.

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

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

commit 2cd43895718a28782fb7cfcdcc7f627646be0522
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jan 21 23:11:50 2021 +0000

    ISIS-1628: no longer requires method to be overridden in mixin subclass.
---
 .../modules/simple/dom/so/SimpleObject.layout.xml  | 25 ++++++++++++++++------
 .../simple/mixins/CollectionCountSubscriber.java   | 20 +++++++++++++----
 .../modules/simple/mixins/Collection_count.java    | 19 +++++++++++++---
 .../mixins/SimpleObject_numberOfChildren.java      | 20 +++++++----------
 4 files changed, 59 insertions(+), 25 deletions(-)

diff --git a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml
index 0bd636d..e43ff9f 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml
+++ b/module-simple/src/main/java/domainapp/modules/simple/dom/so/SimpleObject.layout.xml
@@ -21,11 +21,6 @@
                                 </c:property>
                                 <c:property id="notes"/>
                             </c:fieldSet>
-                            <c:fieldSet name="Contributed by Collection_count Mixin" id="other" unreferencedProperties="true">
-                                <c:property id="numberOfChildren">
-                                    <c:named>Number Of Children</c:named>
-                                </c:property>
-                            </c:fieldSet>
                         </bs3:col>
                     </bs3:row>
                 </bs3:tab>
@@ -48,7 +43,25 @@
             </bs3:tabGroup>
         </bs3:col>
         <bs3:col span="6">
-            <bs3:tabGroup  unreferencedCollections="true">
+            <bs3:tabGroup  unreferencedCollections="true" collapseIfOne="false">
+                <bs3:tab name="Children">
+                    <bs3:row>
+                        <bs3:col span="12">
+                            <c:collection id="children">
+                                <c:action id="addChild"/>
+                            </c:collection>
+                        </bs3:col>
+                    </bs3:row>
+                    <bs3:row>
+                        <bs3:col span="12">
+                            <c:fieldSet name="Contributed by Collection_count Mixin">
+                                <c:property id="numberOfChildren">
+                                    <c:named>Number Of Children</c:named>
+                                </c:property>
+                            </c:fieldSet>
+                        </bs3:col>
+                    </bs3:row>
+                </bs3:tab>
             </bs3:tabGroup>
         </bs3:col>
     </bs3:row>
diff --git a/module-simple/src/main/java/domainapp/modules/simple/mixins/CollectionCountSubscriber.java b/module-simple/src/main/java/domainapp/modules/simple/mixins/CollectionCountSubscriber.java
index e8211fa..245ecd8 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/mixins/CollectionCountSubscriber.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/mixins/CollectionCountSubscriber.java
@@ -1,8 +1,12 @@
 package domainapp.modules.simple.mixins;
 
+import javax.inject.Inject;
+
+import org.springframework.context.event.EventListener;
 import org.springframework.stereotype.Component;
 
-import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.Identifier;
+import org.apache.isis.applib.services.title.TitleService;
 
 import domainapp.modules.simple.dom.so.SimpleObject;
 
@@ -13,10 +17,18 @@ import domainapp.modules.simple.dom.so.SimpleObject;
  * To replicate the problem remove this annotation and see how the contribution disappears from the UI.
  */
 @Component
-public class SimpleObject_numberOfChildren extends Collection_count {
+public class CollectionCountSubscriber {
+
+	@EventListener(Collection_count.PropertyEvent.class)
+	public void on(Collection_count.PropertyEvent ev) {
 
-	public SimpleObject_numberOfChildren(SimpleObject simpleObject) {
-		super(simpleObject.getChildren());
+		final Object subject = ev.getSubject();
+		final Identifier identifier = ev.getIdentifier();
+		System.err.printf("%s collection '%s' now contains %d elements%n",
+				titleService.titleOf(subject),
+				identifier.getMemberName(),
+				ev.getNewValue());
 	}
 
+	@Inject TitleService titleService;
 }
diff --git a/module-simple/src/main/java/domainapp/modules/simple/mixins/Collection_count.java b/module-simple/src/main/java/domainapp/modules/simple/mixins/Collection_count.java
index 861ac47..f6c0397 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/mixins/Collection_count.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/mixins/Collection_count.java
@@ -2,17 +2,30 @@ package domainapp.modules.simple.mixins;
 
 import java.util.Collection;
 
+import org.apache.isis.applib.annotation.Action;
+import org.apache.isis.applib.annotation.Navigable;
 import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
+import org.apache.isis.applib.events.domain.ActionDomainEvent;
+import org.apache.isis.applib.events.domain.PropertyDomainEvent;
 
-@Property
+import domainapp.modules.simple.SimpleModule;
+
+@Action(domainEvent = Collection_count.ActionEvent.class)
+@Property(domainEvent = Collection_count.PropertyEvent.class)
+@PropertyLayout(describedAs = "Number of items in the collection")
 public abstract class Collection_count {
-	
+
+	public static class ActionEvent extends ActionDomainEvent<Integer> {}
+	public static class PropertyEvent extends PropertyDomainEvent<Object, Integer> {}
+
 	private final Collection<?> collection;
 	public Collection_count(Collection<?> collection) {
 		super();
 		this.collection = collection;
+
 	}
-	
+
 	public int prop() {
 		return collection.size();
 	}
diff --git a/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_numberOfChildren.java b/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_numberOfChildren.java
index c4d810a..1dd6664 100644
--- a/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_numberOfChildren.java
+++ b/module-simple/src/main/java/domainapp/modules/simple/mixins/SimpleObject_numberOfChildren.java
@@ -1,30 +1,26 @@
 package domainapp.modules.simple.mixins;
 
+import org.springframework.stereotype.Component;
+
+import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.Property;
+import org.apache.isis.applib.annotation.PropertyLayout;
 
 import domainapp.modules.simple.dom.so.SimpleObject;
 
 /*
  * ISIS-1628: the @Property mixin annotation of the abstract super class is ignored and
  * needs to be duplicated on the concrete sub class.
- * 
+ *
  * To replicate the problem remove this annotation and see how the contribution disappears from the UI.
  */
-@Property
+@Component
+@Property(domainEvent = Collection_count.PropertyEvent.class)
+@PropertyLayout(describedAs = "Number of items in the collection")
 public class SimpleObject_numberOfChildren extends Collection_count {
 
 	public SimpleObject_numberOfChildren(SimpleObject simpleObject) {
 		super(simpleObject.getChildren());
 	}
 
-	/*
-	 * ISIS-1628: the prop() method of the abstract super class needs to
-	 * be overridden in the concrete sub class.
-	 * 
-	 * To replicate the problem remove this method and see how the contribution disappears from the UI.
-	 */
-	@Override
-	public int prop() {
-		return super.prop();
-	}	
 }