]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6236: Adding conditioncheck procedure. All unit tests pass
authorJesse Martinez <mjesse@gmail.com>
Fri, 3 Oct 2014 01:17:55 +0000 (21:17 -0400)
committerJesse Martinez <mjesse@gmail.com>
Fri, 3 Oct 2014 01:17:55 +0000 (21:17 -0400)
34 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/common/src/main/resources/db/postgresql/load_id_generators.sql
services/conditioncheck/.project [new file with mode: 0644]
services/conditioncheck/3rdparty/.project [new file with mode: 0644]
services/conditioncheck/3rdparty/build.xml [new file with mode: 0644]
services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/build.xml [new file with mode: 0644]
services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/pom.xml [new file with mode: 0644]
services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/src/main/resources/OSGI-INF/README.txt [new file with mode: 0644]
services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/src/main/resources/schemas/README.txt [new file with mode: 0644]
services/conditioncheck/3rdparty/pom.xml [new file with mode: 0644]
services/conditioncheck/build.xml [new file with mode: 0644]
services/conditioncheck/client/pom.xml [new file with mode: 0644]
services/conditioncheck/client/src/main/java/org/collectionspace/services/client/ConditioncheckClient.java [new file with mode: 0644]
services/conditioncheck/client/src/main/java/org/collectionspace/services/client/ConditioncheckProxy.java [new file with mode: 0644]
services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckAuthRefsTest.java [new file with mode: 0644]
services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckServiceTest.java [new file with mode: 0644]
services/conditioncheck/client/src/test/resources/log4j.properties [new file with mode: 0644]
services/conditioncheck/jaxb/pom.xml [new file with mode: 0644]
services/conditioncheck/jaxb/src/main/java/org/collectionspace/services/ConditioncheckJAXBSchema.java [new file with mode: 0644]
services/conditioncheck/jaxb/src/main/java/org/collectionspace/services/ConditioncheckListItemJAXBSchema.java [new file with mode: 0644]
services/conditioncheck/jaxb/src/main/resources/conditionchecks-common.xsd [new file with mode: 0644]
services/conditioncheck/pom.xml [new file with mode: 0644]
services/conditioncheck/service/pom.xml [new file with mode: 0644]
services/conditioncheck/service/profiles.xml [new file with mode: 0644]
services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/ConditioncheckResource.java [new file with mode: 0644]
services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckConstants.java [new file with mode: 0644]
services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckDocumentModelHandler.java [new file with mode: 0644]
services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckValidatorHandler.java [new file with mode: 0644]
services/conditioncheck/service/src/test/java/org/collectionspace/services/test/ConditioncheckServiceTest.java [new file with mode: 0644]
services/conditioncheck/service/src/test/resources/log4j.xml [new file with mode: 0644]
services/pom.xml

index 842dbf7e2645020c9a0c71a3f6b9a7e075ea41f2..533b2efd973a3d2e8874e035d4a62addae0e2ab0 100644 (file)
             <artifactId>org.collectionspace.services.loanout.service</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.conditioncheck.service</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.objectexit.service</artifactId>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.person.service</artifactId>\r
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.citation.service</artifactId>
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.citation.service</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
         <dependency>\r
index f9a1c656f996c9a52b0389c9438bc98dd78dda6b..df6dad718f3cdcb178c3604daed2da9f519beeff 100644 (file)
@@ -50,6 +50,7 @@ import org.collectionspace.services.vocabulary.VocabularyResource;
 import org.collectionspace.services.organization.OrgAuthorityResource;
 import org.collectionspace.services.person.PersonAuthorityResource;
 import org.collectionspace.services.citation.CitationAuthorityResource;
+import org.collectionspace.services.conditioncheck.ConditioncheckResource;
 
 import javax.servlet.ServletContext;
 import javax.ws.rs.core.Application;
@@ -115,6 +116,7 @@ public class CollectionSpaceJaxRsApplication extends Application
         addResourceToMapAndSingletons(new RelationResource());
         addResourceToMapAndSingletons(new LoaninResource());
         addResourceToMapAndSingletons(new LoanoutResource());
+        addResourceToMapAndSingletons(new ConditioncheckResource());
         addResourceToMapAndSingletons(new ObjectExitResource());
         addResourceToMapAndSingletons(new BatchResource());
         addResourceToMapAndSingletons(new MediaResource());
index 5bba1174716ae2a96ee8d8ceba9c811e31865dad..a15a962520ec0861d6e0bf98494c60b9ca347d30 100644 (file)
         <ant antfile="imports/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="loanin/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="loanout/build.xml" target="deploy" inheritAll="false"/>\r
+        <ant antfile="conditioncheck/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="objectexit/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="batch/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="location/build.xml" target="deploy" 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="conditioncheck/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="objectexit/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="batch/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="report/build.xml" target="undeploy" 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="conditioncheck/build.xml" target="dist" inheritAll="false"/>\r
         <ant antfile="objectexit/build.xml" target="dist" inheritAll="false"/>\r
         <ant antfile="batch/build.xml" target="dist" inheritAll="false"/>\r
         <ant antfile="media/build.xml" target="dist" inheritAll="false"/>\r
index 342333e6f917174e371a7313f021abec23e9c167..80189d28b54e926c8ad6e2549ee3b1378af76ed6 100644 (file)
             </service:object>
         </tenant:serviceBindings>
         <!-- end loanout service meta-data -->
+
+        <!-- begin conditioncheck service meta-data -->
+        <tenant:serviceBindings id="Conditionchecks" name="Conditionchecks" type="procedure" 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.conditioncheck.nuxeo.ConditioncheckDocumentModelHandler</service:documentHandler>
+            <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
+                <service:params>
+                    <service:ListResultsFields>
+                        <service:ListResultField>
+                            <service:element>conditionCheckRefNumber</service:element>
+                            <service:xpath>conditionCheckRefNumber</service:xpath>
+                        </service:ListResultField>
+                        <service:ListResultField>
+                            <service:element>condition</service:element>
+                            <service:xpath>conditionCheckGroupList/[0]/condition</service:xpath>
+                        </service:ListResultField>
+                    </service:ListResultsFields>
+                </service:params>
+            </service:DocHandlerParams>
+            <service:validatorHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.conditioncheck.nuxeo.ConditioncheckValidatorHandler</service:validatorHandler>
+            <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>conditionCheckGroupList/[0]/condition</types:value>
+                </types:item>
+                <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                    <types:key>objectNumberProperty</types:key>
+                    <types:value>conditionCheckRefNumber</types:value>
+                </types:item>
+            </service:properties>
+            <service:object xmlns:service="http://collectionspace.org/services/config/service" name="Conditioncheck" version="0.1">
+                <service:part id="0" control_group="Managed" versionable="true" auditable="false" label="conditionchecks-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="conditionchecks_common" updated="" order="1">
+                    <service:properties>
+                        <!-- Fields containing authority term references -->
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>authRef</types:key>
+                            <types:value>conditionChecker</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>objectAuditCategory</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>completenessGroupList/*/completeness</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>conditionCheckGroupList/*/condition</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>conservationTreatmentPriority</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>hazardGroupList/*/hazard</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>conditionCheckMethod</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>conditionCheckReason</types:value>
+                        </types:item>
+                        <types:item xmlns:types="http://collectionspace.org/services/config/types">
+                            <types:key>termRef</types:key>
+                            <types:value>salvagePriorityCodeGroupList/*/salvagePriorityCode</types:value>
+                        </types:item>
+                    </service:properties>
+                    <service:content contentType="application/xml">
+                        <service:xmlContent namespaceURI="http://collectionspace.org/services/conditioncheck" schemaLocation="http://collectionspace.org/services/conditioncheck http://services.collectionspace.org/conditioncheck/conditionchecks_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 conditioncheck service meta-data -->
     
         <!-- begin objectexit service meta-data -->
         <tenant:serviceBindings id="ObjectExit" name="ObjectExit" type="procedure" version="0.1">
index b4ec5495f3f16d8bb96bd943b9426d629758b1cb..bbadc1524fb28dc60181991ce7fa381338f31b13 100644 (file)
@@ -154,6 +154,42 @@ acquired for the archives.',
         FROM    id_generators
         );
 
