]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-6609: Add exhibition procedure.
authorRay Lee <rhlee@berkeley.edu>
Tue, 5 May 2015 06:08:01 +0000 (23:08 -0700)
committerRay Lee <rhlee@berkeley.edu>
Tue, 5 May 2015 06:08:01 +0000 (23:08 -0700)
29 files changed:
services/JaxRsServiceProvider/pom.xml
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java
services/build.xml
services/exhibition/3rdparty/build.xml [new file with mode: 0644]
services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/build.xml [new file with mode: 0644]
services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/pom.xml [new file with mode: 0644]
services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/src/main/resources/OSGI-INF/README.txt [new file with mode: 0644]
services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/src/main/resources/schemas/README.txt [new file with mode: 0644]
services/exhibition/3rdparty/pom.xml [new file with mode: 0644]
services/exhibition/build.xml [new file with mode: 0644]
services/exhibition/client/pom.xml [new file with mode: 0644]
services/exhibition/client/src/main/java/org/collectionspace/services/client/ExhibitionClient.java [new file with mode: 0644]
services/exhibition/client/src/main/java/org/collectionspace/services/client/ExhibitionProxy.java [new file with mode: 0644]
services/exhibition/client/src/test/java/org/collectionspace/services/client/test/ExhibitionServiceTest.java [new file with mode: 0644]
services/exhibition/client/src/test/resources/log4j.properties [new file with mode: 0644]
services/exhibition/jaxb/pom.xml [new file with mode: 0644]
services/exhibition/jaxb/src/main/java/org/collectionspace/services/ExhibitionJAXBSchema.java [new file with mode: 0644]
services/exhibition/jaxb/src/main/java/org/collectionspace/services/ExhibitionListItemJAXBSchema.java [new file with mode: 0644]
services/exhibition/jaxb/src/main/resources/exhibitions-common.xsd [new file with mode: 0644]
services/exhibition/pom.xml [new file with mode: 0644]
services/exhibition/service/pom.xml [new file with mode: 0644]
services/exhibition/service/profiles.xml [new file with mode: 0644]
services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/ExhibitionResource.java [new file with mode: 0644]
services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionConstants.java [new file with mode: 0644]
services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionDocumentModelHandler.java [new file with mode: 0644]
services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionValidatorHandler.java [new file with mode: 0644]
services/exhibition/service/src/test/java/org/collectionspace/services/test/ExhibitionServiceTest.java [new file with mode: 0644]
services/exhibition/service/src/test/resources/log4j.xml [new file with mode: 0644]
services/pom.xml

index c37cbff79ba25871b1275ed529fb2ac445d99823..4dee57776308de46ecd32a8ba62f74faf7174feb 100644 (file)
             <artifactId>org.collectionspace.services.loanout.service</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.exhibition.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.conditioncheck.service</artifactId>
index 654b30764c0b2896098ae183f8ec012d874a9c8d..06c5f87c284de17b4b1aef4d3b3c987aa228d135 100644 (file)
@@ -51,6 +51,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.exhibition.ExhibitionResource;
 import org.collectionspace.services.conditioncheck.ConditioncheckResource;
 
 import javax.servlet.ServletContext;
@@ -117,6 +118,7 @@ public class CollectionSpaceJaxRsApplication extends Application
         addResourceToMapAndSingletons(new RelationResource());
         addResourceToMapAndSingletons(new LoaninResource());
         addResourceToMapAndSingletons(new LoanoutResource());
+        addResourceToMapAndSingletons(new ExhibitionResource());
         addResourceToMapAndSingletons(new ConditioncheckResource());
         addResourceToMapAndSingletons(new ValuationcontrolResource());
         addResourceToMapAndSingletons(new ObjectExitResource());
index 5078e9d492158be2a502e77acacd3ce7dcc34725..a4bbaf5868bc674a4468fcca8eafb0d2d93baef1 100644 (file)
         <ant antfile="imports/build.xml" target="deploy" inheritAll="false"/>
         <ant antfile="loanin/build.xml" target="deploy" inheritAll="false"/>
         <ant antfile="loanout/build.xml" target="deploy" inheritAll="false"/>
