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/04/22 19:23:08 UTC

[1/4] isis git commit: ISIS-1344: reinstating the TransactionClosureXxxAbstract adapter classes ... otherwise these break isis addons security module, for example.

Repository: isis
Updated Branches:
  refs/heads/ISIS-1291 10693b1a4 -> 2d43907fa


ISIS-1344: reinstating the TransactionClosureXxxAbstract adapter classes ... otherwise these break isis addons security module, for example.


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

Branch: refs/heads/ISIS-1291
Commit: 0abdc72762486e319e3ed9e289c77dd7b7a5af05
Parents: 10693b1
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Apr 22 14:32:57 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Apr 22 14:32:57 2016 +0100

----------------------------------------------------------------------
 .../TransactionalClosureAbstract.java           | 25 ++++++++++++++++++++
 .../TransactionalClosureWithReturnAbstract.java | 25 ++++++++++++++++++++
 2 files changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/0abdc727/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java
new file mode 100644
index 0000000..2453a6c
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java
@@ -0,0 +1,25 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.system.transaction;
+
+public interface TransactionalClosureAbstract {
+
+    public void execute();
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/0abdc727/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java
new file mode 100644
index 0000000..8465280
--- /dev/null
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java
@@ -0,0 +1,25 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+
+package org.apache.isis.core.runtime.system.transaction;
+
+public interface TransactionalClosureWithReturnAbstract<T> {
+
+    public T execute();
+}


[4/4] isis git commit: ISIS-1291: extending common.xsd to support enums.

Posted by da...@apache.org.
ISIS-1291: extending common.xsd to support enums.

Also ensuring all the XSD files are consistent.


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

Branch: refs/heads/ISIS-1291
Commit: 2d43907faeab61cf731c50ab064528078cfc7c05
Parents: d2b3f6c
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Apr 22 16:59:21 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Apr 22 18:22:29 2016 +0100

----------------------------------------------------------------------
 .../layout/grid/bootstrap3/bootstrap3.xsd       |  12 +-
 .../src/main/asciidoc/schema/aim/aim-2.0.xsd    | 157 +++++++++++++++++++
 .../src/main/asciidoc/schema/aim/aim.xsd        | 157 +++++++++++++++++++
 .../src/main/asciidoc/schema/cmd/cmd-1.0.xsd    | 111 +++++++++++++
 .../main/asciidoc/schema/common/common-1.0.xsd  |  45 +++++-
 .../src/main/asciidoc/schema/common/common.xsd  |  44 +++++-
 .../schema/utils/CommandMementoDtoUtils.java    |   3 +
 .../isis/schema/utils/CommonDtoUtils.java       |  38 +++++
 .../isis/schema/utils/CommonDtoUtilsTest.java   |  66 ++++++++
 .../org/apache/isis/schema/utils/Vertical.java  |  23 +++
 .../apache/isis/schema/common/common-1.0.xsd    |  17 +-
 11 files changed, 646 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd b/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd
index 09087f6..f01916d 100644
--- a/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd
+++ b/adocs/documentation/src/main/asciidoc/applib/layout/grid/bootstrap3/bootstrap3.xsd
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://isis.apache.org/applib/layout/component" xmlns:tns="http://isis.apache.org/applib/layout/grid/bootstrap3" elementFormDefault="qualified" targetNamespace="http://isis.apache.org/applib/layout/grid/bootstrap3" version="1.0">
+<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:cpt="http://isis.apache.org/applib/layout/component" xmlns:tns="http://isis.apache.org/applib/layout/grid/bootstrap3" elementFormDefault="qualified" targetNamespace="http://isis.apache.org/applib/layout/grid/bootstrap3" version="1.0">
 
-    <xs:import namespace="http://isis.apache.org/applib/layout/component" schemaLocation="../../component"/>
+    <xs:import namespace="http://isis.apache.org/applib/layout/component" schemaLocation="../../component/component.xsd"/>
 
     <xs:element name="clearFixHidden" type="tns:clearFixHidden"/>
 
@@ -44,12 +44,12 @@
             <xs:extension base="tns:bs3RowContent">
                 <xs:sequence>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="sizeSpan" type="tns:sizeSpan"/>
-                    <xs:element minOccurs="0" ref="ns1:domainObject"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns1:action"/>
+                    <xs:element minOccurs="0" ref="cpt:domainObject"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" ref="cpt:action"/>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="row" type="tns:row"/>
                     <xs:element maxOccurs="unbounded" minOccurs="0" name="tabGroup" type="tns:tabGroup"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns1:fieldSet"/>
-                    <xs:element maxOccurs="unbounded" minOccurs="0" ref="ns1:collection"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" ref="cpt:fieldSet"/>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" ref="cpt:collection"/>
                     <xs:element minOccurs="0" name="metadataError" type="xs:string"/>
                 </xs:sequence>
                 <xs:attribute name="id" type="xs:string"/>

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/adocs/documentation/src/main/asciidoc/schema/aim/aim-2.0.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/aim/aim-2.0.xsd b/adocs/documentation/src/main/asciidoc/schema/aim/aim-2.0.xsd
new file mode 100644
index 0000000..811dff1
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/schema/aim/aim-2.0.xsd
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xs:schema targetNamespace="http://isis.apache.org/schema/aim"
+           elementFormDefault="qualified"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns="http://isis.apache.org/schema/aim"
+           xmlns:cmd="http://isis.apache.org/schema/cmd"
+           xmlns:common="http://isis.apache.org/schema/common"
+        >
+
+    <xs:import namespace="http://isis.apache.org/schema/common" schemaLocation="../common/common-1.0.xsd"/>
+    <xs:import namespace="http://isis.apache.org/schema/cmd" schemaLocation="../cmd/cmd-1.0.xsd"/>
+
+    <xs:element name="actionInvocationMementoDto">
+        <xs:annotation>
+            <xs:documentation>Represents v2.0 of this schema.  Changes since v1.0 are the addition of the 'majorVersion' and 'minorVersion', the 'mixinFqClassName' element, the 'threw' element, the 'timestampComplete' element and the 'subActions' element.  The 'timestamp' element has been replaced by 'timestampStart'.  The 'returned' element has been redefined.  The 'metadata' and 'payload' containers have been removed.  The supporting 'paramDto' types have been moved to common (so can be shared with cmd.xsd).
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="majorVersion" type="xs:string" minOccurs="0" maxOccurs="1" default="2">
+                    <xs:annotation>
+                        <xs:documentation>The major version of the schema that an XML instance was created using.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="minorVersion" type="xs:string" minOccurs="0" maxOccurs="1" default="0">
+                    <xs:annotation>
+                        <xs:documentation>The minor version of the schema that an XML instance was created using.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="transactionId" type="xs:string">
+                    <xs:annotation>
+                        <xs:documentation>Transaction id within which this action was invoked; can be used to locate the corresponding Command object (which may have been persisted).  However, there could be many such actions (eg by virtue of WrapperFactory); the 'sequence' is used to provide a unique id for each action invocation.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="invocation" type="actionInvocationDto"/>
+                <xs:element name="subInvocations" type="actionInvocationDto" minOccurs="0" maxOccurs="unbounded">
+                    <xs:annotation>
+                        <xs:documentation>Capture invocations of any other actions invoked from this action, using the WrapperFactory service.  These therefore define a graph/call-stack of actions.  Note that the subactions will redundantly also specify their majorVersion and minorVersion (the alternative would have required restructuring in such a way as to break backward compatibility).
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+            </xs:sequence>
+        </xs:complexType>
+
+    </xs:element>
+
+    <xs:complexType name="actionInvocationDto">
+        <xs:sequence>
+            <xs:element name="id" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>Unique identifier for this action invocation in the format &quot;transactionId.sequence&quot;.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="sequence" type="xs:int">
+                <xs:annotation>
+                    <xs:documentation>Action invocation within this transaction/command.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="target" type="common:oidDto" minOccurs="1" maxOccurs="1">
+                <xs:annotation>
+                    <xs:documentation>For regular actions, represents the entity or view model upon which the action is to be invoked.  For mixin actions, is the object being mixed-into (the constructor arg to the mixin).  For contributed actions, is the domain service (the contributee object will be one of the action arguments within the payload).  Mixin actions can be determined by the presence of the 'mixinFqClassName' element.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="action" type="cmd:actionDto">
+                <xs:annotation>
+                    <xs:documentation>The action and arguments to be invoked on the target object.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="user" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>The name of the user that invoked this action.  Note that this isn't necessarily the user that initiated the original command; the SudoService may be being used to temporarily switch the effective user.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="title" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>User-friendly title of the 'target' object.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="timings" type="common:periodDto">
+                <xs:annotation>
+                    <xs:documentation>Captures the time taken to invoke the action.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:choice>
+                <xs:element name="returned" type="returnDto" minOccurs="0" maxOccurs="1">
+                    <xs:annotation>
+                        <xs:documentation>The value returned by this action (including the type of that returned value).  Either the 'returned' or the 'threw' element will be populated.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="threw" type="exceptionDto" minOccurs="0" maxOccurs="1">
+                    <xs:annotation>
+                        <xs:documentation>Captures any exception thrown by an action.  Either the 'returned' or the 'threw' element will be populated.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+            </xs:choice>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="returnDto">
+        <xs:annotation>
+            <xs:documentation>Captures both the value returned of an action, and also the type of that returned value.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="value" type="common:valueDto"/>
+        </xs:sequence>
+        <xs:attribute name="returnType" use="required" type="common:valueType"/>
+        <xs:attribute name="null" use="optional" type="xs:boolean"/>
+    </xs:complexType>
+
+    <xs:complexType name="exceptionDto">
+        <xs:annotation>
+            <xs:documentation>Captures any exception thrown by an action invocation.  Use as the xsd:type of the 'threw' element.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="message" type="xs:string"/>
+            <xs:element name="stackTrace" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>A formatted stack trace.  (A future version of the 'exceptionDto' element might refine this to more easily parseable stack trace elements).
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="causedBy" type="exceptionDto" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/adocs/documentation/src/main/asciidoc/schema/aim/aim.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/aim/aim.xsd b/adocs/documentation/src/main/asciidoc/schema/aim/aim.xsd
new file mode 100644
index 0000000..811dff1
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/schema/aim/aim.xsd
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xs:schema targetNamespace="http://isis.apache.org/schema/aim"
+           elementFormDefault="qualified"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns="http://isis.apache.org/schema/aim"
+           xmlns:cmd="http://isis.apache.org/schema/cmd"
+           xmlns:common="http://isis.apache.org/schema/common"
+        >
+
+    <xs:import namespace="http://isis.apache.org/schema/common" schemaLocation="../common/common-1.0.xsd"/>
+    <xs:import namespace="http://isis.apache.org/schema/cmd" schemaLocation="../cmd/cmd-1.0.xsd"/>
+
+    <xs:element name="actionInvocationMementoDto">
+        <xs:annotation>
+            <xs:documentation>Represents v2.0 of this schema.  Changes since v1.0 are the addition of the 'majorVersion' and 'minorVersion', the 'mixinFqClassName' element, the 'threw' element, the 'timestampComplete' element and the 'subActions' element.  The 'timestamp' element has been replaced by 'timestampStart'.  The 'returned' element has been redefined.  The 'metadata' and 'payload' containers have been removed.  The supporting 'paramDto' types have been moved to common (so can be shared with cmd.xsd).
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="majorVersion" type="xs:string" minOccurs="0" maxOccurs="1" default="2">
+                    <xs:annotation>
+                        <xs:documentation>The major version of the schema that an XML instance was created using.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="minorVersion" type="xs:string" minOccurs="0" maxOccurs="1" default="0">
+                    <xs:annotation>
+                        <xs:documentation>The minor version of the schema that an XML instance was created using.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="transactionId" type="xs:string">
+                    <xs:annotation>
+                        <xs:documentation>Transaction id within which this action was invoked; can be used to locate the corresponding Command object (which may have been persisted).  However, there could be many such actions (eg by virtue of WrapperFactory); the 'sequence' is used to provide a unique id for each action invocation.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="invocation" type="actionInvocationDto"/>
+                <xs:element name="subInvocations" type="actionInvocationDto" minOccurs="0" maxOccurs="unbounded">
+                    <xs:annotation>
+                        <xs:documentation>Capture invocations of any other actions invoked from this action, using the WrapperFactory service.  These therefore define a graph/call-stack of actions.  Note that the subactions will redundantly also specify their majorVersion and minorVersion (the alternative would have required restructuring in such a way as to break backward compatibility).
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+            </xs:sequence>
+        </xs:complexType>
+
+    </xs:element>
+
+    <xs:complexType name="actionInvocationDto">
+        <xs:sequence>
+            <xs:element name="id" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>Unique identifier for this action invocation in the format &quot;transactionId.sequence&quot;.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="sequence" type="xs:int">
+                <xs:annotation>
+                    <xs:documentation>Action invocation within this transaction/command.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="target" type="common:oidDto" minOccurs="1" maxOccurs="1">
+                <xs:annotation>
+                    <xs:documentation>For regular actions, represents the entity or view model upon which the action is to be invoked.  For mixin actions, is the object being mixed-into (the constructor arg to the mixin).  For contributed actions, is the domain service (the contributee object will be one of the action arguments within the payload).  Mixin actions can be determined by the presence of the 'mixinFqClassName' element.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="action" type="cmd:actionDto">
+                <xs:annotation>
+                    <xs:documentation>The action and arguments to be invoked on the target object.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="user" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>The name of the user that invoked this action.  Note that this isn't necessarily the user that initiated the original command; the SudoService may be being used to temporarily switch the effective user.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="title" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>User-friendly title of the 'target' object.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="timings" type="common:periodDto">
+                <xs:annotation>
+                    <xs:documentation>Captures the time taken to invoke the action.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:choice>
+                <xs:element name="returned" type="returnDto" minOccurs="0" maxOccurs="1">
+                    <xs:annotation>
+                        <xs:documentation>The value returned by this action (including the type of that returned value).  Either the 'returned' or the 'threw' element will be populated.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="threw" type="exceptionDto" minOccurs="0" maxOccurs="1">
+                    <xs:annotation>
+                        <xs:documentation>Captures any exception thrown by an action.  Either the 'returned' or the 'threw' element will be populated.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+            </xs:choice>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="returnDto">
+        <xs:annotation>
+            <xs:documentation>Captures both the value returned of an action, and also the type of that returned value.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="value" type="common:valueDto"/>
+        </xs:sequence>
+        <xs:attribute name="returnType" use="required" type="common:valueType"/>
+        <xs:attribute name="null" use="optional" type="xs:boolean"/>
+    </xs:complexType>
+
+    <xs:complexType name="exceptionDto">
+        <xs:annotation>
+            <xs:documentation>Captures any exception thrown by an action invocation.  Use as the xsd:type of the 'threw' element.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="message" type="xs:string"/>
+            <xs:element name="stackTrace" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>A formatted stack trace.  (A future version of the 'exceptionDto' element might refine this to more easily parseable stack trace elements).
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="causedBy" type="exceptionDto" minOccurs="0" maxOccurs="1"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/adocs/documentation/src/main/asciidoc/schema/cmd/cmd-1.0.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/cmd/cmd-1.0.xsd b/adocs/documentation/src/main/asciidoc/schema/cmd/cmd-1.0.xsd
new file mode 100644
index 0000000..408c31d
--- /dev/null
+++ b/adocs/documentation/src/main/asciidoc/schema/cmd/cmd-1.0.xsd
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  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.
+-->
+<xs:schema targetNamespace="http://isis.apache.org/schema/cmd"
+           elementFormDefault="qualified"
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns="http://isis.apache.org/schema/cmd"
+           xmlns:common="http://isis.apache.org/schema/common">
+
+    <xs:import namespace="http://isis.apache.org/schema/common" schemaLocation="../common/common-1.0.xsd"/>
+
+    <xs:element name="commandMementoDto">
+        <xs:annotation>
+            <xs:documentation>Represents v1.0 of this schema.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="majorVersion" type="xs:string" minOccurs="1" maxOccurs="1" default="1">
+                    <xs:annotation>
+                        <xs:documentation>The major version of the schema that an XML instance was created using.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="minorVersion" type="xs:string" minOccurs="1" maxOccurs="1" default="1">
+                    <xs:annotation>
+                        <xs:documentation>Introduced in v1.1. The minor version of the schema that an XML instance was created using.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="transactionId" type="xs:string">
+                    <xs:annotation>
+                        <xs:documentation>Transaction id for this command, a unique identifier.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="targets" type="common:oidDto" minOccurs="1" maxOccurs="unbounded">
+                    <xs:annotation>
+                        <xs:documentation>For regular actions, represents the entity/entities or view model(s) upon which the action is to be invoked.  For mixin actions, is the object(s) being mixed-into (the constructor arg to the mixin).  For contributed actions, is the domain service (the contributee object will be one of the action arguments within the payload).  Note that this means that bulk contributed actions cannot be reified as a memento (for this use case, implement as a mixin action instead).
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="action" type="actionDto">
+                    <xs:annotation>
+                        <xs:documentation>The action and arguments to be invoked on the target object(s).</xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+                <xs:element name="user" type="xs:string">
+                    <xs:annotation>
+                        <xs:documentation>The name of the user that initiated/created this command.
+                        </xs:documentation>
+                    </xs:annotation>
+                </xs:element>
+            </xs:sequence>
+        </xs:complexType>
+
+    </xs:element>
+
+    <xs:complexType name="actionDto">
+        <xs:annotation>
+            <xs:documentation>Captures the information required to be able to invoke an action on the target(s).  In particular, identifies the action to be invoked, and also the arguments for the parameters of said action.  Note that the targets are not part of this structure so that it can be reused between cmd and aim schemas (the former of which can relate to multiple targets, the latter always to a single target).  It also _isn't_ necessary to capture whether the action is actually a mixin; this detail is encapsulated within the Apache Isis metamodel.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="actionIdentifier" type="xs:string">
+                <xs:annotation>
+                    <xs:documentation>Formal identifier of the action being invoked.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:sequence minOccurs="0" maxOccurs="unbounded">
+                <xs:element name="parameters" type="paramDto"/>
+            </xs:sequence>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="paramDto">
+        <xs:annotation>
+            <xs:documentation>The parameter types and values (ie arguments) of action parameters.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="argument" type="common:valueDto">
+                <xs:annotation>
+                    <xs:documentation>The argument value of this parameter.</xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="parameterName" use="required" type="xs:string"/>
+        <xs:attribute name="parameterType" use="required" type="common:valueType"/>
+        <xs:attribute name="null" use="optional" type="xs:boolean"/>
+    </xs:complexType>
+
+
+</xs:schema>

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/adocs/documentation/src/main/asciidoc/schema/common/common-1.0.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/common/common-1.0.xsd b/adocs/documentation/src/main/asciidoc/schema/common/common-1.0.xsd
index bb07ba6..bfd25cb 100644
--- a/adocs/documentation/src/main/asciidoc/schema/common/common-1.0.xsd
+++ b/adocs/documentation/src/main/asciidoc/schema/common/common-1.0.xsd
@@ -33,12 +33,13 @@
             <xs:element name="double" type="xs:double"/>
             <xs:element name="boolean" type="xs:boolean"/>
             <xs:element name="char" type="xs:string"/>
-            <xs:element name="bigDecimal" type="xs:decimal"/>
             <xs:element name="bigInteger" type="xs:integer"/>
+            <xs:element name="bigDecimal" type="xs:decimal"/>
             <xs:element name="dateTime" type="xs:dateTime"/>
             <xs:element name="localDate" type="xs:date"/>
             <xs:element name="localDateTime" type="xs:dateTime"/>
             <xs:element name="localTime" type="xs:time"/>
+            <xs:element name="enum" type="enumDto"/>
             <xs:element name="reference" type="oidDto"/>
         </xs:choice>
     </xs:complexType>
@@ -51,6 +52,13 @@
         <xs:attribute name="objectState" type="bookmarkObjectState" default="persistent"/>
     </xs:complexType>
 
+    <xs:complexType name="enumDto">
+        <xs:sequence>
+            <xs:element name="enumType" type="xs:string"/>
+            <xs:element name="enumName" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
     <xs:simpleType name="bookmarkObjectState">
         <xs:restriction base="xs:string">
             <xs:enumeration value="persistent"/>
@@ -59,7 +67,6 @@
         </xs:restriction>
     </xs:simpleType>
 
-
     <xs:simpleType name="valueType">
         <xs:restriction base="xs:string">
             <xs:enumeration value="string"/>
@@ -74,18 +81,42 @@
             <xs:enumeration value="bigInteger"/>
             <xs:enumeration value="bigDecimal"/>
             <xs:enumeration value="javaUtilDate"/>
-            <xs:enumeration value="javaSqlDate"/>
-            <xs:enumeration value="javaSqlTime"/>
-            <xs:enumeration value="javaSqlTimestamp"/>
             <xs:enumeration value="jodaDateTime"/>
             <xs:enumeration value="jodaLocalDate"/>
             <xs:enumeration value="jodaLocalTime"/>
             <xs:enumeration value="jodaLocalDateTime"/>
-            <xs:enumeration value="isisApplibBlob"/>
-            <xs:enumeration value="isisApplibClob"/>
+            <xs:enumeration value="enum"/>
             <xs:enumeration value="reference"/>
+            <xs:enumeration value="void">
+                <xs:annotation>
+                    <xs:documentation>
+                        Not valid to be used as the parameter type of an action; can be used as its return type.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:enumeration>
         </xs:restriction>
     </xs:simpleType>
 
+    <xs:complexType name="periodDto">
+        <xs:annotation>
+            <xs:documentation>Captures a period of time, eg for capturing metrics/timings.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="start" type="xs:dateTime">
+                <xs:annotation>
+                    <xs:documentation>The point in time that this period of time started.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="complete" type="xs:dateTime" minOccurs="0" maxOccurs="1">
+                <xs:annotation>
+                    <xs:documentation>The point in time that this period of time completed.  The duration is the difference between 'start' and 'complete'.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+
 
 </xs:schema>

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/adocs/documentation/src/main/asciidoc/schema/common/common.xsd
----------------------------------------------------------------------
diff --git a/adocs/documentation/src/main/asciidoc/schema/common/common.xsd b/adocs/documentation/src/main/asciidoc/schema/common/common.xsd
index bb07ba6..a52b8f5 100644
--- a/adocs/documentation/src/main/asciidoc/schema/common/common.xsd
+++ b/adocs/documentation/src/main/asciidoc/schema/common/common.xsd
@@ -33,12 +33,13 @@
             <xs:element name="double" type="xs:double"/>
             <xs:element name="boolean" type="xs:boolean"/>
             <xs:element name="char" type="xs:string"/>
-            <xs:element name="bigDecimal" type="xs:decimal"/>
             <xs:element name="bigInteger" type="xs:integer"/>
+            <xs:element name="bigDecimal" type="xs:decimal"/>
             <xs:element name="dateTime" type="xs:dateTime"/>
             <xs:element name="localDate" type="xs:date"/>
             <xs:element name="localDateTime" type="xs:dateTime"/>
             <xs:element name="localTime" type="xs:time"/>
+            <xs:element name="enum" type="enumDto"/>
             <xs:element name="reference" type="oidDto"/>
         </xs:choice>
     </xs:complexType>
@@ -51,6 +52,13 @@
         <xs:attribute name="objectState" type="bookmarkObjectState" default="persistent"/>
     </xs:complexType>
 
+    <xs:complexType name="enumDto">
+        <xs:sequence>
+            <xs:element name="enumType" type="xs:string"/>
+            <xs:element name="enumName" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
     <xs:simpleType name="bookmarkObjectState">
         <xs:restriction base="xs:string">
             <xs:enumeration value="persistent"/>
@@ -59,7 +67,6 @@
         </xs:restriction>
     </xs:simpleType>
 
-
     <xs:simpleType name="valueType">
         <xs:restriction base="xs:string">
             <xs:enumeration value="string"/>
@@ -74,18 +81,41 @@
             <xs:enumeration value="bigInteger"/>
             <xs:enumeration value="bigDecimal"/>
             <xs:enumeration value="javaUtilDate"/>
-            <xs:enumeration value="javaSqlDate"/>
-            <xs:enumeration value="javaSqlTime"/>
-            <xs:enumeration value="javaSqlTimestamp"/>
             <xs:enumeration value="jodaDateTime"/>
             <xs:enumeration value="jodaLocalDate"/>
             <xs:enumeration value="jodaLocalTime"/>
             <xs:enumeration value="jodaLocalDateTime"/>
-            <xs:enumeration value="isisApplibBlob"/>
-            <xs:enumeration value="isisApplibClob"/>
+            <xs:enumeration value="enum"/>
             <xs:enumeration value="reference"/>
+            <xs:enumeration value="void">
+                <xs:annotation>
+                    <xs:documentation>
+                        Not valid to be used as the parameter type of an action; can be used as its return type.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:enumeration>
         </xs:restriction>
     </xs:simpleType>
 
+    <xs:complexType name="periodDto">
+        <xs:annotation>
+            <xs:documentation>Captures a period of time, eg for capturing metrics/timings.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="start" type="xs:dateTime">
+                <xs:annotation>
+                    <xs:documentation>The point in time that this period of time started.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+            <xs:element name="complete" type="xs:dateTime" minOccurs="0" maxOccurs="1">
+                <xs:annotation>
+                    <xs:documentation>The point in time that this period of time completed.  The duration is the difference between 'start' and 'complete'.
+                    </xs:documentation>
+                </xs:annotation>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
 
 </xs:schema>

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/core/applib/src/main/java/org/apache/isis/schema/utils/CommandMementoDtoUtils.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/schema/utils/CommandMementoDtoUtils.java b/core/applib/src/main/java/org/apache/isis/schema/utils/CommandMementoDtoUtils.java
index 5719d97..9e7ae06 100644
--- a/core/applib/src/main/java/org/apache/isis/schema/utils/CommandMementoDtoUtils.java
+++ b/core/applib/src/main/java/org/apache/isis/schema/utils/CommandMementoDtoUtils.java
@@ -207,6 +207,9 @@ public final class CommandMementoDtoUtils {
         }else
         if(parameterType == LocalTime.class) {
             paramDto = newParamDto(params, parameterName, ValueType.JODA_LOCAL_TIME, arg);
+        }else
+        if(parameterType.isEnum()) {
+            paramDto = newParamDto(params, parameterName, ValueType.ENUM, arg);
         }
 
         if(paramDto != null) {

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/core/applib/src/main/java/org/apache/isis/schema/utils/CommonDtoUtils.java
----------------------------------------------------------------------
diff --git a/core/applib/src/main/java/org/apache/isis/schema/utils/CommonDtoUtils.java b/core/applib/src/main/java/org/apache/isis/schema/utils/CommonDtoUtils.java
index 41f102f..3959f41 100644
--- a/core/applib/src/main/java/org/apache/isis/schema/utils/CommonDtoUtils.java
+++ b/core/applib/src/main/java/org/apache/isis/schema/utils/CommonDtoUtils.java
@@ -33,6 +33,7 @@ import org.joda.time.LocalTime;
 
 import org.apache.isis.applib.services.bookmark.Bookmark;
 import org.apache.isis.schema.cmd.v1.ParamDto;
+import org.apache.isis.schema.common.v1.EnumDto;
 import org.apache.isis.schema.common.v1.OidDto;
 import org.apache.isis.schema.common.v1.ValueDto;
 import org.apache.isis.schema.common.v1.ValueType;
@@ -126,6 +127,13 @@ public final class CommonDtoUtils {
             final LocalTime argValue = (LocalTime) val;
             valueDto.setLocalTime(JodaLocalTimeXMLGregorianCalendarAdapter.print(argValue));
         }else
+        if(type.isEnum()) {
+            final Enum argValue = (Enum) val;
+            final EnumDto enumDto = new EnumDto();
+            valueDto.setEnum(enumDto);
+            enumDto.setEnumType(argValue.getClass().getName());
+            enumDto.setEnumName(argValue.name());
+        }else
         {
             // none of the supported value types
             return false;
@@ -169,12 +177,42 @@ public final class CommonDtoUtils {
             return (T) JodaLocalDateTimeXMLGregorianCalendarAdapter.parse(valueDto.getLocalDateTime());
         case JODA_LOCAL_TIME:
             return (T) JodaLocalTimeXMLGregorianCalendarAdapter.parse(valueDto.getLocalTime());
+        case ENUM:
+            final EnumDto enumDto = valueDto.getEnum();
+            final String enumType = enumDto.getEnumType();
+            final Class<? extends Enum> enumClass = loadClass3(enumType);
+            return (T) Enum.valueOf(enumClass, enumDto.getEnumName());
         case REFERENCE:
             return (T) valueDto.getReference();
         }
         throw new IllegalStateException("Value type was not recognised (possible bug)");
     }
 
+    static <T> Class<T> loadClass3(final String enumType) {
+        try {
+            return (Class<T>) loadClass(enumType);
+        } catch (ClassNotFoundException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    static Class<?> loadClass(String className) throws ClassNotFoundException {
+        ClassLoader ccl = Thread.currentThread().getContextClassLoader();
+        if(ccl == null) {
+            return loadClass(className, (ClassLoader)null);
+        } else {
+            try {
+                return loadClass(className, ccl);
+            } catch (ClassNotFoundException var3) {
+                return loadClass(className, (ClassLoader)null);
+            }
+        }
+    }
+
+    static Class<?> loadClass(String className, ClassLoader classLoader) throws ClassNotFoundException {
+        return classLoader == null?Class.forName(className):Class.forName(className, true, classLoader);
+    }
+
     public static OidDto asOidDto(final Bookmark reference) {
         return reference != null ? reference.toOidDto() : null;
     }

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/core/applib/src/test/java/org/apache/isis/schema/utils/CommonDtoUtilsTest.java
----------------------------------------------------------------------
diff --git a/core/applib/src/test/java/org/apache/isis/schema/utils/CommonDtoUtilsTest.java b/core/applib/src/test/java/org/apache/isis/schema/utils/CommonDtoUtilsTest.java
new file mode 100644
index 0000000..2b45322
--- /dev/null
+++ b/core/applib/src/test/java/org/apache/isis/schema/utils/CommonDtoUtilsTest.java
@@ -0,0 +1,66 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.schema.utils;
+
+import org.junit.Test;
+
+import org.apache.isis.schema.common.v1.ValueDto;
+import org.apache.isis.schema.common.v1.ValueType;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+public class CommonDtoUtilsTest {
+
+    @Test
+    public void enums() throws Exception {
+
+        ValueDto valueDto = new ValueDto();
+        boolean b = CommonDtoUtils.setValue(valueDto, Vertical.class, Vertical.DOWN);
+
+        assertThat(b, is(true));
+
+        Object value = CommonDtoUtils.getValue(valueDto, ValueType.ENUM);
+        assertThat(value, is(notNullValue()));
+
+        assertThat((Vertical)value, is(equalTo(Vertical.DOWN)));
+    }
+
+    enum Horizontal {
+        LEFT, RIGHT
+    }
+
+    @Test
+    public void nested_enums() throws Exception {
+
+        ValueDto valueDto = new ValueDto();
+        boolean b = CommonDtoUtils.setValue(valueDto, Horizontal.class, Horizontal.LEFT);
+
+        assertThat(b, is(true));
+
+        Object value = CommonDtoUtils.getValue(valueDto, ValueType.ENUM);
+        assertThat(value, is(notNullValue()));
+
+        assertThat((Horizontal)value, is(equalTo(Horizontal.LEFT)));
+    }
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/core/applib/src/test/java/org/apache/isis/schema/utils/Vertical.java
----------------------------------------------------------------------
diff --git a/core/applib/src/test/java/org/apache/isis/schema/utils/Vertical.java b/core/applib/src/test/java/org/apache/isis/schema/utils/Vertical.java
new file mode 100644
index 0000000..ed8fa23
--- /dev/null
+++ b/core/applib/src/test/java/org/apache/isis/schema/utils/Vertical.java
@@ -0,0 +1,23 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.schema.utils;
+
+enum Vertical {
+    UP, DOWN
+}

http://git-wip-us.apache.org/repos/asf/isis/blob/2d43907f/core/schema/src/main/resources/org/apache/isis/schema/common/common-1.0.xsd
----------------------------------------------------------------------
diff --git a/core/schema/src/main/resources/org/apache/isis/schema/common/common-1.0.xsd b/core/schema/src/main/resources/org/apache/isis/schema/common/common-1.0.xsd
index fe2ac8f..bfd25cb 100644
--- a/core/schema/src/main/resources/org/apache/isis/schema/common/common-1.0.xsd
+++ b/core/schema/src/main/resources/org/apache/isis/schema/common/common-1.0.xsd
@@ -33,12 +33,13 @@
             <xs:element name="double" type="xs:double"/>
             <xs:element name="boolean" type="xs:boolean"/>
             <xs:element name="char" type="xs:string"/>
-            <xs:element name="bigDecimal" type="xs:decimal"/>
             <xs:element name="bigInteger" type="xs:integer"/>
+            <xs:element name="bigDecimal" type="xs:decimal"/>
             <xs:element name="dateTime" type="xs:dateTime"/>
             <xs:element name="localDate" type="xs:date"/>
             <xs:element name="localDateTime" type="xs:dateTime"/>
             <xs:element name="localTime" type="xs:time"/>
+            <xs:element name="enum" type="enumDto"/>
             <xs:element name="reference" type="oidDto"/>
         </xs:choice>
     </xs:complexType>
@@ -51,6 +52,13 @@
         <xs:attribute name="objectState" type="bookmarkObjectState" default="persistent"/>
     </xs:complexType>
 
+    <xs:complexType name="enumDto">
+        <xs:sequence>
+            <xs:element name="enumType" type="xs:string"/>
+            <xs:element name="enumName" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
     <xs:simpleType name="bookmarkObjectState">
         <xs:restriction base="xs:string">
             <xs:enumeration value="persistent"/>
@@ -59,7 +67,6 @@
         </xs:restriction>
     </xs:simpleType>
 
-
     <xs:simpleType name="valueType">
         <xs:restriction base="xs:string">
             <xs:enumeration value="string"/>
@@ -74,15 +81,11 @@
             <xs:enumeration value="bigInteger"/>
             <xs:enumeration value="bigDecimal"/>
             <xs:enumeration value="javaUtilDate"/>
-            <xs:enumeration value="javaSqlDate"/>
-            <xs:enumeration value="javaSqlTime"/>
-            <xs:enumeration value="javaSqlTimestamp"/>
             <xs:enumeration value="jodaDateTime"/>
             <xs:enumeration value="jodaLocalDate"/>
             <xs:enumeration value="jodaLocalTime"/>
             <xs:enumeration value="jodaLocalDateTime"/>
-            <xs:enumeration value="isisApplibBlob"/>
-            <xs:enumeration value="isisApplibClob"/>
+            <xs:enumeration value="enum"/>
             <xs:enumeration value="reference"/>
             <xs:enumeration value="void">
                 <xs:annotation>


[2/4] isis git commit: ISIS-1291: using wormhole pattern so that bulk actions are persisted as list of adapters on command memento. Note sure I like this, though...

Posted by da...@apache.org.
ISIS-1291: using wormhole pattern so that bulk actions are persisted as list of adapters on command memento.  Note sure I like this, though...


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

Branch: refs/heads/ISIS-1291
Commit: a5f3ec11772086ded0828f225d1c36fa70ec1d61
Parents: 0abdc72
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Apr 22 14:36:56 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Apr 22 14:36:56 2016 +0100

----------------------------------------------------------------------
 .../metamodel/spec/feature/ObjectMember.java    |  6 +++-
 .../specimpl/ObjectActionDefault.java           | 31 ++++++++++++++++++--
 .../TransactionalClosureAbstract.java           | 11 +++++--
 .../TransactionalClosureWithReturnAbstract.java |  9 ++++--
 .../collection/bulk/BulkActionsLinkFactory.java | 21 +++++++++----
 5 files changed, 64 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/a5f3ec11/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
index b099991..71b85c6 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/feature/ObjectMember.java
@@ -211,9 +211,13 @@ public interface ObjectMember extends ObjectFeature {
                 public int compare(final ObjectMember o1, final ObjectMember o2) {
                     final MemberOrderFacet o1Facet = o1.getFacet(MemberOrderFacet.class);
                     final MemberOrderFacet o2Facet = o2.getFacet(MemberOrderFacet.class);
+                    String memberId1 = o1.getId();
+                    String memberId2 = o2.getId();
+                    String o1Sequence = o1Facet != null ? o1Facet.sequence() : "0";
+                    String o2Sequence = o2Facet != null ? o2Facet.sequence() : "0";
                     return o1Facet == null? +1:
                             o2Facet == null? -1:
-                                    deweyOrderComparator.compare(o1Facet.sequence(), o2Facet.sequence());
+                                    deweyOrderComparator.compare(o1Sequence, o2Sequence);
                 }
             };
         }

http://git-wip-us.apache.org/repos/asf/isis/blob/a5f3ec11/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionDefault.java
----------------------------------------------------------------------
diff --git a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionDefault.java b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionDefault.java
index bcc0f03..e198ab4 100644
--- a/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionDefault.java
+++ b/core/metamodel/src/main/java/org/apache/isis/core/metamodel/specloader/specimpl/ObjectActionDefault.java
@@ -21,6 +21,7 @@ package org.apache.isis.core.metamodel.specloader.specimpl;
 
 import java.util.Collections;
 import java.util.List;
+import java.util.concurrent.Callable;
 
 import com.google.common.base.Objects;
 import com.google.common.collect.Lists;
@@ -28,6 +29,7 @@ import com.google.common.collect.Lists;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import org.apache.isis.applib.ApplicationException;
 import org.apache.isis.applib.RecoverableException;
 import org.apache.isis.applib.annotation.ActionSemantics;
 import org.apache.isis.applib.annotation.Bulk;
@@ -594,6 +596,26 @@ public class ObjectActionDefault extends ObjectMemberAbstract implements ObjectA
         command.setMemberIdentifier(CommandUtil.actionIdentifierFor(this));
     }
 
+    private static ThreadLocal<List<ObjectAdapter>> commandTargetAdaptersHolder = new ThreadLocal<>();
+
+    /**
+     * A horrible hack to be able to persist a number of adapters in the command object.
+     *
+     * <p>
+     *     What is really needed is to be able to invoke an action on a number of adapters all together.
+     * </p>
+     */
+    public static <T> T withTargetAdapters(final List<ObjectAdapter> adapters, final Callable<T> callable) {
+        commandTargetAdaptersHolder.set(adapters);
+        try {
+            return callable.call();
+        } catch (Exception e) {
+            throw new ApplicationException(e);
+        } finally {
+            commandTargetAdaptersHolder.set(null);
+        }
+    }
+
     protected void setupCommandMementoAndExecutionContext(
             final ObjectAdapter targetAdapter,
             final ObjectAdapter[] arguments) {
@@ -619,9 +641,14 @@ public class ObjectActionDefault extends ObjectMemberAbstract implements ObjectA
 
         // memento
         final CommandMementoService commandMementoService = getCommandMementoService();
+
+        List<ObjectAdapter> commandTargetAdapters =
+                commandTargetAdaptersHolder.get() != null
+                        ? commandTargetAdaptersHolder.get()
+                        : Collections.singletonList(targetAdapter);
+
         final CommandMementoDto dto = commandMementoService.asCommandMemento(
-                Collections.singletonList(targetAdapter),
-                this, arguments);
+                commandTargetAdapters, this, arguments);
 
         final String mementoXml = CommandMementoDtoUtils.toXml(dto);
         command.setMemento(mementoXml);

http://git-wip-us.apache.org/repos/asf/isis/blob/a5f3ec11/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java
index 2453a6c..20bbcdf 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureAbstract.java
@@ -19,7 +19,12 @@
 
 package org.apache.isis.core.runtime.system.transaction;
 
-public interface TransactionalClosureAbstract {
+/**
+ * Not used by the framework, but provided for backward compatibility, eg by the (non-ASF) Isis addons.
+ *
+ * @deprecated - implement {@link TransactionalClosure} instead
+ */
+@Deprecated
+public abstract class TransactionalClosureAbstract implements TransactionalClosure {
 
-    public void execute();
-}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/isis/blob/a5f3ec11/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java
index 8465280..74caac1 100644
--- a/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java
+++ b/core/runtime/src/main/java/org/apache/isis/core/runtime/system/transaction/TransactionalClosureWithReturnAbstract.java
@@ -19,7 +19,12 @@
 
 package org.apache.isis.core.runtime.system.transaction;
 
-public interface TransactionalClosureWithReturnAbstract<T> {
+/**
+ * Not used by the framework, but provided for backward compatibility, eg by the (non-ASF) Isis addons.
+ *
+ * @deprecated - implement {@link TransactionalClosureWithReturn} instead
+ */
+@Deprecated
+public abstract class TransactionalClosureWithReturnAbstract<T> implements TransactionalClosureWithReturn<T> {
 
-    public T execute();
 }

http://git-wip-us.apache.org/repos/asf/isis/blob/a5f3ec11/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
index 7004c56..2a3dc52 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
@@ -19,7 +19,10 @@
 package org.apache.isis.viewer.wicket.ui.components.collection.bulk;
 
 import java.util.List;
+import java.util.concurrent.Callable;
+
 import com.google.common.base.Predicate;
+import com.google.common.collect.FluentIterable;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 import org.apache.wicket.Session;
@@ -41,6 +44,7 @@ import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChec
 import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
 import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
+import org.apache.isis.core.metamodel.specloader.specimpl.ObjectActionDefault;
 import org.apache.isis.core.runtime.system.context.IsisContext;
 import org.apache.isis.viewer.wicket.model.links.LinkAndLabel;
 import org.apache.isis.viewer.wicket.model.mementos.ActionMemento;
@@ -87,8 +91,10 @@ public final class BulkActionsLinkFactory implements ActionLinkFactory {
                 try {
                     final List<ObjectAdapterMemento> toggleMementosList = model.getToggleMementosList();
 
-                    final Iterable<ObjectAdapter> toggledAdapters =
-                            Iterables.transform(toggleMementosList, ObjectAdapterMemento.Functions.fromMemento(concurrencyChecking));
+                    final List<ObjectAdapter> toggledAdapters =
+                            FluentIterable.from(toggleMementosList)
+                            .transform(ObjectAdapterMemento.Functions.fromMemento(concurrencyChecking))
+                            .toList();
 
                     final List<Object> domainObjects = Lists.newArrayList(Iterables.transform(toggledAdapters, ObjectAdapter.Functions.getObject()));
 
@@ -125,13 +131,16 @@ public final class BulkActionsLinkFactory implements ActionLinkFactory {
                             bulkInteractionContext.setIndex(i++);
                         }
 
-                        lastReturnedAdapter = objectAction.executeWithRuleChecking(adapter, new ObjectAdapter[]{},
-                                InteractionInitiatedBy.USER, ActionModel.WHERE_FOR_ACTION_INVOCATION
-                        );
+                        lastReturnedAdapter = ObjectActionDefault.withTargetAdapters(toggledAdapters, new Callable<ObjectAdapter>() {
+                            @Override public ObjectAdapter call() throws Exception {
+                                return objectAction.executeWithRuleChecking(adapter, new ObjectAdapter[]{},
+                                        InteractionInitiatedBy.USER, ActionModel.WHERE_FOR_ACTION_INVOCATION
+                                );
+                            }
+                        });
                     }
 
 
-
                     model.clearToggleMementosList();
                     toggleboxColumn.clearToggles();
                     final ActionModel actionModel = model.getActionModelHint();


[3/4] isis git commit: ISIS-1291: re-implementing BulkActionsLink so that each action is in its own transaction (with its own command).

Posted by da...@apache.org.
ISIS-1291: re-implementing BulkActionsLink so that each action is in its own transaction (with its own command).


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

Branch: refs/heads/ISIS-1291
Commit: d2b3f6c3c62160614724e2a48996fcab0d5434ee
Parents: a5f3ec1
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Fri Apr 22 14:56:31 2016 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Fri Apr 22 14:56:31 2016 +0100

----------------------------------------------------------------------
 .../collection/bulk/BulkActionsLinkFactory.java | 35 ++++++++++----------
 1 file changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/d2b3f6c3/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
index 2a3dc52..12682d5 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collection/bulk/BulkActionsLinkFactory.java
@@ -19,32 +19,33 @@
 package org.apache.isis.viewer.wicket.ui.components.collection.bulk;
 
 import java.util.List;
-import java.util.concurrent.Callable;
 
 import com.google.common.base.Predicate;
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
+
 import org.apache.wicket.Session;
 import org.apache.wicket.markup.html.link.AbstractLink;
 import org.apache.wicket.markup.html.link.Link;
+
 import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
 import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.applib.annotation.InvokedOn;
+import org.apache.isis.applib.services.actinvoc.ActionInvocationContext;
 import org.apache.isis.applib.services.command.Command;
 import org.apache.isis.applib.services.command.Command.Executor;
 import org.apache.isis.applib.services.command.CommandContext;
+import org.apache.isis.applib.services.xactn.TransactionService;
 import org.apache.isis.core.commons.authentication.AuthenticationSession;
 import org.apache.isis.core.commons.authentication.AuthenticationSessionProvider;
 import org.apache.isis.core.commons.authentication.MessageBroker;
 import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
 import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking;
 import org.apache.isis.core.metamodel.adapter.version.ConcurrencyException;
+import org.apache.isis.core.metamodel.consent.InteractionInitiatedBy;
 import org.apache.isis.core.metamodel.runtimecontext.ServicesInjector;
 import org.apache.isis.core.metamodel.spec.feature.ObjectAction;
-import org.apache.isis.core.metamodel.specloader.specimpl.ObjectActionDefault;
 import org.apache.isis.core.runtime.system.context.IsisContext;
 import org.apache.isis.viewer.wicket.model.links.LinkAndLabel;
 import org.apache.isis.viewer.wicket.model.mementos.ActionMemento;
@@ -111,18 +112,19 @@ public final class BulkActionsLinkFactory implements ActionLinkFactory {
                         bulkInteractionContext.setDomainObjects(domainObjects);
                     }
 
-                    final CommandContext commandContext = getServicesInjector().lookupService(CommandContext.class);
-                    final Command command;
-                    if (commandContext != null) {
-                        command = commandContext.getCommand();
-                        command.setExecutor(Executor.USER);
-                    }
 
 
                     ObjectAdapter lastReturnedAdapter = null;
                     int i=0;
                     for(final ObjectAdapter adapter : toggledAdapters) {
 
+                        final CommandContext commandContext = getServicesInjector().lookupService(CommandContext.class);
+                        final Command command;
+                        if (commandContext != null) {
+                            command = commandContext.getCommand();
+                            command.setExecutor(Executor.USER);
+                        }
+
                         int numParameters = objectAction.getParameterCount();
                         if(numParameters != 0) {
                             return;
@@ -131,13 +133,12 @@ public final class BulkActionsLinkFactory implements ActionLinkFactory {
                             bulkInteractionContext.setIndex(i++);
                         }
 
-                        lastReturnedAdapter = ObjectActionDefault.withTargetAdapters(toggledAdapters, new Callable<ObjectAdapter>() {
-                            @Override public ObjectAdapter call() throws Exception {
-                                return objectAction.executeWithRuleChecking(adapter, new ObjectAdapter[]{},
-                                        InteractionInitiatedBy.USER, ActionModel.WHERE_FOR_ACTION_INVOCATION
-                                );
-                            }
-                        });
+                        lastReturnedAdapter = objectAction.executeWithRuleChecking(adapter, new ObjectAdapter[]{},
+                                InteractionInitiatedBy.USER, ActionModel.WHERE_FOR_ACTION_INVOCATION
+                        );
+                        TransactionService transactionService =
+                                getServicesInjector().lookupService(TransactionService.class);
+                        transactionService.nextTransaction();
                     }