+-- CONDITIONCHECK_NUMBER
+
+INSERT INTO id_generators
+    (csid, displayname, description, priority, last_generated_id, id_generator_state)
+  SELECT
+     '585af100-1a35-11e2-892e-0800200c9a66',
+     'Condition Check Number',
+     'Identifies a condition check record.',
+     '9',
+     '',
+'<org.collectionspace.services.id.SettableIDGenerator>
+  <parts>
+    <org.collectionspace.services.id.StringIDGeneratorPart>
+      <initialValue>CC</initialValue>
+      <currentValue>CC</currentValue>
+    </org.collectionspace.services.id.StringIDGeneratorPart>
+    <org.collectionspace.services.id.YearIDGeneratorPart>
+      <currentValue></currentValue>
+    </org.collectionspace.services.id.YearIDGeneratorPart>
+    <org.collectionspace.services.id.StringIDGeneratorPart>
+      <initialValue>.</initialValue>
+      <currentValue>.</currentValue>
+    </org.collectionspace.services.id.StringIDGeneratorPart>
+    <org.collectionspace.services.id.NumericIDGeneratorPart>
+      <maxLength>6</maxLength>
+      <initialValue>1</initialValue>
+      <currentValue>-1</currentValue>
+    </org.collectionspace.services.id.NumericIDGeneratorPart>
+  </parts>
+</org.collectionspace.services.id.SettableIDGenerator>'
+  WHERE '585af100-1a35-11e2-892e-0800200c9a66' NOT IN
+        (
+        SELECT  csid
+        FROM    id_generators
+        );
+
 -- EVALUATION_NUMBER
 
 INSERT INTO id_generators