+        <ant antfile="exhibition/build.xml" target="deploy" inheritAll="false"/>
         <ant antfile="conditioncheck/build.xml" target="deploy" inheritAll="false"/>
         <ant antfile="valuationcontrol/build.xml" target="deploy" inheritAll="false"/>
         <ant antfile="objectexit/build.xml" target="deploy" inheritAll="false"/>
         <ant antfile="location/build.xml" target="undeploy" inheritAll="false"/>
         <ant antfile="objectexit/build.xml" target="undeploy" inheritAll="false"/>
         <ant antfile="valuationcontrol/build.xml" target="undeploy" inheritAll="false"/>
+        <ant antfile="exhibition/build.xml" target="undeploy" inheritAll="false"/>
         <ant antfile="conditioncheck/build.xml" target="undeploy" inheritAll="false"/>
         <ant antfile="batch/build.xml" target="undeploy" inheritAll="false"/>
         <ant antfile="report/build.xml" target="undeploy" inheritAll="false"/>
         <ant antfile="work/build.xml" target="dist" inheritAll="false"/>
         <ant antfile="concept/build.xml" target="dist" inheritAll="false"/>
         <ant antfile="taxonomy/build.xml" target="dist" inheritAll="false"/>
+        <ant antfile="exhibition/build.xml" target="dist" inheritAll="false"/>
         <ant antfile="conditioncheck/build.xml" target="dist" inheritAll="false"/>
         <ant antfile="valuationcontrol/build.xml" target="dist" inheritAll="false"/>
         <ant antfile="objectexit/build.xml" target="dist" inheritAll="false"/>
