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 2018/01/18 15:35:34 UTC

[isis] branch ISIS-1569-replay-commands updated (a649b8f -> b7392e7)

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

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


    from a649b8f  ISIS-1569: defines CommandWithDto as an optional interface for Command SPI implementations to have their Command's implement (translatable into a CommandDto) along with out-of-the-box ContentMapingService to convert these into CommandsDto structure.
     new f0da7bf  ISIS-1569: extends cmd and ixn schemas to allow userData to be specified, and moves the new CommandsDto into the new version of cmd.xsd also.
     new b7392e7  ISIS-1569: adds guard to ensure that BackgroundCommand#startedAt is always populated.

The 2 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:
 .../services/background/BackgroundCommandExecution.java   | 12 ++++++++++++
 core/schema/pom.xml                                       |  4 ++--
 .../main/resources/org/apache/isis/schema/bindings.xml    |  8 ++++----
 .../apache/isis/schema/cmd/{cmd-1.3.xsd => cmd-1.4.xsd}   | 15 ++++++++++++++-
 .../apache/isis/schema/ixn/{ixn-1.2.xsd => ixn-1.3.xsd}   |  4 ++--
 5 files changed, 34 insertions(+), 9 deletions(-)
 rename core/schema/src/main/resources/org/apache/isis/schema/cmd/{cmd-1.3.xsd => cmd-1.4.xsd} (91%)
 rename core/schema/src/main/resources/org/apache/isis/schema/ixn/{ixn-1.2.xsd => ixn-1.3.xsd} (98%)

-- 
To stop receiving notification emails like this one, please contact
['"commits@isis.apache.org" <co...@isis.apache.org>'].

[isis] 01/02: ISIS-1569: extends cmd and ixn schemas to allow userData to be specified, and moves the new CommandsDto into the new version of cmd.xsd also.

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

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

commit f0da7bf0f2c586f6639b8ac6c58a3fa6530ddfe0
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jan 18 14:03:57 2018 +0000

    ISIS-1569: extends cmd and ixn schemas to allow userData to be specified, and moves the new CommandsDto into the new version of cmd.xsd also.
---
 core/schema/pom.xml                                       |  4 ++--
 .../main/resources/org/apache/isis/schema/bindings.xml    |  8 ++++----
 .../apache/isis/schema/cmd/{cmd-1.3.xsd => cmd-1.4.xsd}   | 15 ++++++++++++++-
 .../apache/isis/schema/ixn/{ixn-1.2.xsd => ixn-1.3.xsd}   |  4 ++--
 4 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/core/schema/pom.xml b/core/schema/pom.xml
index a984e44..cc2a0b9 100644
--- a/core/schema/pom.xml
+++ b/core/schema/pom.xml
@@ -79,8 +79,8 @@
                                     <schemaDirectory>src/main/resources/org/apache/isis/schema</schemaDirectory>
                                     <schemaIncludes>
                                         <schemaInclude>common/common-1.1.xsd</schemaInclude>
-                                        <schemaInclude>cmd/cmd-1.3.xsd</schemaInclude>
-                                        <schemaInclude>ixn/ixn-1.2.xsd</schemaInclude>
+                                        <schemaInclude>cmd/cmd-1.4.xsd</schemaInclude>
+                                        <schemaInclude>ixn/ixn-1.3.xsd</schemaInclude>
                                         <schemaInclude>chg/chg-1.1.xsd</schemaInclude>
                                     </schemaIncludes>
                                     <bindingDirectory>src/main/resources/org/apache/isis/schema</bindingDirectory>
diff --git a/core/schema/src/main/resources/org/apache/isis/schema/bindings.xml b/core/schema/src/main/resources/org/apache/isis/schema/bindings.xml
index 5898075..50d69cc 100644
--- a/core/schema/src/main/resources/org/apache/isis/schema/bindings.xml
+++ b/core/schema/src/main/resources/org/apache/isis/schema/bindings.xml
@@ -38,7 +38,7 @@
         </jaxb:bindings>
     </jaxb:bindings>
 
-    <jaxb:bindings schemaLocation="ixn/ixn-1.2.xsd">
+    <jaxb:bindings schemaLocation="ixn/ixn-1.3.xsd">
         <jaxb:schemaBindings>
             <!--
             we don't include the minor version, because the
@@ -50,7 +50,7 @@
             <namespace:prefix name="ixn" />
         </jaxb:bindings>
     </jaxb:bindings>
-    <!-- since ixn-1.2.xsd does an xs:import of common-1.1.xsd, we need to specify common's package bindings -->
+    <!-- since ixn-1.3.xsd does an xs:import of common-1.1.xsd, we need to specify common's package bindings -->
     <jaxb:bindings schemaLocation="common/common-1.1.xsd">
         <jaxb:schemaBindings>
             <!--
