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 2016/05/04 09:11:58 UTC

[6/8] isis git commit: ISIS-1389: further standardization of DTOs to Interaction.

ISIS-1389: further standardization of DTOs to Interaction.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/3e199c9f
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/3e199c9f
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/3e199c9f

Branch: refs/heads/ISIS-1291
Commit: 3e199c9f75770e1ef8f5a525d075d9b6b606e554
Parents: d08a4e1
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Wed May 4 00:49:37 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Wed May 4 00:49:37 2016 +0100

----------------------------------------------------------------------
 .../org/apache/isis/schema/utils/InteractionDtoUtils.java | 10 ++++++----
 .../services/background/BackgroundCommandExecution.java   |  2 +-
 .../command/CommandDtoServiceInternalDefault.java         |  4 ++--
 .../main/resources/org/apache/isis/schema/cmd/cmd-1.0.xsd |  7 ++++++-
 .../main/resources/org/apache/isis/schema/ixn/ixn-1.0.xsd |  7 ++++++-
 5 files changed, 21 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/3e199c9f/core/applib/src/main/java/org/apache/isis/schema/utils/InteractionDtoUtils.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/schema/utils/InteractionDtoUtils.java b/core/applib/src/main/java/org/apache/isis/schema/utils/InteractionDtoUtils.java
index 8c70cf2..883ab8d 100644
--- a/core/applib/src/main/java/org/apache/isis/schema/utils/InteractionDtoUtils.java
+++ b/core/applib/src/main/java/org/apache/isis/schema/utils/InteractionDtoUtils.java
@@ -252,10 +252,12 @@ public final class InteractionDtoUtils {
 
     //region > addExecution
 
-    public static void addExecution(final InteractionDto interactionDto, final InteractionExecutionDto executionDto) {
+    public static void addExecution(
+            final InteractionDto interactionDto,
+            final InteractionExecutionDto executionDto) {
         interactionDto.setExecution(executionDto);
 
-        interactionDto.setInteractionType(
+        executionDto.setInteractionType(
                 executionDto instanceof ActionInvocationDto
                         ? InteractionType.ACTION_INVOCATION
                         : InteractionType.PROPERTY_EDIT);
@@ -283,7 +285,7 @@ public final class InteractionDtoUtils {
         if(invocation == null) {
             invocation = new ActionInvocationDto();
             interactionDto.setExecution(invocation);
-            interactionDto.setInteractionType(InteractionType.ACTION_INVOCATION);
+            invocation.setInteractionType(InteractionType.ACTION_INVOCATION);
         }
         return invocation;
     }
@@ -293,7 +295,7 @@ public final class InteractionDtoUtils {
         if(edit == null) {
             edit = new PropertyEditDto();
             interactionDto.setExecution(edit);
-            interactionDto.setInteractionType(InteractionType.PROPERTY_EDIT);
+            edit.setInteractionType(InteractionType.PROPERTY_EDIT);
         }
         return edit;
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/3e199c9f/core/runtime/src/main/java/org/apache/isis/core/runtime/services/background/BackgroundCommandExecution.java
----------------------------------------------------------------------
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 923aac4..2eb5b4e 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
@@ -166,7 +166,7 @@ public abstract class BackgroundCommandExecution extends AbstractIsisSessionTemp
                         final MemberDto memberDto = dto.getMember();
                         final String memberId = memberDto.getMemberIdentifier();
 
-                        final InteractionType interactionType = dto.getInteractionType();
+                        final InteractionType interactionType = memberDto.getInteractionType();
                         if(interactionType == InteractionType.ACTION_INVOCATION) {
 
                             final ActionDto actionDto = (ActionDto) memberDto;

http://git-wip-us.apache.org/repos/asf/isis/blob/3e199c9f/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java
index 1d8a7ed..c64c18f 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/services/command/CommandDtoServiceInternalDefault.java
@@ -145,8 +145,8 @@ public class CommandDtoServiceInternalDefault implements CommandDtoServiceIntern
 
         final CommandDto dto = asCommandDto(targetAdapters);
 
-        dto.setInteractionType(InteractionType.ACTION_INVOCATION);
         final ActionDto actionDto = new ActionDto();
+        actionDto.setInteractionType(InteractionType.ACTION_INVOCATION);
         dto.setMember(actionDto);
 
         addActionArgs(objectAction, actionDto, argAdapters);
@@ -162,8 +162,8 @@ public class CommandDtoServiceInternalDefault implements CommandDtoServiceIntern
 
         final CommandDto dto = asCommandDto(targetAdapters);
 
-        dto.setInteractionType(InteractionType.PROPERTY_EDIT);
         final PropertyDto propertyDto = new PropertyDto();
+        propertyDto.setInteractionType(InteractionType.PROPERTY_EDIT);
         dto.setMember(propertyDto);
 
         addPropertyValue(property, propertyDto, valueAdapterOrNull);

http://git-wip-us.apache.org/repos/asf/isis/blob/3e199c9f/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.0.xsd
----------------------------------------------------------------------
diff --git a/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.0.xsd b/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.0.xsd
index a5c02cf..4be3695 100644
--- a/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.0.xsd
+++ b/core/schema/src/main/resources/org/apache/isis/schema/cmd/cmd-1.0.xsd
@@ -56,7 +56,6 @@
                         </xs:documentation>
                     </xs:annotation>
                 </xs:element>
-                <xs:element name="interactionType" type="common:interactionType"/>
                 <xs:element name="member" type="memberDto">
                     <xs:annotation>
                         <xs:documentation>The action or property (identifier and parameter arguments) to be invoked on the target object(s).</xs:documentation>
@@ -84,6 +83,12 @@
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
+            <xs:element name="interactionType" type="common:interactionType">
+                <xs:annotation>
+                    <xs:documentation>Indicates whether this is an intention to invoke an action, or edit a property.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
         </xs:sequence>
     </xs:complexType>
 

http://git-wip-us.apache.org/repos/asf/isis/blob/3e199c9f/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.0.xsd
----------------------------------------------------------------------
diff --git a/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.0.xsd b/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.0.xsd
index c7e651a..968dd9e 100644
--- a/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.0.xsd
+++ b/core/schema/src/main/resources/org/apache/isis/schema/ixn/ixn-1.0.xsd
@@ -54,7 +54,6 @@
                     </xs:annotation>
                 </xs:element>
                 <xs:element name="execution" type="interactionExecutionDto"/>
-                <xs:element name="interactionType" type="common:interactionType"/>
             </xs:sequence>
         </xs:complexType>
 
@@ -84,6 +83,12 @@
                     </xs:documentation>
                 </xs:annotation>
             </xs:element>
+            <xs:element name="interactionType" type="common:interactionType">
+                <xs:annotation>
+                    <xs:documentation>Indicates whether this is an intention to invoke an action, or edit a property.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
             <xs:element name="memberId" type="xs:string">
                 <xs:annotation>
                     <xs:documentation>Formal identifier of the member being interacted with (action or property).