You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2023/04/10 11:59:28 UTC
[causeway] 06/13: CAUSEWAY-2485: reworks and simplifies @Action#commandPublishing
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch CAUSEWAY-2485
in repository https://gitbox.apache.org/repos/asf/causeway.git
commit a0081ef85d4d1302dfe98110278684534969c1a8
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Sun Apr 9 13:23:40 2023 +0100
CAUSEWAY-2485: reworks and simplifies @Action#commandPublishing
---
.../src/main/java/demoapp/dom/DemoModuleJpa.java | 2 +-
.../dom/domain/actions/Action/ActionMenu.java | 7 +-
.../jpa/ActionChoicesFromJpa-description.adoc | 7 +-
...nnotation.java => ActionCommandPublishing.java} | 39 +++--
...yout.xml => ActionCommandPublishing.layout.xml} | 42 ++++-
...ommandPublishingEntity_mixinUpdateProperty.java | 57 ------
...ixinUpdatePropertyMetaAnnotationOverridden.java | 59 -------
.../ActionCommandPublishingPage-description.adoc | 62 +++++++
...ntity.java => ActionCommandPublishingPage.java} | 49 +++---
....xml => ActionCommandPublishingPage.layout.xml} | 19 +-
...mandPublishingPage_changeNameNotPublished.java} | 46 +++--
...CommandPublishingPage_changeNamePublished.java} | 47 +++--
.../ActionCommandPublishingPage_objects.java | 27 +++
...ionCommandPublishingPage_publishedCommands.java | 31 ++++
...java => ActionCommandPublishingRepository.java} | 22 +--
.../ActionCommandPublishingSeeding.java | 10 +-
...nCommandPublishing_changeNameNotPublished.java} | 35 ++--
...tionCommandPublishing_changeNamePublished.java} | 33 ++--
.../ActionCommandPublishing_publishedCommands.java | 30 ++++
.../ActionCommandPublishingJdo-description.adoc | 137 ---------------
.../jdo/ActionCommandPublishingJdo.java | 192 ---------------------
.../ActionCommandPublishingJpa-description.adoc | 136 +--------------
.../jpa/ActionCommandPublishingJpa.java | 170 ++----------------
.../jpa/ActionCommandPublishingJpaEntities.java | 21 ++-
24 files changed, 380 insertions(+), 900 deletions(-)
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
index 13ba31f98f..24ae0f758f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/DemoModuleJpa.java
@@ -130,8 +130,8 @@ import org.springframework.context.annotation.Profile;
ActionChoicesFromJpa.class,
ActionCommandPublishingJpa.class,
-
ActionExecutionPublishingJpa.class,
+
PropertyCommandPublishingJpa.class,
PropertyExecutionPublishingJpa.class,
PropertyProjectingChildJpa.class,
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/ActionMenu.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/ActionMenu.java
index 8adfd533c2..03b79c9fff 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/ActionMenu.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/ActionMenu.java
@@ -31,7 +31,7 @@ import org.apache.causeway.applib.annotation.SemanticsOf;
import demoapp.dom._infra.samples.NameSamples;
import demoapp.dom._infra.values.ValueHolderRepository;
import demoapp.dom.domain.actions.Action.choicesFrom.ActionChoicesFromPage;
-import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingEntity;
+import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingPage;
import demoapp.dom.domain.actions.Action.domainEvent.ActionDomainEventPage;
import demoapp.dom.domain.actions.Action.executionPublishing.ActionExecutionPublishingEntity;
import demoapp.dom.domain.actions.Action.hidden.ActionHiddenPage;
@@ -48,7 +48,6 @@ import lombok.val;
@RequiredArgsConstructor(onConstructor_ = {@Inject})
public class ActionMenu {
- final ValueHolderRepository<String, ? extends ActionCommandPublishingEntity> actionCommandEntities;
final ValueHolderRepository<String, ? extends ActionExecutionPublishingEntity> actionPublishingEntities;
final NameSamples samples;
@@ -60,8 +59,8 @@ public class ActionMenu {
@Action(semantics = SemanticsOf.SAFE)
@ActionLayout(cssClassFa="fa-terminal", describedAs = "Action invocation intentions as XML")
- public ActionCommandPublishingEntity commandPublishing(){
- return actionCommandEntities.first().orElse(null);
+ public ActionCommandPublishingPage commandPublishing(){
+ return new ActionCommandPublishingPage();
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/choicesFrom/jpa/ActionChoicesFromJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/choicesFrom/jpa/ActionChoicesFromJpa-description.adoc
index 089e5cf4fa..ba6838b9ca 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/choicesFrom/jpa/ActionChoicesFromJpa-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/choicesFrom/jpa/ActionChoicesFromJpa-description.adoc
@@ -1,10 +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 domain class uses `named` to provide a different effective name.
+This domain class is used in the collection and as the parameter type of an action annotated with `@Action#choicesFrom`.
-[source,java,indent=0]
-----
-include::../DomainObjectLayoutNamed.java[tags=class]
-----
-<.> specifies "bus" CSS font-awesome style
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEnabledMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing.java
similarity index 62%
copy from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEnabledMetaAnnotation.java
copy to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing.java
index e41532fd72..9d80cf6e18 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEnabledMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing.java
@@ -18,23 +18,32 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.Publishing;
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom._infra.values.ValueHolder;
//tag::class[]
-@Action(commandPublishing = Publishing.ENABLED) // <.>
-@Inherited
-@Target({
- ElementType.TYPE, ElementType.METHOD // <.>
-})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ActionCommandPublishingEnabledMetaAnnotation {
+public abstract class ActionCommandPublishing
+//end::class[]
+ implements
+ HasAsciiDocDescription,
+ ValueHolder<String>
+//tag::class[]
+{
+ // ...
+//end::class[]
+ public String title() {
+ return value();
+ }
+
+ @Override
+ public String value() {
+ return getName();
+ }
+
+ public abstract String getName();
+ public abstract void setName(String value);
+
+//tag::class[]
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing.layout.xml
similarity index 71%
copy from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.layout.xml
copy to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing.layout.xml
index bb8440a448..77b79681d6 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing.layout.xml
@@ -26,11 +26,38 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Annotated" id="annotation"/>
- <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"/>
- <cpt:collection id="commands"/>
+ <bs3:tabGroup>
+ <bs3:tab name="General">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="General" id="general" >
+ <cpt:property id="name">
+ <cpt:action id="changeNamePublished"/>
+ <cpt:action id="changeNameNotPublished"/>
+ </cpt:property>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ <bs3:tab name="Metadata">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Metadata" id="metadata" >
+ <cpt:property id="id"/>
+ <cpt:property id="logicalTypeName"/>
+ <cpt:property id="version"/>
+ </cpt:fieldSet>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ <bs3:tab name="Other">
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:fieldSet name="Other" id="other" unreferencedProperties="true"/>
+ </bs3:col>
+ </bs3:row>
+ </bs3:tab>
+ </bs3:tabGroup>
</bs3:col>
<bs3:col span="6">
<cpt:fieldSet name="Description" id="description" >
@@ -49,6 +76,11 @@
</cpt:fieldSet>
</bs3:col>
</bs3:row>
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:collection id="publishedCommands"/>
+ </bs3:col>
+ </bs3:row>
<bs3:row>
<bs3:col span="12" unreferencedCollections="true"/>
</bs3:row>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdateProperty.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdateProperty.java
deleted file mode 100644
index 136cccfa18..0000000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdateProperty.java
+++ /dev/null
@@ -1,57 +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 demoapp.dom.domain.actions.Action.commandPublishing;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.Publishing;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-
-//tag::class[]
-@Action(
- commandPublishing = Publishing.ENABLED // <.>
- , semantics = SemanticsOf.IDEMPOTENT
-)
-@ActionLayout(
- named = "Mixin Update Property"
- , describedAs = "@Action(command = ENABLED)"
- , associateWith = "property"
- , sequence = "2"
-)
-public class ActionCommandPublishingEntity_mixinUpdateProperty {
- // ...
-//end::class[]
-
- private final ActionCommandPublishingEntity actionCommandEntity;
-
- public ActionCommandPublishingEntity_mixinUpdateProperty(final ActionCommandPublishingEntity actionCommandEntity) {
- this.actionCommandEntity = actionCommandEntity;
- }
-
- @MemberSupport public ActionCommandPublishingEntity act(final String value) {
- actionCommandEntity.setProperty(value);
- return actionCommandEntity;
- }
- @MemberSupport public String default0Act() {
- return actionCommandEntity.getProperty();
- }
-//tag::class[]
-}
-//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotationOverridden.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotationOverridden.java
deleted file mode 100644
index dd1357796d..0000000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotationOverridden.java
+++ /dev/null
@@ -1,59 +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 demoapp.dom.domain.actions.Action.commandPublishing;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.Publishing;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-
-import lombok.RequiredArgsConstructor;
-
-//tag::class[]
-@ActionCommandPublishingDisabledMetaAnnotation // <.>
-@Action(
- commandPublishing = Publishing.ENABLED // <.>
- , semantics = SemanticsOf.IDEMPOTENT
-)
-@ActionLayout(
- named = "Mixin Update Property"
- , describedAs =
- "@ActionCommandDisabledMetaAnnotation " +
- "@Action(command = ENABLED)"
- , associateWith = "propertyMetaAnnotatedOverridden"
- , sequence = "2"
-)
-@RequiredArgsConstructor
-public class ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotationOverridden {
- // ...
-//end::class[]
-
- private final ActionCommandPublishingEntity actionCommandEntity;
-
- @MemberSupport public ActionCommandPublishingEntity act(final String value) {
- actionCommandEntity.setPropertyMetaAnnotatedOverridden(value);
- return actionCommandEntity;
- }
- @MemberSupport public String default0Act() {
- return actionCommandEntity.getPropertyMetaAnnotatedOverridden();
- }
-//tag::class[]
-}
-//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage-description.adoc
new file mode 100644
index 0000000000..75eddd353d
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage-description.adoc
@@ -0,0 +1,62 @@
+: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 [...]
+
+
+Every action invocation is reified into a link:https://causeway.apache.org/refguide/2.0.0-SNAPSHOT/applib/index/services/command/Command.html[Command] which captures the target and action arguments, as well as the "who" and the "when" (identity of the user performing the action and a timestamp).
+
+The link:https://causeway.apache.org/refguide/2.0.0-SNAPSHOT/applib/index/annotation/Action.html#commandpublishing[@Action#commandPublishing] determines whether subscribers are notified of the action being executed.
+
+The _commandLog_ extension provides an out-of-the-box subscriber implementation that persists every published command into a log.
+This can be invaluable for auditing and performance monitoring.
+
+It is also possible to register additional subscribers for your own purposes.
+
+
+=== How this demo works
+
+The collection on the left hand side shows a list of entities, and two associated actions.
+These actions can be used to change the name of any one of those entities.
+One of the actions is published, the other is not.
+
+Invoking the published action will result in a command representing the action invocation from being persisted; these are listed in the collection at the bottom of the page.
+
+You can also navigate into the entities and invoke actions on the objects themselves.
+These actions are also logged.
+
+In terms of code:
+
+* action with command publishing enabled:
++
+[source,java,indent=0]
+.ActionCommandPublishingPage_changeNamePublished.java
+----
+include::ActionCommandPublishingPage_changeNamePublished.java[tags=class]
+----
+<.> enables command publishing
+
+* contributed collection showing persisted ``CommandLogEntry``s:
++
+[source,java,indent=0]
+.ActionCommandPublishingPage_changeNamePublished.java
+----
+include::ActionCommandPublishingPage_publishedCommands.java[tags=class]
+----
+<.> repository provided by the _commandLog_ extension.
+
+
+
+=== Related configuration property
+
+To set the global default for `commandPublishing`, use this configuration property:
+
+[source,yaml]
+.application.yaml
+----
+causeway:
+ applib:
+ annotation:
+ action:
+ command-publishing: "none" # <.>
+----
+<.> `none` | `disabled` | `enabled`.
+
+
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage.java
similarity index 52%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.java
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage.java
index 97637beb98..709c4873b5 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage.java
@@ -18,37 +18,28 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing;
-import javax.inject.Named;
-
-import org.apache.causeway.applib.annotation.DomainObject;
-
import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
-import demoapp.dom._infra.values.ValueHolder;
-import demoapp.dom.domain._commands.ExposePersistedCommands;
-@Named("demo.ActionCommandPublishingEntity") // shared permissions with concrete sub class
-@DomainObject
-public abstract class ActionCommandPublishingEntity
-implements
- HasAsciiDocDescription,
- ExposePersistedCommands,
- ValueHolder<String> {
+import javax.inject.Named;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
- @Override
- public String value() {
- return getProperty();
+import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.Nature;
+import org.apache.causeway.applib.annotation.ObjectSupport;
+
+//tag::class[]
+@XmlRootElement(name = "root")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@Named("demo.ActionCommandPublishingPage")
+@DomainObject(nature=Nature.VIEW_MODEL)
+public class ActionCommandPublishingPage implements HasAsciiDocDescription {
+
+ @ObjectSupport public String title() {
+ return "@Action#choicesFrom";
}
-
- protected abstract String getProperty();
- protected abstract void setProperty(String value);
-
- protected abstract String getPropertyCommandDisabled();
- protected abstract void setPropertyCommandDisabled(String value);
-
- protected abstract String getPropertyMetaAnnotated();
- protected abstract void setPropertyMetaAnnotated(String value);
-
- protected abstract String getPropertyMetaAnnotatedOverridden();
- protected abstract void setPropertyMetaAnnotatedOverridden(String value);
-
}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.layout.xml b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage.layout.xml
similarity index 83%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.layout.xml
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage.layout.xml
index bb8440a448..a362ba67d4 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage.layout.xml
@@ -26,11 +26,11 @@
<bs3:row>
<bs3:col span="6">
- <cpt:fieldSet name="Annotated" id="annotation"/>
- <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"/>
- <cpt:collection id="commands"/>
+ <cpt:collection id="objects">
+ <cpt:action id="changeNamePublished"/>
+ <cpt:action id="changeNameNotPublished"/>
+ </cpt:collection>
</bs3:col>
<bs3:col span="6">
<cpt:fieldSet name="Description" id="description" >
@@ -40,15 +40,20 @@
<cpt:action id="inspectMetamodel" position="PANEL_DROPDOWN"/>
<cpt:action id="downloadMetamodelXml" position="PANEL_DROPDOWN"/>
<cpt:action id="downloadJdoMetamodel" position="PANEL_DROPDOWN"/>
- <cpt:action id="recentCommands" position="PANEL_DROPDOWN"/>
- <cpt:action id="recentExecutions" position="PANEL_DROPDOWN"/>
- <cpt:action id="recentAuditTrailEntries" position="PANEL_DROPDOWN"/>
+ <cpt:action id="recentCommands" position="PANEL_DROPDOWN"/>
+ <cpt:action id="recentExecutions" position="PANEL_DROPDOWN"/>
+ <cpt:action id="recentAuditTrailEntries" position="PANEL_DROPDOWN"/>
<cpt:action id="impersonateWithRoles" position="PANEL_DROPDOWN"/>
<cpt:action id="openRestApi" position="PANEL_DROPDOWN" />
<cpt:property id="description"/>
</cpt:fieldSet>
</bs3:col>
</bs3:row>
+ <bs3:row>
+ <bs3:col span="12">
+ <cpt:collection id="publishedCommands"/>
+ </bs3:col>
+ </bs3:row>
<bs3:row>
<bs3:col span="12" unreferencedCollections="true"/>
</bs3:row>
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyCommandDisabled.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_changeNameNotPublished.java
similarity index 57%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyCommandDisabled.java
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_changeNameNotPublished.java
index 55681ab992..46c173efec 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyCommandDisabled.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_changeNameNotPublished.java
@@ -18,41 +18,37 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.MemberSupport;
import org.apache.causeway.applib.annotation.Publishing;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-
-import lombok.RequiredArgsConstructor;
-
//tag::class[]
-@Action(
- commandPublishing = Publishing.DISABLED // <.>
- , semantics = SemanticsOf.IDEMPOTENT
-)
-@ActionLayout(
- named = "Mixin Update Property"
- , describedAs = "@Action(command = DISABLED)"
- , associateWith = "propertyCommandDisabled"
- , sequence = "2"
-)
+@Action(commandPublishing = Publishing.DISABLED) // <.>
@RequiredArgsConstructor
-public class ActionCommandPublishingEntity_mixinUpdatePropertyCommandDisabled {
- // ...
-//end::class[]
+public class ActionCommandPublishingPage_changeNameNotPublished {
- private final ActionCommandPublishingEntity actionCommandEntity;
+ private final ActionCommandPublishingPage page;
- @MemberSupport public ActionCommandPublishingEntity act(final String value) {
- actionCommandEntity.setPropertyCommandDisabled(value);
- return actionCommandEntity;
+ @MemberSupport public ActionCommandPublishingPage act(
+ final ActionCommandPublishing entity,
+ final String newName) {
+ entity.setName(newName);
+ return page;
}
- @MemberSupport public String default0Act() {
- return actionCommandEntity.getPropertyCommandDisabled();
+ public List<? extends ActionCommandPublishing> choices0Act() {
+ return repository.allInstances();
}
-//tag::class[]
+ public String default1Act(ActionCommandPublishing entity) {
+ return entity != null ? entity.getName() : null;
+ }
+
+ @Inject ActionCommandPublishingRepository repository;
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_changeNamePublished.java
similarity index 55%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotation.java
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_changeNamePublished.java
index 8a3e906d57..dd62462003 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_changeNamePublished.java
@@ -18,38 +18,37 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-
-import lombok.RequiredArgsConstructor;
+import org.apache.causeway.applib.annotation.Publishing;
//tag::class[]
-@ActionCommandPublishingEnabledMetaAnnotation // <.>
-@Action(
- semantics = SemanticsOf.IDEMPOTENT
-)
-@ActionLayout(
- named = "Mixin Update Property"
- , describedAs = "@ActionPublishingEnabledMetaAnnotation"
- , associateWith = "propertyMetaAnnotated"
- , sequence = "2"
-)
+@Action(commandPublishing = Publishing.ENABLED) // <.>
@RequiredArgsConstructor
-public class ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotation {
- // ...
-//end::class[]
+public class ActionCommandPublishingPage_changeNamePublished {
- private final ActionCommandPublishingEntity actionCommandEntity;
+ private final ActionCommandPublishingPage page;
- @MemberSupport public ActionCommandPublishingEntity act(final String value) {
- actionCommandEntity.setPropertyMetaAnnotated(value);
- return actionCommandEntity;
+ @MemberSupport public ActionCommandPublishingPage act(
+ final ActionCommandPublishing entity,
+ final String newName) {
+ entity.setName(newName);
+ return page;
}
- @MemberSupport public String default0Act() {
- return actionCommandEntity.getPropertyMetaAnnotated();
+
+ public List<? extends ActionCommandPublishing> choices0Act() {
+ return repository.allInstances();
}
-//tag::class[]
+ public String default1Act(ActionCommandPublishing entity) {
+ return entity != null ? entity.getName() : null;
+ }
+
+ @Inject ActionCommandPublishingRepository repository;
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_objects.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_objects.java
new file mode 100644
index 0000000000..a241cd944d
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_objects.java
@@ -0,0 +1,27 @@
+package demoapp.dom.domain.actions.Action.commandPublishing;
+
+import demoapp.dom._infra.values.ValueHolderRepository;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.causeway.applib.annotation.Collection;
+import org.apache.causeway.applib.annotation.MemberSupport;
+
+//tag::class[]
+@Collection()
+@RequiredArgsConstructor
+public class ActionCommandPublishingPage_objects {
+
+ @SuppressWarnings("unused")
+ private final ActionCommandPublishingPage page;
+
+ @MemberSupport public List<? extends ActionCommandPublishing> coll() {
+ return objectRepository.all();
+ }
+
+ @Inject ValueHolderRepository<String, ? extends ActionCommandPublishing> objectRepository;
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_publishedCommands.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_publishedCommands.java
new file mode 100644
index 0000000000..d1e8381142
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingPage_publishedCommands.java
@@ -0,0 +1,31 @@
+package demoapp.dom.domain.actions.Action.commandPublishing;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.causeway.applib.annotation.Collection;
+import org.apache.causeway.applib.annotation.MemberSupport;
+import org.apache.causeway.applib.services.bookmark.Bookmark;
+import org.apache.causeway.applib.services.bookmark.BookmarkService;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
+
+//tag::class[]
+@Collection()
+@RequiredArgsConstructor
+public class ActionCommandPublishingPage_publishedCommands {
+
+ @SuppressWarnings("unused")
+ private final ActionCommandPublishingPage page;
+
+ @MemberSupport public List<? extends CommandLogEntry> coll() {
+ return commandLogEntryRepository.findRecentByTarget(bookmarkService.bookmarkForElseFail(page));
+ }
+
+ @Inject CommandLogEntryRepository<? extends CommandLogEntry> commandLogEntryRepository; // <.>
+ @Inject BookmarkService bookmarkService;
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdoEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingRepository.java
similarity index 56%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdoEntities.java
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingRepository.java
index f21cbd33ee..6d9d99ee5f 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdoEntities.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingRepository.java
@@ -16,25 +16,11 @@
* specific language governing permissions and limitations
* under the License.
*/
-package demoapp.dom.domain.actions.Action.commandPublishing.jdo;
+package demoapp.dom.domain.actions.Action.commandPublishing;
-import org.springframework.context.annotation.Profile;
-import org.springframework.stereotype.Service;
+import java.util.List;
-import demoapp.dom._infra.values.ValueHolderRepository;
-
-@Profile("demo-jdo")
-@Service
-public class ActionCommandPublishingJdoEntities
-extends ValueHolderRepository<String, ActionCommandPublishingJdo> {
-
- protected ActionCommandPublishingJdoEntities() {
- super(ActionCommandPublishingJdo.class);
- }
-
- @Override
- protected ActionCommandPublishingJdo newDetachedEntity(String value) {
- return new ActionCommandPublishingJdo(value);
- }
+public interface ActionCommandPublishingRepository {
+ List<? extends ActionCommandPublishing> allInstances();
}
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingSeeding.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingSeeding.java
index 494d51feac..698f354533 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingSeeding.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingSeeding.java
@@ -18,21 +18,21 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing;
+import demoapp.dom._infra.seed.SeedServiceAbstract;
+import demoapp.dom._infra.values.ValueHolderRepository;
+
import javax.inject.Inject;
import org.springframework.stereotype.Service;
-import demoapp.dom._infra.seed.SeedServiceAbstract;
-import demoapp.dom._infra.values.ValueHolderRepository;
-
@Service
public class ActionCommandPublishingSeeding
extends SeedServiceAbstract {
@Inject
- public ActionCommandPublishingSeeding(ValueHolderRepository<String, ? extends ActionCommandPublishingEntity> entities) {
+ public ActionCommandPublishingSeeding(
+ ValueHolderRepository<String, ? extends ActionCommandPublishing> entities) {
super(entities);
}
}
-
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEnabledMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_changeNameNotPublished.java
similarity index 61%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEnabledMetaAnnotation.java
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_changeNameNotPublished.java
index e41532fd72..5077f52796 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingEnabledMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_changeNameNotPublished.java
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,23 +19,33 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import javax.inject.Inject;
import org.apache.causeway.applib.annotation.Action;
+import org.apache.causeway.applib.annotation.MemberSupport;
import org.apache.causeway.applib.annotation.Publishing;
//tag::class[]
-@Action(commandPublishing = Publishing.ENABLED) // <.>
-@Inherited
-@Target({
- ElementType.TYPE, ElementType.METHOD // <.>
-})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ActionCommandPublishingEnabledMetaAnnotation {
+@Action(commandPublishing = Publishing.DISABLED) // <.>
+@RequiredArgsConstructor
+public class ActionCommandPublishing_changeNameNotPublished {
+
+ private final ActionCommandPublishing entity;
+
+ @MemberSupport public ActionCommandPublishing act(
+ final String newName) {
+ entity.setName(newName);
+ return entity;
+ }
+
+ public String default0Act() {
+ return entity.getName();
+ }
+ @Inject ActionCommandPublishingRepository repository;
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingDisabledMetaAnnotation.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_changeNamePublished.java
similarity index 62%
rename from examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingDisabledMetaAnnotation.java
rename to examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_changeNamePublished.java
index 9c9a606277..f1f8de7268 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishingDisabledMetaAnnotation.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_changeNamePublished.java
@@ -1,3 +1,4 @@
+
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -18,23 +19,31 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
+import lombok.RequiredArgsConstructor;
+
+import javax.inject.Inject;
import org.apache.causeway.applib.annotation.Action;
+import org.apache.causeway.applib.annotation.MemberSupport;
import org.apache.causeway.applib.annotation.Publishing;
//tag::class[]
-@Action(commandPublishing = Publishing.DISABLED) // <.>
-@Inherited
-@Target({
- ElementType.TYPE, ElementType.METHOD // <.>
-})
-@Retention(RetentionPolicy.RUNTIME)
-public @interface ActionCommandPublishingDisabledMetaAnnotation {
+@Action(commandPublishing = Publishing.ENABLED) // <.>
+@RequiredArgsConstructor
+public class ActionCommandPublishing_changeNamePublished {
+
+ private final ActionCommandPublishing entity;
+
+ @MemberSupport public ActionCommandPublishing act(
+ final String newName) {
+ entity.setName(newName);
+ return entity;
+ }
+
+ public String default0Act() {
+ return entity.getName();
+ }
+ @Inject ActionCommandPublishingRepository repository;
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_publishedCommands.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_publishedCommands.java
new file mode 100644
index 0000000000..8dca6e09b4
--- /dev/null
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/ActionCommandPublishing_publishedCommands.java
@@ -0,0 +1,30 @@
+package demoapp.dom.domain.actions.Action.commandPublishing;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.List;
+
+import javax.inject.Inject;
+
+import org.apache.causeway.applib.annotation.Collection;
+import org.apache.causeway.applib.annotation.MemberSupport;
+import org.apache.causeway.applib.services.bookmark.BookmarkService;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntry;
+import org.apache.causeway.extensions.commandlog.applib.dom.CommandLogEntryRepository;
+
+//tag::class[]
+@Collection()
+@RequiredArgsConstructor
+public class ActionCommandPublishing_publishedCommands {
+
+ @SuppressWarnings("unused")
+ private final ActionCommandPublishing entity;
+
+ @MemberSupport public List<? extends CommandLogEntry> coll() {
+ return commandLogEntryRepository.findRecentByTarget(bookmarkService.bookmarkForElseFail(entity));
+ }
+
+ @Inject CommandLogEntryRepository<? extends CommandLogEntry> commandLogEntryRepository;
+ @Inject BookmarkService bookmarkService;
+}
+//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdo-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdo-description.adoc
deleted file mode 100644
index e923b678ab..0000000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdo-description.adoc
+++ /dev/null
@@ -1,137 +0,0 @@
-: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 `command` element is used to allow or suppress the reification of an action invocation into a https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command].
-
-When allowed (the default), then the https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command] is sent to registered implementation(s) of https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/publishing/spi/CommandSubscriber.html SPI, _after_ the interaction has completed.
-One use case is to replicate and replay commands to a secondary system, for example for regression testing.
-For more on this, see the "Command Replay" section below.
-
-Commands are also used under the covers to allow actions invocations to be made asynchronously using the https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/wrapper/WrapperFactory.html[WrapperFactory].
-This can be useful for long-running actions.
-
-[NOTE]
-====
-The list of persisted https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command]s can be viewed in a collection on the left bottom of this page.
-https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command]s are persisted after the page rendering phase, so to view a just-persisted command, refresh the page.
-
-If running in prototype mode, the list of persisted https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command]s can also be truncated from the activity menu.
-====
-
-== Annotated
-
-The `command` element can be specified explicitly using an annotation through `@Action#command()`:
-
-* it can be applied to an action:
-+
-[source,java,indent=0]
-----
-include::ActionCommandPublishingJdo.java[tags=annotation]
-----
-<.> explicitly specifies that invoking the action should be reified .
-
-* or to a mixin:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEntity_mixinUpdateProperty.java[tags=class]
-----
-<.> explicitly specifies that invoking the mixin action should be reified.
-
-The command reification can also be disabled:
-
-* for an action:
-+
-[source,java,indent=0]
-----
-include::ActionCommandPublishingJdo.java[tags=annotation-2]
-----
-<.> explicitly specifies that invoking the action should not be reified.
-
-* or to a mixin:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEntity_mixinUpdatePropertyCommandDisabled.java[tags=class]
-----
-<.> explicitly specifies that invoking the mixin action should not be reified.
-
-
-== Meta-annotated
-
-The `command` element can also be specified using a custom meta-annotation:
-
-* the meta-annotation is defined as:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEnabledMetaAnnotation.java[tags=class]
-----
-<.> annotated for an action
-<.> annotation can be applied to an action method or to a mixin
-
-* and can be applied to an action:
-+
-[source,java,indent=0]
-----
-include::ActionCommandPublishingJdo.java[tags=meta-annotation]
-----
-<.> semantic is inherited from the meta-annotation
-
-* or to a mixin:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotation.java[tags=class]
-----
-<.> semantic is inherited from the meta-annotation
-
-
-=== Meta-annotated Overridden
-
-The meta-annotation can itself be overridden:
-
-* for an action:
-+
-[source,java,indent=0]
-----
-include::ActionCommandPublishingJdo.java[tags=meta-annotation-overridden]
-----
-<.> semantic from meta-annotation ...
-<.> \... is overridden by the `@Action` annotation
-
-* or on a mixin:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotationOverridden.java[tags=class]
-----
-<.> semantic from meta-annotation ...
-<.> \... is overridden by the `@Action` annotation
-
-
-== CommandSubscriber
-
-The demo includes the link:https://causeway.apache.org/userguide/${CAUSEWAY_VERSION}/commandlog/about.html[Command Log] extension, so every command is persisted.
-These can be viewed in the collection at the left bottom of the page.
-https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command]s are persisted after the page rendering phase, so to view a just-persisted command, refresh the page.
-
-
-== Configuration
-
-By default, reification of commands for action invocations is enabled.
-This can be configured globally:
-
-[source,yaml]
-.application.yml
-----
-causeway:
- applib:
- annotation:
- action:
- command: none # or 'all', or 'ignore_safe'
-----
-
-In addition to globally enabling or disabling command reification, it is also possible to specify `ignore_safe`.
-This enables commands for all actions except those that have safe (that is, query-only) semantics.
-In other words actions are reified to commands except for those that don't change (aren't declared as changing) the state of the system.
-
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdo.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdo.java
deleted file mode 100644
index 42bf8659c2..0000000000
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jdo/ActionCommandPublishingJdo.java
+++ /dev/null
@@ -1,192 +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 demoapp.dom.domain.actions.Action.commandPublishing.jdo;
-
-import javax.inject.Named;
-import javax.jdo.annotations.DatastoreIdentity;
-import javax.jdo.annotations.IdGeneratorStrategy;
-import javax.jdo.annotations.IdentityType;
-import javax.jdo.annotations.PersistenceCapable;
-
-import org.springframework.context.annotation.Profile;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.DomainObject;
-import org.apache.causeway.applib.annotation.Editing;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.Nature;
-import org.apache.causeway.applib.annotation.ObjectSupport;
-import org.apache.causeway.applib.annotation.Property;
-import org.apache.causeway.applib.annotation.PropertyLayout;
-import org.apache.causeway.applib.annotation.Publishing;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-
-import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingDisabledMetaAnnotation;
-import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingEnabledMetaAnnotation;
-import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingEntity;
-import lombok.Getter;
-import lombok.Setter;
-
-@Profile("demo-jdo")
-//tag::class[]
-@PersistenceCapable(identityType = IdentityType.DATASTORE, schema = "demo")
-@DatastoreIdentity(strategy = IdGeneratorStrategy.IDENTITY, column = "id")
-@Named("demo.ActionCommandPublishingEntity")
-@DomainObject(
- nature=Nature.ENTITY
- , editing = Editing.DISABLED
-)
-public class ActionCommandPublishingJdo
- extends ActionCommandPublishingEntity {
- // ...
-//end::class[]
-
- public ActionCommandPublishingJdo(final String initialValue) {
- this.property = initialValue;
- this.propertyCommandDisabled = initialValue;
- this.propertyMetaAnnotated = initialValue;
- this.propertyMetaAnnotatedOverridden = initialValue;
- }
-
- @ObjectSupport public String title() {
- return "@Action#commandPublishing (JDO)";
- }
-
-//tag::property[]
- @Property()
- @PropertyLayout(fieldSetId = "annotation", sequence = "1")
- @Getter @Setter
- private String property;
-
- @Property()
- @PropertyLayout(fieldSetId = "annotation", sequence = "2")
- @Getter @Setter
- private String propertyCommandDisabled;
-
- @Property()
- @PropertyLayout(fieldSetId = "meta-annotated", sequence = "1")
- @Getter @Setter
- private String propertyMetaAnnotated;
-
- @Property()
- @PropertyLayout(fieldSetId = "meta-annotated-overridden", sequence = "1")
- @Getter @Setter
- private String propertyMetaAnnotatedOverridden;
-//end::property[]
-
-//tag::annotation[]
- @Action(
- commandPublishing = Publishing.ENABLED // <.>
- , semantics = SemanticsOf.IDEMPOTENT
- )
- @ActionLayout(
- named = "Update Property"
- , describedAs = "@Action(command = ENABLED)"
- , associateWith = "property"
- , sequence = "1"
- )
- public ActionCommandPublishingJdo updatePropertyUsingAnnotation(final String value) {
- // ...
-//end::annotation[]
- setProperty(value);
- return this;
- }
- @MemberSupport public String default0UpdatePropertyUsingAnnotation() {
- return getProperty();
-//tag::annotation[]
- }
-//end::annotation[]
-
-//tag::annotation-2[]
- @Action(
- commandPublishing = Publishing.DISABLED // <.>
- , semantics = SemanticsOf.IDEMPOTENT
- )
- @ActionLayout(
- named = "Update Property"
- , describedAs = "@Action(command = ENABLED)"
- , associateWith = "propertyCommandDisabled"
- , sequence = "1"
- )
- public ActionCommandPublishingJdo updatePropertyCommandDisabledUsingAnnotation(final String value) {
- // ...
-//end::annotation-2[]
- setPropertyCommandDisabled(value);
- return this;
- }
- @MemberSupport public String default0UpdatePropertyCommandDisabledUsingAnnotation() {
- return getPropertyCommandDisabled();
-//tag::annotation-2[]
- }
-//end::annotation-2[]
-
-//tag::meta-annotation[]
- @ActionCommandPublishingEnabledMetaAnnotation // <.>
- @Action(
- semantics = SemanticsOf.IDEMPOTENT
- )
- @ActionLayout(
- named = "Update Property"
- , describedAs = "@ActionCommandEnabledMetaAnnotation"
- , associateWith = "propertyMetaAnnotated"
- , sequence = "1"
- )
- public ActionCommandPublishingJdo updatePropertyUsingMetaAnnotation(final String value) {
- // ...
-//end::meta-annotation[]
- setPropertyMetaAnnotated(value);
- return this;
- }
- @MemberSupport public String default0UpdatePropertyUsingMetaAnnotation() {
- return getPropertyMetaAnnotated();
-//tag::meta-annotation[]
- }
-//end::meta-annotation[]
-
-//tag::meta-annotation-overridden[]
- @ActionCommandPublishingDisabledMetaAnnotation // <.>
- @Action(
- semantics = SemanticsOf.IDEMPOTENT
- , commandPublishing = Publishing.ENABLED // <.>
- )
- @ActionLayout(
- named = "Update Property"
- , describedAs =
- "@ActionCommandDisabledMetaAnnotation @Action(command = ENABLED)"
- , associateWith = "propertyMetaAnnotatedOverridden"
- , sequence = "1"
- )
- public ActionCommandPublishingJdo updatePropertyUsingMetaAnnotationButOverridden(final String value) {
- // ...
-//end::meta-annotation-overridden[]
- setPropertyMetaAnnotatedOverridden(value);
- return this;
- }
- @MemberSupport public String default0UpdatePropertyUsingMetaAnnotationButOverridden() {
- return getPropertyMetaAnnotatedOverridden();
-//tag::meta-annotation-overridden[]
- }
-//end::meta-annotation-overridden[]
-
-
-//tag::class[]
-
-}
-//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpa-description.adoc b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpa-description.adoc
index 93bbce0992..ff5908d790 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpa-description.adoc
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpa-description.adoc
@@ -1,137 +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 [...]
-The `command` element is used to allow or suppress the reification of an action invocation into a https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command].
-
-When allowed (the default), then the https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command] is sent to registered implementation(s) of https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/publishing/spi/CommandServiceListener.html#section-top[CommandServiceListener] SPI, _after_ the interaction has completed.
-One use case is to replicate and replay commands to a secondary system, for example for regression testing.
-For more on this, see the "Command Replay" section below.
-
-Commands are also used under the covers to allow actions invocations to be made asynchronously using the link:https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/wrapper/WrapperFactory.html[WrapperFactory].
-This can be useful for long-running actions.
-
-[NOTE]
-====
-The list of persisted https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command]s can be viewed in a collection on the left bottom of this page.
-https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command]s are persisted after the page rendering phase, so to view a just-persisted command, refresh the page.
-
-If running in prototype mode, the list of persisted https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command]s can also be truncated from the activity menu.
-====
-
-== Annotated
-
-The `command` element can be specified explicitly using an annotation through `@Action#command()`:
-
-* it can be applied to an action:
-+
-[source,java,indent=0]
-----
-include::ActionCommandPublishingJpa.java[tags=annotation]
-----
-<.> explicitly specifies that invoking the action should be reified .
-
-* or to a mixin:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEntity_mixinUpdateProperty.java[tags=class]
-----
-<.> explicitly specifies that invoking the mixin action should be reified.
-
-The command reification can also be disabled:
-
-* for an action:
-+
-[source,java,indent=0]
-----
-include::ActionCommandPublishingJpa.java[tags=annotation-2]
-----
-<.> explicitly specifies that invoking the action should not be reified.
-
-* or to a mixin:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEntity_mixinUpdatePropertyCommandDisabled.java[tags=class]
-----
-<.> explicitly specifies that invoking the mixin action should not be reified.
-
-
-== Meta-annotated
-
-The `command` element can also be specified using a custom meta-annotation:
-
-* the meta-annotation is defined as:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEnabledMetaAnnotation.java[tags=class]
-----
-<.> annotated for an action
-<.> annotation can be applied to an action method or to a mixin
-
-* and can be applied to an action:
-+
-[source,java,indent=0]
-----
-include::ActionCommandPublishingJpa.java[tags=meta-annotation]
-----
-<.> semantic is inherited from the meta-annotation
-
-* or to a mixin:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotation.java[tags=class]
-----
-<.> semantic is inherited from the meta-annotation
-
-
-=== Meta-annotated Overridden
-
-The meta-annotation can itself be overridden:
-
-* for an action:
-+
-[source,java,indent=0]
-----
-include::ActionCommandPublishingJpa.java[tags=meta-annotation-overridden]
-----
-<.> semantic from meta-annotation ...
-<.> \... is overridden by the `@Action` annotation
-
-* or on a mixin:
-+
-[source,java,indent=0]
-----
-include::../ActionCommandPublishingEntity_mixinUpdatePropertyMetaAnnotationOverridden.java[tags=class]
-----
-<.> semantic from meta-annotation ...
-<.> \... is overridden by the `@Action` annotation
-
-
-== CommandSubscriber
-
-The demo includes the link:https://causeway.apache.org/userguide/${CAUSEWAY_VERSION}/commandlog/about.html extension, so every command is persisted.
-These can be viewed in the collection at the left bottom of the page.
-https://causeway.apache.org/refguide/${CAUSEWAY_VERSION}/applib/index/services/command/Command.html[Command]s are persisted after the page rendering phase, so to view a just-persisted command, refresh the page.
-
-
-== Configuration
-
-By default, reification of commands for action invocations is enabled.
-This can be configured globally:
-
-[source,yaml]
-.application.yml
-----
-causeway:
- applib:
- annotation:
- action:
- command: none # or 'all', or 'ignore_safe'
-----
-
-In addition to globally enabling or disabling command reification, it is also possible to specify `ignore_safe`.
-This enables commands for all actions except those that have safe (that is, query-only) semantics.
-In other words actions are reified to commands except for those that don't change (aren't declared as changing) the state of the system.
-
+This domain class is used in the demo of `@Action#commandPublishing`.
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpa.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpa.java
index 2e5bc95e7b..290ed84742 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpa.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpa.java
@@ -18,184 +18,46 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing.jpa;
-import javax.inject.Named;
-import javax.persistence.Entity;
-import javax.persistence.EntityListeners;
-import javax.persistence.GeneratedValue;
-import javax.persistence.Id;
-import javax.persistence.Table;
+import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishing;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
-import org.springframework.context.annotation.Profile;
+import javax.inject.Named;
+import javax.persistence.*;
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
import org.apache.causeway.applib.annotation.DomainObject;
-import org.apache.causeway.applib.annotation.Editing;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.ObjectSupport;
-import org.apache.causeway.applib.annotation.Property;
-import org.apache.causeway.applib.annotation.PropertyLayout;
-import org.apache.causeway.applib.annotation.Publishing;
-import org.apache.causeway.applib.annotation.SemanticsOf;
+import org.apache.causeway.applib.annotation.Nature;
import org.apache.causeway.persistence.jpa.applib.integration.CausewayEntityListener;
-
-import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingDisabledMetaAnnotation;
-import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingEnabledMetaAnnotation;
-import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingEntity;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
+import org.springframework.context.annotation.Profile;
@Profile("demo-jpa")
-//tag::class[]
@Entity
@Table(
schema = "demo",
name = "ActionCommandPublishingJpa"
)
@EntityListeners(CausewayEntityListener.class)
-@Named("demo.ActionCommandPublishingEntity")
-@DomainObject(
- editing = Editing.DISABLED)
+@Named("demo.ActionCommandPublishingJpa")
@NoArgsConstructor
-public class ActionCommandPublishingJpa
- extends ActionCommandPublishingEntity {
+//tag::class[]
+// ...
+@DomainObject(nature = Nature.ENTITY)
+public class ActionCommandPublishingJpa extends ActionCommandPublishing {
// ...
//end::class[]
- public ActionCommandPublishingJpa(final String initialValue) {
- this.property = initialValue;
- this.propertyCommandDisabled = initialValue;
- this.propertyMetaAnnotated = initialValue;
- this.propertyMetaAnnotatedOverridden = initialValue;
- }
-
- @ObjectSupport public String title() {
- return "@Action#commandPublishing (JPA)";
+ public ActionCommandPublishingJpa(String value) {
+ setName(value);
}
@Id
@GeneratedValue
private Long id;
-//tag::property[]
- @Property()
- @PropertyLayout(fieldSetId = "annotation", sequence = "1")
- @Getter @Setter
- private String property;
-
- @Property()
- @PropertyLayout(fieldSetId = "annotation", sequence = "2")
@Getter @Setter
- private String propertyCommandDisabled;
-
- @Property()
- @PropertyLayout(fieldSetId = "meta-annotated", sequence = "1")
- @Getter @Setter
- private String propertyMetaAnnotated;
-
- @Property()
- @PropertyLayout(fieldSetId = "meta-annotated-overridden", sequence = "1")
- @Getter @Setter
- private String propertyMetaAnnotatedOverridden;
-//end::property[]
-
-//tag::annotation[]
- @Action(
- commandPublishing = Publishing.ENABLED // <.>
- , semantics = SemanticsOf.IDEMPOTENT
- )
- @ActionLayout(
- named = "Update Property"
- , describedAs = "@Action(command = ENABLED)"
- , associateWith = "property"
- , sequence = "1"
- )
- public ActionCommandPublishingJpa updatePropertyUsingAnnotation(final String value) {
- // ...
-//end::annotation[]
- setProperty(value);
- return this;
- }
- @MemberSupport public String default0UpdatePropertyUsingAnnotation() {
- return getProperty();
-//tag::annotation[]
- }
-//end::annotation[]
-
-//tag::annotation-2[]
- @Action(
- commandPublishing = Publishing.DISABLED // <.>
- , semantics = SemanticsOf.IDEMPOTENT
- )
- @ActionLayout(
- named = "Update Property"
- , describedAs = "@Action(command = ENABLED)"
- , associateWith = "propertyCommandDisabled"
- , sequence = "1"
- )
- public ActionCommandPublishingJpa updatePropertyCommandDisabledUsingAnnotation(final String value) {
- // ...
-//end::annotation-2[]
- setPropertyCommandDisabled(value);
- return this;
- }
- @MemberSupport public String default0UpdatePropertyCommandDisabledUsingAnnotation() {
- return getPropertyCommandDisabled();
-//tag::annotation-2[]
- }
-//end::annotation-2[]
-
-//tag::meta-annotation[]
- @ActionCommandPublishingEnabledMetaAnnotation // <.>
- @Action(
- semantics = SemanticsOf.IDEMPOTENT
- )
- @ActionLayout(
- named = "Update Property"
- , describedAs = "@ActionCommandEnabledMetaAnnotation"
- , associateWith = "propertyMetaAnnotated"
- , sequence = "1"
- )
- public ActionCommandPublishingJpa updatePropertyUsingMetaAnnotation(final String value) {
- // ...
-//end::meta-annotation[]
- setPropertyMetaAnnotated(value);
- return this;
- }
- @MemberSupport public String default0UpdatePropertyUsingMetaAnnotation() {
- return getPropertyMetaAnnotated();
-//tag::meta-annotation[]
- }
-//end::meta-annotation[]
-
-//tag::meta-annotation-overridden[]
- @ActionCommandPublishingDisabledMetaAnnotation // <.>
- @Action(
- semantics = SemanticsOf.IDEMPOTENT
- , commandPublishing = Publishing.ENABLED // <.>
- )
- @ActionLayout(
- named = "Update Property"
- , describedAs =
- "@ActionCommandDisabledMetaAnnotation @Action(command = ENABLED)"
- , associateWith = "propertyMetaAnnotatedOverridden"
- , sequence = "1"
- )
- public ActionCommandPublishingJpa updatePropertyUsingMetaAnnotationButOverridden(final String value) {
- // ...
-//end::meta-annotation-overridden[]
- setPropertyMetaAnnotatedOverridden(value);
- return this;
- }
- @MemberSupport public String default0UpdatePropertyUsingMetaAnnotationButOverridden() {
- return getPropertyMetaAnnotatedOverridden();
-//tag::meta-annotation-overridden[]
- }
-//end::meta-annotation-overridden[]
-
+ private String name;
//tag::class[]
-
}
//end::class[]
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpaEntities.java b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpaEntities.java
index 614e53cff5..e099aade2d 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpaEntities.java
+++ b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/Action/commandPublishing/jpa/ActionCommandPublishingJpaEntities.java
@@ -18,15 +18,19 @@
*/
package demoapp.dom.domain.actions.Action.commandPublishing.jpa;
+import demoapp.dom._infra.values.ValueHolderRepository;
+import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishing;
+import demoapp.dom.domain.actions.Action.commandPublishing.ActionCommandPublishingRepository;
+
+import java.util.List;
+
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Service;
-import demoapp.dom._infra.values.ValueHolderRepository;
-
@Profile("demo-jpa")
@Service
public class ActionCommandPublishingJpaEntities
-extends ValueHolderRepository<String, ActionCommandPublishingJpa> {
+extends ValueHolderRepository<String, ActionCommandPublishingJpa> implements ActionCommandPublishingRepository {
protected ActionCommandPublishingJpaEntities() {
super(ActionCommandPublishingJpa.class);
@@ -37,4 +41,15 @@ extends ValueHolderRepository<String, ActionCommandPublishingJpa> {
return new ActionCommandPublishingJpa(value);
}
+ @Override
+ public List<? extends ActionCommandPublishing> allInstances() {
+ return all();
+ }
+
+ public List<? extends ActionCommandPublishing> allMatches(final String s) {
+ return all();
+ }
+ public List<? extends ActionCommandPublishing> allMatches() {
+ return all();
+ }
}