]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
adding work authority code. all unit tests pass
authorJesse Martinez <mjesse@gmail.com>
Wed, 6 Feb 2013 14:49:19 +0000 (09:49 -0500)
committerJesse Martinez <mjesse@gmail.com>
Wed, 6 Feb 2013 14:49:19 +0000 (09:49 -0500)
40 files changed:
services/JaxRsServiceProvider/pom.xml
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java
services/build.xml
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml
services/pom.xml
services/relation/service/pom.xml
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java
services/work/3rdparty/build.xml [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/build.xml [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/pom.xml [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/META-INF/MANIFEST.MF [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/core-types-contrib.xml [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/deployment-fragment.xml [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/ecm-types-contrib.xml [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/layouts-contrib.xml [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/life-cycle-contrib.xml [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/workauthorities_common.xsd [new file with mode: 0644]
services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/works_common.xsd [new file with mode: 0644]
services/work/3rdparty/pom.xml [new file with mode: 0644]
services/work/build.xml [new file with mode: 0644]
services/work/client/pom.xml [new file with mode: 0644]
services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClient.java [new file with mode: 0644]
services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClientUtils.java [new file with mode: 0644]
services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityProxy.java [new file with mode: 0644]
services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java [new file with mode: 0644]
services/work/client/src/test/resources/log4j.properties [new file with mode: 0644]
services/work/installer/build.xml [new file with mode: 0644]
services/work/jaxb/pom.xml [new file with mode: 0644]
services/work/jaxb/src/main/java/org/collectionspace/services/WorkJAXBSchema.java [new file with mode: 0644]
services/work/jaxb/src/main/resources/work_common.xsd [new file with mode: 0644]
services/work/jaxb/src/main/resources/workauthority_common.xsd [new file with mode: 0644]
services/work/output.txt [new file with mode: 0644]
services/work/pom.xml [new file with mode: 0644]
services/work/service/pom.xml [new file with mode: 0644]
services/work/service/src/main/java/org/collectionspace/services/work/WorkAuthorityResource.java [new file with mode: 0644]
services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityConstants.java [new file with mode: 0644]
services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityDocumentModelHandler.java [new file with mode: 0644]
services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkConstants.java [new file with mode: 0644]
services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkDocumentModelHandler.java [new file with mode: 0644]
services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkValidatorHandler.java [new file with mode: 0644]

index a0f7709873385315b6a5f3c56e14d932ce71a42d..87565ca7069a08fc9ffd39911dbbcaf9d56554ab 100644 (file)
             <artifactId>org.collectionspace.services.place.service</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.work.service</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.concept.service</artifactId>\r
index f2e3aca030ec4b7b9752ae5998368425913923d7..ff2638176eb94568508272fd27cdbc5e5f4f4f76 100644 (file)
@@ -38,6 +38,7 @@ import org.collectionspace.services.batch.BatchResource;
 import org.collectionspace.services.imports.ImportsResource;
 import org.collectionspace.services.location.LocationAuthorityResource;
 import org.collectionspace.services.place.PlaceAuthorityResource;
+import org.collectionspace.services.work.WorkAuthorityResource;
 import org.collectionspace.services.concept.ConceptAuthorityResource;
 import org.collectionspace.services.taxonomy.TaxonomyAuthorityResource;
 import org.collectionspace.services.movement.MovementResource;
@@ -114,6 +115,7 @@ public class CollectionSpaceJaxRsApplication extends Application
         addResourceToMapAndSingletons(new ConceptAuthorityResource());
         addResourceToMapAndSingletons(new TaxonomyAuthorityResource());
         addResourceToMapAndSingletons(new PlaceAuthorityResource());
+        addResourceToMapAndSingletons(new WorkAuthorityResource());
         addResourceToMapAndSingletons(new AcquisitionResource());
         addResourceToMapAndSingletons(new ContactResource());
         addResourceToMapAndSingletons(new CollectionObjectResource());
index 5e4bde13634d49c935c41d92303de3342410e784..a01573126c67a6eebbde04fd1b500859db83cc5c 100644 (file)
         <ant antfile="batch/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="location/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="place/build.xml" target="deploy" inheritAll="false"/>\r
+        <ant antfile="work/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="concept/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="taxonomy/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="media/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="acquisition/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="taxonomy/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="concept/build.xml" target="undeploy" inheritAll="false"/>\r
+        <ant antfile="work/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="place/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="location/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="objectexit/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="loanout/build.xml" target="dist" inheritAll="false"/>\r
         <ant antfile="location/build.xml" target="dist" inheritAll="false"/>\r
         <ant antfile="place/build.xml" target="dist" inheritAll="false"/>\r
+        <ant antfile="work/build.xml" target="dist" inheritAll="false"/>\r
         <ant antfile="concept/build.xml" target="dist" inheritAll="false"/>\r
         <ant antfile="taxonomy/build.xml" target="dist" inheritAll="false"/>\r
         <ant antfile="objectexit/build.xml" target="dist" inheritAll="false"/>\r
index ce50d07508c5df9aa293db37bed86ac03e63811e..e263015e7d5c1cbe3e9d764ff2e61a52d544f549 100644 (file)
         </tenant:serviceBindings>
         <!-- end concept service meta-data -->
 
+        <!-- begin workauthority service meta-data -->
+        <tenant:serviceBindings id="Workauthorities" name="Workauthorities" type="utility" version="0.1">
+            <!--service:uriPath xmlns:service="http://collectionspace.org/services/common/service">/workauthorities/*/workflow/</service:uriPath>
+            <service:uriPath xmlns:service="http://collectionspace.org/services/common/service">/workauthorities/*/items/*/workflow/</service:uriPath-->
+            <!-- other URI paths using which this service could be accessed -->
+            <!-- 
+            <service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
+                /workauthorities/*/items/
+            </service:uriPath>-->
+            <service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
+            <service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.work.nuxeo.WorkAuthorityDocumentModelHandler</service:documentHandler>
+            <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
+                <service:params>
+                    <service:ListResultsFields>
+                        <service:ListResultField>
+                            <service:element>displayName</service:element>
+                            <service:xpath>displayName</service:xpath>
+                        </service:ListResultField>
+                        <service:ListResultField>
+                            <service:element>shortIdentifier</service:element>
+                            <service:xpath>shortIdentifier</service:xpath>
+                        </service:ListResultField>
+                        <service:ListResultField>
+                            <service:element>vocabType</service:element>
+                            <service:xpath>vocabType</service:xpath>
+                        </service:ListResultField>
+                    </service:ListResultsFields>
+                </service:params>
+            </service:DocHandlerParams>
+            <service:initHandler xmlns:service="http://collectionspace.org/services/config/service">
+                <service:classname>org.collectionspace.services.common.init.AddIndices</service:classname>
+                <service:params>
+                    <service:field>
+                        <service:table>workauthorities_common</service:table>
+                        <service:col>displayname</service:col>
+                    </service:field>
+                    <service:field>
+                        <service:table>workauthorities_common</service:table>
+                        <service:col>shortidentifier</service:col>
+                    </service:field>
+                </service:params>
+            </service:initHandler>
+            <service:object xmlns:service="http://collectionspace.org/services/config/service" id="1" name="Workauthority" version="0.1">
+                <service:part id="0" control_group="Managed" versionable="true" auditable="false" label="workauthorities-system" updated="" order="0">
+                    <service:content contentType="application/xml">
+                        <service:xmlContent namespaceURI="http://collectionspace.org/services/config/system" schemaLocation="http://collectionspace.org/services/config/system http://collectionspace.org/services/config/system/system-response.xsd"/>
+                    </service:content>
+                </service:part>
+                <service:part id="1" control_group="Managed" versionable="true" auditable="false" label="workauthorities_common" updated="" order="1">
+                    <service:content contentType="application/xml">
+                        <service:xmlContent namespaceURI="http://collectionspace.org/services/work" schemaLocation="http://collectionspace.org/services/work http://services.collectionspace.org/work/workauthorities_common.xsd"/>
+                    </service:content>
+                </service:part>
+                <service:part id="2" control_group="Managed" versionable="true" auditable="false" label="collectionspace_core" updated="" order="2">
+                    <service:content contentType="application/xml">
+                        <service:xmlContent namespaceURI="http://collectionspace.org/collectionspace_core/" schemaLocation="http://collectionspace.org/collectionspace_core/ http://services.collectionspace.org/collectionspace_core.xsd"/>
+                    </service:content>
+                </service:part>
+            </service:object>
+        </tenant:serviceBindings>
+        <!-- end workauthority service meta-data -->
+    
+        <!-- begin work service meta-data.
+             Note there is no Work service, but there is a
+             Repository workspace so we have to configure that.
+        -->
+        <tenant:serviceBindings id="Works" name="Works" type="authority" version="0.1">
+            <service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
+            <service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.work.nuxeo.WorkDocumentModelHandler</service:documentHandler>
+            <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
+                <service:params>
+                    <service:ListResultsFields>
+                        <!-- Omit the standard AuthorityItem items (they are handled by the code) -->
+                    </service:ListResultsFields>
+                </service:params>
+            </service:DocHandlerParams>
+            <service:validatorHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.work.nuxeo.WorkValidatorHandler</service:validatorHandler>
+            <service:initHandler xmlns:service="http://collectionspace.org/services/config/service">
+                <service:classname>org.collectionspace.services.common.init.AddIndices</service:classname>
+                <service:params>
+                    <service:field>
+                        <service:table>works_common</service:table>
+                        <service:col>inauthority</service:col>
+                    </service:field>
+                    <service:field>
+                        <service:table>worktermgroup</service:table>
+                        <service:col>termdisplayname</service:col>
+                    </service:field>
+                    <service:field>
+                        <service:table>works_common</service:table>
+                        <service:col>shortidentifier</service:col>
+                    </service:field>
+                </service:params>
+            </service:initHandler>
+            <service:properties xmlns:service="http://collectionspace.org/services/config/service">
+                <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                    <types:key>objectNameProperty</types:key>
+                    <types:value>workTermGroupList/[0]/termDisplayName</types:value>
+                </types:item>
+                <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                    <types:key>objectNumberProperty</types:key>
+                    <types:value>shortIdentifier</types:value>
+                </types:item>
+            </service:properties>
+            <service:object xmlns:service="http://collectionspace.org/services/config/service" id="1" name="Workitem" version="0.1">
+                <service:part id="0" control_group="Managed" versionable="true" auditable="false" label="works-system" updated="" order="0">
+                    <service:content contentType="application/xml">
+                        <service:xmlContent namespaceURI="http://collectionspace.org/services/config/system" schemaLocation="http://collectionspace.org/services/config/system http://collectionspace.org/services/config/system/system-response.xsd"/>
+                    </service:content>
+                </service:part>
+                <service:part id="1" control_group="Managed" versionable="true" auditable="false" label="works_common" updated="" order="1">
+                    <service:properties xmlns:service="http://collectionspace.org/services/config/service">
+                        <!-- Fields containing authority term references -->
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>authRef</types:key>
+                            <types:value>creatorGroupList/*/creator</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>authRef</types:key>
+                            <types:value>publisherGroupList/*/publisher</types:value>
+                        </types:item>
+                        <!-- Fields containing term list / controlled vocabulary references -->
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>creatorGroupList/*/creatorType</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>publisherGroupList/*/publisherType</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>workType</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>workTermGroupList/*/termType</types:value> 
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>workTermGroupList/*/termStatus</types:value> 
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>workTermGroupList/*/termLanguage</types:value> 
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>workTermGroupList/*/termSource</types:value>
+                        </types:item>
+                    </service:properties>
+                    <service:content contentType="application/xml">
+                        <service:xmlContent namespaceURI="http://collectionspace.org/services/work" schemaLocation="http://collectionspace.org/services/work http://services.collectionspace.org/work/works_common.xsd"/>
+                    </service:content>
+                </service:part>
+                <service:part id="2" control_group="Managed" versionable="true" auditable="false" label="collectionspace_core" updated="" order="2">
+                    <service:content contentType="application/xml">
+                        <service:xmlContent namespaceURI="http://collectionspace.org/collectionspace_core/" schemaLocation="http://collectionspace.org/collectionspace_core/ http://services.collectionspace.org/collectionspace_core.xsd"/>
+                    </service:content>
+                </service:part>
+            </service:object>
+        </tenant:serviceBindings>
+        <!-- end work service meta-data --> 
+
         <!-- begin acquisition service meta-data -->
         <tenant:serviceBindings id="Acquisitions" name="Acquisitions" type="procedure" version="0.1">
             <!-- other URI paths through which this service could be accessed -->
index abc587c1a866899c8fc96a1c956b7fccacf65cab..9f200fd81202b2093cabb2668915838ddfbd4cf7 100644 (file)
@@ -63,6 +63,7 @@
         <module>imports</module>
         <module>location</module>
         <module>place</module>
+        <module>work</module>
         <module>concept</module>
         <module>taxonomy</module>
         <module>movement</module>
index 11a9fa8c2e4a98c79a915d74961f127796b4d152..51c52754c7012b19b3856ef61fbb82d5c82370f4 100644 (file)
             <artifactId>org.collectionspace.services.place.client</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.work.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.taxonomy.client</artifactId>\r
index 2b5e22c1412c4180741166f1ab585a7f8d5be325..44e24b9584c6a88b7cd55e9916a46ac40cc7d19e 100644 (file)
@@ -56,6 +56,7 @@ import org.collectionspace.services.client.OrgAuthorityClient;
 import org.collectionspace.services.client.LocationAuthorityClient;
 import org.collectionspace.services.client.TaxonomyAuthorityClient;
 import org.collectionspace.services.client.PlaceAuthorityClient;
+import org.collectionspace.services.client.WorkAuthorityClient;
 import org.collectionspace.services.client.ConceptAuthorityClient;
 import org.collectionspace.services.client.workflow.WorkflowClient;
 
diff --git a/services/work/3rdparty/build.xml b/services/work/3rdparty/build.xml
new file mode 100644 (file)
index 0000000..579742c
--- /dev/null
@@ -0,0 +1,131 @@
+
+<project name="work.3rdparty" default="package" basedir=".">
+    <description>
+        work service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </target>
+
+    <target name="package" depends="package-unix,package-windows"
+  description="Package CollectionSpace Services" />
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+  description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    
+    <target name="clean" depends="clean-unix,clean-windows"
+  description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+    description="deploy work in ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-work/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy work from ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-work/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for work" depends="package">
+        <ant antfile="nuxeo-platform-cs-work/build.xml" target="dist" inheritall="false"/>
+    </target>
+    
+    <target name="dist_installer"
+    description="generate distribution for collectionobject" depends="package">
+        <ant antfile="nuxeo-platform-cs-work/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/build.xml b/services/work/3rdparty/nuxeo-platform-cs-work/build.xml
new file mode 100644 (file)
index 0000000..63c936c
--- /dev/null
@@ -0,0 +1,149 @@
+
+<project name="nuxeo-platform-cs-work" default="package" basedir=".">
+    <description>
+        work nuxeo document type
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../../.."/>
+    <!-- environment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+    <property name="nuxeo.work.jar"
+        value="org.collectionspace.services.work.3rdparty.nuxeo-${cspace.release}.jar"/>
+    <property name="nuxeo.work.jars.all"
+        value="org.collectionspace.services.work.3rdparty.nuxeo-*.jar"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </target>
+
+    <target name="package" depends="package-unix,package-windows"
+        description="Package CollectionSpace Services" />
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+        description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="clean" depends="clean-unix,clean-windows"
+        description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+        description="deploy work doctype in ${jee.server.nuxeo}">
+        <copy file="${basedir}/target/${nuxeo.work.jar}"
+        todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy work doctype from ${jee.server.nuxeo}">
+        <delete>
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.work.jars.all}"/>
+            </fileset>
+            <!-- Legacy deployment location through release 0.6 -->
+            <fileset dir="${jee.deploy.nuxeo.system}">
+                <include name="${nuxeo.work.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+    <target name="dist"
+        description="generate distribution for work doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.work.jar}"/>
+        </copy>
+    </target>
+
+    <target name="dist_installer"
+        description="Creates an installer distribution for work doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.installer.services}/work/nuxeo">
+            <fileset file="${basedir}/target/${nuxeo.work.jar}"/>
+        </copy>
+    </target>
+
+</project>
+
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/pom.xml b/services/work/3rdparty/nuxeo-platform-cs-work/pom.xml
new file mode 100644 (file)
index 0000000..8f98b99
--- /dev/null
@@ -0,0 +1,43 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.work.3rdparty</artifactId>
+        <version>3.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.work.3rdparty.nuxeo</artifactId>
+    <name>services.work.3rdparty.nuxeo</name>
+    <packaging>jar</packaging>
+    <description>
+        Work Nuxeo Document Type
+    </description>
+    
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+                        <manifestEntries>
+                            <Bundle-Version>${eclipseVersion}</Bundle-Version>
+                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/META-INF/MANIFEST.MF b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..988d890
--- /dev/null
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: NuxeoCS
+Bundle-SymbolicName: org.collectionspace.work;singleton:=true 
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Bundle-Vendor: Nuxeo 
+Require-Bundle: org.nuxeo.runtime, 
+ org.nuxeo.ecm.core.api, 
+ org.nuxeo.ecm.core,
+ org.nuxeo.ecm.core.api,
+ org.nuxeo.ecm.platform.types.api,
+ org.nuxeo.ecm.platform.versioning.api,
+ org.nuxeo.ecm.platform.ui,
+ org.nuxeo.ecm.platform.forms.layout.client,
+ org.nuxeo.ecm.platform.ws,
+ org.collectionspace.collectionspace_core
+Provide-Package: org.collectionspace.work
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml,
+ OSGI-INF/life-cycle-contrib.xml,
+ OSGI-INF/ecm-types-contrib.xml,
+ OSGI-INF/layouts-contrib.xml
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/core-types-contrib.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/core-types-contrib.xml
new file mode 100644 (file)
index 0000000..daf074d
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.work.coreTypes">
+    <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+        <schema name="workauthorities_common" prefix="workauthorities_common" src="schemas/workauthorities_common.xsd"/>
+    </extension>
+    <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+        <schema name="works_common" prefix="works_common" src="schemas/works_common.xsd"/>
+    </extension>
+    <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+        <doctype name="Workauthority" extends="Document">
+            <schema name="common"/>
+            <schema name="collectionspace_core"/>
+            <schema name="dublincore"/>
+            <schema name="workauthorities_common"/>
+        </doctype>
+    </extension>
+    <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+        <doctype name="Workitem" extends="Document">
+            <schema name="common"/>
+            <schema name="collectionspace_core"/>
+            <schema name="dublincore"/>
+            <schema name="works_common"/>
+            <prefetch>
+                works_common:workTermGroupList/0/termDisplayName
+                works_common:refName
+                works_common:shortIdentifier
+            </prefetch>
+        </doctype>
+    </extension>
+</component>
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/deployment-fragment.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/deployment-fragment.xml
new file mode 100644 (file)
index 0000000..8bbdd72
--- /dev/null
@@ -0,0 +1,408 @@
+<?xml version="1.0"?>
+<fragment>
+
+  <extension target="application#MODULE">
+    <module>
+      <ejb>${bundle.fileName}</ejb>
+    </module>
+
+    <module>
+      <web>
+        <web-uri>nuxeo.war</web-uri>
+        <context-root>/nuxeo</context-root>
+      </web>
+    </module>
+  </extension>
+
+  <!-- uncomment that to enable tomcat based auth
+    <extension target="web#LOGIN-CONFIG">
+    <login-config>
+    <auth-method>FORM</auth-method>
+    <realm-name>nuxeo.ecm</realm-name>
+    <form-login-config>
+    <form-login-page>/login.jsp</form-login-page>
+    <form-error-page>/login.jsp?loginFailed=true</form-error-page>
+    </form-login-config>
+    </login-config>
+    </extension>
+  -->
+
+  <extension target="web#FILTER-MAPPING">
+
+    <!-- Seam Context Filter is declared in org.nuxeo.ecm.platform.ui.web
+      deployment fragment -->
+
+    <filter-mapping>
+      <filter-name>Seam Context Filter</filter-name>
+      <url-pattern>/ws/FileManageWS</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+      <filter-name>Seam Context Filter</filter-name>
+      <url-pattern>/DocumentManagerWS</url-pattern>
+    </filter-mapping>
+  </extension>
+
+  <extension target="web#SERVLET">
+  </extension>
+
+  <extension target="web#SERVLET-MAPPING">
+  </extension>
+
+  <extension target="pages#PAGES">
+    <!-- This calls a method which load the Workspace logo -->
+    <page view-id="/showLogo.xhtml" action="#{logoHelper.getLogo}"/>
+
+    <!-- Bind URL to the Document URL resolver-->
+    <page view-id="/getDocument.xhtml"
+        action="#{navigationContext.navigateToURL}">
+    </page>
+
+    <page view-id="/nxliveedit.xhtml" action="#{liveEditHelper.getBootstrap()}"/>
+
+    <!-- Bind URL to the Parallele conversation Document URL resolver-->
+    <page view-id="/parallele.xhtml"
+        action="#{paralleleNavigationHelper.navigateToURL}">
+    </page>
+
+    <!-- Post login and 'home' view handler -->
+    <page view-id="/nxstartup.xhtml"
+        action="#{startupHelper.initDomainAndFindStartupPage('Default domain', 'view')}"/>
+
+    <!-- To redirect to the user dashboard instead, use instead:
+
+      <page view-id="/nxstartup.xhtml"
+      action="#{startupHelper.initDomainAndFindStartupPage('Default domain', 'user_dashboard')}" />
+    -->
+
+    <!--  config for workspace management
+      = give a description for each viewId
+    -->
+
+    <page view-id="/view_domains.xhtml">
+      #{currentServerLocation.name}/#{currentTabAction.label}
+    </page>
+
+    <page view-id="/select_document_type.faces.xhtml">
+      Create new document in #{currentDocument.name}
+    </page>
+
+    <page view-id="/create_document.faces.xhtml">
+      Create new document in #{currentDocument.name}
+    </page>
+
+    <page view-id="/user_dashboard.xhtml">
+      breadcrumb=command.user_dashboard
+    </page>
+
+    <page view-id="/view_users.xhtml">
+      breadcrumb=command.manageMembers
+    </page>
+
+    <page view-id="/view_many_users.xhtml">
+      breadcrumb=command.manageMembers
+    </page>
+
+    <page view-id="/view_orgauthorities.xhtml">
+      breadcrumb=title.orgauthorities
+    </page>
+
+    <page view-id="/search/search_form.xhtml">
+      breadcrumb=command.advancedSearch
+    </page>
+  </extension>
+
+  <extension target="faces-config#APPLICATION">
+    <locale-config>
+      <default-locale>en</default-locale>
+      <supported-locale>en_GB</supported-locale>
+      <supported-locale>en_US</supported-locale>
+      <supported-locale>fr</supported-locale>
+      <supported-locale>de</supported-locale>
+      <supported-locale>es</supported-locale>
+      <supported-locale>it</supported-locale>
+      <supported-locale>ar</supported-locale>
+      <supported-locale>ru</supported-locale>
+      <supported-locale>ja</supported-locale>
+      <supported-locale>vn</supported-locale>
+    </locale-config>
+
+    <message-bundle>messages</message-bundle>
+  </extension>
+
+  <extension target="components#PAGEFLOW">
+    <value>config/addWorkspace.jpdl.xml</value>
+  </extension>
+
+  <extension target="faces-config#NAVIGATION">
+    <!-- generic pages -->
+    <navigation-case>
+      <from-outcome>generic_error_page</from-outcome>
+      <to-view-id>/generic_error_page.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>generic_message_page</from-outcome>
+      <to-view-id>/generic_message_page.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>home</from-outcome>
+      <to-view-id>/nxstartup.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>user_login</from-outcome>
+      <to-view-id>/login.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>user_logout</from-outcome>
+      <to-view-id>/logout.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_servers</from-outcome>
+      <to-view-id>/view_servers.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- pages for document actions -->
+
+    <navigation-case>
+      <from-outcome>view_domains</from-outcome>
+      <to-view-id>/view_domains.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>select_document_type</from-outcome>
+      <to-view-id>/select_document_type.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>create_document</from-outcome>
+      <to-view-id>/create_document.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>edit_document</from-outcome>
+      <to-view-id>/edit_document.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_documents</from-outcome>
+      <to-view-id>/view_documents.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>create_file</from-outcome>
+      <to-view-id>/create_file.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>create_workspace_wizard</from-outcome>
+      <to-view-id>/createWorkspaceWizard.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>send_email</from-outcome>
+      <to-view-id>/document_email.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- AT: BBB, use view_documents instead -->
+    <navigation-case>
+      <from-outcome>view_workspaces</from-outcome>
+      <to-view-id>/view_workspaces.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- AT: BBB, use create_document instead -->
+    <navigation-case>
+      <from-outcome>create_domain</from-outcome>
+      <to-view-id>/create_domain.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- AT: BBB, use edit_document instead -->
+    <navigation-case>
+      <from-outcome>edit_domain</from-outcome>
+      <to-view-id>/edit_domain.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- AT: BBB, use create_document instead -->
+    <navigation-case>
+      <from-outcome>create_workspace</from-outcome>
+      <to-view-id>/create_workspace.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- AT: BBB, use edit_document instead -->
+    <navigation-case>
+      <from-outcome>edit_workspace</from-outcome>
+      <to-view-id>/edit_workspace.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- users ang groups -->
+
+    <navigation-case>
+      <from-outcome>members_management</from-outcome>
+      <to-view-id>/members_management.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_users</from-outcome>
+      <to-view-id>/view_users.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_many_users</from-outcome>
+      <to-view-id>/view_many_users.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>edit_user</from-outcome>
+      <to-view-id>/edit_user.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>edit_user_password</from-outcome>
+      <to-view-id>/edit_user_password.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_user</from-outcome>
+      <to-view-id>/view_user.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>create_user</from-outcome>
+      <to-view-id>/create_user.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_groups</from-outcome>
+      <to-view-id>/view_groups.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_group</from-outcome>
+      <to-view-id>/view_group.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>edit_group</from-outcome>
+      <to-view-id>/edit_group.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>create_group</from-outcome>
+      <to-view-id>/create_group.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_orgauthorities</from-outcome>
+      <to-view-id>/view_orgauthorities.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>view_orgauthority</from-outcome>
+      <to-view-id>/view_orgauthority.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- search -->
+
+    <navigation-case>
+      <from-outcome>search_form</from-outcome>
+      <to-view-id>/search/search_form.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>search_results_nxql</from-outcome>
+      <to-view-id>/search/search_results_nxql.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>search_results_advanced</from-outcome>
+      <to-view-id>
+        /search/search_results_advanced.xhtml
+      </to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>search_results_simple</from-outcome>
+      <to-view-id>/search/search_results_simple.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <!-- miscellaneaous -->
+
+    <navigation-case>
+      <from-outcome>clipboard</from-outcome>
+      <to-view-id>/incl/clipboard.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>user_dashboard</from-outcome>
+      <to-view-id>/user_dashboard.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>select_workspace_template</from-outcome>
+      <to-view-id>/select_workspace_template.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>pdf_generation_error</from-outcome>
+      <to-view-id>/pdf_generation_error.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>mass_edit</from-outcome>
+      <to-view-id>/massedit_documents.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+
+    <navigation-case>
+      <from-outcome>mass_edit_confirm</from-outcome>
+      <to-view-id>/massedit_documents_preview.xhtml</to-view-id>
+      <redirect/>
+    </navigation-case>
+  </extension>
+
+</fragment>
+
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/ecm-types-contrib.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/ecm-types-contrib.xml
new file mode 100644 (file)
index 0000000..214104e
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.work.ecm.types">
+  <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
+    <type id="Workauthority" coretype="Workauthority">
+      <label>org.collectionspace.workauthority</label>
+      <!--icon>/icons/file.gif</icon-->
+      <default-view>view_documents</default-view>
+
+      <layouts mode="any">
+        <layout>heading</layout>
+        <layout>csworkauthority</layout>
+      </layouts>
+    </type>
+
+    <type id="Folder" coretype="Folder">
+      <subtypes>
+        <type>Workauthority</type>
+      </subtypes>
+    </type>
+    
+    <type id="Workspace" coretype="Workspace">
+      <subtypes>
+        <type>Workauthority</type>
+      </subtypes>
+    </type>
+
+  </extension>
+  <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
+    <type id="Workitem" coretype="Workitem">
+      <label>org.collectionspace.work</label>
+      <!--icon>/icons/file.gif</icon-->
+      <default-view>view_documents</default-view>
+
+      <layouts mode="any">
+        <layout>heading</layout>
+        <layout>work</layout>
+      </layouts>
+    </type>
+
+    <type id="Folder" coretype="Folder">
+      <subtypes>
+        <type>Work</type>
+      </subtypes>
+    </type>
+    
+    <type id="Workspace" coretype="Workspace">
+      <subtypes>
+        <type>Work</type>
+      </subtypes>
+    </type>
+
+  </extension>
+</component>
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/layouts-contrib.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/layouts-contrib.xml
new file mode 100644 (file)
index 0000000..4327cd5
--- /dev/null
@@ -0,0 +1,240 @@
+<?xml version="1.0"?>
+
+<component name="org.collectionspace.work.layouts.webapp">
+
+  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
+    point="layouts">
+
+    <layout name="csworkauthority">
+      <templates>
+        <template mode="any">/layouts/layout_default_template.xhtml</template>
+      </templates>
+      <rows>
+        <row><widget>displayName</widget></row>
+        <row><widget>shortIdentifier</widget></row>
+        <row><widget>refName</widget></row>
+        <row><widget>vocabType</widget></row>
+      </rows>
+
+      <widget name="displayName" type="text">
+        <labels>
+          <label mode="any">Display Name</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="workauthorities_common">displayName</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="shortIdentifier" type="text">
+        <labels>
+          <label mode="any">Short Identifier</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="workauthorities_common">shortIdentifier</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="refName" type="text">
+        <labels>
+          <label mode="any">RefName</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="workauthorities_common">refName</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="vocabType" type="text">
+        <labels>
+          <label mode="any">Type</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="workauthorities_common">vocabType</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+    </layout>
+  </extension>
+
+  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
+    point="layouts">
+
+    <layout name="work">
+      
+      <templates>
+        <template mode="any">/layouts/layout_default_template.xhtml</template>
+      </templates>
+      <rows>
+        <row><widget>inAuthority</widget></row>
+        <row><widget>shortIdentifier</widget></row>
+        <row><widget>refName</widget></row>
+        <row><widget>displayName</widget></row>
+        <row><widget>displayNameComputed</widget></row>
+        <row><widget>name</widget></row>
+        <row><widget>conditionNote</widget></row>
+        <row><widget>conditionNoteDate</widget></row>
+        <row><widget>securityNote</widget></row>
+        <row><widget>workType</widget></row>
+        <row><widget>status</widget></row>
+      </rows>
+
+      <widget name="inAuthority" type="text">
+        <labels>
+          <label mode="any">inAuthority (WorkAuthority)</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">inAuthority</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+
+      <widget name="shortIdentifier" type="text">
+        <labels>
+          <label mode="any">Short Identifier</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">shortIdentifier</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="refName" type="text">
+        <labels>
+          <label mode="any">refName</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">refName</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="displayName" type="text">
+        <labels>
+          <label mode="any">displayName</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="workauthorities_common">displayName</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="displayNameComputed" type="text">
+        <labels>
+          <label mode="any">displayNameComputed</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="workauthorities_common">displayNameComputed</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="name" type="text">
+        <labels>
+          <label mode="any">name</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">name</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="conditionNote" type="text">
+        <labels>
+          <label mode="any">conditionNote</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">conditionNote</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="conditionNoteDate" type="text">
+        <labels>
+          <label mode="any">conditionNoteDate</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">conditionNoteDate</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="securityNote" type="text">
+        <labels>
+          <label mode="any">securityNote</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">securityNote</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="workType" type="text">
+        <labels>
+          <label mode="any">workType</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">workType</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="status" type="text">
+        <labels>
+          <label mode="any">status</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="works_common">status</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+    
+    </layout>
+  </extension>
+</component>
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/life-cycle-contrib.xml b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/OSGI-INF/life-cycle-contrib.xml
new file mode 100644 (file)
index 0000000..d2db541
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.work.LifeCycleManagerExtensions">
+
+  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+             point="types">
+    <types>
+      <type name="Workauthority">${Lifecycle}</type>
+      <type name="Workitem">${Lifecycle}</type>
+    </types>
+  </extension>
+
+</component>
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/workauthorities_common.xsd b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/workauthorities_common.xsd
new file mode 100644 (file)
index 0000000..8a0e95c
--- /dev/null
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    WorkAuthority schema (XSD)
+    
+    Entity  : WorkAuthority
+    Part    : Common
+    Used for: Nuxeo EP core document type
+    
+-->
+
+<xs:schema 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:ns="http://collectionspace.org/services/work"
+  xmlns="http://collectionspace.org/services/work"
+  targetNamespace="http://collectionspace.org/services/work"
+  version="0.1"
+  >
+
+<!-- Flattened version of jaxb schema for nuxeo -->
+<!-- See http://wiki.collectionspace.org/display/deploy/Work+Authority+Schema -->    
+
+    <!--  WorkAuthority Information Group -->
+    <xs:element name="displayName" type="xs:string"/>
+    <xs:element name="shortIdentifier" type="xs:string"/>
+    <xs:element name="refName" type="xs:string"/>
+    <xs:element name="vocabType" type="xs:string"/>
+    <xs:element name="source" type="xs:string"/>
+    <xs:element name="description" type="xs:string"/>
+
+</xs:schema>
+
diff --git a/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/works_common.xsd b/services/work/3rdparty/nuxeo-platform-cs-work/src/main/resources/schemas/works_common.xsd
new file mode 100644 (file)
index 0000000..76fc280
--- /dev/null
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Work schema (XSD)
+    
+    Entity  : Work
+    Part    : Common
+    Used for: Nuxeo EP core document type
+
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/services/work"
+    xmlns="http://collectionspace.org/services/work"
+    targetNamespace="http://collectionspace.org/services/work" version="0.1">
+    <!-- See http://wiki.collectionspace.org/display/deploy/MMI+Data+Analysis+and+Mapping -->
+
+    <!--  Common Authority Information Group -->
+    <!--  inAuthority is the csid of the owning WorkAuthority -->
+    <xs:element name="inAuthority" type="xs:string"/>
+    <xs:element name="shortIdentifier" type="xs:string"/>
+    <xs:element name="refName" type="xs:string"/>
+
+    <xs:element name="workHistoryNote" type="xs:string"/>
+    <xs:element name="workType" type="xs:string"/>
+    
+    <!-- List of WorkTerms -->
+    <xs:element name="workTermGroupList" type="workTermGroupList"/>
+    
+    <!-- List of Creators -->
+    <xs:element name="creatorGroupList" type="creatorGroupList"/>
+    
+    <!-- List of Publishers -->
+    <xs:element name="publisherGroupList" type="publisherGroupList"/>
+
+    <!-- List of Structured Dates -->
+    <xs:element name="workDateGroupList" type="workDateGroupList"/>
+
+<!-- =================================================================
+     Work Term Group repeating structure
+     ================================================================= -->
+
+    <xs:complexType name="workTermGroupList">
+        <xs:sequence>
+            <xs:element name="workTermGroup" type="workTermGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="workTermGroup">
+        <xs:sequence>
+            <xs:element name="termDisplayName" type="xs:string"/>
+            <xs:element name="termName" type="xs:string"/>
+            <xs:element name="termType" type="xs:string"/>
+            <xs:element name="termStatus" type="xs:string"/>
+            <xs:element name="termQualifier" type="xs:string"/>
+            <xs:element name="termLanguage" type="xs:string"/>
+            <xs:element name="termPrefForLang" type="xs:boolean"/>
+            <xs:element name="termSource" type="xs:string"/>
+            <xs:element name="termSourceDetail" type="xs:string"/>
+            <xs:element name="termSourceID" type="xs:string"/>
+            <xs:element name="termSourceNote" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+    
+<!-- =================================================================
+     Creator Group repeating structure
+     ================================================================= -->
+
+    <xs:complexType name="creatorGroupList">
+        <xs:sequence>
+            <xs:element name="creatorGroup" type="creatorGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="creatorGroup">
+        <xs:sequence>
+            <xs:element name="creator" type="xs:string"/>
+            <xs:element name="creatorType" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+<!-- =================================================================
+     Publisher Group repeating structure
+     ================================================================= -->
+
+    <xs:complexType name="publisherGroupList">
+        <xs:sequence>
+            <xs:element name="publisherGroup" 
+                        type="publisherGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="publisherGroup">
+        <xs:sequence>
+            <xs:element name="publisher" type="xs:string"/>
+            <xs:element name="publisherType" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+<!-- =================================================================
+     Structured Date repeating structure
+     ================================================================= -->
+    
+    <xs:complexType name="workDateGroupList">
+        <xs:sequence>
+            <xs:element name="workDateGroup" type="structuredDateGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+            </xs:sequence>
+    </xs:complexType>
+    
+    <!-- Before (re)using this generic complex type in any record type -->
+    <!-- other than CollectionObject, be sure to verify that Nuxeo handles -->
+    <!-- that correctly in its table creation/row linking. -->
+    <xs:complexType name="structuredDateGroup">
+        <xs:sequence>
+            <xs:element name="dateDisplayDate" type="xs:string"/>
+            <xs:element name="dateAssociation" type="xs:string"/>
+            <xs:element name="dateEarliestSingleYear" type="xs:integer"/>
+            <xs:element name="dateEarliestSingleMonth" type="xs:integer"/>
+            <xs:element name="dateEarliestSingleDay" type="xs:integer"/>
+            <xs:element name="dateEarliestSingleEra" type="xs:string"/>
+            <xs:element name="dateEarliestSingleCertainty" type="xs:string"/>
+            <xs:element name="dateEarliestSingleQualifier" type="xs:string"/>
+            <xs:element name="dateEarliestSingleQualifierValue" type="xs:integer"/>
+            <xs:element name="dateEarliestSingleQualifierUnit" type="xs:string"/>
+            <xs:element name="dateLatestYear" type="xs:integer"/>
+            <xs:element name="dateLatestMonth" type="xs:integer"/>
+            <xs:element name="dateLatestDay" type="xs:integer"/>
+            <xs:element name="dateLatestEra" type="xs:string"/>
+            <xs:element name="dateLatestCertainty" type="xs:string"/>
+            <xs:element name="dateLatestQualifier" type="xs:string"/>
+            <xs:element name="dateLatestQualifierValue" type="xs:integer"/>
+            <xs:element name="dateLatestQualifierUnit" type="xs:string"/>
+            <xs:element name="datePeriod" type="xs:string"/>
+            <xs:element name="dateNote" type="xs:string"/>
+            <xs:element name="dateEarliestScalarValue" type="xs:date"/>
+            <xs:element name="dateLatestScalarValue" type="xs:date"/>
+            <xs:element name="scalarValuesComputed" type="xs:boolean"/>
+        </xs:sequence>
+    </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/services/work/3rdparty/pom.xml b/services/work/3rdparty/pom.xml
new file mode 100644 (file)
index 0000000..97bce69
--- /dev/null
@@ -0,0 +1,23 @@
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.work</artifactId>
+        <version>3.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.work.3rdparty</artifactId>
+    <name>services.work.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+        3rd party build for work service
+    </description>
+
+    <modules>
+        <module>nuxeo-platform-cs-work</module>
+    </modules>
+</project>
diff --git a/services/work/build.xml b/services/work/build.xml
new file mode 100644 (file)
index 0000000..b8f3ffe
--- /dev/null
@@ -0,0 +1,131 @@
+<project name="work" default="package" basedir=".">
+    <description>
+        Work Authority service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+        <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="package" depends="package-unix,package-windows"
+  description="Package CollectionSpace Services" />
+  
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+  description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="clean" depends="clean-unix,clean-windows"
+  description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+        description="deploy work service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy work service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+        description="distribute work service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+    <target name="dist_installer" depends="package"
+        description="distribute work service">        
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}/work">
+            <fileset dir="${basedir}/installer/"/>
+        </copy>
+        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
diff --git a/services/work/client/pom.xml b/services/work/client/pom.xml
new file mode 100644 (file)
index 0000000..f526786
--- /dev/null
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.work</artifactId>
+        <version>3.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.work.client</artifactId>
+    <name>services.work.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.work.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>   
+        <!-- External dependencies -->
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <!-- filter out unwanted jars -->
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-work-client</finalName>
+        <plugins>
+        </plugins>
+    </build>
+</project>
+
diff --git a/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClient.java b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClient.java
new file mode 100644 (file)
index 0000000..cb74f4c
--- /dev/null
@@ -0,0 +1,72 @@
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright Â© 2009 The Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.client;
+
+import org.collectionspace.services.work.WorksCommon;
+
+/**
+ * The Class WorkAuthorityClient.
+ */
+public class WorkAuthorityClient extends AuthorityClientImpl<WorksCommon, WorkAuthorityProxy> {
+
+    public static final String SERVICE_NAME = "workauthorities";
+    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
+    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+    public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
+    public static final String TERM_INFO_GROUP_XPATH_BASE = "workTermGroupList";
+    //
+    // Subitem constants
+    //
+    public static final String SERVICE_ITEM_NAME = "works";
+    public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
+    //
+    // Payload Part/Schema part names
+    //
+    public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME
+            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+    public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME
+            + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+
+    @Override
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
+
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+    @Override
+    public String getItemCommonPartName() {
+        return getCommonPartName(SERVICE_ITEM_NAME);
+    }
+
+    @Override
+    public Class<WorkAuthorityProxy> getProxyClass() {
+        return WorkAuthorityProxy.class;
+    }
+
+    @Override
+    public String getInAuthority(WorksCommon item) {
+        return item.getInAuthority();
+    }
+
+    @Override
+    public void setInAuthority(WorksCommon item, String inAuthorityCsid) {
+        item.setInAuthority(inAuthorityCsid);
+    }
+}
diff --git a/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClientUtils.java b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityClientUtils.java
new file mode 100644 (file)
index 0000000..2b783d8
--- /dev/null
@@ -0,0 +1,294 @@
+package org.collectionspace.services.client;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+import org.apache.commons.io.FileUtils;
+import org.collectionspace.services.WorkJAXBSchema;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.work.WorkTermGroup;
+import org.collectionspace.services.work.WorkTermGroupList;
+import org.collectionspace.services.work.WorkauthoritiesCommon;
+import org.collectionspace.services.work.WorksCommon;
+import org.dom4j.DocumentException;
+import org.jboss.resteasy.client.ClientResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkAuthorityClientUtils {
+    private static final Logger logger =
+        LoggerFactory.getLogger(WorkAuthorityClientUtils.class);
+
+    /**
+     * Creates a new Work Authority
+     * @param displayName   The displayName used in UI, etc.
+     * @param refName       The proper refName for this authority
+     * @param headerLabel   The common part label
+     * @return  The PoxPayloadOut payload for the create call
+     */
+    public static PoxPayloadOut createWorkAuthorityInstance(
+            String displayName, String shortIdentifier, String headerLabel ) {
+        WorkauthoritiesCommon workAuthority = new WorkauthoritiesCommon();
+        workAuthority.setDisplayName(displayName);
+        workAuthority.setShortIdentifier(shortIdentifier);
+        String refName = createWorkAuthRefName(shortIdentifier, displayName);
+        workAuthority.setRefName(refName);
+        workAuthority.setVocabType("WorkAuthority"); //FIXME: REM - Should this really be hard-coded?
+        PoxPayloadOut multipart = new PoxPayloadOut(WorkAuthorityClient.SERVICE_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(workAuthority, MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+            logger.debug("to be created, workAuthority common ", 
+                        workAuthority, WorkauthoritiesCommon.class);
+        }
+
+        return multipart;
+    }
+
+    /**
+     * @param workRefName  The proper refName for this authority
+     * @param workInfo the properties for the new Work. Can pass in one condition
+     *                      note and date string.
+     * @param headerLabel   The common part label
+     * @return  The PoxPayloadOut payload for the create call
+     */
+    public static PoxPayloadOut createWorkInstance( 
+            String workAuthRefName, Map<String, String> workInfo, 
+        List<WorkTermGroup> terms, String headerLabel){
+        WorksCommon work = new WorksCommon();
+        String shortId = workInfo.get(WorkJAXBSchema.SHORT_IDENTIFIER);
+        work.setShortIdentifier(shortId);
+
+        // Set values in the Term Information Group
+        WorkTermGroupList termList = new WorkTermGroupList();
+        if (terms == null || terms.isEmpty()) {
+            terms = getTermGroupInstance(getGeneratedIdentifier());
+        }
+        termList.getWorkTermGroup().addAll(terms); 
+        work.setWorkTermGroupList(termList);
+        
+        PoxPayloadOut multipart = new PoxPayloadOut(WorkAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(work,
+            MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+            logger.debug("to be created, work common ", work, WorksCommon.class);
+        }
+
+        return multipart;
+    }
+    
+    /**
+     * @param vcsid CSID of the authority to create a new work
+     * @param workAuthorityRefName The refName for the authority
+     * @param workMap the properties for the new Work
+     * @param client the service client
+     * @return the CSID of the new item
+     */
+    public static String createItemInAuthority(String vcsid, 
+            String workAuthorityRefName, Map<String,String> workMap,
+            List<WorkTermGroup> terms, WorkAuthorityClient client ) {
+        // Expected status code: 201 Created
+        int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+        // Type of service request being tested
+        ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+        
+        String displayName = "";
+        if ((terms !=null) && (! terms.isEmpty())) {
+            displayName = terms.get(0).getTermDisplayName();
+        }
+        if(logger.isDebugEnabled()){
+            logger.debug("Creating item with display name: \"" + displayName
+                    +"\" in locationAuthority: \"" + vcsid +"\"");
+        }
+        PoxPayloadOut multipart = 
+            createWorkInstance( workAuthorityRefName,
+                workMap, terms, client.getItemCommonPartName() );
+        String newID = null;
+        ClientResponse<Response> res = client.createItem(vcsid, multipart);
+        try {
+            int statusCode = res.getStatus();
+    
+            if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                throw new RuntimeException("Could not create Item: \""
+                        +workMap.get(WorkJAXBSchema.SHORT_IDENTIFIER)
+                        +"\" in workAuthority: \"" + workAuthorityRefName
+                        +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+            }
+            if(statusCode != EXPECTED_STATUS_CODE) {
+                throw new RuntimeException("Unexpected Status when creating Item: \""
+                        +workMap.get(WorkJAXBSchema.SHORT_IDENTIFIER)
+                        +"\" in workAuthority: \"" + workAuthorityRefName +"\", Status:"+ statusCode);
+            }
+            newID = extractId(res);
+        } finally {
+            res.releaseConnection();
+        }
+
+        return newID;
+    }
+
+    public static PoxPayloadOut createWorkInstance(
+            String commonPartXML, String headerLabel)  throws DocumentException {
+        PoxPayloadOut multipart = new PoxPayloadOut(WorkAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(commonPartXML,
+            MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+            logger.debug("to be created, work common ", commonPartXML);
+        }
+
+        return multipart;
+    }
+    
+    public static String createItemInAuthority(String vcsid,
+            String commonPartXML,
+            WorkAuthorityClient client ) throws DocumentException {
+        // Expected status code: 201 Created
+        int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+        // Type of service request being tested
+        ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+        
+        PoxPayloadOut multipart = 
+            createWorkInstance(commonPartXML, client.getItemCommonPartName());
+        String newID = null;
+        ClientResponse<Response> res = client.createItem(vcsid, multipart);
+        try {
+            int statusCode = res.getStatus();
+    
+            if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                throw new RuntimeException("Could not create Item: \""+commonPartXML
+                        +"\" in workAuthority: \"" + vcsid
+                        +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+            }
+            if(statusCode != EXPECTED_STATUS_CODE) {
+                throw new RuntimeException("Unexpected Status when creating Item: \""+commonPartXML
+                        +"\" in workAuthority: \"" + vcsid +"\", Status:"+ statusCode);
+            }
+            newID = extractId(res);
+        } finally {
+            res.releaseConnection();
+        }
+
+        return newID;
+    }
+    
+    /**
+     * Creates the from xml file.
+     *
+     * @param fileName the file name
+     * @return new CSID as string
+     * @throws Exception the exception
+     */
+    private String createItemInAuthorityFromXmlFile(String vcsid, String commonPartFileName, 
+            WorkAuthorityClient client) throws Exception {
+        byte[] b = FileUtils.readFileToByteArray(new File(commonPartFileName));
+        String commonPartXML = new String(b);
+        return createItemInAuthority(vcsid, commonPartXML, client );
+    }    
+
+    /**
+     * Creates the workAuthority ref name.
+     *
+     * @param shortId the workAuthority shortIdentifier
+     * @param displaySuffix displayName to be appended, if non-null
+     * @return the string
+     */
+    public static String createWorkAuthRefName(String shortId, String displaySuffix) {
+        String refName = "urn:cspace:org.collectionspace.demo:workauthority:name("
+            +shortId+")";
+        if(displaySuffix!=null&&!displaySuffix.isEmpty())
+            refName += "'"+displaySuffix+"'";
+        return refName;
+    }
+
+    /**
+     * Creates the work ref name.
+     *
+     * @param workAuthRefName the workAuthority ref name
+     * @param shortId the work shortIdentifier
+     * @param displaySuffix displayName to be appended, if non-null
+     * @return the string
+     */
+    public static String createWorkRefName(
+                            String workAuthRefName, String shortId, String displaySuffix) {
+        String refName = workAuthRefName+":work:name("+shortId+")";
+        if(displaySuffix!=null&&!displaySuffix.isEmpty())
+            refName += "'"+displaySuffix+"'";
+        return refName;
+    }
+
+    public static String extractId(ClientResponse<Response> res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);
+        if(logger.isDebugEnabled()){
+            logger.debug("extractId:uri=" + uri);
+        }
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        if(logger.isDebugEnabled()){
+            logger.debug("id=" + id);
+        }
+        return id;
+    }
+    
+    /**
+     * Returns an error message indicating that the status code returned by a
+     * specific call to a service does not fall within a set of valid status
+     * codes for that service.
+     *
+     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).
+     *
+     * @param statusCode  The invalid status code that was returned in the response,
+     *                    from submitting that type of request to the service.
+     *
+     * @return An error message.
+     */
+    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {
+        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +
+                requestType.validStatusCodesAsString();
+    }
+
+
+    
+    /**
+     * Produces a default displayName from one or more supplied field(s).
+     * @see WorkAuthorityDocumentModelHandler.prepareDefaultDisplayName() which
+     * duplicates this logic, until we define a service-general utils package
+     * that is neither client nor service specific.
+     * @param workName  
+     * @return a display name
+     */
+    public static String prepareDefaultDisplayName(
+            String workName ) {
+        StringBuilder newStr = new StringBuilder();
+            newStr.append(workName);
+        return newStr.toString();
+    }
+    
+    public static List<WorkTermGroup> getTermGroupInstance(String identifier) {
+        if (Tools.isBlank(identifier)) {
+            identifier = getGeneratedIdentifier();
+        }
+        List<WorkTermGroup> terms = new ArrayList<WorkTermGroup>();
+        WorkTermGroup term = new WorkTermGroup();
+        term.setTermDisplayName(identifier);
+        term.setTermName(identifier);
+        terms.add(term);
+        return terms;
+    }
+    
+    private static String getGeneratedIdentifier() {
+        return "id" + new Date().getTime(); 
+   }
+    
+}
diff --git a/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityProxy.java b/services/work/client/src/main/java/org/collectionspace/services/client/WorkAuthorityProxy.java
new file mode 100644 (file)
index 0000000..0bdf244
--- /dev/null
@@ -0,0 +1,11 @@
+package org.collectionspace.services.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+@Path(WorkAuthorityClient.SERVICE_PATH + "/")
+@Produces("application/xml")
+@Consumes("application/xml")
+public interface WorkAuthorityProxy extends AuthorityProxy {
+}
diff --git a/services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java b/services/work/client/src/test/java/org/collectionspace/services/client/test/WorkAuthorityServiceTest.java
new file mode 100644 (file)
index 0000000..34d0130
--- /dev/null
@@ -0,0 +1,525 @@
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c)) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * 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.collectionspace.services.client.test;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.collectionspace.services.WorkJAXBSchema;
+import org.collectionspace.services.client.AbstractCommonListUtils;
+import org.collectionspace.services.client.AuthorityClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.client.WorkAuthorityClient;
+import org.collectionspace.services.client.WorkAuthorityClientUtils;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.work.WorkTermGroup;
+import org.collectionspace.services.work.WorkTermGroupList;
+import org.collectionspace.services.work.WorkauthoritiesCommon;
+import org.collectionspace.services.work.WorksCommon;
+import org.jboss.resteasy.client.ClientResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+
+/**
+ * WorkAuthorityServiceTest, carries out tests against a
+ * deployed and running WorkAuthority Service.
+ *
+ */
+public class WorkAuthorityServiceTest extends AbstractAuthorityServiceTest<WorkauthoritiesCommon, WorksCommon> {
+
+    /** The logger. */
+    private final String CLASS_NAME = WorkAuthorityServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(WorkAuthorityServiceTest.class);
+
+    @Override
+    public String getServicePathComponent() {
+        return WorkAuthorityClient.SERVICE_PATH_COMPONENT;
+    }
+
+    @Override
+    protected String getServiceName() {
+        return WorkAuthorityClient.SERVICE_NAME;
+    }
+    
+    public String getItemServicePathComponent() {
+        return AuthorityClient.ITEMS;
+    }   
+    
+    // Instance variables specific to this test.
+    
+//    /** The SERVICE path component. */
+//    final String SERVICE_PATH_COMPONENT = "workauthorities";
+//    
+//    /** The ITEM service path component. */
+//    final String ITEM_SERVICE_PATH_COMPONENT = "items";
+//    
+
+    final String TEST_WORK_TERM_DISPLAY_NAME = "Muppets Take Manhattan (1984)";
+    final String TEST_WORK_TERM_NAME = "Muppets Take Manhattan";
+    final String TEST_WORK_TERM_TYPE = "";
+    final String TEST_WORK_TERM_STATUS = "accepted";
+    final String TEST_WORK_TERM_QUALIFIER = "";
+    final String TEST_WORK_TERM_LANGUAGE = "english";
+    final Boolean TEST_WORK_TERM_PREFFORLANG = true;
+    final String TEST_WORK_TERM_SOURCE = "featurefilms";
+    final String TEST_WORK_TERM_SOURCE_DETAIL = "internal";
+    final String TEST_WORK_TERM_SOURCE_ID = "12345";    
+    final String TEST_WORK_TERM_SOURCE_NOTE = "source note goes here";
+    final String TEST_WORK_HISTORY_NOTE = "history note goes here";
+    final String TEST_WORK_TYPE = "work type goes here";
+    final String TEST_WORK_CREATOR_GROUP_CREATOR = "Frank Oz";
+    final String TEST_WORK_CREATOR_GROUP_CREATOR_TYPE = "director";
+    final String TEST_WORK_PUBLISHER_GROUP_PUBLISHER = "TriStar Pictures";
+    final String TEST_WORK_PUBLISHER_GROUP_PUBLISHER_TYPE = "Distributor";
+    final String TEST_WORK_SHORT_IDENTIFIER = "muppetstakemanhattan";
+    final String TEST_WORK_REFNAME = "refname";
+    
+    /** The known resource id. */
+    private String knownResourceShortIdentifer = null;
+    private String knownResourceRefName = null;
+    private String knownWorkTypeRefName = null;
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+        return new WorkAuthorityClient();
+    }
+
+    /**
+     * Creates the item in authority.
+     *
+     * @param vcsid the vcsid
+     * @param authRefName the auth ref name
+     * @return the string
+     */
+    private String createItemInAuthority(String vcsid, String authRefName) {
+        final String testName = "createItemInAuthority("+vcsid+","+authRefName+")"; 
+    
+        // Submit the request to the service and store the response.
+        WorkAuthorityClient client = new WorkAuthorityClient();
+        Map<String, String> workMap = new HashMap<String,String>();
+        // TODO Make work type and status be controlled vocabs.
+        workMap.put(WorkJAXBSchema.SHORT_IDENTIFIER, TEST_WORK_SHORT_IDENTIFIER);
+        workMap.put(WorkJAXBSchema.WORK_TYPE, TEST_WORK_TYPE);
+        workMap.put(WorkJAXBSchema.WORK_HISTORY_NOTE, TEST_WORK_HISTORY_NOTE);
+        
+        List<WorkTermGroup> terms = new ArrayList<WorkTermGroup>();
+        WorkTermGroup term = new WorkTermGroup();
+        term.setTermDisplayName(TEST_WORK_TERM_DISPLAY_NAME);
+        term.setTermName(TEST_WORK_TERM_NAME);
+        term.setTermSource(TEST_WORK_TERM_SOURCE);
+        term.setTermSourceDetail(TEST_WORK_TERM_SOURCE_DETAIL);
+        term.setTermStatus(TEST_WORK_TERM_STATUS);
+        terms.add(term);
+        
+        String newID = WorkAuthorityClientUtils.createItemInAuthority(vcsid,
+                authRefName, workMap, terms, client );    
+
+        // Store the ID returned from the first item resource created
+        // for additional tests below.
+        if (knownItemResourceId == null){
+            setKnownItemResource(newID, TEST_WORK_SHORT_IDENTIFIER);
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": knownItemResourceId=" + newID);
+            }
+        }
+        
+        // Store the IDs from any item resources created
+        // by tests, along with the IDs of their parents, so these items
+        // can be deleted after all tests have been run.
+        allResourceItemIdsCreated.put(newID, vcsid);
+
+        return newID;
+    }
+
+    /**
+     * Verify illegal item display name.
+     *
+     * @param testName the test name
+     * @throws Exception the exception
+     */
+    @Test(dataProvider="testName")
+    public void verifyIllegalItemDisplayName(String testName) throws Exception {
+        // Perform setup for read.
+        setupRead();
+
+        // Submit the request to the service and store the response.
+        WorkAuthorityClient client = new WorkAuthorityClient();
+        ClientResponse<String> res = client.readItem(knownResourceId, knownItemResourceId);
+        WorksCommon work = null;
+        try {
+            assertStatusCode(res, testName);        
+            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+            work = (WorksCommon) extractPart(input,
+                    client.getItemCommonPartName(), WorksCommon.class);
+            Assert.assertNotNull(work);
+        } finally {
+                if (res != null) {
+                res.releaseConnection();
+        }
+        }
+
+        //
+        // Make an invalid UPDATE request, without a display name
+        //
+        WorkTermGroupList termList = work.getWorkTermGroupList();
+        Assert.assertNotNull(termList);
+        List<WorkTermGroup> terms = termList.getWorkTermGroup();
+        Assert.assertNotNull(terms);
+        Assert.assertTrue(terms.size() > 0);
+        terms.get(0).setTermDisplayName(null);
+        terms.get(0).setTermName(null);
+        
+        setupUpdateWithInvalidBody(); // we expect a failure
+        
+        // Submit the updated resource to the service and store the response.
+        PoxPayloadOut output = new PoxPayloadOut(WorkAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = output.addPart(client.getItemCommonPartName(), work);
+        setupUpdateWithInvalidBody(); // we expected a failure here.
+        res = client.updateItem(knownResourceId, knownItemResourceId, output);
+        try {
+            assertStatusCode(res, testName);
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+    }
+
+    /**
+     * Read item list.
+     */
+    @Test(dataProvider = "testName", groups = {"readList"},
+               dependsOnMethods = {"readList"})
+    public void readItemList(String testName) {
+        readItemList(knownAuthorityWithItems, null);
+    }
+
+    /**
+     * Read item list by authority name.
+     */
+    @Test(dataProvider = "testName", groups = {"readList"},
+            dependsOnMethods = {"readItemList"})
+    public void readItemListByAuthorityName(String testName) {
+        readItemList(null, READITEMS_SHORT_IDENTIFIER);
+    }
+    
+    /**
+     * Read item list.
+     * 
+     * @param vcsid
+     *            the vcsid
+     * @param name
+     *            the name
+     */
+    private void readItemList(String vcsid, String shortId) {
+        String testName = "readItemList";
+
+        // Perform setup.
+        setupReadList();
+
+        // Submit the request to the service and store the response.
+        WorkAuthorityClient client = new WorkAuthorityClient();
+        ClientResponse<AbstractCommonList> res = null;
+        if (vcsid != null) {
+            res = client.readItemList(vcsid, null, null);
+        } else if (shortId != null) {
+            res = client.readItemListForNamedAuthority(shortId, null, null);
+        } else {
+            Assert.fail("readItemList passed null csid and name!");
+        }
+        
+        AbstractCommonList list = null;
+        try {
+            assertStatusCode(res, testName);
+            list = res.getEntity();
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+        
+        List<AbstractCommonList.ListItem> items = list.getListItem();
+        int nItemsReturned = items.size();
+        // There will be 'nItemsToCreateInList'
+        // items created by the createItemList test,
+        // all associated with the same parent resource.
+        int nExpectedItems = nItemsToCreateInList;
+        if (logger.isDebugEnabled()) {
+            logger.debug(testName + ": Expected " + nExpectedItems
+                    + " items; got: " + nItemsReturned);
+        }
+        Assert.assertEquals(nItemsReturned, nExpectedItems);
+
+        for (AbstractCommonList.ListItem item : items) {
+            String value = AbstractCommonListUtils.ListItemGetElementValue(
+                    item, WorkJAXBSchema.REF_NAME);
+            Assert.assertTrue((null != value), "Item refName is null!");
+            value = AbstractCommonListUtils.ListItemGetElementValue(item,
+                    WorkJAXBSchema.WORK_TERM_DISPLAY_NAME);
+            Assert.assertTrue((null != value), "Item termDisplayName is null!");
+        }
+        if (logger.isTraceEnabled()) {
+            AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger,
+                    testName);
+        }
+    }
+
+    @Override
+    public void delete(String testName) throws Exception {
+        // Do nothing.  See localDelete().  This ensure proper test order.
+    }
+    
+    @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"})    
+    public void localDelete(String testName) throws Exception {
+        super.delete(testName);
+    }
+
+    @Override
+    public void deleteItem(String testName) throws Exception {
+        // Do nothing.  We need to wait until after the test "localDelete" gets run.  When it does,
+        // its dependencies will get run first and then we can call the base class' delete method.
+    }
+    
+    @Test(dataProvider = "testName", groups = {"delete"},
+        dependsOnMethods = {"verifyIllegalItemDisplayName"})
+    public void localDeleteItem(String testName) throws Exception {
+        super.deleteItem(testName);
+    }
+    
+    // ---------------------------------------------------------------
+    // Cleanup of resources created during testing
+    // ---------------------------------------------------------------
+    
+    /**
+     * Deletes all resources created by tests, after all tests have been run.
+     *
+     * This cleanup method will always be run, even if one or more tests fail.
+     * For this reason, it attempts to remove all resources created
+     * at any point during testing, even if some of those resources
+     * may be expected to be deleted by certain tests.
+     */
+
+    @AfterClass(alwaysRun=true)
+    public void cleanUp() {
+        String noTest = System.getProperty("noTestCleanup");
+        if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
+            if (logger.isDebugEnabled()) {
+                logger.debug("Skipping Cleanup phase ...");
+            }
+            return;
+        }
+        if (logger.isDebugEnabled()) {
+            logger.debug("Cleaning up temporary resources created for testing ...");
+        }
+        String parentResourceId;
+        String itemResourceId;
+        // Clean up contact resources.
+        WorkAuthorityClient client = new WorkAuthorityClient();
+        parentResourceId = knownResourceId;
+        // Clean up item resources.
+        for (Map.Entry<String, String> entry : allResourceItemIdsCreated.entrySet()) {
+            itemResourceId = entry.getKey();
+            parentResourceId = entry.getValue();
+            // Note: Any non-success responses from the delete operation
+            // below are ignored and not reported.
+            client.deleteItem(parentResourceId, itemResourceId).releaseConnection();
+        }
+        // Clean up parent resources.
+        for (String resourceId : allResourceIdsCreated) {
+            // Note: Any non-success responses from the delete operation
+            // below are ignored and not reported.
+        client.delete(resourceId).releaseConnection();
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
+     */
+
+    /**
+     * Returns the root URL for the item service.
+     *
+     * This URL consists of a base URL for all services, followed by
+     * a path component for the owning parent, followed by the
+     * path component for the items.
+     *
+     * @param  parentResourceIdentifier  An identifier (such as a UUID) for the
+     * parent authority resource of the relevant item resource.
+     *
+     * @return The root URL for the item service.
+     */
+    protected String getItemServiceRootURL(String parentResourceIdentifier) {
+        return getResourceURL(parentResourceIdentifier) + "/" + getItemServicePathComponent();
+    }
+
+    /**
+     * Returns the URL of a specific item resource managed by a service, and
+     * designated by an identifier (such as a universally unique ID, or UUID).
+     *
+     * @param  parentResourceIdentifier  An identifier (such as a UUID) for the
+     * parent authority resource of the relevant item resource.
+     *
+     * @param  itemResourceIdentifier  An identifier (such as a UUID) for an
+     * item resource.
+     *
+     * @return The URL of a specific item resource managed by a service.
+     */
+    protected String getItemResourceURL(String parentResourceIdentifier, String itemResourceIdentifier) {
+        return getItemServiceRootURL(parentResourceIdentifier) + "/" + itemResourceIdentifier;
+    }
+
+        @Override
+    public void authorityTests(String testName) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    //
+    // Work specific overrides
+    //
+    
+    @Override
+    protected PoxPayloadOut createInstance(String commonPartName,
+            String identifier) {
+        // Submit the request to the service and store the response.
+        String shortId = identifier;
+        String displayName = "displayName-" + shortId;
+        // String baseRefName = WorkAuthorityClientUtils.createWorkAuthRefName(shortId, null);      
+        PoxPayloadOut result = 
+            WorkAuthorityClientUtils.createWorkAuthorityInstance(
+            displayName, shortId, commonPartName);
+        return result;
+    }
+    
+    @Override
+    protected PoxPayloadOut createNonExistenceInstance(String commonPartName, String identifier) {
+        String displayName = "displayName-NON_EXISTENT_ID";
+        PoxPayloadOut result = WorkAuthorityClientUtils.createWorkAuthorityInstance(
+                    displayName, "nonEx", commonPartName);
+        return result;
+    }
+
+    @Override
+    protected WorkauthoritiesCommon updateInstance(WorkauthoritiesCommon workauthoritiesCommon) {
+        WorkauthoritiesCommon result = new WorkauthoritiesCommon();
+        
+        result.setDisplayName("updated-" + workauthoritiesCommon.getDisplayName());
+        result.setVocabType("updated-" + workauthoritiesCommon.getVocabType());
+        
+        return result;
+    }
+
+    @Override
+    protected void compareUpdatedInstances(WorkauthoritiesCommon original,
+            WorkauthoritiesCommon updated) throws Exception {
+        Assert.assertEquals(updated.getDisplayName(),
+                original.getDisplayName(),
+                "Display name in updated object did not match submitted data.");
+    }
+
+    protected void compareReadInstances(WorkauthoritiesCommon original,
+            WorkauthoritiesCommon fromRead) throws Exception {
+        Assert.assertNotNull(fromRead.getDisplayName());
+        Assert.assertNotNull(fromRead.getShortIdentifier());
+        Assert.assertNotNull(fromRead.getRefName());
+    }
+    
+    //
+    // Authority item specific overrides
+    //
+    
+    @Override
+    protected String createItemInAuthority(String authorityId) {
+        return createItemInAuthority(authorityId, null /*refname*/);
+    }
+
+    @Override
+    protected WorksCommon updateItemInstance(WorksCommon worksCommon) {
+                            
+            WorkTermGroupList termList = worksCommon.getWorkTermGroupList();
+            Assert.assertNotNull(termList);
+            List<WorkTermGroup> terms = termList.getWorkTermGroup();
+            Assert.assertNotNull(terms);
+            Assert.assertTrue(terms.size() > 0);
+            terms.get(0).setTermDisplayName("updated-" + terms.get(0).getTermDisplayName());
+            terms.get(0).setTermName("updated-" + terms.get(0).getTermName());
+            worksCommon.setWorkTermGroupList(termList);
+
+            return worksCommon;
+    }
+
+    @Override
+    protected void compareUpdatedItemInstances(WorksCommon original,
+            WorksCommon updated) throws Exception {
+            
+            WorkTermGroupList originalTermList = original.getWorkTermGroupList();
+            Assert.assertNotNull(originalTermList);
+            List<WorkTermGroup> originalTerms = originalTermList.getWorkTermGroup();
+            Assert.assertNotNull(originalTerms);
+            Assert.assertTrue(originalTerms.size() > 0);
+            
+            WorkTermGroupList updatedTermList = updated.getWorkTermGroupList();
+            Assert.assertNotNull(updatedTermList);
+            List<WorkTermGroup> updatedTerms = updatedTermList.getWorkTermGroup();
+            Assert.assertNotNull(updatedTerms);
+            Assert.assertTrue(updatedTerms.size() > 0);
+            
+            Assert.assertEquals(updatedTerms.get(0).getTermDisplayName(),
+                originalTerms.get(0).getTermDisplayName(),
+                "Value in updated record did not match submitted data.");
+    }
+
+    @Override
+    protected void verifyReadItemInstance(WorksCommon item)
+            throws Exception {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    protected PoxPayloadOut createNonExistenceItemInstance(
+            String commonPartName, String identifier) {
+        Map<String, String> nonexMap = new HashMap<String,String>();
+        nonexMap.put(WorkJAXBSchema.WORK_TERM_DISPLAY_NAME, TEST_WORK_TERM_DISPLAY_NAME);
+        nonexMap.put(WorkJAXBSchema.SHORT_IDENTIFIER, "nonEx");
+        nonexMap.put(WorkJAXBSchema.WORK_TERM_STATUS, TEST_WORK_TERM_STATUS);
+        final String EMPTY_REFNAME = "";
+        PoxPayloadOut result = 
+                WorkAuthorityClientUtils.createWorkInstance(EMPTY_REFNAME, nonexMap,
+                WorkAuthorityClientUtils.getTermGroupInstance(TEST_WORK_TERM_DISPLAY_NAME), commonPartName);
+        return result;
+    }
+}
diff --git a/services/work/client/src/test/resources/log4j.properties b/services/work/client/src/test/resources/log4j.properties
new file mode 100644 (file)
index 0000000..148a3e8
--- /dev/null
@@ -0,0 +1,23 @@
+log4j.rootLogger=debug, stdout, R
+
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+log4j.appender.R=org.apache.log4j.RollingFileAppender
+log4j.appender.R.File=target/test-client.log
+
+log4j.appender.R.MaxFileSize=100KB
+# Keep one backup file
+log4j.appender.R.MaxBackupIndex=1
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n
+
+#packages
+log4j.logger.org.collectionspace=DEBUG
+log4j.logger.org.apache=INFO
+log4j.logger.httpclient=INFO
+log4j.logger.org.jboss.resteasy=INFO
diff --git a/services/work/installer/build.xml b/services/work/installer/build.xml
new file mode 100644 (file)
index 0000000..3fa6787
--- /dev/null
@@ -0,0 +1,61 @@
+
+<project name="work" default="package" basedir=".">
+    <description>
+        work service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+    
+    <target name="install" description="">
+        <exec executable="echo">
+                <arg value="Installer: Executing work Service's &apos;install&apos; target." />
+                </exec>
+                <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->
+        <copy todir="${jee.deploy.nuxeo.plugins}">
+            <fileset file="nuxeo/*.jar"/>
+        </copy>             
+    </target>    
+
+    <target name="config" description="" depends="install">
+        <exec executable="echo">
+                <arg value="Installer: Executing Work Service's &apos;config&apos; target." />
+                </exec>
+    </target>
+    
+    <target name="predeploy" description="" depends="config">
+        <exec executable="echo">
+                <arg value="Installer: Executing Work Service's &apos;predeploy&apos; target." />
+                </exec>
+    </target>    
+    
+    <target name="deploy" description="">
+        <exec executable="echo">
+                <arg value="Installer: Executing Work Service's &apos;deploy&apos; target." />
+                </exec>
+    </target>
+    
+    <target name="postdeploy">
+        <exec executable="echo">
+                <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Work Service." />
+                </exec>     
+        <exec executable="echo">
+                <arg value="Importing necessary workauthorities." />
+                </exec>             
+        <java jar="./postdeploy/collectionspace-services-work-importer-jar-with-dependencies.jar"
+            fork="true"
+            failonerror="true">
+                </java> 
+    </target>
+    
+
+</project>
diff --git a/services/work/jaxb/pom.xml b/services/work/jaxb/pom.xml
new file mode 100644 (file)
index 0000000..9117a65
--- /dev/null
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.work</artifactId>
+        <version>3.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.work.jaxb</artifactId>
+    <name>services.work.jaxb</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+                <!--
+        <dependency>
+            <groupId>org.jvnet.jaxb2-commons</groupId>
+            <artifactId>property-listener-injector</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.jaxb2_commons</groupId>
+            <artifactId>runtime</artifactId>
+                </dependency>
+                -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>  
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>   
+    </dependencies>
+
+    <build>
+        <finalName>collectionspace-services-work-jaxb</finalName>
+        <defaultGoal>install</defaultGoal>
+        <plugins>
+            <plugin>
+                <groupId>org.jvnet.jaxb2.maven2</groupId>
+                <artifactId>maven-jaxb2-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+
diff --git a/services/work/jaxb/src/main/java/org/collectionspace/services/WorkJAXBSchema.java b/services/work/jaxb/src/main/java/org/collectionspace/services/WorkJAXBSchema.java
new file mode 100644 (file)
index 0000000..3fa9a36
--- /dev/null
@@ -0,0 +1,42 @@
+/**
+ * 
+ */
+package org.collectionspace.services;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
+
+public interface WorkJAXBSchema extends AuthorityItemJAXBSchema {
+    final static String WORKS_COMMON = "works_common";
+    final static String DISPLAY_NAME = "displayName";
+    final static String DISPLAY_NAME_COMPUTED = "displayNameComputed";
+    final static String SHORT_DISPLAY_NAME = "shortDisplayName";
+    final static String SHORT_DISPLAY_NAME_COMPUTED = "shortDisplayNameComputed";
+
+    final static String WORK_TYPE = "workType";
+    final static String WORK_HISTORY_NOTE = "workHistoryNote";
+
+    final static String WORK_CREATOR_GROUP_LIST = "creatorGroupList";
+    final static String WORK_CREATOR_GROUP_CREATOR = "creator";
+    final static String WORK_CREATOR_GROUP_CREATOR_TYPE = "creatorType";
+
+    final static String WORK_PUBLISHER_GROUP_LIST = "publisherGroupList";
+    final static String WORK_PUBLISHER_GROUP_PUBLISHER = "publisher";
+    final static String WORK_PUBLISHER_GROUP_PUBLISHER_TYPE = "publisherType";
+
+    final static String WORK_TERM_GROUP_LIST = "workTermGroupList";
+    final static String WORK_TERM_DISPLAY_NAME = "termDisplayName";
+    final static String WORK_TERM_NAME = "termName";
+    final static String WORK_TERM_TYPE = "termType";
+    final static String WORK_TERM_STATUS = "termStatus";
+    final static String WORK_TERM_QUALIFIER = "termQualifier";
+    final static String WORK_TERM_LANGUAGE = "termLanguage";
+    final static String WORK_TERM_PREFFORLANGUAGE = "termPrefForLang";
+    final static String WORK_TERM_SOURCE = "termSource";
+    final static String WORK_TERM_SOURCE_DETAIL = "termSourceDetail";
+    final static String WORK_TERM_SOURCE_ID = "termSourceID";
+    final static String WORK_TERM_SOURCE_NOTE = "termSourceNote";
+
+    final static String WORK_SHORT_IDENTIFIER = "shortIdentifier";
+    final static String WORK_REFNAME = "refName";
+    final static String WORK_INAUTHORITY = "inAuthority";
+}
+
diff --git a/services/work/jaxb/src/main/resources/work_common.xsd b/services/work/jaxb/src/main/resources/work_common.xsd
new file mode 100644 (file)
index 0000000..20e8406
--- /dev/null
@@ -0,0 +1,171 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+    jaxb:version="1.0" elementFormDefault="unqualified"
+    xmlns:ns="http://collectionspace.org/services/work"
+    xmlns="http://collectionspace.org/services/work"
+    targetNamespace="http://collectionspace.org/services/work"
+    version="0.1"
+    >
+
+    <!-- avoid XmlRootElement nightmare, see http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html-->
+
+    <!-- Work -->
+    <xs:element name="works_common">
+        <xs:complexType>
+            <xs:sequence>
+                <!--  Common identifier -->
+                <xs:element name="csid" type="xs:string" />
+
+                <!--  Common Authority Information Group -->
+                <!--  inAuthority is the csid of the owning WorkAuthority -->
+                <xs:element name="inAuthority" type="xs:string"/>
+                <xs:element name="shortIdentifier" type="xs:string"/>
+                <xs:element name="refName" type="xs:string"/>
+
+                <xs:element name="workHistoryNote" type="xs:string"/>
+                <xs:element name="workType" type="xs:string"/>
+
+                <!-- List of workTerms -->
+                <xs:element name="workTermGroupList" type="workTermGroupList"/>
+    
+                <!--  List of Creators -->
+                <xs:element name="creatorGroupList" type="creatorGroupList"/>
+
+                <!--  List of additional Work Term sources -->
+                <xs:element name="publisherGroupList" type="publisherGroupList"/>
+
+                <!-- List of MigratedEntities -->
+                <xs:element name="migratedEntityGroupList" type="migratedEntityGroupList"/>
+
+                <!-- Structured Date group -->
+                <xs:element name="workDateGroupList" type="workDateGroupList"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+
+<!-- =================================================================
+     Work Term Group repeating structure
+     ================================================================= -->
+
+    <xs:complexType name="workTermGroupList">
+        <xs:sequence>
+            <xs:element name="workTermGroup" type="workTermGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="workTermGroup">
+        <xs:sequence>
+            <xs:element name="termDisplayName" type="xs:string"/>
+            <xs:element name="termName" type="xs:string"/>
+            <xs:element name="termType" type="xs:string"/>
+            <xs:element name="termStatus" type="xs:string"/>
+            <xs:element name="termQualifier" type="xs:string"/>
+            <xs:element name="termLanguage" type="xs:string"/>
+            <xs:element name="termPrefForLang" type="xs:boolean"/>
+            <xs:element name="termSource" type="xs:string"/>
+            <xs:element name="termSourceDetail" type="xs:string"/>
+            <xs:element name="termSourceID" type="xs:string"/>
+            <xs:element name="termSourceNote" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+<!-- =================================================================
+     Creator Group repeating structure
+     ================================================================= -->
+
+    <xs:complexType name="creatorGroupList">
+        <xs:sequence>
+            <xs:element name="creatorGroup" type="creatorGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="creatorGroup">
+        <xs:sequence>
+            <xs:element name="creator" type="xs:string"/>
+            <xs:element name="creatorType" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+<!-- =================================================================
+     Publisher Group repeating structure
+     ================================================================= -->
+
+    <xs:complexType name="publisherGroupList">
+        <xs:sequence>
+            <xs:element name="publisherGroup" 
+                        type="publisherGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="publisherGroup">
+        <xs:sequence>
+            <xs:element name="publisher" type="xs:string"/>
+            <xs:element name="publisherType" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+<!-- =================================================================
+     Migrated Entity Group repeating structure
+     ================================================================= -->
+
+    <xs:complexType name="migratedEntityGroupList">
+        <xs:sequence>
+            <xs:element name="migratedEntityGroup" 
+                        type="migratedEntityGroup" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="migratedEntityGroup">
+        <xs:sequence>
+            <xs:element name="migratedEntity" type="xs:string"/>
+            <xs:element name="migratedEntityType" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+<!-- =================================================================
+     Structured Date repeating structure
+     ================================================================= -->
+
+    <xs:complexType name="workDateGroupList">
+        <xs:sequence>
+            <xs:element name="workDateGroup" type="structuredDateGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+            </xs:sequence>
+        </xs:complexType>
+
+        <!-- Before (re)using this generic complex type in any record type -->
+        <!-- other than CollectionObject, be sure to verify that Nuxeo handles -->
+        <!-- that correctly in its table creation/row linking. -->
+        <xs:complexType name="structuredDateGroup">
+            <xs:sequence>
+                <xs:element name="dateDisplayDate" type="xs:string"/>
+                <xs:element name="dateAssociation" type="xs:string"/>
+                <xs:element name="dateEarliestSingleYear" type="xs:integer"/>
+                <xs:element name="dateEarliestSingleMonth" type="xs:integer"/>
+                <xs:element name="dateEarliestSingleDay" type="xs:integer"/>
+                <xs:element name="dateEarliestSingleEra" type="xs:string"/>
+                <xs:element name="dateEarliestSingleCertainty" type="xs:string"/>
+                <xs:element name="dateEarliestSingleQualifier" type="xs:string"/>
+                <xs:element name="dateEarliestSingleQualifierValue" type="xs:integer"/>
+                <xs:element name="dateEarliestSingleQualifierUnit" type="xs:string"/>
+                <xs:element name="dateLatestYear" type="xs:integer"/>
+                <xs:element name="dateLatestMonth" type="xs:integer"/>
+                <xs:element name="dateLatestDay" type="xs:integer"/>
+                <xs:element name="dateLatestEra" type="xs:string"/>
+                <xs:element name="dateLatestCertainty" type="xs:string"/>
+                <xs:element name="dateLatestQualifier" type="xs:string"/>
+                <xs:element name="dateLatestQualifierValue" type="xs:integer"/>
+                <xs:element name="dateLatestQualifierUnit" type="xs:string"/>
+                <xs:element name="datePeriod" type="xs:string"/>
+                <xs:element name="dateNote" type="xs:string"/>
+                <xs:element name="dateEarliestScalarValue" type="xs:date"/>
+                <xs:element name="dateLatestScalarValue" type="xs:date"/>
+                <xs:element name="scalarValuesComputed" type="xs:boolean"/>
+            </xs:sequence>
+        </xs:complexType>
+
+</xs:schema>
\ No newline at end of file
diff --git a/services/work/jaxb/src/main/resources/workauthority_common.xsd b/services/work/jaxb/src/main/resources/workauthority_common.xsd
new file mode 100644 (file)
index 0000000..dac51d8
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    WorkAuthority schema (XSD)
+    
+    Entity  : WorkAuthority
+    Part    : Common
+    Used for: JAXB binding between XML and Java objects
+    
+-->
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+    jaxb:version="1.0" elementFormDefault="unqualified"
+    xmlns:ns="http://collectionspace.org/services/work"
+    xmlns="http://collectionspace.org/services/work"
+    targetNamespace="http://collectionspace.org/services/work"
+    version="0.1"
+    >
+    
+    <!--
+        Avoid XmlRootElement nightmare:
+        See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html
+    -->
+    <!-- See http://wiki.collectionspace.org/display/collectionspace/Work+Service+Home -->    
+    
+    <!-- WorkAuthority  -->
+    <xs:element name="workauthorities_common">
+        <xs:complexType>
+            <xs:sequence>
+                <!--  Common identifier -->
+                <xs:element name="csid" type="xs:string" />
+                
+                <!--  WorkAuthority Information Group -->
+                <xs:element name="displayName" type="xs:string"/>
+                <xs:element name="shortIdentifier" type="xs:string"/>
+                <xs:element name="refName" type="xs:string"/>
+                <xs:element name="vocabType" type="xs:string"/>
+                <xs:element name="source" type="xs:string"/>
+                <xs:element name="description" type="xs:string"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    
+</xs:schema>
+
diff --git a/services/work/output.txt b/services/work/output.txt
new file mode 100644 (file)
index 0000000..0f075d9
--- /dev/null
@@ -0,0 +1,744 @@
+[INFO] Scanning for projects...
+[INFO] Reactor build order: 
+[INFO]   services.work
+[INFO]   services.work.jaxb
+[INFO]   services.work.client
+[INFO]   services.work.service
+[INFO]   services.work.3rdparty
+[INFO]   services.work.3rdparty.nuxeo
+[INFO] ------------------------------------------------------------------------
+[INFO] Building services.work
+[INFO]    task-segment: [test]
+[INFO] ------------------------------------------------------------------------
+[INFO] No goals needed for project - skipping
+[INFO] ------------------------------------------------------------------------
+[INFO] Building services.work.jaxb
+[INFO]    task-segment: [test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [jaxb2:generate {execution: default}]
+[INFO] Skipped XJC execution. Generated sources were up-to-date.
+[INFO] [resources:resources {execution: default-resources}]
+[INFO] Using 'UTF-8' encoding to copy filtered resources.
+[INFO] Copying 2 resources
+[INFO] Copying 1 resource
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [resources:testResources {execution: default-testResources}]
+[INFO] Using 'UTF-8' encoding to copy filtered resources.
+[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/jaxb/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] No sources to compile
+[WARNING] DEPRECATED [systemProperties]: Use systemPropertyVariables instead.
+[INFO] [surefire:test {execution: default-test}]
+[INFO] No tests to run.
+[INFO] Surefire report directory: /Users/mjesse/Documents/github/walker/services/services/work/jaxb/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running TestSuite
+There are no tests to run.
+
+Results :
+
+Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
+
+[INFO] ------------------------------------------------------------------------
+[INFO] Building services.work.client
+[INFO]    task-segment: [test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [resources:resources {execution: default-resources}]
+[INFO] Using 'UTF-8' encoding to copy filtered resources.
+[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/client/src/main/resources
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [resources:testResources {execution: default-testResources}]
+[INFO] Using 'UTF-8' encoding to copy filtered resources.
+[INFO] Copying 1 resource
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] Nothing to compile - all classes are up to date
+[WARNING] DEPRECATED [systemProperties]: Use systemPropertyVariables instead.
+[INFO] [surefire:test {execution: default-test}]
+[INFO] Surefire report directory: /Users/mjesse/Documents/github/walker/services/services/work/client/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running TestSuite
+2013-02-05 17:40:24,168 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:24,229 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:24,233 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:24,936 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = create
+===================================================
+2013-02-05 17:40:24,948 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:24,948 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:24,949 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:25,034 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:26,115 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] create: HTTP status = 201
+2013-02-05 17:40:26,118 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/3983ae95-ffec-40e9-be1c
+2013-02-05 17:40:26,118 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=3983ae95-ffec-40e9-be1c
+2013-02-05 17:40:26,120 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:100] create: Setting knownResourceId=3983ae95-ffec-40e9-be1c
+2013-02-05 17:40:26,127 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = createList
+===================================================
+2013-02-05 17:40:26,129 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:26,129 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:26,130 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:26,168 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:26,626 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:26,627 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/12d307c8-6fa2-44cd-b6b7
+2013-02-05 17:40:26,628 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=12d307c8-6fa2-44cd-b6b7
+2013-02-05 17:40:26,630 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:26,631 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:26,631 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:26,659 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:26,959 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:26,960 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/37563d16-ba88-4f80-a5a8
+2013-02-05 17:40:26,960 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=37563d16-ba88-4f80-a5a8
+2013-02-05 17:40:26,961 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:26,973 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:26,974 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:26,995 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:27,198 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:27,198 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/18ab8cb4-099f-4936-9492
+2013-02-05 17:40:27,199 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=18ab8cb4-099f-4936-9492
+2013-02-05 17:40:27,200 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:27,201 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:27,201 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:27,219 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:27,606 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:27,607 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/175cdd05-e79c-4dd4-b657
+2013-02-05 17:40:27,608 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=175cdd05-e79c-4dd4-b657
+2013-02-05 17:40:27,609 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:27,616 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:27,617 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:27,638 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:27,870 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:27,871 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/64d8cd08-a95d-441a-afac
+2013-02-05 17:40:27,871 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=64d8cd08-a95d-441a-afac
+2013-02-05 17:40:27,872 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:27,873 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:27,874 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:27,905 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:28,099 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:28,100 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/7e4cc36a-31cb-428f-a301
+2013-02-05 17:40:28,115 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=7e4cc36a-31cb-428f-a301
+2013-02-05 17:40:28,117 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:28,117 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:28,118 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:28,134 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:28,374 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:28,375 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/196cff90-c760-4dff-a8e1
+2013-02-05 17:40:28,381 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=196cff90-c760-4dff-a8e1
+2013-02-05 17:40:28,382 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:28,392 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:28,392 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:28,407 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:28,849 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:28,849 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/71c79387-8ac1-44e3-a648
+2013-02-05 17:40:28,850 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=71c79387-8ac1-44e3-a648
+2013-02-05 17:40:28,851 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:28,852 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:28,853 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:28,871 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:29,148 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:29,149 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/d3f9ca52-8f58-44d2-9e3d
+2013-02-05 17:40:29,151 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=d3f9ca52-8f58-44d2-9e3d
+2013-02-05 17:40:29,154 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:29,155 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:29,155 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:29,169 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:29,357 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createList: HTTP status = 201
+2013-02-05 17:40:29,358 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/036a5fd8-f613-45c7-ac68
+2013-02-05 17:40:29,358 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=036a5fd8-f613-45c7-ac68
+2013-02-05 17:40:29,363 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = read
+===================================================
+2013-02-05 17:40:29,364 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:29,365 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:29,365 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:29,852 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:194] read: status = 200
+2013-02-05 17:40:29,856 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:29,856 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:29,857 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:29,879 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:29,881 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:29,882 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:29,882 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:29,917 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:29,921 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:29,930 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:29,946 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part workauthorities_common ...
+2013-02-05 17:40:30,156 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readList
+===================================================
+2013-02-05 17:40:30,157 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:30,158 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:30,158 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:30,497 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:429] readList: status = 200
+2013-02-05 17:40:30,501 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readPaginatedList
+===================================================
+2013-02-05 17:40:30,502 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:30,502 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:30,502 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:30,609 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200
+2013-02-05 17:40:30,619 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:477] readPaginatedList:created list of 11 to be paginated.
+2013-02-05 17:40:30,708 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200
+2013-02-05 17:40:30,731 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:785] readPaginatedList:page number is 0
+2013-02-05 17:40:30,731 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:791] readPaginatedList:page size is 3
+2013-02-05 17:40:30,731 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:797] readPaginatedList:actual items in page was/were 3
+2013-02-05 17:40:30,732 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:803] readPaginatedList:total number of items is 11
+2013-02-05 17:40:30,831 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200
+2013-02-05 17:40:30,854 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:785] readPaginatedList:page number is 1
+2013-02-05 17:40:30,854 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:791] readPaginatedList:page size is 3
+2013-02-05 17:40:30,855 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:797] readPaginatedList:actual items in page was/were 3
+2013-02-05 17:40:30,855 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:803] readPaginatedList:total number of items is 11
+2013-02-05 17:40:30,997 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200
+2013-02-05 17:40:31,093 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:785] readPaginatedList:page number is 2
+2013-02-05 17:40:31,094 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:791] readPaginatedList:page size is 3
+2013-02-05 17:40:31,094 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:797] readPaginatedList:actual items in page was/were 3
+2013-02-05 17:40:31,094 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:803] readPaginatedList:total number of items is 11
+2013-02-05 17:40:31,186 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:758] readPaginatedList: status = 200
+2013-02-05 17:40:31,202 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:785] readPaginatedList:page number is 3
+2013-02-05 17:40:31,203 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:791] readPaginatedList:page size is 3
+2013-02-05 17:40:31,203 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:797] readPaginatedList:actual items in page was/were 2
+2013-02-05 17:40:31,203 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:803] readPaginatedList:total number of items is 11
+2013-02-05 17:40:31,205 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = testSubmitRequest
+===================================================
+2013-02-05 17:40:31,206 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:31,211 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:31,212 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:31,503 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:372] testSubmitRequest: url=http://localhost:8180/cspace-services/workauthorities/3983ae95-ffec-40e9-be1c status=200
+2013-02-05 17:40:31,506 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = update
+===================================================
+2013-02-05 17:40:31,507 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:31,508 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:31,508 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:31,838 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:317] update: read status = 200
+2013-02-05 17:40:31,838 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:322] Got object to update with CSID= 3983ae95-ffec-40e9-be1c
+2013-02-05 17:40:31,839 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:31,840 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:31,840 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:31,856 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part workauthorities_common ...
+2013-02-05 17:40:32,128 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:329] 
+
+To be updated fields: CSID = 3983ae95-ffec-40e9-be1c
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:workauthorities_common xmlns:ns2="http://collectionspace.org/services/work">
+    <displayName>updated-displayName-1360450869391</displayName>
+    <vocabType>updated-WorkAuthority</vocabType>
+</ns2:workauthorities_common>
+
+2013-02-05 17:40:32,131 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:32,131 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:32,133 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:32,606 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:339] update: status = 200
+2013-02-05 17:40:32,607 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:32,607 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:32,608 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:32,625 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part workauthorities_common ...
+2013-02-05 17:40:32,760 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readWorkflow
+===================================================
+2013-02-05 17:40:32,761 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:32,786 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:32,787 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:32,932 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200
+2013-02-05 17:40:33,019 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:33,020 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:33,020 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:33,031 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:33,031 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:33,032 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:33,040 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:33,211 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/ad8ded5b-8885-4748-a745
+2013-02-05 17:40:33,212 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=ad8ded5b-8885-4748-a745
+2013-02-05 17:40:33,213 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:33,214 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:33,214 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:33,224 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:33,225 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:33,225 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:33,233 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:33,399 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/4c2e8eea-4cd5-4e3f-82f2
+2013-02-05 17:40:33,399 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=4c2e8eea-4cd5-4e3f-82f2
+2013-02-05 17:40:33,404 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:33,404 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:33,404 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:33,434 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:33,435 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:33,436 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:33,445 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:33,667 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/814172fb-9069-44d3-81bc
+2013-02-05 17:40:33,667 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=814172fb-9069-44d3-81bc
+2013-02-05 17:40:33,668 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:33,668 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:33,669 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:33,793 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200
+2013-02-05 17:40:33,794 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:818] Got object to update life cycle state with ID: 814172fb-9069-44d3-81bc
+2013-02-05 17:40:33,836 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:830] Current workflow state:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:workflow_common xmlns:ns2="http://collectionspace.org/services/workflow">
+    <lifeCyclePolicy>cs_default</lifeCyclePolicy>
+    <currentLifeCycleState>project</currentLifeCycleState>
+</ns2:workflow_common>
+
+2013-02-05 17:40:34,036 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200
+2013-02-05 17:40:34,126 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200
+2013-02-05 17:40:34,126 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:857] Got workflow state of updated object with ID: 814172fb-9069-44d3-81bc
+2013-02-05 17:40:34,133 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:863] Expected workflow state found: deleted
+2013-02-05 17:40:34,134 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:34,134 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:34,134 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:34,404 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readWorkflow: status = 200
+2013-02-05 17:40:34,508 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:34,508 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:34,509 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:34,606 INFO  [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:550] Workflow transition to 'deleted' is complete
+2013-02-05 17:40:34,609 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = delete
+===================================================
+2013-02-05 17:40:34,618 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readNonExistent
+===================================================
+2013-02-05 17:40:34,619 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:34,620 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:34,620 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:34,714 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:242] readNonExistent: status = 404
+2013-02-05 17:40:34,720 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = baseCRUDTests
+===================================================
+2013-02-05 17:40:34,722 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = CRUDTests
+===================================================
+2013-02-05 17:40:34,725 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = createItem
+===================================================
+2013-02-05 17:40:34,726 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:34,727 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:34,727 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:34,734 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "3983ae95-ffec-40e9-be1c"
+2013-02-05 17:40:34,734 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common 
+2013-02-05 17:40:34,933 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/3983ae95-ffec-40e9-be1c/items/59763387-2665-4cf7-b188
+2013-02-05 17:40:34,934 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=59763387-2665-4cf7-b188
+2013-02-05 17:40:34,934 DEBUG [main] [org.collectionspace.services.client.test.WorkAuthorityServiceTest:152] createItemInAuthority(3983ae95-ffec-40e9-be1c,null): knownItemResourceId=59763387-2665-4cf7-b188
+2013-02-05 17:40:34,943 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = baseAuthorityTests
+===================================================
+2013-02-05 17:40:34,945 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = createItemList
+===================================================
+2013-02-05 17:40:34,945 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:34,946 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:34,946 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:34,953 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:35,128 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:163] createItemList: HTTP status = 201
+2013-02-05 17:40:35,128 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe
+2013-02-05 17:40:35,129 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=c70af1dd-d27c-43ef-aebe
+2013-02-05 17:40:35,130 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:35,130 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:35,130 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:35,138 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe"
+2013-02-05 17:40:35,140 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common 
+2013-02-05 17:40:35,535 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/b615f65c-2141-45d8-95f2
+2013-02-05 17:40:35,535 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=b615f65c-2141-45d8-95f2
+2013-02-05 17:40:35,538 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:35,539 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:35,539 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:35,546 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe"
+2013-02-05 17:40:35,547 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common 
+2013-02-05 17:40:35,803 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/ff11bc76-efeb-41f7-8255
+2013-02-05 17:40:35,804 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=ff11bc76-efeb-41f7-8255
+2013-02-05 17:40:35,805 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:35,805 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:35,805 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:35,826 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe"
+2013-02-05 17:40:35,827 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common 
+2013-02-05 17:40:36,013 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/9ad7de8a-6a91-4326-aa03
+2013-02-05 17:40:36,014 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=9ad7de8a-6a91-4326-aa03
+2013-02-05 17:40:36,016 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:36,018 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:36,019 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:36,026 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe"
+2013-02-05 17:40:36,026 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common 
+2013-02-05 17:40:36,191 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/010c033e-b272-4b08-8226
+2013-02-05 17:40:36,192 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=010c033e-b272-4b08-8226
+2013-02-05 17:40:36,192 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:36,194 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:36,194 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:36,200 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:109] Creating item with display name: "Muppets Take Manhattan (1984)" in locationAuthority: "c70af1dd-d27c-43ef-aebe"
+2013-02-05 17:40:36,201 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common 
+2013-02-05 17:40:36,412 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:234] extractId:uri=http://localhost:8180/cspace-services/workauthorities/c70af1dd-d27c-43ef-aebe/items/486bb415-76ab-4780-b39f
+2013-02-05 17:40:36,412 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:239] id=486bb415-76ab-4780-b39f
+2013-02-05 17:40:36,417 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readByName
+===================================================
+2013-02-05 17:40:36,419 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:36,419 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:36,420 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:36,748 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:228] readByName: status = 200
+2013-02-05 17:40:36,749 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:36,749 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:36,749 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:36,756 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part workauthorities_common ...
+2013-02-05 17:40:36,951 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readItem
+===================================================
+2013-02-05 17:40:36,952 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:36,953 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:36,953 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:37,230 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:294] readItem: status = 200
+2013-02-05 17:40:37,231 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:37,231 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:37,232 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:37,237 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ...
+2013-02-05 17:40:37,329 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readItemListByName
+===================================================
+2013-02-05 17:40:37,331 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:37,331 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:37,331 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:37,443 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:348]   readItemListByName: status = 200
+2013-02-05 17:40:37,502 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:359]   readItemListByName: Expected 5 items; got: 5 of: 5
+2013-02-05 17:40:37,505 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readItemNonExistent
+===================================================
+2013-02-05 17:40:37,505 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:37,506 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:37,506 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:37,614 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:273] readItemNonExistent: status = 404
+2013-02-05 17:40:37,615 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = testItemSubmitRequest
+===================================================
+2013-02-05 17:40:37,616 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:37,616 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:37,616 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:37,890 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:121] testItemSubmitRequest: url=http://localhost:8180/cspace-services/workauthorities/3983ae95-ffec-40e9-be1c/items/59763387-2665-4cf7-b188 status=200
+2013-02-05 17:40:37,891 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = verifyIgnoredUpdateWithInAuthority
+===================================================
+2013-02-05 17:40:37,892 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:37,892 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:37,893 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:38,427 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:143] verifyIgnoredUpdateWithInAuthority read authority:3983ae95-ffec-40e9-be1c/Item:59763387-2665-4cf7-b188 status = 200
+2013-02-05 17:40:38,428 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:38,428 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:38,429 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:38,435 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ...
+2013-02-05 17:40:38,620 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:38,621 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:38,621 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:38,877 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:164] verifyIgnoredUpdateWithInAuthority: status = 200
+2013-02-05 17:40:39,224 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:39,224 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:39,225 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:39,231 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ...
+2013-02-05 17:40:39,326 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = updateItem
+===================================================
+2013-02-05 17:40:39,327 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:39,327 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:39,327 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:39,685 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:437] updateItem: read status = 200
+2013-02-05 17:40:39,685 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:442] got Authority item to update with ID: 59763387-2665-4cf7-b188 in authority: 3983ae95-ffec-40e9-be1c
+2013-02-05 17:40:39,686 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:39,687 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:39,687 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:39,693 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ...
+2013-02-05 17:40:39,855 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:452] 
+
+To be updated fields: CSID = 59763387-2665-4cf7-b188
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<ns2:works_common xmlns:ns2="http://collectionspace.org/services/work">
+    <csid>59763387-2665-4cf7-b188</csid>
+    <inAuthority>3983ae95-ffec-40e9-be1c</inAuthority>
+    <shortIdentifier>muppetstakemanhattan</shortIdentifier>
+    <refName>urn:cspace:core.collectionspace.org:workauthorities:name(1360450869391):item:name(muppetstakemanhattan)'Muppets Take Manhattan (1984)'</refName>
+    <workTermGroupList>
+        <workTermGroup>
+            <termDisplayName>updated-Muppets Take Manhattan (1984)</termDisplayName>
+            <termName>updated-Muppets Take Manhattan</termName>
+            <termType></termType>
+            <termStatus>accepted</termStatus>
+            <termQualifier></termQualifier>
+            <termLanguage></termLanguage>
+            <termPrefForLang>false</termPrefForLang>
+            <termSource>featurefilms</termSource>
+            <termSourceDetail>internal</termSourceDetail>
+            <termSourceID></termSourceID>
+            <termSourceNote></termSourceNote>
+        </workTermGroup>
+    </workTermGroupList>
+    <creatorGroupList/>
+    <publisherGroupList/>
+    <workDateGroupList/>
+</ns2:works_common>
+
+2013-02-05 17:40:39,858 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:39,877 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:39,883 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:40,271 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:467] updateItem: status = 200
+2013-02-05 17:40:40,272 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:40,272 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:40,273 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:40,278 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:72] Reading part works_common ...
+2013-02-05 17:40:40,327 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = deleteItem
+===================================================
+2013-02-05 17:40:40,329 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = deleteNonExistentItem
+===================================================
+2013-02-05 17:40:40,330 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:40,330 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:40,330 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:40,423 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:395] deleteNonExistentItem: status = 404
+2013-02-05 17:40:40,425 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = deleteNonExistent
+===================================================
+2013-02-05 17:40:40,426 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:40,427 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:40,427 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:40,513 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:266] deleteNonExistent: status = 404
+2013-02-05 17:40:40,515 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = updateNonExistent
+===================================================
+2013-02-05 17:40:40,516 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:40,516 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:40,516 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:40,522 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:40,661 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:699] updateNonExistent: status = 404
+2013-02-05 17:40:40,664 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = updateNonExistentItem
+===================================================
+2013-02-05 17:40:40,665 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:40,665 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:40,665 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:40,672 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:83] to be created, work common 
+2013-02-05 17:40:40,849 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:508] updateNonExistentItem: status = 404
+2013-02-05 17:40:40,851 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readItemList
+===================================================
+2013-02-05 17:40:40,852 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:40,852 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:40,852 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:41,054 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readItemList: status = 200
+2013-02-05 17:40:41,102 DEBUG [main] [org.collectionspace.services.client.test.WorkAuthorityServiceTest:278] readItemList: Expected 5 items; got: 5
+2013-02-05 17:40:41,106 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readItemListByAuthorityName
+===================================================
+2013-02-05 17:40:41,108 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:41,108 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:41,109 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:41,260 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] readItemList: status = 200
+2013-02-05 17:40:41,298 DEBUG [main] [org.collectionspace.services.client.test.WorkAuthorityServiceTest:278] readItemList: Expected 5 items; got: 5
+2013-02-05 17:40:41,299 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = verifyIllegalItemDisplayName
+===================================================
+2013-02-05 17:40:41,300 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:41,300 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:41,301 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:41,614 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] verifyIllegalItemDisplayName: status = 200
+2013-02-05 17:40:41,877 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:664] verifyIllegalItemDisplayName: status = 400
+2013-02-05 17:40:41,879 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = localDeleteItem
+===================================================
+2013-02-05 17:40:41,880 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:41,880 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:41,880 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:41,991 DEBUG [main] [org.collectionspace.services.client.test.AbstractAuthorityServiceTest:322] delete: status = 200
+2013-02-05 17:40:41,993 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = localDelete
+===================================================
+2013-02-05 17:40:41,994 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:41,995 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:41,995 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:42,118 DEBUG [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:221] localDelete: status = 200
+2013-02-05 17:40:42,119 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = readAuthorityItemWorkflow
+===================================================
+2013-02-05 17:40:42,120 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:42,120 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:42,121 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:42,132 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:42,133 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:42,133 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:42,141 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:42,142 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:42,142 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:42,148 DEBUG [main] [org.collectionspace.services.client.WorkAuthorityClientUtils:48] to be created, workAuthority common 
+2013-02-05 17:40:42,444 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:393] extractId:uri=http://localhost:8180/cspace-services/workauthorities/3bb3435f-19a2-4615-a718
+2013-02-05 17:40:42,445 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:398] id=3bb3435f-19a2-4615-a718
+2013-02-05 17:40:42,448 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:42,448 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:42,448 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:42,454 WARN  [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:985] Sub-class test clients should override this method
+2013-02-05 17:40:42,454 WARN  [main] [org.collectionspace.services.client.test.AbstractServiceTestImpl:1062] org.collectionspace.services.client.test.WorkAuthorityServiceTest did not implement createWorkflowTarget() method.  No workflow tests performed.
+2013-02-05 17:40:42,462 DEBUG [main] [org.collectionspace.services.client.test.BaseServiceTest:644] 
+===================================================
+Class = WorkAuthorityServiceTest
+ Test = searchWorkflowDeleted
+===================================================
+2013-02-05 17:40:42,475 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:42,476 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:42,477 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+2013-02-05 17:40:42,497 DEBUG [main] [org.collectionspace.services.client.test.WorkAuthorityServiceTest:342] Cleaning up temporary resources created for testing ...
+2013-02-05 17:40:42,498 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:269] readProperties() using url=http://localhost:8180/cspace-services/
+2013-02-05 17:40:42,498 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:323] setupHttpClient() using url=http://localhost:8180/cspace-services/ user=admin@core.collectionspace.org password=Administrator
+2013-02-05 17:40:42,498 DEBUG [main] [org.collectionspace.services.client.AbstractServiceClientImpl:334] setupHttpClient: set preemptive authentication
+Tests run: 34, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 20.689 sec
+
+Results :
+
+Tests run: 34, Failures: 0, Errors: 0, Skipped: 0
+
+[INFO] ------------------------------------------------------------------------
+[INFO] Building services.work.service
+[INFO]    task-segment: [test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [resources:resources {execution: default-resources}]
+[INFO] Using 'UTF-8' encoding to copy filtered resources.
+[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/service/src/main/resources
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] Nothing to compile - all classes are up to date
+[INFO] [resources:testResources {execution: default-testResources}]
+[INFO] Using 'UTF-8' encoding to copy filtered resources.
+[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/service/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] No sources to compile
+[WARNING] DEPRECATED [systemProperties]: Use systemPropertyVariables instead.
+[INFO] [surefire:test {execution: default-test}]
+[INFO] No tests to run.
+[INFO] Surefire report directory: /Users/mjesse/Documents/github/walker/services/services/work/service/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running TestSuite
+There are no tests to run.
+
+Results :
+
+Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
+
+[INFO] ------------------------------------------------------------------------
+[INFO] Building services.work.3rdparty
+[INFO]    task-segment: [test]
+[INFO] ------------------------------------------------------------------------
+[INFO] No goals needed for project - skipping
+[INFO] ------------------------------------------------------------------------
+[INFO] Building services.work.3rdparty.nuxeo
+[INFO]    task-segment: [test]
+[INFO] ------------------------------------------------------------------------
+[INFO] [resources:resources {execution: default-resources}]
+[INFO] Using 'UTF-8' encoding to copy filtered resources.
+[INFO] Copying 8 resources
+[INFO] [compiler:compile {execution: default-compile}]
+[INFO] No sources to compile
+[INFO] [resources:testResources {execution: default-testResources}]
+[INFO] Using 'UTF-8' encoding to copy filtered resources.
+[INFO] skip non existing resourceDirectory /Users/mjesse/Documents/github/walker/services/services/work/3rdparty/nuxeo-platform-cs-work/src/test/resources
+[INFO] [compiler:testCompile {execution: default-testCompile}]
+[INFO] No sources to compile
+[WARNING] DEPRECATED [systemProperties]: Use systemPropertyVariables instead.
+[INFO] [surefire:test {execution: default-test}]
+[INFO] No tests to run.
+[INFO] Surefire report directory: /Users/mjesse/Documents/github/walker/services/services/work/3rdparty/nuxeo-platform-cs-work/target/surefire-reports
+
+-------------------------------------------------------
+ T E S T S
+-------------------------------------------------------
+Running TestSuite
+There are no tests to run.
+
+Results :
+
+Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
+
+[INFO] 
+[INFO] 
+[INFO] ------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO] ------------------------------------------------------------------------
+[INFO] services.work ......................................... SUCCESS [0.362s]
+[INFO] services.work.jaxb .................................... SUCCESS [6.008s]
+[INFO] services.work.client .................................. SUCCESS [22.019s]
+[INFO] services.work.service ................................. SUCCESS [1.629s]
+[INFO] services.work.3rdparty ................................ SUCCESS [0.001s]
+[INFO] services.work.3rdparty.nuxeo .......................... SUCCESS [0.525s]
+[INFO] ------------------------------------------------------------------------
+[INFO] ------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ------------------------------------------------------------------------
+[INFO] Total time: 31 seconds
+[INFO] Finished at: Tue Feb 05 17:40:46 EST 2013
+[INFO] Final Memory: 50M/102M
+[INFO] ------------------------------------------------------------------------
diff --git a/services/work/pom.xml b/services/work/pom.xml
new file mode 100644 (file)
index 0000000..93f401b
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <version>3.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.work</artifactId>
+    <name>services.work</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+      <!--  <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>-->
+    </dependencies>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+    
+    <profiles>
+        <profile>
+            <id>samples</id>
+        <modules>
+            <!-- <module>sample</module> -->
+        </modules>
+        </profile>
+    </profiles>
+    
+</project>
+
diff --git a/services/work/service/pom.xml b/services/work/service/pom.xml
new file mode 100644 (file)
index 0000000..0708b52
--- /dev/null
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.work</artifactId>
+        <version>3.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.work.service</artifactId>
+    <name>services.work.service</name>
+    <packaging>jar</packaging>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+<!-- CollectionSpace dependencies -->        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.work.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.work.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>
+        <!-- External dependencies -->        
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.testng</groupId>
+            <artifactId>testng</artifactId>
+            <version>5.6</version>
+        </dependency>
+        
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+      <!-- javax -->
+
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>org.restlet</groupId>
+            <artifactId>org.restlet</artifactId>
+            <version>1.0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>com.noelios.restlet</groupId>
+            <artifactId>com.noelios.restlet.ext.httpclient</artifactId>
+            <version>1.0.7</version>
+        </dependency>
+        <dependency>
+            <groupId>com.noelios.restlet</groupId>
+            <artifactId>com.noelios.restlet</artifactId>
+            <version>1.0.7</version>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-work</finalName>
+        <plugins>
+        </plugins>
+    </build>
+</project>
+
diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/WorkAuthorityResource.java b/services/work/service/src/main/java/org/collectionspace/services/work/WorkAuthorityResource.java
new file mode 100644 (file)
index 0000000..045b14a
--- /dev/null
@@ -0,0 +1,69 @@
+/**
+ * This document is a part of the source code and related artifacts for
+ * CollectionSpace, an open source collections management system for museums and
+ * related institutions:
+ *
+ * http://www.collectionspace.org http://wiki.collectionspace.org
+ *
+ * Copyright 2009 University of California at Berkeley
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0. You may
+ * not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ *
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * 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.collectionspace.services.work;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import org.collectionspace.services.client.WorkAuthorityClient;
+import org.collectionspace.services.common.vocabulary.AuthorityResource;
+import org.collectionspace.services.work.nuxeo.WorkDocumentModelHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * WorkAuthorityResource
+ * 
+ * Handles, dispatches, and returns responses to RESTful requests
+ * related to Work authority-related resources.
+ */
+
+@Path(WorkAuthorityClient.SERVICE_PATH)
+@Consumes("application/xml")
+@Produces("application/xml")
+public class WorkAuthorityResource
+        extends AuthorityResource<WorkauthoritiesCommon, WorkDocumentModelHandler> {
+
+    final Logger logger = LoggerFactory.getLogger(WorkAuthorityResource.class);
+
+    public WorkAuthorityResource() {
+        super(WorkauthoritiesCommon.class, WorkAuthorityResource.class,
+                WorkAuthorityClient.SERVICE_COMMON_PART_NAME, WorkAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+    }
+
+    @Override
+    public String getServiceName() {
+        return WorkAuthorityClient.SERVICE_NAME;
+    }
+
+    @Override
+    public String getItemServiceName() {
+        return WorkAuthorityClient.SERVICE_ITEM_NAME;
+    }
+
+    @Override
+    public String getItemTermInfoGroupXPathBase() {
+        return WorkAuthorityClient.TERM_INFO_GROUP_XPATH_BASE;
+    }
+
+}
diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityConstants.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityConstants.java
new file mode 100644 (file)
index 0000000..af98993
--- /dev/null
@@ -0,0 +1,35 @@
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  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.collectionspace.services.work.nuxeo;
+
+/**
+ * WorkAuthorityConstants processes CollectionObject document
+ *
+ */
+public class WorkAuthorityConstants {
+
+    public final static String NUXEO_DOCTYPE = "WorkAuthority";
+    public final static String NUXEO_SCHEMA_NAME = "workauthority";
+    public final static String NUXEO_DC_TITLE = "CollectionSpace-WorkAuthority";
+}
diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityDocumentModelHandler.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkAuthorityDocumentModelHandler.java
new file mode 100644 (file)
index 0000000..f295d71
--- /dev/null
@@ -0,0 +1,55 @@
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  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.collectionspace.services.work.nuxeo;
+
+import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
+import org.collectionspace.services.work.WorkauthoritiesCommon;
+
+/**
+ * WorkAuthorityDocumentModelHandler
+ *
+ */
+public class WorkAuthorityDocumentModelHandler
+        extends AuthorityDocumentModelHandler<WorkauthoritiesCommon> {
+
+    /**
+     * Common part schema label
+     */
+    private static final String COMMON_PART_LABEL = "workauthorities_common";   
+    
+    public WorkAuthorityDocumentModelHandler() {
+        super(COMMON_PART_LABEL);
+    }
+    
+    /**
+     * getQProperty converts the given property to qualified schema property
+     * @param prop
+     * @return
+     */
+    @Override
+    public String getQProperty(String prop) {
+        return WorkAuthorityConstants.NUXEO_SCHEMA_NAME + ":" + prop;
+    }
+}
+
diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkConstants.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkConstants.java
new file mode 100644 (file)
index 0000000..44e8036
--- /dev/null
@@ -0,0 +1,35 @@
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  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.collectionspace.services.work.nuxeo;
+
+/**
+ * WorkConstants processes CollectionObject document
+ *
+ */
+public class WorkConstants {
+
+    public final static String NUXEO_DOCTYPE = "Work";
+    public final static String NUXEO_SCHEMA_NAME = "work";
+    public final static String NUXEO_DC_TITLE = "CollectionSpace-Work";
+}
diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkDocumentModelHandler.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkDocumentModelHandler.java
new file mode 100644 (file)
index 0000000..8e175b7
--- /dev/null
@@ -0,0 +1,114 @@
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  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.collectionspace.services.work.nuxeo;
+
+import org.collectionspace.services.WorkJAXBSchema;
+import org.collectionspace.services.client.WorkAuthorityClient;
+import org.collectionspace.services.common.document.DocumentWrapper;
+import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
+import org.collectionspace.services.work.WorksCommon;
+import org.nuxeo.ecm.core.api.DocumentModel;
+
+/**
+ * WorkDocumentModelHandler
+ *
+ */
+public class WorkDocumentModelHandler
+        extends AuthorityItemDocumentModelHandler<WorksCommon> {
+
+    /**
+     * Common part schema label
+     */
+    private static final String COMMON_PART_LABEL = "works_common";
+    
+    public WorkDocumentModelHandler() {
+        super(COMMON_PART_LABEL);
+    }
+
+    @Override
+    public String getAuthorityServicePath(){
+        return WorkAuthorityClient.SERVICE_PATH_COMPONENT;    //  CSPACE-3932
+    }
+
+        /**
+     * Handle display name.
+     *
+     * @param docModel the doc model
+     * @throws Exception the exception
+     */
+//    @Override
+//    protected void handleComputedDisplayNames(DocumentModel docModel) throws Exception {
+//        String commonPartLabel = getServiceContext().getCommonPartLabel("works");
+//      Boolean displayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
+//              WorkJAXBSchema.DISPLAY_NAME_COMPUTED);
+//      Boolean shortDisplayNameComputed = (Boolean) docModel.getProperty(commonPartLabel,
+//              WorkJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);
+//      if(displayNameComputed==null)
+//          displayNameComputed = true;
+//      if(shortDisplayNameComputed==null)
+//          shortDisplayNameComputed = true;
+//      if (displayNameComputed || shortDisplayNameComputed) {
+//                // Obtain the primary work name from the list of work names, for computing the display name.
+//          String xpathToWorkName = WorkJAXBSchema.WORK_TERM_NAME_GROUP_LIST 
+//                        + "/[0]/" + WorkeJAXBSchema.WORK_TERM_NAME;
+//          String workName = getXPathStringValue(docModel, COMMON_PART_LABEL, xpathToWorkName);
+//          String displayName = prepareDefaultDisplayName(workName);
+//          if (displayNameComputed) {
+//              docModel.setProperty(commonPartLabel, WorkJAXBSchema.DISPLAY_NAME,
+//                      displayName);
+//          }
+//          if (shortDisplayNameComputed) {
+//              docModel.setProperty(commonPartLabel, WorkJAXBSchema.SHORT_DISPLAY_NAME,
+//                      displayName);
+//          }
+//      }
+//    }
+    
+    /**
+     * Produces a default displayName from one or more supplied fields.
+     * @see WorkAuthorityClientUtils.prepareDefaultDisplayName() which
+     * duplicates this logic, until we define a service-general utils package
+     * that is neither client nor service specific.
+     * @param workName
+     * @return the default display name
+     * @throws Exception
+     */
+    private static String prepareDefaultDisplayName(
+            String workName ) throws Exception {
+        StringBuilder newStr = new StringBuilder();
+            newStr.append(workName);
+            return newStr.toString();
+    }
+    
+    /**
+     * getQProperty converts the given property to qualified schema property
+     * @param prop
+     * @return
+     */
+    @Override
+    public String getQProperty(String prop) {
+        return WorkConstants.NUXEO_SCHEMA_NAME + ":" + prop;
+    }
+}
+
diff --git a/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkValidatorHandler.java b/services/work/service/src/main/java/org/collectionspace/services/work/nuxeo/WorkValidatorHandler.java
new file mode 100644 (file)
index 0000000..93d6341
--- /dev/null
@@ -0,0 +1,148 @@
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California, Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  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.collectionspace.services.work.nuxeo;
+
+import java.util.List;
+import java.util.regex.Pattern;
+import org.collectionspace.services.common.api.Tools;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandlerImpl;
+import org.collectionspace.services.work.WorkTermGroup;
+import org.collectionspace.services.work.WorkTermGroupList;
+import org.collectionspace.services.work.WorksCommon;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * WorkValidatorHandler
+ * 
+ * Performs validation when making requests related to Work records.
+ * As an example, you can modify this class to customize validation of
+ * payloads supplied in requests to create and/or update records.
+ */
+public class WorkValidatorHandler extends ValidatorHandlerImpl {
+
+    final Logger logger = LoggerFactory.getLogger(WorkValidatorHandler.class);
+    // 'Bad pattern' for shortIdentifiers matches any non-word characters
+    private static final Pattern SHORT_ID_BAD_PATTERN = Pattern.compile("[\\W]");
+    private static final String SHORT_ID_BAD_CHARS_ERROR =
+            "shortIdentifier must only contain standard word characters";
+    private static final String HAS_NO_TERMS_ERROR =
+            "Authority items must contain at least one term.";
+    private static final String TERM_HAS_EMPTY_DISPLAYNAME_ERROR =
+            "Each term group in an authority item must contain "
+            + "a non-empty display name.";
+
+    @Override
+    protected Class getCommonPartClass() {
+        return WorksCommon.class;
+    }
+
+    @Override
+    protected void handleCreate() throws InvalidDocumentException {
+        WorksCommon work = (WorksCommon) getCommonPart();
+        // No guarantee that there is a common part in every post/update.
+        if (work != null) {
+            try {
+                String shortId = work.getShortIdentifier();
+                if (shortId != null) {
+                    CS_ASSERT(shortIdentifierContainsOnlyValidChars(shortId), SHORT_ID_BAD_CHARS_ERROR);
+                }
+                CS_ASSERT(containsAtLeastOneTerm(work), HAS_NO_TERMS_ERROR);
+                CS_ASSERT(allTermsContainDisplayName(work), TERM_HAS_EMPTY_DISPLAYNAME_ERROR);
+            } catch (AssertionError e) {
+                if (logger.isErrorEnabled()) {
+                    logger.error(e.getMessage(), e);
+                }
+                throw new InvalidDocumentException(e.getMessage(), e);
+            }
+        }
+    }
+
+    @Override
+    protected void handleGet() throws InvalidDocumentException {
+    }
+
+    @Override
+    protected void handleGetAll() throws InvalidDocumentException {
+    }
+
+    @Override
+    protected void handleUpdate() throws InvalidDocumentException {
+        WorksCommon work = (WorksCommon) getCommonPart();
+        // No guarantee that there is a common part in every post/update.
+        if (work != null) {
+            try {
+                // shortIdentifier is among a set of fields that are
+                // prevented from being changed on an update, and thus
+                // we don't need to check its value here.
+                CS_ASSERT(containsAtLeastOneTerm(work), HAS_NO_TERMS_ERROR);
+                CS_ASSERT(allTermsContainDisplayName(work), TERM_HAS_EMPTY_DISPLAYNAME_ERROR);
+            } catch (AssertionError e) {
+                if (logger.isErrorEnabled()) {
+                    logger.error(e.getMessage(), e);
+                }
+                throw new InvalidDocumentException(e.getMessage(), e);
+            }
+        }
+    }
+
+    @Override
+    protected void handleDelete() throws InvalidDocumentException {
+    }
+
+    private boolean shortIdentifierContainsOnlyValidChars(String shortId) {
+        // Check whether any characters match the 'bad' pattern
+        if (SHORT_ID_BAD_PATTERN.matcher(shortId).find()) {
+            return false;
+        }
+        return true;
+    }
+
+    private boolean containsAtLeastOneTerm(WorksCommon work) {
+        WorkTermGroupList termGroupList = work.getWorkTermGroupList();
+        if (termGroupList == null) {
+            return false;
+        }
+        List<WorkTermGroup> termGroups = termGroupList.getWorkTermGroup();
+        if ((termGroups == null) || (termGroups.isEmpty())){ 
+            return false;
+        }
+        return true;
+    }
+
+    private boolean allTermsContainDisplayName(WorksCommon work) {
+        WorkTermGroupList termGroupList = work.getWorkTermGroupList();
+        List<WorkTermGroup> termGroups = termGroupList.getWorkTermGroup();
+        for (WorkTermGroup termGroup : termGroups) {
+            if (Tools.isBlank(termGroup.getTermDisplayName())) {
+                return false;
+            }
+        }
+        return true;
+    }
+}
+