diff --git a/services/exhibition/3rdparty/build.xml b/services/exhibition/3rdparty/build.xml
new file mode 100644 (file)
index 0000000..049f3e0
--- /dev/null
@@ -0,0 +1,130 @@
+<project name="exhibition.3rdparty" default="package" basedir=".">
+    <description>
+        exhibition 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 exhibition 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-exhibition/build.xml" target="deploy" inheritall="false"/>
+        -->
+    </target>
+
+    <target name="undeploy"
+    description="undeploy exhibition 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-exhibition/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for exhibition" depends="package">
+        <ant antfile="nuxeo-platform-cs-exhibition/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+
+</project>
diff --git a/services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/build.xml b/services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/build.xml
new file mode 100644 (file)
index 0000000..5c0ae04
--- /dev/null
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="nuxeo-platform-cs-exhibition" default="package" basedir=".">
+    <description>
+        exhibition 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.exhibition.doctype.jars.all"
+        value="collectionspace.exhibition.doctype.*.jar"/>
+    <property name="nuxeo.exhibition.schema.jars.all"
+        value="collectionspace.exhibition.schema.*.jar"/>
+    <!-- Legacy JAR files used by CollectionSpace 3.3 and earlier --> 
+    <property name="nuxeo.exhibition.legacy.jars.all"
+        value="org.collectionspace.services.exhibition.3rdparty.nuxeo-*.jar"/>
+    <property name="nuxeo.exhibition.legacy.jar"
+        value="org.collectionspace.services.exhibition.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 exhibition 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.exhibition.legacy.jar}"
+            todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy exhibition doctype from ${jee.server.nuxeo}">
+        <delete>
+            <!-- Undeploy doctype and schema artifacts -->
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.exhibition.doctype.jars.all}"/>
+            </fileset>
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.exhibition.schema.jars.all}"/>
+            </fileset>
+            <!-- Undeploy legacy artifacts -->
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.exhibition.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.exhibition.legacy.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+
+    <target name="dist"
+        description="generate distribution for exhibition doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.exhibition.legacy.jar}"/>
+        </copy>
+    </target>
+
+</project>
+
diff --git a/services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/pom.xml b/services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/pom.xml
new file mode 100644 (file)
index 0000000..ba14426
--- /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.exhibition.3rdparty</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.exhibition.3rdparty.nuxeo</artifactId>
+    <name>services.exhibition.3rdparty.nuxeo</name>
+    <packaging>jar</packaging>
+    <description>
+        Exhibition Nuxeo Document Type
+    </description>
+
+    <properties>
+        <ServiceName>exhibition</ServiceName>
+        <NuxeoDocTypeName>Exhibition</NuxeoDocTypeName>
+        <CommonSchemaName>exhibitions_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/exhibition/3rdparty/nuxeo-platform-cs-exhibition/src/main/resources/OSGI-INF/README.txt b/services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/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/exhibition/3rdparty/nuxeo-platform-cs-exhibition/src/main/resources/schemas/README.txt b/services/exhibition/3rdparty/nuxeo-platform-cs-exhibition/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/exhibition/3rdparty/pom.xml b/services/exhibition/3rdparty/pom.xml
new file mode 100644 (file)
index 0000000..7dfa3af
--- /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.exhibition</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.exhibition.3rdparty</artifactId>
+    <name>services.exhibition.3rdparty</name>
+    <packaging>pom</packaging>
+    
+    <description>
+        3rd party build for exhibition service
+    </description>
+
+    <modules>
+    <!-- This module is obsolete.  The Nuxeo artifacts are now created and deployed using the "csmake" tool
+        <module>nuxeo-platform-cs-exhibition</module>
+        -->
+    </modules>
+</project>
diff --git a/services/exhibition/build.xml b/services/exhibition/build.xml
new file mode 100644 (file)
index 0000000..aae1ba6
--- /dev/null
@@ -0,0 +1,124 @@
+
+<project name="exhibition" default="package" basedir=".">
+    <description>
+        exhibition 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 exhibition service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy exhibition service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+    description="distribute exhibition service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+</project>
diff --git a/services/exhibition/client/pom.xml b/services/exhibition/client/pom.xml
new file mode 100644 (file)
index 0000000..ff5903a
--- /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.exhibition</artifactId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.exhibition.client</artifactId>
+    <name>services.exhibition.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.exhibition.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-exhibition-client</finalName>
+    </build>
+</project>
diff --git a/services/exhibition/client/src/main/java/org/collectionspace/services/client/ExhibitionClient.java b/services/exhibition/client/src/main/java/org/collectionspace/services/client/ExhibitionClient.java
new file mode 100644 (file)
index 0000000..dec1bd0
--- /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;
+
+/**
+ * ExhibitionClient.java
+ */
+public class ExhibitionClient extends AbstractCommonListPoxServiceClientImpl<ExhibitionProxy> {
+
+    public static final String SERVICE_NAME = "exhibitions";
+    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<ExhibitionProxy> getProxyClass() {
+        return ExhibitionProxy.class;
+    }
+
+}
diff --git a/services/exhibition/client/src/main/java/org/collectionspace/services/client/ExhibitionProxy.java b/services/exhibition/client/src/main/java/org/collectionspace/services/client/ExhibitionProxy.java
new file mode 100644 (file)
index 0000000..bed42e2
--- /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;
+
+/**
+ * ExhibitionProxy.java
+ */
+@Path(ExhibitionClient.SERVICE_PATH_PROXY)
+@Produces({"application/xml"})
+@Consumes({"application/xml"})
+public interface ExhibitionProxy extends CollectionSpaceCommonListPoxProxy {
+}
diff --git a/services/exhibition/client/src/test/java/org/collectionspace/services/client/test/ExhibitionServiceTest.java b/services/exhibition/client/src/test/java/org/collectionspace/services/client/test/ExhibitionServiceTest.java
new file mode 100644 (file)
index 0000000..5a824ed
--- /dev/null
@@ -0,0 +1,689 @@
+/**
+ * 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.ExhibitionClient;
+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.jaxb.AbstractCommonList;
+import org.collectionspace.services.exhibition.ExhibitionsCommon;
+
+import org.jboss.resteasy.client.ClientResponse;
+import org.testng.Assert;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * ExhibitionServiceTest, carries out tests against a
+ * deployed and running Exhibition Service.
+ */
+public class ExhibitionServiceTest extends AbstractPoxServiceTestImpl<AbstractCommonList, ExhibitionsCommon> {
+
+    /** The logger. */
+    private final String CLASS_NAME = ExhibitionServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    // Instance variables specific to this test.
+    /** The service path component. */
+    final String SERVICE_NAME = "exhibitions";
+    final String SERVICE_PATH_COMPONENT = "exhibitions";
+
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+        return new ExhibitionClient();
+    }
+
+    /* (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.
+        ExhibitionClient client = new ExhibitionClient();
+        String identifier = createIdentifier();
+        PoxPayloadOut multipart = createExhibitionInstance(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.
+        ExhibitionClient client = new ExhibitionClient();
+        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());
+        ExhibitionsCommon exhibitionCommon = null;
+        if (payloadInputPart != null) {
+            exhibitionCommon = (ExhibitionsCommon) payloadInputPart.getBody();
+        }
+        Assert.assertNotNull(exhibitionCommon);
+
+        // Check selected fields.
+
+        // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
+        String generalNote = exhibitionCommon.getGeneralNote();
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("UTF-8 data sent=" + getUTF8DataFragment() + "\n"
+                    + "UTF-8 data received=" + generalNote);
+        }
+
+        Assert.assertEquals(generalNote, getUTF8DataFragment(),
+                "UTF-8 data retrieved '" + generalNote
+                + "' 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.
+        ExhibitionClient client = new ExhibitionClient();
+        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;
+        ExhibitionClient client = new ExhibitionClient();
+        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.
+        ExhibitionClient client = new ExhibitionClient();
+        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());
+        ExhibitionsCommon exhibitionCommon = null;
+        if (payloadInputPart != null) {
+            exhibitionCommon = (ExhibitionsCommon) payloadInputPart.getBody();
+        }
+        Assert.assertNotNull(exhibitionCommon);
+
+        // Update the content of this resource.
+        exhibitionCommon.setExhibitionNumber("updated-" + exhibitionCommon.getExhibitionNumber());
+
+        String generalNote = exhibitionCommon.getGeneralNote();
+        exhibitionCommon.setGeneralNote("updated-generalNote-" + generalNote);
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("to be updated object");
+            logger.debug(objectAsXmlString(exhibitionCommon, ExhibitionsCommon.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(), exhibitionCommon);
+        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());
+        ExhibitionsCommon updatedExhibitionCommon = null;
+        if (payloadInputPart != null) {
+            updatedExhibitionCommon = (ExhibitionsCommon) payloadInputPart.getBody();
+        }
+        Assert.assertNotNull(updatedExhibitionCommon);
+
+        // Check selected fields in the updated common part.
+        Assert.assertEquals(updatedExhibitionCommon.getExhibitionNumber(),
+                exhibitionCommon.getExhibitionNumber(),
+                "Data in updated object did not match submitted data.");
+
+        // Check the values of fields containing Unicode UTF-8 (non-Latin-1) characters.
+        String originalGeneralNote = exhibitionCommon.getGeneralNote();
+        String updatedGeneralNote = updatedExhibitionCommon.getGeneralNote();
+        
+        Assert.assertEquals(updatedGeneralNote, originalGeneralNote,
+                "Data in updated object did not match submitted data.");
+
+        if(logger.isDebugEnabled()){
+            logger.debug("UTF-8 data sent=" + originalGeneralNote + "\n"
+                    + "UTF-8 data received=" + updatedGeneralNote);
+        }
+        Assert.assertTrue(updatedGeneralNote.contains(getUTF8DataFragment()),
+                "UTF-8 data retrieved '" + updatedGeneralNote
+                + "' 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.
+        ExhibitionClient client = new ExhibitionClient();
+        PoxPayloadOut multipart = createExhibitionInstance(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.
+        ExhibitionClient client = new ExhibitionClient();
+        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.
+        ExhibitionClient client = new ExhibitionClient();
+        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 createExhibitionInstance(identifier);
+    }
+
+    /**
+     * Creates the exhibition instance.
+     *
+     * @param identifier the identifier
+     * @return the multipart output
+     */
+    //private PoxPayloadOut createExhibitionInstance(String identifier) {
+    //    return createExhibitionInstance("exhibitionNumber-" + identifier);
+    //}
+
+    /**
+     * Creates the exhibition instance.
+     *
+     * @param exhibitionNumber the exhibition number
+     * @return the multipart output
+     */
+    private PoxPayloadOut createExhibitionInstance(String exhibitionNumber) {
+
+        ExhibitionsCommon exhibitionCommon = new ExhibitionsCommon();
+        exhibitionCommon.setExhibitionNumber(exhibitionNumber);
+        exhibitionCommon.setGeneralNote(getUTF8DataFragment());
+
+        PoxPayloadOut multipart = new PoxPayloadOut(this.getServicePathComponent());
+        PayloadOutputPart commonPart =
+                multipart.addPart(new ExhibitionClient().getCommonPartName(), exhibitionCommon);
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("to be created, exhibition common");
+            logger.debug(objectAsXmlString(exhibitionCommon, ExhibitionsCommon.class));
+        }
+
+        return multipart;
+    }
+
+    @Override
+    public void CRUDTests(String testName) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    protected PoxPayloadOut createInstance(String commonPartName,
+            String identifier) {
+        PoxPayloadOut result = createExhibitionInstance(identifier);
+        return result;
+    }
+
+    @Override
+    protected ExhibitionsCommon updateInstance(ExhibitionsCommon commonPartObject) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    protected void compareUpdatedInstances(ExhibitionsCommon original,
+            ExhibitionsCommon updated) throws Exception {
+        // TODO Auto-generated method stub
+        
+    }
+}
diff --git a/services/exhibition/client/src/test/resources/log4j.properties b/services/exhibition/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/exhibition/jaxb/pom.xml b/services/exhibition/jaxb/pom.xml
new file mode 100644 (file)
index 0000000..24ac715
--- /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.exhibition</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.exhibition.jaxb</artifactId>
+    <name>services.exhibition.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-exhibition-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/exhibition/jaxb/src/main/java/org/collectionspace/services/ExhibitionJAXBSchema.java b/services/exhibition/jaxb/src/main/java/org/collectionspace/services/ExhibitionJAXBSchema.java
new file mode 100644 (file)
index 0000000..780860b
--- /dev/null
@@ -0,0 +1,8 @@
+/**
+ * 
+ */
+package org.collectionspace.services;
+
+public interface ExhibitionJAXBSchema {
+    final static String EXHIBITION_NUMBER = "exhibitionNumber";
+}
diff --git a/services/exhibition/jaxb/src/main/java/org/collectionspace/services/ExhibitionListItemJAXBSchema.java b/services/exhibition/jaxb/src/main/java/org/collectionspace/services/ExhibitionListItemJAXBSchema.java
new file mode 100644 (file)
index 0000000..297486a
--- /dev/null
@@ -0,0 +1,14 @@
+package org.collectionspace.services;
+
+public interface ExhibitionListItemJAXBSchema {
+    final static String EXHIBITION_REF_NUMBER = "exhibitionRefNumber";
+    final static String VALUE_CURRENCY = "valueCurrency";
+    final static String VALUE_AMOUNT = "valueAmount";
+    final static String VALUE_DATE = "valueDate";
+    final static String VALUE_RENEWAL_DATE = "valueRenewalDate";
+    final static String VALUE_SOURCE = "valueSource";
+    final static String VALUE_TYPE = "valueType";
+    final static String VALUE_NOTE = "valueNote";
+    final static String CSID = "csid";
+    final static String URI = "url";
+}
diff --git a/services/exhibition/jaxb/src/main/resources/exhibitions-common.xsd b/services/exhibition/jaxb/src/main/resources/exhibitions-common.xsd
new file mode 100644 (file)
index 0000000..f1a7bed
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Exhibition schema (XSD)
+    
+    Entity  : Exhibition
+    Part    : Common
+    Used for: JAXB binding between XML and Java objects
+-->
+
+<xs:schema 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+  jaxb:version="1.0" elementFormDefault="unqualified"
+  xmlns:ns="http://collectionspace.org/services/exhibition"
+  xmlns="http://collectionspace.org/services/exhibition"
+  targetNamespace="http://collectionspace.org/services/exhibition"
+  version="0.1"
+>
+
+<!--
+    Avoid XmlRootElement nightmare:
+    See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html
+--> 
+    
+    <!--  Exhibition Information Group -->
+    <xs:element name="exhibitions_common">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="exhibitionNumber" type="xs:string"/>
+                <xs:element name="generalNote" type="xs:string"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>
diff --git a/services/exhibition/pom.xml b/services/exhibition/pom.xml
new file mode 100644 (file)
index 0000000..07dd986
--- /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.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.exhibition</artifactId>
+    <name>services.exhibition</name>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+
+</project>
diff --git a/services/exhibition/service/pom.xml b/services/exhibition/service/pom.xml
new file mode 100644 (file)
index 0000000..56be4cd
--- /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.exhibition</artifactId>        
+        <version>4.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.exhibition.service</artifactId>
+    <name>services.exhibition.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.exhibition.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.exhibition.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>
+            <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-exhibition</finalName>
+    </build>
+</project>
+
diff --git a/services/exhibition/service/profiles.xml b/services/exhibition/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/exhibition/service/src/main/java/org/collectionspace/services/exhibition/ExhibitionResource.java b/services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/ExhibitionResource.java
new file mode 100644 (file)
index 0000000..59d8aa4
--- /dev/null
@@ -0,0 +1,58 @@
+/**
+ *  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.exhibition;
+
+import org.collectionspace.services.client.ExhibitionClient;
+import org.collectionspace.services.common.NuxeoBasedResource;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+@Path(ExhibitionClient.SERVICE_PATH)
+@Consumes("application/xml")
+@Produces("application/xml")
+public class ExhibitionResource extends NuxeoBasedResource {
+
+    final Logger logger = LoggerFactory.getLogger(ExhibitionResource.class);
+
+    @Override
+    protected String getVersionString() {
+            final String lastChangeRevision = "$LastChangedRevision$";
+            return lastChangeRevision;
+    }
+    
+    @Override
+    public String getServiceName() {
+        return ExhibitionClient.SERVICE_NAME;
+    }
+
+    @Override
+    public Class<ExhibitionsCommon> getCommonPartClass() {
+            return ExhibitionsCommon.class;
+    }
+}
+
diff --git a/services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionConstants.java b/services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionConstants.java
new file mode 100644 (file)
index 0000000..0b21c1b
--- /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.exhibition.nuxeo;
+
+/**
+ * ExhibitionConstants specifies constants for the Exhibition service
+ *
+ */
+public class ExhibitionConstants {
+
+    public final static String NUXEO_DOCTYPE = "Exhibition";
+    public final static String NUXEO_SCHEMA_NAME = "exhibition";
+    public final static String NUXEO_DC_TITLE = "CollectionSpace-Exhibition";
+}
diff --git a/services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionDocumentModelHandler.java b/services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionDocumentModelHandler.java
new file mode 100644 (file)
index 0000000..6dff613
--- /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.exhibition.nuxeo;
+
+import org.collectionspace.services.exhibition.ExhibitionsCommon;
+import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentModelHandler;
+
+/** ExhibitionDocumentModelHandler
+ */
+public class ExhibitionDocumentModelHandler
+        extends NuxeoDocumentModelHandler<ExhibitionsCommon> {
+}
diff --git a/services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionValidatorHandler.java b/services/exhibition/service/src/main/java/org/collectionspace/services/exhibition/nuxeo/ExhibitionValidatorHandler.java
new file mode 100644 (file)
index 0000000..422f8c1
--- /dev/null
@@ -0,0 +1,18 @@
+package org.collectionspace.services.exhibition.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 ExhibitionValidatorHandler implements ValidatorHandler {
+
+    @Override
+    public void validate(Action action, ServiceContext ctx)
+                throws InvalidDocumentException {
+        // TODO Auto-generated method stub
+        System.out.println("ExhibitionValidatorHandler executed.");
+
+    }
+
+}
diff --git a/services/exhibition/service/src/test/java/org/collectionspace/services/test/ExhibitionServiceTest.java b/services/exhibition/service/src/test/java/org/collectionspace/services/test/ExhibitionServiceTest.java
new file mode 100644 (file)
index 0000000..f3f946c
--- /dev/null
@@ -0,0 +1,11 @@
+package org.collectionspace.services.test;
+
+//import org.collectionspace.services.exhibition.Exhibition;
+//import org.collectionspace.services.exhibition.ExhibitionList;
+
+/**
+ * Placeholder for server-side testing of Exhibition service code.
+ */
+public class ExhibitionServiceTest {
+        //empty
+}
diff --git a/services/exhibition/service/src/test/resources/log4j.xml b/services/exhibition/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 6b3b581941606d210b5d0c3d82d2ac3b30400d14..867a8421c04774406273758fd753896073425cc5 100644 (file)
@@ -61,6 +61,7 @@
         <module>intake</module>
         <module>loanin</module>
         <module>loanout</module>
+        <module>exhibition</module>
         <module>conditioncheck</module>
         <module>valuationcontrol</module>
         <module>objectexit</module>