diff --git a/services/conditioncheck/.project b/services/conditioncheck/.project
new file mode 100644 (file)
index 0000000..4a5da7d
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.conditioncheck</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
diff --git a/services/conditioncheck/3rdparty/.project b/services/conditioncheck/3rdparty/.project
new file mode 100644 (file)
index 0000000..1a7b39e
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.collectionspace.services.conditioncheck.3rdparty</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.m2e.core.maven2Builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.m2e.core.maven2Nature</nature>
+       </natures>
+</projectDescription>
diff --git a/services/conditioncheck/3rdparty/build.xml b/services/conditioncheck/3rdparty/build.xml
new file mode 100644 (file)
index 0000000..c678152
--- /dev/null
@@ -0,0 +1,130 @@
+<project name="conditioncheck.3rdparty" default="package" basedir=".">
+    <description>
+        conditioncheck service 3rdparty
+    </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="-V" />
+    <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 conditioncheck in ${jee.server.nuxeo}">
+       <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <ant antfile="nuxeo-platform-cs-conditioncheck/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy conditioncheck from ${jee.server.nuxeo}">
+       <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+       leaving this only for backwards compatibility reasons. -->
+        <ant antfile="nuxeo-platform-cs-conditioncheck/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for conditioncheck" depends="package">
+        <ant antfile="nuxeo-platform-cs-conditioncheck/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
diff --git a/services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/build.xml b/services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/build.xml
new file mode 100644 (file)
index 0000000..018c093
--- /dev/null
@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="nuxeo-platform-cs-conditioncheck" default="package" basedir=".">
+    <description>
+        conditioncheck 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="-V" />
+    <property name="src" location="src"/>
+    <!-- JAR files used by CollectionSpace 4.0 and later -->
+    <property name="nuxeo.conditioncheck.doctype.jars.all"
+        value="collectionspace.conditioncheck.doctype.*.jar"/>
+    <property name="nuxeo.conditioncheck.schema.jars.all"
+        value="collectionspace.conditioncheck.schema.*.jar"/>
+    <!-- Legacy JAR files used by CollectionSpace 3.3 and earlier --> 
+    <property name="nuxeo.conditioncheck.legacy.jars.all"
+        value="org.collectionspace.services.conditioncheck.3rdparty.nuxeo-*.jar"/>
+    <property name="nuxeo.conditioncheck.legacy.jar"
+        value="org.collectionspace.services.conditioncheck.3rdparty.nuxeo-${cspace.release}.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 conditioncheck doctype in ${jee.server.nuxeo}">
+        <!-- This target is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        leaving this only for backwards compatibility reasons. --> 
+        <copy file="${basedir}/target/${nuxeo.conditioncheck.legacy.jar}"
+            todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy conditioncheck doctype from ${jee.server.nuxeo}">
+        <delete>
+            <!-- Undeploy doctype and schema artifacts -->
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.conditioncheck.doctype.jars.all}"/>
+            </fileset>
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.conditioncheck.schema.jars.all}"/>
+            </fileset>
+            <!-- Undeploy legacy artifacts -->
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.conditioncheck.legacy.jars.all}"/>
+            </fileset>
+        </delete>
+        <!-- Undeploy legacy artifacts from old deployment location through release 0.6 -->
+        <delete quiet="true">
+            <fileset dir="${jee.deploy.nuxeo.system}">
+                <include name="${nuxeo.conditioncheck.legacy.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+
+    <target name="dist"
+        description="generate distribution for conditioncheck doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.conditioncheck.legacy.jar}"/>
+        </copy>
+    </target>
+
+</project>
diff --git a/services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/pom.xml b/services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/pom.xml
new file mode 100644 (file)
index 0000000..5f7cd03
--- /dev/null
@@ -0,0 +1,55 @@
+<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.conditioncheck.3rdparty</artifactId>
+        <version>4.1-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.conditioncheck.3rdparty.nuxeo</artifactId>
+    <name>services.conditioncheck.3rdparty.nuxeo</name>
+    <packaging>jar</packaging>
+    <description>
+        Conditioncheck Nuxeo Document Type
+    </description>
+
+    <properties>
+        <ServiceName>conditioncheck</ServiceName>
+        <NuxeoDocTypeName>Conditioncheck</NuxeoDocTypeName>
+        <CommonSchemaName>conditionchecks_common</CommonSchemaName>
+       <Lifecycle>cs_default</Lifecycle>
+    </properties>
+
+    <build>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+            <resource>
+                <directory>../../../../3rdparty/nuxeo/nuxeo-doctype/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>target/classes/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/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/src/main/resources/OSGI-INF/README.txt b/services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/src/main/resources/OSGI-INF/README.txt
new file mode 100644 (file)
index 0000000..5f304de
--- /dev/null
@@ -0,0 +1,16 @@
+Files formerly located in this directory are no longer needed
+-------------------------------------------------------------
+
+In CollectionSpace versions 4.0 and higher, changes were introduced
+which streamline and simplify the process through which you configure
+fields in CollectionSpace's main record types.
+
+In most cases now, you will typically change the behavior of existing fields,
+or create extension schemas to add new fields specific to your museum and/or
+community of practice, merely by editing simpler XML-based configuration
+files within CollectionSpace's Application layer.
+
+Services layer files that were formerly located in this directory and
+other, similar directories - which you previously needed to manually
+create or edit - are now generated automatically from your configuration
+in the Application layer.
diff --git a/services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/src/main/resources/schemas/README.txt b/services/conditioncheck/3rdparty/nuxeo-platform-cs-conditioncheck/src/main/resources/schemas/README.txt
new file mode 100644 (file)
index 0000000..5f304de
--- /dev/null
@@ -0,0 +1,16 @@
+Files formerly located in this directory are no longer needed
+-------------------------------------------------------------
+
+In CollectionSpace versions 4.0 and higher, changes were introduced
+which streamline and simplify the process through which you configure
+fields in CollectionSpace's main record types.
+
+In most cases now, you will typically change the behavior of existing fields,
+or create extension schemas to add new fields specific to your museum and/or
+community of practice, merely by editing simpler XML-based configuration
+files within CollectionSpace's Application layer.
+
+Services layer files that were formerly located in this directory and
+other, similar directories - which you previously needed to manually
+create or edit - are now generated automatically from your configuration
+in the Application layer.
diff --git a/services/conditioncheck/3rdparty/pom.xml b/services/conditioncheck/3rdparty/pom.xml
new file mode 100644 (file)
index 0000000..e578bb1
--- /dev/null
@@ -0,0 +1,24 @@
+<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>
+        <artifactId>org.collectionspace.services.conditioncheck</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.1-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.conditioncheck.3rdparty</artifactId>
+    <name>services.conditioncheck.3rdparty</name>
+    <packaging>pom</packaging>
+    
+    <description>
+        3rd party build for conditioncheck service
+    </description>
+
+    <modules>
+    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <module>nuxeo-platform-cs-conditioncheck</module>
+        -->
+    </modules>
+</project>
diff --git a/services/conditioncheck/build.xml b/services/conditioncheck/build.xml
new file mode 100644 (file)
index 0000000..c320a6f
--- /dev/null
@@ -0,0 +1,123 @@
+<project name="conditioncheck" default="package" basedir=".">
+    <description>
+        conditioncheck service
+    </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="-V" />
+    <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 conditioncheck service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy conditioncheck service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+    description="distribute conditioncheck service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
diff --git a/services/conditioncheck/client/pom.xml b/services/conditioncheck/client/pom.xml
new file mode 100644 (file)
index 0000000..39cb0ba
--- /dev/null
@@ -0,0 +1,95 @@
+<?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.conditioncheck</artifactId>
+        <version>4.1-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.conditioncheck.client</artifactId>
+    <name>services.conditioncheck.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>test</scope>
+        </dependency>
+<!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </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.common</artifactId>
+            <optional>true</optional>
+            <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.conditioncheck.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.person.client</artifactId>
+            <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-conditioncheck-client</finalName>
+    </build>
+</project>
diff --git a/services/conditioncheck/client/src/main/java/org/collectionspace/services/client/ConditioncheckClient.java b/services/conditioncheck/client/src/main/java/org/collectionspace/services/client/ConditioncheckClient.java
new file mode 100644 (file)
index 0000000..29b7f19
--- /dev/null
@@ -0,0 +1,48 @@
+/**        
+ * 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
+ */
+package org.collectionspace.services.client;
+
+/**
+ * ConditioncheckClient.java
+ */
+public class ConditioncheckClient extends AbstractCommonListPoxServiceClientImpl<ConditioncheckProxy> {
+
+    public static final String SERVICE_NAME = "conditionchecks";
+    public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
+    public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+    public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";
+    public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.AbstractServiceClientImpl#getServicePathComponent()
+     */
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+    @Override
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
+
+    @Override
+    public Class<ConditioncheckProxy> getProxyClass() {
+        return ConditioncheckProxy.class;
+    }
+
+}
diff --git a/services/conditioncheck/client/src/main/java/org/collectionspace/services/client/ConditioncheckProxy.java b/services/conditioncheck/client/src/main/java/org/collectionspace/services/client/ConditioncheckProxy.java
new file mode 100644 (file)
index 0000000..c557f05
--- /dev/null
@@ -0,0 +1,30 @@
+/**        
+ * 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
+ */
+package org.collectionspace.services.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+/**
+ * ConditioncheckProxy.java
+ */
+@Path(ConditioncheckClient.SERVICE_PATH_PROXY)
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public interface ConditioncheckProxy extends CollectionSpaceCommonListPoxProxy {
+}
diff --git a/services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckAuthRefsTest.java b/services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckAuthRefsTest.java
new file mode 100644 (file)
index 0000000..9071f35
--- /dev/null
@@ -0,0 +1,355 @@
+/**
+ * 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 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 javax.ws.rs.core.Response;
+
+import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.ConditioncheckClient;
+import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonAuthorityClientUtils;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
+import org.collectionspace.services.common.authorityref.AuthorityRefList;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.conditioncheck.ConditionchecksCommon;
+import org.collectionspace.services.person.PersonTermGroup;
+
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * ConditioncheckAuthRefsTest, carries out Authority References tests against a
+ * deployed and running Conditioncheck (aka Condition Checks) Service.
+ */
+public class ConditioncheckAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
+
+    private final String CLASS_NAME = ConditioncheckAuthRefsTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    
+    // Instance variables specific to this test.
+    final String SERVICE_NAME = "conditionchecks";
+    final String SERVICE_PATH_COMPONENT = "conditionchecks";
+    final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
+    private String knownResourceId = null;
+    private List<String> conditioncheckIdsCreated = new ArrayList<String>();
+    private List<String> personIdsCreated = new ArrayList<String>();
+    private String personAuthCSID = null;
+    private String conditionCheckerRefName = null;
+
+    private final int NUM_AUTH_REFS_EXPECTED = 1;
+
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+        throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+    protected AbstractCommonList getCommonList(
+            ClientResponse<AbstractCommonList> response) {
+        throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
+    }
+
+    // ---------------------------------------------------------------
+    // CRUD tests : CREATE tests
+    // ---------------------------------------------------------------
+    // Success outcomes
+    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
+    public void createWithAuthRefs(String testName) throws Exception {
+        testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
+
+        // Submit the request to the service and store the response.
+        String identifier = createIdentifier();
+        
+        // Create all the person refs and entities
+        createPersonRefs();
+
+        // Create a new Condition Check resource.
+        //
+        // One or more fields in this resource will be PersonAuthority
+        // references, and will refer to Person resources by their refNames.
+        ConditioncheckClient conditioncheckClient = new ConditioncheckClient();
+        PoxPayloadOut multipart = createConditioncheckInstance(
+                "conditionCheckRefNumber-" + identifier,
+                conditionCheckerRefName);
+        ClientResponse<Response> response = conditioncheckClient.create(multipart);
+        int statusCode = response.getStatus();
+        try {
+            // Check the status code of the response: does it match
+            // the expected response(s)?
+            //
+            // Specifically:
+            // Does it fall within the set of valid status codes?
+            // Does it exactly match the expected status code?
+            if(logger.isDebugEnabled()){
+                logger.debug(testName + ": status = " + statusCode);
+            }
+            Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                    invalidStatusCodeMessage(testRequestType, statusCode));
+            Assert.assertEquals(statusCode, testExpectedStatusCode);
+    
+            // Store the ID returned from the first resource created
+            // for additional tests below.
+            if (knownResourceId == null){
+                knownResourceId = extractId(response);
+                if (logger.isDebugEnabled()) {
+                    logger.debug(testName + ": knownResourceId=" + knownResourceId);
+                }
+            }
+            
+            // Store the IDs from every resource created by tests,
+            // so they can be deleted after tests have been run.
+            conditioncheckIdsCreated.add(extractId(response));
+        } finally {
+            response.releaseConnection();
+        }
+    }
+    
+    protected void createPersonRefs(){
+
+        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        // Create a temporary PersonAuthority resource, and its corresponding
+        // refName by which it can be identified.
+        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
+            PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
+        ClientResponse<Response> res = personAuthClient.create(multipart);
+        int statusCode = res.getStatus();
+
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+            invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, STATUS_CREATED);
+        personAuthCSID = extractId(res);
+
+        String authRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
+        
+        // Create temporary Person resources, and their corresponding refNames
+        // by which they can be identified.
+        String csid = createPerson("Carrie", "ConditionChecker1", "carrieConditionChecker", authRefName);
+        personIdsCreated.add(csid);
+        conditionCheckerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
+    }
+    
+    protected String createPerson(String firstName, String surName, String shortId, String authRefName ) {
+        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        Map<String, String> personInfo = new HashMap<String,String>();
+        personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
+        personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
+        personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
+        List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
+        PersonTermGroup term = new PersonTermGroup();
+        String termName = firstName + " " + surName;
+        term.setTermDisplayName(termName);
+        term.setTermName(termName);
+        personTerms.add(term);
+        PoxPayloadOut multipart =
+            PersonAuthorityClientUtils.createPersonInstance(personAuthCSID, 
+                    authRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
+        ClientResponse<Response> res = personAuthClient.createItem(personAuthCSID, multipart);
+        int statusCode = res.getStatus();
+
+        Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(testRequestType, statusCode));
+        Assert.assertEquals(statusCode, STATUS_CREATED);
+        return extractId(res);
+    }
+
+    // Success outcomes
+    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
+        dependsOnMethods = {"createWithAuthRefs"})
+    public void readAndCheckAuthRefs(String testName) throws Exception {
+        // Perform setup.
+        testSetup(STATUS_OK, ServiceRequestType.READ);
+
+        // Submit the request to the service and store the response.
+        ConditioncheckClient conditioncheckClient = new ConditioncheckClient();
+        ClientResponse<String> res = conditioncheckClient.read(knownResourceId);
+        ConditionchecksCommon conditioncheckCommon = null;
+        try {
+            assertStatusCode(res, testName);
+            // Extract the common part from the response.
+            PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
+            conditioncheckCommon = (ConditionchecksCommon) extractPart(input,
+                conditioncheckClient.getCommonPartName(), ConditionchecksCommon.class);
+            Assert.assertNotNull(conditioncheckCommon);
+            if(logger.isDebugEnabled()){
+                logger.debug(objectAsXmlString(conditioncheckCommon, ConditionchecksCommon.class));
+            }
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+        //
+        // Check a couple of fields
+        Assert.assertEquals(conditioncheckCommon.getConditionChecker(), conditionCheckerRefName);
+        
+        // Get the auth refs and check them
+        ClientResponse<AuthorityRefList> res2 = conditioncheckClient.getAuthorityRefs(knownResourceId);
+        AuthorityRefList list = null;
+        try {
+            assertStatusCode(res2, testName);
+            list = res2.getEntity();
+            Assert.assertNotNull(list);
+        } finally {
+            if (res2 != null) {
+                res2.releaseConnection();
+            }
+        }
+        
+        List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
+        int numAuthRefsFound = items.size();
+        if(logger.isDebugEnabled()){
+            logger.debug("Expected " + NUM_AUTH_REFS_EXPECTED +
+                " authority references, found " + numAuthRefsFound);
+        }
+
+        // Optionally output additional data about list members for debugging.
+        boolean iterateThroughList = true;
+        if(iterateThroughList && logger.isDebugEnabled()){
+            int i = 0;
+            for(AuthorityRefList.AuthorityRefItem item : items){
+                logger.debug(testName + ": list-item[" + i + "] Field:" +
+                        item.getSourceField() + "= " +
+                        item.getAuthDisplayName() +
+                        item.getItemDisplayName());
+                logger.debug(testName + ": list-item[" + i + "] refName=" +
+                        item.getRefName());
+                logger.debug(testName + ": list-item[" + i + "] URI=" +
+                        item.getUri());
+                i++;
+            }
+        }
+
+        Assert.assertEquals(numAuthRefsFound, NUM_AUTH_REFS_EXPECTED,
+            "Did not find all expected authority references! " +
+            "Expected " + NUM_AUTH_REFS_EXPECTED + ", found " + numAuthRefsFound);
+
+    }
+
+
+    // ---------------------------------------------------------------
+    // 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 ...");
+        }
+        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        // Delete Person resource(s) (before PersonAuthority resources).
+        
+        for (String resourceId : personIdsCreated) {
+            // Note: Any non-success responses are ignored and not reported.
+            ClientResponse<Response> response = 
+                personAuthClient.deleteItem(personAuthCSID, resourceId); // alternative to personAuthClient.deleteItem().releaseConnection();
+            response.releaseConnection();
+        }
+        
+        // Delete PersonAuthority resource(s).
+        // Note: Any non-success response is ignored and not reported.
+        if (personAuthCSID != null) {
+            personAuthClient.delete(personAuthCSID);
+            // Delete Condition Checks resource(s).
+            ConditioncheckClient conditioncheckClient = new ConditioncheckClient();
+            ClientResponse<Response> response = null;
+            for (String resourceId : conditioncheckIdsCreated) {
+                // Note: Any non-success responses are ignored and not reported.
+                response = conditioncheckClient.delete(resourceId); // alternative to conditioncheckClient.delete(resourceId).releaseConnection();
+                response.releaseConnection();
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
+
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+    private PoxPayloadOut createConditioncheckInstance(String conditionCheckRefNumber,
+            String conditionChecker) {
+        ConditionchecksCommon conditioncheckCommon = new ConditionchecksCommon();
+
+        conditioncheckCommon.setConditionCheckRefNumber(conditionCheckRefNumber);
+        conditioncheckCommon.setConditionChecker(conditionChecker);
+
+        PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
+        PayloadOutputPart commonPart =
+                multipart.addPart(new ConditioncheckClient().getCommonPartName(), conditioncheckCommon);
+
+        if(logger.isDebugEnabled()){
+            logger.debug("to be created, conditioncheck common");
+            logger.debug(objectAsXmlString(conditioncheckCommon, ConditionchecksCommon.class));
+        }
+
+        return multipart;
+    }
+
+    @Override
+    protected Class<AbstractCommonList> getCommonListType() {
+        return AbstractCommonList.class;
+    }
+}
diff --git a/services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckServiceTest.java b/services/conditioncheck/client/src/test/java/org/collectionspace/services/client/test/ConditioncheckServiceTest.java
new file mode 100644 (file)
index 0000000..68d2919
--- /dev/null
@@ -0,0 +1,721 @@
+/**
+ * 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 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.List;
+import javax.ws.rs.core.Response;
+
+import org.collectionspace.services.client.AbstractCommonListUtils;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.ConditioncheckClient;
+import org.collectionspace.services.client.PayloadInputPart;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.conditioncheck.ConditionchecksCommon;
+import org.collectionspace.services.conditioncheck.HazardGroupList;
+import org.collectionspace.services.conditioncheck.HazardGroup;
+
+import org.jboss.resteasy.client.ClientResponse;
+import org.testng.Assert;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * ConditioncheckServiceTest, carries out tests against a
+ * deployed and running Conditioncheck (aka Condition Checks) Service.
+ */
+public class ConditioncheckServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonList, ConditionchecksCommon> {
+
+    /** The logger. */
+    private final String CLASS_NAME = ConditioncheckServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    // Instance variables specific to this test.
+    /** The service path component. */
+    final String SERVICE_NAME = "conditionchecks";
+    final String SERVICE_PATH_COMPONENT = "conditionchecks";
+    private String CONDITIONCHECKER_REF_NAME =
+            "urn:cspace:org.collectionspace.demo:personauthorities:name(TestPersonAuth):item:name(HarryLender)'Harry Lender'";
+    private String CONDITIONCHECK_HAZARD = 
+            "urn:cspace:core.collectionspace.org:vocabularies:name(TestTermList):item:name(hazard1)'multi-dimensional'";
+    private String CONDITIONCHECK_HAZARD_NOTE = "Object needs to be extinguished occasionally.";
+    private final static String CURRENT_DATE_UTC =
+            GregorianCalendarDateTimeUtils.timestampUTC();
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+        return new ConditioncheckClient();
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
+     */
+    @Override
+    protected AbstractCommonList getCommonList(
+            ClientResponse<AbstractCommonList> response) {
+        return response.getEntity(AbstractCommonList.class);
+    }
+
+    // ---------------------------------------------------------------
+    // CRUD tests : CREATE tests
+    // ---------------------------------------------------------------
+    
+    // Success outcomes
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.ServiceTest#create(java.lang.String)
+     */
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class)
+    public void create(String testName) throws Exception {
+        // Perform setup, such as initializing the type of service request
+        // (e.g. CREATE, DELETE), its valid and expected status codes, and
+        // its associated HTTP method name (e.g. POST, DELETE).
+        setupCreate();
+
+        // Submit the request to the service and store the response.
+        ConditioncheckClient client = new ConditioncheckClient();
+        String identifier = createIdentifier();
+        PoxPayloadOut multipart = createConditioncheckInstance(identifier);
+        String newID = null;
+        ClientResponse<Response> res = client.create(multipart);
+        try {
+            int statusCode = res.getStatus();
+
+            // Check the status code of the response: does it match
+            // the expected response(s)?
+            //
+            // Specifically:
+            // Does it fall within the set of valid status codes?
+            // Does it exactly match the expected status code?
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": status = " + statusCode);
+            }
+            Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                    invalidStatusCodeMessage(testRequestType, statusCode));
+            Assert.assertEquals(statusCode, testExpectedStatusCode);
+
+            newID = extractId(res);
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+
+        // Store the ID returned from the first resource created
+        // for additional tests below.
+        if (knownResourceId == null) {
+            knownResourceId = newID;
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": knownResourceId=" + knownResourceId);
+            }
+        }
+
+        // Store the IDs from every resource created by tests,
+        // so they can be deleted after tests have been run.
+        allResourceIdsCreated.add(newID);
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
+     */
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+//    dependsOnMethods = {"create"})
+    public void createList(String testName) throws Exception {
+        for (int i = 0; i < 3; i++) {
+            create(testName);
+        }
+    }
+
+
+    /*
+    @Override
+    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
+    dependsOnMethods = {"create", "testSubmitRequest"})
+    public void createWithEmptyEntityBody(String testName) throws Exception {
+    
+    if (logger.isDebugEnabled()) {
+    logger.debug(testBanner(testName, CLASS_NAME));
+    }
+    // Perform setup.
+    setupCreateWithEmptyEntityBody();
+    
+    // Submit the request to the service and store the response.
+    String method = REQUEST_TYPE.httpMethodName();
+    String url = getServiceRootURL();
+    String mediaType = MediaType.APPLICATION_XML;
+    final String entity = "";
+    int statusCode = submitRequest(method, url, mediaType, entity);
+    
+    // Check the status code of the response: does it match
+    // the expected response(s)?
+    if(logger.isDebugEnabled()){
+    logger.debug("createWithEmptyEntityBody url=" + url +
+    " status=" + statusCode);
+    }
+    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+    }
+    
+    @Override
+    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
+    dependsOnMethods = {"create", "testSubmitRequest"})
+    public void createWithMalformedXml(String testName) throws Exception {
+    
+    if (logger.isDebugEnabled()) {
+    logger.debug(testBanner(testName, CLASS_NAME));
+    }
+    // Perform setup.
+    setupCreateWithMalformedXml(testName, logger);
+    
+    // Submit the request to the service and store the response.
+    String method = REQUEST_TYPE.httpMethodName();
+    String url = getServiceRootURL();
+    String mediaType = MediaType.APPLICATION_XML;
+    final String entity = MALFORMED_XML_DATA; // Constant from base class.
+    int statusCode = submitRequest(method, url, mediaType, entity);
+    
+    // Check the status code of the response: does it match
+    // the expected response(s)?
+    if(logger.isDebugEnabled()){
+    logger.debug(testName + ": url=" + url +
+    " status=" + statusCode);
+    }
+    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+    }
+    
+    @Override
+    @Test(dataProvider="testName", dataProviderClass=AbstractServiceTest.class,
+    dependsOnMethods = {"create", "testSubmitRequest"})
+    public void createWithWrongXmlSchema(String testName) throws Exception {
+    
+    if (logger.isDebugEnabled()) {
+    logger.debug(testBanner(testName, CLASS_NAME));
+    }
+    // Perform setup.
+    setupCreateWithWrongXmlSchema(testName, logger);
+    
+    // Submit the request to the service and store the response.
+    String method = REQUEST_TYPE.httpMethodName();
+    String url = getServiceRootURL();
+    String mediaType = MediaType.APPLICATION_XML;
+    final String entity = WRONG_XML_SCHEMA_DATA;
+    int statusCode = submitRequest(method, url, mediaType, entity);
+    
+    // Check the status code of the response: does it match
+    // the expected response(s)?
+    if(logger.isDebugEnabled()){
+    logger.debug(testName + ": url=" + url +
+    " status=" + statusCode);
+    }
+    Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+    invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+    Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
+    }
+     */
+    
+    // ---------------------------------------------------------------
+    // CRUD tests : READ tests
+    // ---------------------------------------------------------------
+    
+    // Success outcomes
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#read(java.lang.String)
+     */
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+//    dependsOnMethods = {"create"})
+    public void read(String testName) throws Exception {
+        // Perform setup.
+        setupRead();
+
+        // Submit the request to the service and store the response.
+        ConditioncheckClient client = new ConditioncheckClient();
+        ClientResponse<String> res = client.read(knownResourceId);
+        PoxPayloadIn input = null;
+        try {
+            assertStatusCode(res, testName);
+            input = new PoxPayloadIn(res.getEntity());
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+
+        // Get the common part of the response and verify that it is not null.
+        PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
+        ConditionchecksCommon conditioncheckCommon = null;
+        if (payloadInputPart != null) {
+            conditioncheckCommon = (ConditionchecksCommon) payloadInputPart.getBody();
+        }
+        Assert.assertNotNull(conditioncheckCommon);
+
+        // Check selected fields.
+        HazardGroupList hazardGroupList = conditioncheckCommon.getHazardGroupList();
+        Assert.assertNotNull(hazardGroupList);
+        List<HazardGroup> hazardGroups = hazardGroupList.getHazardGroup();
+        Assert.assertNotNull(hazardGroups);
+        String hazard = hazardGroups.get(0).getHazard();
+        Assert.assertEquals(hazard, CONDITIONCHECK_HAZARD);
+        String hazardNote = hazardGroups.get(0).getHazardNote();
+        Assert.assertEquals(hazardNote, CONDITIONCHECK_HAZARD_NOTE);
+        String hazardDate = hazardGroups.get(0).getHazardDate();
+        Assert.assertEquals(hazardDate, CURRENT_DATE_UTC);
+        String conditionChecker = conditioncheckCommon.getConditionChecker();
+        Assert.assertEquals(conditionChecker, CONDITIONCHECKER_REF_NAME);
+
+        // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
+        String conditionCheckNote = conditioncheckCommon.getConditionCheckNote();
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("UTF-8 data sent=" + getUTF8DataFragment() + "\n"
+                    + "UTF-8 data received=" + conditionCheckNote);
+        }
+
+        Assert.assertEquals(conditionCheckNote, getUTF8DataFragment(),
+                "UTF-8 data retrieved '" + conditionCheckNote
+                + "' does not match expected data '" + getUTF8DataFragment());
+    }
+
+    // Failure outcomes
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readNonExistent(java.lang.String)
+     */
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+//    dependsOnMethods = {"read"})
+    public void readNonExistent(String testName) throws Exception {
+        // Perform setup.
+        setupReadNonExistent();
+
+        // Submit the request to the service and store the response.
+        ConditioncheckClient client = new ConditioncheckClient();
+        ClientResponse<String> res = client.read(NON_EXISTENT_ID);
+        try {
+            int statusCode = res.getStatus();
+
+            // Check the status code of the response: does it match
+            // the expected response(s)?
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": status = " + statusCode);
+            }
+            Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                    invalidStatusCodeMessage(testRequestType, statusCode));
+            Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // CRUD tests : READ_LIST tests
+    // ---------------------------------------------------------------
+    
+    // Success outcomes
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#readList(java.lang.String)
+     */
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+//    dependsOnMethods = {"createList", "read"})
+    public void readList(String testName) throws Exception {
+        // Perform setup.
+        setupReadList();
+
+        // Submit the request to the service and store the response.
+        AbstractCommonList list = null;
+        ConditioncheckClient client = new ConditioncheckClient();
+        ClientResponse<AbstractCommonList> res = client.readList();
+        assertStatusCode(res, testName);
+        try {
+            int statusCode = res.getStatus();
+
+            // Check the status code of the response: does it match
+            // the expected response(s)?
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": status = " + statusCode);
+            }
+            Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                    invalidStatusCodeMessage(testRequestType, statusCode));
+            Assert.assertEquals(statusCode, testExpectedStatusCode);
+
+            list = res.getEntity();
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+
+        // Optionally output additional data about list members for debugging.
+        boolean iterateThroughList = true;
+        if(iterateThroughList && logger.isDebugEnabled()){
+            AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+        }
+
+    }
+
+    // Failure outcomes
+    // None at present.
+    
+    // ---------------------------------------------------------------
+    // CRUD tests : UPDATE tests
+    // ---------------------------------------------------------------
+    
+    // Success outcomes
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#update(java.lang.String)
+     */
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+//    dependsOnMethods = {"read"})
+    public void update(String testName) throws Exception {
+        // Perform setup.
+        setupRead();
+
+        // Retrieve the contents of a resource to update.
+        ConditioncheckClient client = new ConditioncheckClient();
+        ClientResponse<String> res = client.read(knownResourceId);
+        PoxPayloadIn input = null;
+        try {
+            assertStatusCode(res, testName);
+            input = new PoxPayloadIn(res.getEntity());
+            if (logger.isDebugEnabled()) {
+                logger.debug("got object to update with ID: " + knownResourceId);
+            }
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+
+        // Extract the common part from the response.
+        PayloadInputPart payloadInputPart = input.getPart(client.getCommonPartName());
+        ConditionchecksCommon conditioncheckCommon = null;
+        if (payloadInputPart != null) {
+            conditioncheckCommon = (ConditionchecksCommon) payloadInputPart.getBody();
+        }
+        Assert.assertNotNull(conditioncheckCommon);
+
+        // Update the content of this resource.
+        conditioncheckCommon.setConditionCheckRefNumber("updated-" + conditioncheckCommon.getConditionCheckRefNumber());
+
+        String conditionCheckNote = conditioncheckCommon.getConditionCheckNote();
+        conditioncheckCommon.setConditionCheckNote("updated-conditionCheckNote-" + conditionCheckNote);
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("to be updated object");
+            logger.debug(objectAsXmlString(conditioncheckCommon, ConditionchecksCommon.class));
+        }
+
+        setupUpdate();
+        
+        // Submit the updated common part in an update request to the service
+        // and store the response.
+        PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
+        PayloadOutputPart commonPart = output.addPart(client.getCommonPartName(), conditioncheckCommon);
+        res = client.update(knownResourceId, output);
+        try {
+            assertStatusCode(res, testName);
+            int statusCode = res.getStatus();
+            // Check the status code of the response: does it match the expected response(s)?
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": status = " + statusCode);
+            }
+            Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                    invalidStatusCodeMessage(testRequestType, statusCode));
+            Assert.assertEquals(statusCode, testExpectedStatusCode);
+            input = new PoxPayloadIn(res.getEntity());
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+
+        // Extract the updated common part from the response.
+        payloadInputPart = input.getPart(client.getCommonPartName());
+        ConditionchecksCommon updatedConditioncheckCommon = null;
+        if (payloadInputPart != null) {
+            updatedConditioncheckCommon = (ConditionchecksCommon) payloadInputPart.getBody();
+        }
+        Assert.assertNotNull(updatedConditioncheckCommon);
+
+        // Check selected fields in the updated common part.
+        Assert.assertEquals(updatedConditioncheckCommon.getConditionCheckRefNumber(),
+                conditioncheckCommon.getConditionCheckRefNumber(),
+                "Data in updated object did not match submitted data.");
+
+        // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
+        String originalConditionCheckNote = conditioncheckCommon.getConditionCheckNote();
+        String updatedConditionCheckNote = updatedConditioncheckCommon.getConditionCheckNote();
+        
+        Assert.assertEquals(updatedConditionCheckNote, originalConditionCheckNote,
+                "Data in updated object did not match submitted data.");
+
+        if(logger.isDebugEnabled()){
+            logger.debug("UTF-8 data sent=" + originalConditionCheckNote + "\n"
+                    + "UTF-8 data received=" + updatedConditionCheckNote);
+        }
+        Assert.assertTrue(updatedConditionCheckNote.contains(getUTF8DataFragment()),
+                "UTF-8 data retrieved '" + updatedConditionCheckNote
+                + "' does not match expected data '" + getUTF8DataFragment());
+    }
+
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+//    dependsOnMethods = {"update", "testSubmitRequest"})
+    public void updateNonExistent(String testName) throws Exception {
+        // Perform setup.
+        setupUpdateNonExistent();
+
+        // Submit the request to the service and store the response.
+        // Note: The ID used in this 'create' call may be arbitrary.
+        // The only relevant ID may be the one used in update(), below.
+        ConditioncheckClient client = new ConditioncheckClient();
+        PoxPayloadOut multipart = createConditioncheckInstance(NON_EXISTENT_ID);
+        ClientResponse<String> res = client.update(NON_EXISTENT_ID, multipart);
+        try {
+            int statusCode = res.getStatus();
+
+            // Check the status code of the response: does it match
+            // the expected response(s)?
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": status = " + statusCode);
+            }
+            Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                    invalidStatusCodeMessage(testRequestType, statusCode));
+            Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // CRUD tests : DELETE tests
+    // ---------------------------------------------------------------
+    
+    // Success outcomes
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#delete(java.lang.String)
+     */
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+//    dependsOnMethods = {"create", "readList", "testSubmitRequest", "update"})
+    public void delete(String testName) throws Exception {
+        // Perform setup.
+        setupDelete();
+
+        // Submit the request to the service and store the response.
+        ConditioncheckClient client = new ConditioncheckClient();
+        ClientResponse<Response> res = client.delete(knownResourceId);
+        try {
+            int statusCode = res.getStatus();
+
+            // Check the status code of the response: does it match
+            // the expected response(s)?
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": status = " + statusCode);
+            }
+            Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                    invalidStatusCodeMessage(testRequestType, statusCode));
+            Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+    }
+
+    // Failure outcomes
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#deleteNonExistent(java.lang.String)
+     */
+    @Override
+//    @Test(dataProvider = "testName", dataProviderClass = AbstractServiceTestImpl.class,
+//    dependsOnMethods = {"delete"})
+    public void deleteNonExistent(String testName) throws Exception {
+        // Perform setup.
+        setupDeleteNonExistent();
+
+        // Submit the request to the service and store the response.
+        ConditioncheckClient client = new ConditioncheckClient();
+        ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
+        try {
+            int statusCode = res.getStatus();
+
+            // Check the status code of the response: does it match
+            // the expected response(s)?
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": status = " + statusCode);
+            }
+            Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
+                    invalidStatusCodeMessage(testRequestType, statusCode));
+            Assert.assertEquals(statusCode, testExpectedStatusCode);
+        } finally {
+            if (res != null) {
+                res.releaseConnection();
+            }
+        }
+    }
+
+    // ---------------------------------------------------------------
+    // Utility tests : tests of code used in tests above
+    // ---------------------------------------------------------------
+    
+    /**
+     * Tests the code for manually submitting data that is used by several
+     * of the methods above.
+     */
+//    @Test(dependsOnMethods = {"create", "read"})
+    public void testSubmitRequest() {
+
+        // Expected status code: 200 OK
+        final int EXPECTED_STATUS = Response.Status.OK.getStatusCode();
+
+        // Submit the request to the service and store the response.
+        String method = ServiceRequestType.READ.httpMethodName();
+        String url = getResourceURL(knownResourceId);
+        int statusCode = submitRequest(method, url);
+
+        // Check the status code of the response: does it match
+        // the expected response(s)?
+        if (logger.isDebugEnabled()) {
+            logger.debug("testSubmitRequest: url=" + url
+                    + " status=" + statusCode);
+        }
+        Assert.assertEquals(statusCode, EXPECTED_STATUS);
+
+    }
+
+    // ---------------------------------------------------------------
+    // Utility methods used by tests above
+    // ---------------------------------------------------------------
+    
+    @Override
+    public String getServiceName() {
+        return SERVICE_NAME;
+    }
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
+     */
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+    @Override
+    protected PoxPayloadOut createInstance(String identifier) {
+        return createConditioncheckInstance(identifier);
+    }
+
+    /**
+     * Creates the conditioncheck instance.
+     *
+     * @param identifier the identifier
+     * @return the multipart output
+     */
+    //private PoxPayloadOut createConditioncheckInstance(String identifier) {
+    //    return createConditioncheckInstance("conditionCheckRefNumber-" + identifier);
+    //}
+
+    /**
+     * Creates the conditioncheck instance.
+     *
+     * @param conditioncheckRefNumber the conditioncheck number
+     * @return the multipart output
+     */
+    private PoxPayloadOut createConditioncheckInstance(String conditionCheckRefNumber) {
+
+        ConditionchecksCommon conditioncheckCommon = new ConditionchecksCommon();
+        conditioncheckCommon.setConditionCheckRefNumber(conditionCheckRefNumber);
+        conditioncheckCommon.setConditionChecker(CONDITIONCHECKER_REF_NAME);
+        conditioncheckCommon.setConditionCheckNote(getUTF8DataFragment());
+
+        HazardGroupList hazardGroupList = new HazardGroupList();
+        List<HazardGroup> hazardGroups = hazardGroupList.getHazardGroup();
+        HazardGroup hazardGroup = new HazardGroup();
+        hazardGroup.setHazard(CONDITIONCHECK_HAZARD);
+        hazardGroup.setHazardDate(CURRENT_DATE_UTC);
+        hazardGroup.setHazardNote(CONDITIONCHECK_HAZARD_NOTE);
+        hazardGroups.add(hazardGroup);
+        conditioncheckCommon.setHazardGroupList(hazardGroupList);
+
+        PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
+        PayloadOutputPart commonPart =
+                multipart.addPart(new ConditioncheckClient().getCommonPartName(), conditioncheckCommon);
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("to be created, conditioncheck common");
+            logger.debug(objectAsXmlString(conditioncheckCommon, ConditionchecksCommon.class));
+        }
+
+        return multipart;
+    }
+
+    @Override
+    public void CRUDTests(String testName) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    protected PoxPayloadOut createInstance(String commonPartName,
+            String identifier) {
+        PoxPayloadOut result = createConditioncheckInstance(identifier);
+        return result;
+    }
+
+    @Override
+    protected ConditionchecksCommon updateInstance(ConditionchecksCommon commonPartObject) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    protected void compareUpdatedInstances(ConditionchecksCommon original,
+            ConditionchecksCommon updated) throws Exception {
+        // TODO Auto-generated method stub
+        
+    }
+}
diff --git a/services/conditioncheck/client/src/test/resources/log4j.properties b/services/conditioncheck/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/conditioncheck/jaxb/pom.xml b/services/conditioncheck/jaxb/pom.xml
new file mode 100644 (file)
index 0000000..813c90d
--- /dev/null
@@ -0,0 +1,34 @@
+<?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>
+        <artifactId>org.collectionspace.services.conditioncheck</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.1-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.conditioncheck.jaxb</artifactId>
+    <name>services.conditioncheck.jaxb</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-conditioncheck-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/conditioncheck/jaxb/src/main/java/org/collectionspace/services/ConditioncheckJAXBSchema.java b/services/conditioncheck/jaxb/src/main/java/org/collectionspace/services/ConditioncheckJAXBSchema.java
new file mode 100644 (file)
index 0000000..6454741
--- /dev/null
@@ -0,0 +1,8 @@
+/**
+ * 
+ */
+package org.collectionspace.services;
+
+public interface ConditioncheckJAXBSchema {
+    final static String CONDITIONCHECK_REF_NUMBER = "conditionCheckRefNumber";
+}
diff --git a/services/conditioncheck/jaxb/src/main/java/org/collectionspace/services/ConditioncheckListItemJAXBSchema.java b/services/conditioncheck/jaxb/src/main/java/org/collectionspace/services/ConditioncheckListItemJAXBSchema.java
new file mode 100644 (file)
index 0000000..75e36af
--- /dev/null
@@ -0,0 +1,7 @@
+package org.collectionspace.services;
+
+public interface ConditioncheckListItemJAXBSchema {
+    final static String CONDITIONCHECK_REF_NUMBER = "conditionCheckRefNumber";
+    final static String CSID = "csid";
+    final static String URI = "url";
+}
diff --git a/services/conditioncheck/jaxb/src/main/resources/conditionchecks-common.xsd b/services/conditioncheck/jaxb/src/main/resources/conditionchecks-common.xsd
new file mode 100644 (file)
index 0000000..41a18e4
--- /dev/null
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Condition check schema (XSD)
+    
+    Entity  : Conditioncheck
+    Part    : Common
+    Used for: Nuxeo EP core document type
+-->
+
+<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/conditioncheck"
+  xmlns="http://collectionspace.org/services/conditioncheck"
+  targetNamespace="http://collectionspace.org/services/conditioncheck"
+  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/Object+Condition+Checking+and+Technical+Assessment+Schema -->
+
+    <!--  Conditioncheck Information Group -->
+    <xs:element name="conditionchecks_common">
+        <xs:complexType>
+            <xs:sequence> 
+                <!--  Object Condition and Technical Assessment Information Group -->
+                <xs:element name="objectAuditCategory" type="xs:string"/>
+                <xs:element name="completenessGroupList" type="completenessGroupList"/>
+                <xs:element name="conditionCheckGroupList" type="conditionCheckGroupList"/>
+                <xs:element name="conservationTreatmentPriority" type="xs:string"/>
+                <xs:element name="envConditionNoteGroupList" type="envConditionNoteGroupList"/>
+                <xs:element name="nextConditionCheckDate" type="xs:string"/>
+                <xs:element name="techAssessmentGroupList" type="techAssessmentGroupList"/>
+                <xs:element name="hazardGroupList" type="hazardGroupList"/>
+
+                <!--  Condition Check and Technical Assessment Information Group -->
+                <xs:element name="conditionCheckAssessmentDatesList" type="conditionCheckAssessmentDatesList"/>
+                <xs:element name="conditionCheckMethod" type="xs:string"/>
+                <xs:element name="conditionCheckNote" type="xs:string"/>
+                <xs:element name="conditionCheckReason" type="xs:string"/>
+                <xs:element name="conditionCheckRefNumber" type="xs:string"/>
+                <xs:element name="conditionChecker" type="xs:string"/>
+
+                <!--  Object Requirement Information Group -->
+                <xs:element name="displayRecommendations" type="xs:string"/>
+                <xs:element name="envRecommendations" type="xs:string"/>
+                <xs:element name="handlingRecommendations" type="xs:string"/>
+                <xs:element name="packingRecommendations" type="xs:string"/>
+                <xs:element name="securityRecommendations" type="xs:string"/>
+                <xs:element name="specialRequirements" type="xs:string"/>
+                <xs:element name="storageRequirements" type="xs:string"/>
+                <xs:element name="salvagePriorityCodeGroupList" type="salvagePriorityCodeGroupList"/>
+                <xs:element name="salvagePriorityCode" type="xs:string"/>
+                <xs:element name="salvagePriorityCodeDate" type="xs:string"/>
+                <xs:element name="legalRequirements" type="xs:string"/>
+                <xs:element name="legalReqsHeldGroupList" type="legalReqsHeldGroupList"/>
+
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+
+    <!-- Repeating Groups -->
+
+    <!-- =================================================================
+        Condition Check Assessment Dates List repeating field
+        ================================================================= -->
+    <xs:complexType name="conditionCheckAssessmentDatesList">
+        <xs:sequence>
+            <xs:element name="conditionCheckAssessmentDate" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- =================================================================
+        Completeness Group repeating structure
+        ================================================================= -->
+    <xs:complexType name="completenessGroupList">
+        <xs:sequence>
+            <xs:element name="completenessGroup" type="completenessGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="completenessGroup">
+        <xs:sequence>
+            <xs:element name="completeness" type="xs:string"/>
+            <xs:element name="completenessDate" type="xs:string"/>
+            <xs:element name="completenessNote" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- =================================================================
+         Condition Check Group repeating structure
+         ================================================================= -->
+    <xs:complexType name="conditionCheckGroupList">
+        <xs:sequence>
+            <xs:element name="conditionCheckGroup" type="conditionCheckGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="conditionCheckGroup">
+        <xs:sequence>
+            <xs:element name="condition" type="xs:string"/>
+            <xs:element name="conditionDate" type="xs:string"/>
+            <xs:element name="conditionNote" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- =================================================================
+         Environmental Condition Group repeating structure
+         ================================================================= -->
+    <xs:complexType name="envConditionNoteGroupList">
+        <xs:sequence>
+            <xs:element name="envConditionNoteGroup" type="envConditionNoteGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="envConditionNoteGroup">
+        <xs:sequence>
+            <xs:element name="envConditionNote" type="xs:string"/>
+            <xs:element name="envConditionNoteDate" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- =================================================================
+         Technical Assessment Group repeating structure
+         ================================================================= -->
+    <xs:complexType name="techAssessmentGroupList">
+        <xs:sequence>
+            <xs:element name="techAssessmentGroup" type="techAssessmentGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="techAssessmentGroup">
+        <xs:sequence>
+            <xs:element name="techAssessment" type="xs:string"/>
+            <xs:element name="techAssessmentDate" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- =================================================================
+         Hazard Group repeating structure
+         ================================================================= -->
+    <xs:complexType name="hazardGroupList">
+        <xs:sequence>
+            <xs:element name="hazardGroup" type="hazardGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="hazardGroup">
+        <xs:sequence>
+            <xs:element name="hazard" type="xs:string"/>
+            <xs:element name="hazardDate" type="xs:string"/>
+            <xs:element name="hazardNote" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- =================================================================
+         Salvage Priority Group repeating structure
+         ================================================================= -->
+    <xs:complexType name="salvagePriorityCodeGroupList">
+        <xs:sequence>
+            <xs:element name="salvagePriorityCodeGroup" type="salvagePriorityCodeGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="salvagePriorityCodeGroup">
+        <xs:sequence>
+            <xs:element name="salvagePriorityCode" type="xs:string"/>
+            <xs:element name="salvagePriorityCodeDate" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <!-- =================================================================
+         Legal/License Requirements Held Group repeating structure
+         ================================================================= -->
+    <xs:complexType name="legalReqsHeldGroupList">
+        <xs:sequence>
+            <xs:element name="legalReqsHeldGroup" type="legalReqsHeldGroup" minOccurs="0"
+                        maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="legalReqsHeldGroup">
+        <xs:sequence>
+            <xs:element name="legalReqsHeld" type="xs:string"/>
+            <xs:element name="legalReqsHeldBeginDate" type="xs:string"/>
+            <xs:element name="legalReqsHeldEndDate" type="xs:string"/>
+            <xs:element name="legalReqsHeldNumber" type="xs:string"/>
+            <xs:element name="legalReqsHeldRenewDate" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+    
+</xs:schema>
diff --git a/services/conditioncheck/pom.xml b/services/conditioncheck/pom.xml
new file mode 100644 (file)
index 0000000..dbec581
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- A comment. -->
+<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>4.1-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.conditioncheck</artifactId>
+    <name>services.conditioncheck</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+
+</project>
diff --git a/services/conditioncheck/service/pom.xml b/services/conditioncheck/service/pom.xml
new file mode 100644 (file)
index 0000000..a4f0486
--- /dev/null
@@ -0,0 +1,105 @@
+<?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.conditioncheck</artifactId>        
+        <version>4.1-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.conditioncheck.service</artifactId>
+    <name>services.conditioncheck.service</name>
+    <packaging>jar</packaging>       
+
+    <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.conditioncheck.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.conditioncheck.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.collectionobject.jaxb</artifactId>
+            <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>
+        </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>
+            <version>${nuxeo.core.version}</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-conditioncheck</finalName>
+    </build>
+</project>
diff --git a/services/conditioncheck/service/profiles.xml b/services/conditioncheck/service/profiles.xml
new file mode 100644 (file)
index 0000000..7c9dc96
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<profilesXml xmlns="http://maven.apache.org/PROFILES/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/PROFILES/1.0.0 http://maven.apache.org/xsd/profiles-1.0.0.xsd">
+</profilesXml>
diff --git a/services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/ConditioncheckResource.java b/services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/ConditioncheckResource.java
new file mode 100644 (file)
index 0000000..921c4d2
--- /dev/null
@@ -0,0 +1,57 @@
+/**
+ *  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.conditioncheck;
+
+import org.collectionspace.services.client.ConditioncheckClient;
+import org.collectionspace.services.common.ResourceBase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+@Path(ConditioncheckClient.SERVICE_PATH)
+@Consumes("application/xml")
+@Produces("application/xml")
+public class ConditioncheckResource extends ResourceBase {
+
+    final Logger logger = LoggerFactory.getLogger(ConditioncheckResource.class);
+
+    @Override
+    protected String getVersionString() {
+        final String lastChangeRevision = "$LastChangedRevision$";
+        return lastChangeRevision;
+    }
+    
+    @Override
+    public String getServiceName() {
+        return ConditioncheckClient.SERVICE_NAME;
+    }
+
+    @Override
+    public Class<ConditionchecksCommon> getCommonPartClass() {
+        return ConditionchecksCommon.class;
+    }
+}
diff --git a/services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckConstants.java b/services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckConstants.java
new file mode 100644 (file)
index 0000000..5ec8cfd
--- /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.conditioncheck.nuxeo;
+
+/**
+ * ConditioncheckConstants specifies constants for the Condition Checks service
+ *
+ */
+public class ConditioncheckConstants {
+
+    public final static String NUXEO_DOCTYPE = "Conditioncheck";
+    public final static String NUXEO_SCHEMA_NAME = "conditioncheck";
+    public final static String NUXEO_DC_TITLE = "CollectionSpace-Conditioncheck";
+}
diff --git a/services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckDocumentModelHandler.java b/services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckDocumentModelHandler.java
new file mode 100644 (file)
index 0000000..240320d
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ *  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.conditioncheck.nuxeo;
+
+import org.collectionspace.services.conditioncheck.ConditionchecksCommon;
+import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
+
+/** ConditioncheckDocumentModelHandler
+ */
+public class ConditioncheckDocumentModelHandler
+        extends DocHandlerBase<ConditionchecksCommon> {
+}
diff --git a/services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckValidatorHandler.java b/services/conditioncheck/service/src/main/java/org/collectionspace/services/conditioncheck/nuxeo/ConditioncheckValidatorHandler.java
new file mode 100644 (file)
index 0000000..e168f98
--- /dev/null
@@ -0,0 +1,16 @@
+package org.collectionspace.services.conditioncheck.nuxeo;
+
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandler;
+import org.collectionspace.services.common.document.DocumentHandler.Action;
+
+public class ConditioncheckValidatorHandler implements ValidatorHandler {
+
+    @Override
+    public void validate(Action action, ServiceContext ctx)
+                throws InvalidDocumentException {
+        // TODO Auto-generated method stub
+        System.out.println("ConditioncheckValidatorHandler executed.");
+    }
+}
diff --git a/services/conditioncheck/service/src/test/java/org/collectionspace/services/test/ConditioncheckServiceTest.java b/services/conditioncheck/service/src/test/java/org/collectionspace/services/test/ConditioncheckServiceTest.java
new file mode 100644 (file)
index 0000000..461c834
--- /dev/null
@@ -0,0 +1,11 @@
+package org.collectionspace.services.test;
+
+//import org.collectionspace.services.conditioncheck.Conditioncheck;
+//import org.collectionspace.services.conditioncheck.ConditioncheckList;
+
+/**
+ * Placeholder for server-side testing of Condition Check service code.
+ */
+public class ConditioncheckServiceTest {
+    //empty
+}
diff --git a/services/conditioncheck/service/src/test/resources/log4j.xml b/services/conditioncheck/service/src/test/resources/log4j.xml
new file mode 100644 (file)
index 0000000..3869b52
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+       <appender name="console" class="org.apache.log4j.ConsoleAppender">
+               <param name="Target" value="System.out" />
+               <layout class="org.apache.log4j.TTCCLayout">
+                       <param name="DateFormat" value="ISO8601" />
+               </layout>
+       </appender>
+
+
+       <appender name="unit-tests"
+               class="org.apache.log4j.RollingFileAppender">
+               <param name="File" value="./target/unit-tests.log" />
+               <param name="MaxFileSize" value="10240KB" />
+               <param name="MaxBackupIndex" value="6" />
+               <layout class="org.apache.log4j.TTCCLayout">
+                       <param name="DateFormat" value="ISO8601" />
+               </layout>
+       </appender>
+
+       <logger name="org.apache.commons.httpclient" additivity="false">
+               <level value="warn" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </logger>
+
+       <logger name="httpclient.wire" additivity="false">
+               <level value="info" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </logger>
+
+       <root>
+               <priority value="debug" />
+               <appender-ref ref="console" />
+               <appender-ref ref="unit-tests" />
+       </root>
+
+</log4j:configuration>
index f124559db2385c5808edbb1cb66a1e307d887180..d03ff4bffbd229a9fbe791b2677e9bcd29c8506c 100644 (file)
@@ -61,6 +61,7 @@
         <module>intake</module>
         <module>loanin</module>
         <module>loanout</module>
+        <module>conditioncheck</module>
         <module>objectexit</module>
         <module>batch</module>
         <module>imports</module>