@@ -63,8 +63,8 @@
             <namespace:prefix name="com" />
         </jaxb:bindings>
     </jaxb:bindings>
-    <!-- since ixn-1.2.xsd does an xs:import of cmd-1.3.xsd, we need to specify common's package bindings -->
-    <jaxb:bindings schemaLocation="cmd/cmd-1.3.xsd">
+    <!-- since ixn-1.3.xsd does an xs:import of cmd-1.4.xsd, we need to specify common's package bindings -->
+    <jaxb:bindings schemaLocation="cmd/cmd-1.4.xsd">
         <jaxb:schemaBindings>
             <!--
             we don't include the minor version, because the
diff --git a/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.3.xsd b/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.4.xsd
similarity index 91%
rename from core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.3.xsd
rename to core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.4.xsd
index 630dbe2..08cedef 100644
--- a/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.3.xsd
+++ b/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.4.xsd
@@ -38,7 +38,7 @@
 
     <xs:element name="commandDto">
         <xs:annotation>
-            <xs:documentation>Represents v1.3 of this schema, adding in 'logicalMemberIdentifier'
+            <xs:documentation>Represents v1.4 of this schema, adding in 'commandsDto' and extending 'commandDto' to allow additional implementation-specific fields to be attached in 'userData' (a map).
             </xs:documentation>
         </xs:annotation>
         <xs:complexType>
@@ -78,6 +78,7 @@
                         <xs:documentation>The action or property (identifier and parameter arguments) to be invoked on the target object(s).</xs:documentation>
                     </xs:annotation>
                 </xs:element>
+                <xs:element name="userData" type="mapDto" minOccurs="0"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
@@ -164,5 +165,17 @@
         </xs:complexContent>
     </xs:complexType>
 
+    <xs:complexType name="mapDto">
+        <xs:sequence>
+            <xs:element name="entry" minOccurs="0" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="key" type="xs:string"/>
+                        <xs:element name="value" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
 
 </xs:schema>
diff --git a/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.2.xsd b/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.3.xsd
similarity index 98%
rename from core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.2.xsd
rename to core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.3.xsd
index 21c16f3..eaec7c1 100644
--- a/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.2.xsd
+++ b/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.3.xsd
@@ -26,11 +26,11 @@
 >
 
     <xs:import namespace="http://isis.apache.org/schema/common" schemaLocation="../common/common-1.1.xsd"/>
-    <xs:import namespace="http://isis.apache.org/schema/cmd" schemaLocation="../cmd/cmd-1.3.xsd"/>
+    <xs:import namespace="http://isis.apache.org/schema/cmd" schemaLocation="../cmd/cmd-1.4.xsd"/>
 
     <xs:element name="interactionDto">
         <xs:annotation>
-            <xs:documentation>Represents v1.2 of this schema, adding in 'logicalMemberIdentifier'.
+            <xs:documentation>Represents v1.3 of this schema, which just updates to use cmd v1.4 schema.
             </xs:documentation>
         </xs:annotation>
         <xs:complexType>

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.

[isis] 02/02: ISIS-1569: adds guard to ensure that BackgroundCommand#startedAt is always populated.

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

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

commit b7392e72b58fc9c27c7082d4084e2fb960fd0622
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Thu Jan 18 15:23:18 2018 +0000

    ISIS-1569: adds guard to ensure that BackgroundCommand#startedAt is always populated.
---
 .../services/background/BackgroundCommandExecution.java      | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
index 6787c25..a66a194 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
@@ -123,6 +123,17 @@ public abstract class BackgroundCommandExecution extends AbstractIsisSessionTemp
                 try {
                     backgroundCommand.setExecutor(Executor.BACKGROUND);
 
+                    // responsibility for setting the Command#startedAt is in the ActionInvocationFacet or
+                    // PropertySetterFacet, but tthis is run if the domain object was found.  If the domain object is
+                    // thrown then we would have a command with only completedAt, which is inconsistent.
+                    // Therefore instead we copy down from the backgroundInteraction (similar to how we populate the
+                    // completedAt at the end)
+                    final Interaction.Execution currentExecution = backgroundInteraction.getCurrentExecution();
+                    backgroundCommand.setStartedAt(
+                            currentExecution != null
+                                    ? currentExecution.getStartedAt()
+                                    : clockService.nowAsJavaSqlTimestamp());
+
                     final boolean legacy = memento.startsWith("<memento");
                     if(legacy) {
 
@@ -223,6 +234,7 @@ public abstract class BackgroundCommandExecution extends AbstractIsisSessionTemp
                     }
 
                 } catch (RuntimeException e) {
+
                     // hmmm, this doesn't really make sense if >1 action
                     //
                     // in any case, the capturing of the result of the action invocation should be the

-- 
To stop receiving notification emails like this one, please contact
"commits@isis.apache.org" <co...@isis.apache.org>.