]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-2403 - Adding initial support for a basic concept authority
authorPatrick Schmitz <pschmitz@berkeley.edu>
Sat, 17 Mar 2012 00:31:52 +0000 (17:31 -0700)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Sat, 17 Mar 2012 00:31:52 +0000 (17:31 -0700)
41 files changed:
services/IntegrationTests/src/test/resources/test-data/xmlreplay/concept/conceptauthorities_materials.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/concept/concepts-wood.xml [new file with mode: 0644]
services/JaxRsServiceProvider/pom.xml
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml
services/concept/3rdparty/build.xml [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/build.xml [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/pom.xml [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/META-INF/MANIFEST.MF [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/core-types-contrib.xml [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/deployment-fragment.xml [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/ecm-types-contrib.xml [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/layouts-contrib.xml [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/life-cycle-contrib.xml [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/schemas/conceptauthorities_common.xsd [new file with mode: 0644]
services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/schemas/concepts_common.xsd [new file with mode: 0644]
services/concept/3rdparty/pom.xml [new file with mode: 0644]
services/concept/build.xml [new file with mode: 0644]
services/concept/client/pom.xml [new file with mode: 0644]
services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityClient.java [new file with mode: 0644]
services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityClientUtils.java [new file with mode: 0644]
services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityProxy.java [new file with mode: 0644]
services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java [new file with mode: 0644]
services/concept/client/src/test/resources/log4j.properties [new file with mode: 0644]
services/concept/installer/build.xml [new file with mode: 0644]
services/concept/jaxb/pom.xml [new file with mode: 0644]
services/concept/jaxb/src/main/java/org/collectionspace/services/ConceptJAXBSchema.java [new file with mode: 0644]
services/concept/jaxb/src/main/resources/concept_common.xsd [new file with mode: 0644]
services/concept/jaxb/src/main/resources/conceptauthority_common.xsd [new file with mode: 0644]
services/concept/pom.xml [new file with mode: 0644]
services/concept/service/pom.xml [new file with mode: 0644]
services/concept/service/src/main/java/org/collectionspace/services/concept/ConceptAuthorityResource.java [new file with mode: 0644]
services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptAuthorityConstants.java [new file with mode: 0644]
services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptAuthorityDocumentModelHandler.java [new file with mode: 0644]
services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptConstants.java [new file with mode: 0644]
services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptDocumentModelHandler.java [new file with mode: 0644]
services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptValidatorHandler.java [new file with mode: 0644]
services/location/client/src/test/java/org/collectionspace/services/client/test/LocationAuthorityServiceTest.java
services/pom.xml
services/relation/service/pom.xml
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java

diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/concept/conceptauthorities_materials.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/concept/conceptauthorities_materials.xml
new file mode 100644 (file)
index 0000000..f95f1f7
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="personauthorities">
+<ns2:conceptauthorities_common
+xmlns:ns2="http://collectionspace.org/services/concept"
+xmlns:ns3="http://collectionspace.org/services/jaxb">
+       <shortIdentifier>conceptMaterials</shortIdentifier>
+  <displayName>Materials</displayName>
+  <vocabType>ConceptAuthority</vocabType>
+</ns2:conceptauthorities_common>
+</document>
+
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/concept/concepts-wood.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/concept/concepts-wood.xml
new file mode 100644 (file)
index 0000000..ce834c2
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<document name="concepts">
+<ns2:concepts_common xmlns:ns2="http://collectionspace.org/services/concept" xmlns:ns3="http://collectionspace.org/services/jaxb">
+       <shortIdentifier>wood</shortIdentifier>
+       <displayName>Wood</displayName>
+       <displayNameComputed>false</displayNameComputed>
+</ns2:concepts_common>
+</document>
+       
index 9600cb3425f5238a941e153d511400330743020f..e857fcf364f1c2086ddfd06516b21adb284401c1 100644 (file)
             <artifactId>org.collectionspace.services.location.service</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.concept.service</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.taxonomy.service</artifactId>\r
index e09dd3c2e7fa4f6613541aa7c9d4f4a418ca0f77..9c9a929377c40d7608fa6914d244b4e4d8965dcb 100644 (file)
@@ -36,6 +36,7 @@ import org.collectionspace.services.objectexit.ObjectExitResource;
 import org.collectionspace.services.batch.BatchResource;
 import org.collectionspace.services.imports.ImportsResource;
 import org.collectionspace.services.location.LocationAuthorityResource;
+import org.collectionspace.services.concept.ConceptAuthorityResource;
 import org.collectionspace.services.taxonomy.TaxonomyAuthorityResource;
 import org.collectionspace.services.movement.MovementResource;
 import org.collectionspace.services.relation.RelationResource;
@@ -104,6 +105,7 @@ public class CollectionSpaceJaxRsApplication extends Application
         addResourceToMapAndSingletons(new PersonAuthorityResource());
         addResourceToMapAndSingletons(new OrgAuthorityResource());
         addResourceToMapAndSingletons(new LocationAuthorityResource());
+        addResourceToMapAndSingletons(new ConceptAuthorityResource());
         addResourceToMapAndSingletons(new TaxonomyAuthorityResource());
         addResourceToMapAndSingletons(new AcquisitionResource());
         addResourceToMapAndSingletons(new ContactResource());
index 869675c0fb9e7aeef04f811e68e28f4f02fc77aa..587c0a7f2b93caf41491a0d2d47b8cd4340d0003 100644 (file)
     </tenant:serviceBindings>
     <!-- end taxon service meta-data -->
     
+    <!-- begin conceptauthority service meta-data -->
+    <tenant:serviceBindings id="Conceptauthorities" name="Conceptauthorities" type="utility" version="0.1">
+      <service:uriPath xmlns:service="http://collectionspace.org/services/common/service">/conceptauthorities/*/workflow/</service:uriPath>
+      <service:uriPath xmlns:service="http://collectionspace.org/services/common/service">/conceptauthorities/*/items/*/workflow/</service:uriPath>
+            <!-- other URI paths through which this service could be accessed -->
+            <!--
+            <service:uriPath xmlns:service='http://collectionspace.org/services/common/service'>
+                /conceptauthorities/*/items/
+            </service:uriPath>
+            -->
+      <service:repositoryDomain xmlns:service="http://collectionspace.org/services/common/service">default-domain</service:repositoryDomain>
+      <service:documentHandler xmlns:service="http://collectionspace.org/services/common/service">org.collectionspace.services.concept.nuxeo.ConceptAuthorityDocumentModelHandler</service:documentHandler>
+      <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
+        <service:params>
+          <service:ListResultsFields>
+            <service:ListResultField>
+              <service:element>displayName</service:element>
+              <service:xpath>displayName</service:xpath>
+            </service:ListResultField>
+            <service:ListResultField>
+              <service:element>refName</service:element>
+              <service:xpath>refName</service:xpath>
+            </service:ListResultField>
+            <service:ListResultField>
+              <service:element>shortIdentifier</service:element>
+              <service:xpath>shortIdentifier</service:xpath>
+            </service:ListResultField>
+            <service:ListResultField>
+              <service:element>vocabType</service:element>
+              <service:xpath>vocabType</service:xpath>
+            </service:ListResultField>
+          </service:ListResultsFields>
+        </service:params>
+      </service:DocHandlerParams>
+      <service:initHandler xmlns:service="http://collectionspace.org/services/common/service">
+        <service:classname>org.collectionspace.services.common.init.AddIndices</service:classname>
+        <service:params>
+          <service:field>
+            <service:table>conceptauthorities_common</service:table>
+            <service:col>displayname</service:col>
+          </service:field>
+          <service:field>
+            <service:table>conceptauthorities_common</service:table>
+            <service:col>shortidentifier</service:col>
+          </service:field>
+        </service:params>
+      </service:initHandler>
+      <service:object xmlns:service="http://collectionspace.org/services/common/service" id="1" name="Conceptauthority" version="0.1">
+        <service:part id="0" control_group="Managed" versionable="true" auditable="false" label="conceptauthorities-system" updated="" order="0">
+          <service:content contentType="application/xml">
+            <service:xmlContent namespaceURI="http://collectionspace.org/services/common/system" schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd" />
+          </service:content>
+        </service:part>
+        <service:part id="1" control_group="Managed" versionable="true" auditable="false" label="conceptauthorities_common" updated="" order="1">
+          <service:content contentType="application/xml">
+            <service:xmlContent namespaceURI="http://collectionspace.org/services/concept" schemaLocation="http://collectionspace.org/services/concept http://services.collectionspace.org/concept/conceptauthorities_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 conceptauthority service meta-data -->
+        
+    <!-- begin concept service meta-data.
+             Note there is no Concept service, but there is a
+             Repository workspace so we have to configure that.
+        -->
+    <tenant:serviceBindings id="Concepts" name="Concepts" type="authority" version="0.1">
+      <service:repositoryDomain xmlns:service="http://collectionspace.org/services/common/service">default-domain</service:repositoryDomain>
+      <service:documentHandler xmlns:service="http://collectionspace.org/services/common/service">org.collectionspace.services.concept.nuxeo.ConceptDocumentModelHandler</service:documentHandler>
+      <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
+        <service:params>
+          <service:ListResultsFields>
+                                       <!-- Omit the standard AuthorityItem items (they are handled by the code) -->
+          </service:ListResultsFields>
+        </service:params>
+      </service:DocHandlerParams>
+      <service:validatorHandler xmlns:service="http://collectionspace.org/services/common/service">org.collectionspace.services.concept.nuxeo.ConceptValidatorHandler</service:validatorHandler>
+      <service:initHandler xmlns:service="http://collectionspace.org/services/common/service">
+        <service:classname>org.collectionspace.services.common.init.AddIndices</service:classname>
+        <service:params>
+          <service:field>
+            <service:table>concepts_common</service:table>
+            <service:col>inauthority</service:col>
+          </service:field>
+          <service:field>
+            <service:table>concepts_common</service:table>
+            <service:col>displayname</service:col>
+          </service:field>
+          <service:field>
+            <service:table>concepts_common</service:table>
+            <service:col>shortidentifier</service:col>
+          </service:field>
+        </service:params>
+      </service:initHandler>
+      <service:properties xmlns:service="http://collectionspace.org/services/common/service">
+               <types:item xmlns:types="http://collectionspace.org/services/common/types">
+                       <types:key>objectNameProperty</types:key>
+                       <types:value>displayName</types:value>
+               </types:item>
+               <types:item xmlns:types="http://collectionspace.org/services/common/types">
+                       <types:key>objectNumberProperty</types:key>
+                       <types:value>shortIdentifier</types:value>
+               </types:item>
+      </service:properties>
+      <service:object xmlns:service="http://collectionspace.org/services/common/service" id="1" name="Conceptitem" version="0.1">
+        <service:part id="0" control_group="Managed" versionable="true" auditable="false" label="concepts-system" updated="" order="0">
+          <service:content contentType="application/xml">
+            <service:xmlContent namespaceURI="http://collectionspace.org/services/common/system" schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd" />
+          </service:content>
+        </service:part>
+        <service:part id="1" control_group="Managed" versionable="true" auditable="false" label="concepts_common" updated="" order="1">
+          <service:properties xmlns:service="http://collectionspace.org/services/common/service">
+                        <!-- Fields containing term list / controlled vocabulary references -->
+            <types:item xmlns:types="http://collectionspace.org/services/common/types">
+              <types:key>termRef</types:key>
+                            <types:value>conceptType</types:value>
+            </types:item>
+            <types:item xmlns:types="http://collectionspace.org/services/common/types">
+              <types:key>termRef</types:key>
+                            <types:value>termStatus</types:value>
+            </types:item>
+                    </service:properties>
+          <service:content contentType="application/xml">
+            <service:xmlContent namespaceURI="http://collectionspace.org/services/concept" schemaLocation="http://collectionspace.org/services/concept http://services.collectionspace.org/concept/concepts_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 concept service meta-data -->
+
     <!-- begin acquisition service meta-data -->
     <tenant:serviceBindings id="Acquisitions" name="Acquisitions" type="procedure" version="0.1">
       <service:uriPath xmlns:service="http://collectionspace.org/services/common/service">/acquisitions/*/workflow/</service:uriPath>
diff --git a/services/concept/3rdparty/build.xml b/services/concept/3rdparty/build.xml
new file mode 100644 (file)
index 0000000..13dafa5
--- /dev/null
@@ -0,0 +1,131 @@
+
+<project name="concept.3rdparty" default="package" basedir=".">
+    <description>
+        concept service 3rdparty
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../.."/>
+    <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+    <!-- Create the time stamp -->
+        <tstamp/>
+    </target>
+
+    <target name="package" depends="package-unix,package-windows"
+  description="Package CollectionSpace Services" />
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+  description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    
+    <target name="clean" depends="clean-unix,clean-windows"
+  description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+    description="deploy concept in ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-concept/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+    description="undeploy concept from ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-concept/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist"
+    description="generate distribution for concept" depends="package">
+        <ant antfile="nuxeo-platform-cs-concept/build.xml" target="dist" inheritall="false"/>
+    </target>
+    
+    <target name="dist_installer"
+    description="generate distribution for collectionobject" depends="package">
+        <ant antfile="nuxeo-platform-cs-concept/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/build.xml b/services/concept/3rdparty/nuxeo-platform-cs-concept/build.xml
new file mode 100644 (file)
index 0000000..bf2c817
--- /dev/null
@@ -0,0 +1,145 @@
+
+<project name="nuxeo-platform-cs-concept" default="package" basedir=".">
+    <description>
+        concept nuxeo document type
+    </description>
+    <!-- set global properties for this build -->
+    <property name="services.trunk" value="../../../.."/>
+    <!-- environment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+    <property name="nuxeo.concept.jar"
+        value="org.collectionspace.services.concept.3rdparty.nuxeo-${cspace.release}.jar"/>
+    <property name="nuxeo.concept.jars.all"
+        value="org.collectionspace.services.concept.3rdparty.nuxeo-*.jar"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="init" >
+        <!-- Create the time stamp -->
+        <tstamp/>
+    </target>
+
+    <target name="package" depends="package-unix,package-windows"
+        description="Package CollectionSpace Services" />
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+        description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="clean" depends="clean-unix,clean-windows"
+        description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+        description="deploy concept doctype in ${jee.server.nuxeo}">
+        <copy file="${basedir}/target/${nuxeo.concept.jar}"
+        todir="${jee.deploy.nuxeo.plugins}"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy concept doctype from ${jee.server.nuxeo}">
+        <delete>
+            <fileset dir="${jee.deploy.nuxeo.plugins}">
+                <include name="${nuxeo.concept.jars.all}"/>
+            </fileset>
+        </delete>
+    </target>
+
+    <target name="dist"
+        description="generate distribution for concept doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
+            <fileset file="${basedir}/target/${nuxeo.concept.jar}"/>
+        </copy>
+    </target>
+
+    <target name="dist_installer"
+       description="Creates an installer distribution for concept doctype" depends="package">
+        <copy todir="${services.trunk}/${dist.installer.services}/concept/nuxeo">
+            <fileset file="${basedir}/target/${nuxeo.concept.jar}"/>
+        </copy>
+    </target>
+
+</project>
+
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/pom.xml b/services/concept/3rdparty/nuxeo-platform-cs-concept/pom.xml
new file mode 100644 (file)
index 0000000..c18c7a9
--- /dev/null
@@ -0,0 +1,37 @@
+<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.concept.3rdparty</artifactId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.concept.3rdparty.nuxeo</artifactId>
+    <name>services.concept.3rdparty.nuxeo</name>
+    <packaging>jar</packaging>
+    <description>
+        Concept Nuxeo Document Type
+    </description>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile> src/main/resources/META-INF/MANIFEST.MF </manifestFile>
+                        <manifestEntries>
+                            <Bundle-Version>${eclipseVersion}</Bundle-Version>
+                            <Bundle-ManifestVersion>2</Bundle-ManifestVersion>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    
+</project>
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/META-INF/MANIFEST.MF b/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..a35cbe2
--- /dev/null
@@ -0,0 +1,23 @@
+Manifest-Version: 1.0 
+Bundle-ManifestVersion: 1 
+Bundle-Name: NuxeoCS
+Bundle-SymbolicName: org.collectionspace.concept;singleton:=true 
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Bundle-Vendor: Nuxeo 
+Require-Bundle: org.nuxeo.runtime, 
+ org.nuxeo.ecm.core.api, 
+ org.nuxeo.ecm.core,
+ org.nuxeo.ecm.core.api,
+ org.nuxeo.ecm.platform.types.api,
+ org.nuxeo.ecm.platform.versioning.api,
+ org.nuxeo.ecm.platform.ui,
+ org.nuxeo.ecm.platform.forms.layout.client,
+ org.nuxeo.ecm.platform.ws,
+ org.collectionspace.collectionspace_core
+Provide-Package: org.collectionspace.concept
+Nuxeo-Component: OSGI-INF/core-types-contrib.xml,
+ OSGI-INF/life-cycle-contrib.xml,
+ OSGI-INF/ecm-types-contrib.xml,
+ OSGI-INF/layouts-contrib.xml
+
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/core-types-contrib.xml b/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/core-types-contrib.xml
new file mode 100644 (file)
index 0000000..687ff79
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.concept.coreTypes">
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+    <schema name="conceptauthorities_common" prefix="conceptauthorities_common" src="schemas/conceptauthorities_common.xsd"/>
+  </extension>
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
+    <schema name="concepts_common" prefix="concepts_common" src="schemas/concepts_common.xsd"/>
+  </extension>
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+    <doctype name="Conceptauthority" extends="Document">
+      <schema name="common"/>
+      <schema name="collectionspace_core"/>
+      <schema name="dublincore"/>
+      <schema name="conceptauthorities_common"/>
+    </doctype>
+  </extension>
+  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
+    <doctype name="Conceptitem" extends="Document">
+      <schema name="common"/>
+      <schema name="collectionspace_core"/>
+      <schema name="dublincore"/>
+      <schema name="concepts_common"/>
+    </doctype>
+  </extension>
+</component>
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/deployment-fragment.xml b/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/deployment-fragment.xml
new file mode 100644 (file)
index 0000000..270abbd
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<fragment>
+
+  <extension target="application#MODULE">
+    <module>
+      <java>${bundle.fileName}</java>
+    </module>
+  </extension>
+  
+</fragment>
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/ecm-types-contrib.xml b/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/ecm-types-contrib.xml
new file mode 100644 (file)
index 0000000..2bbb814
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.concept.ecm.types">
+  <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
+    <type id="Conceptauthority" coretype="Conceptauthority">
+      <label>org.collectionspace.conceptauthority</label>
+      <!--icon>/icons/file.gif</icon-->
+      <default-view>view_documents</default-view>
+
+      <layouts mode="any">
+        <layout>heading</layout>
+        <layout>csconceptauthority</layout>
+      </layouts>        
+    </type>
+
+    <type id="Folder" coretype="Folder">
+      <subtypes>
+        <type>Conceptauthority</type>
+      </subtypes>
+    </type>
+    
+    <type id="Workspace" coretype="Workspace">
+      <subtypes>
+        <type>Conceptauthority</type>
+      </subtypes>
+    </type>
+
+  </extension>
+  <extension target="org.nuxeo.ecm.platform.types.TypeService" point="types">
+    <type id="Conceptitem" coretype="Conceptitem">
+      <label>org.collectionspace.concept</label>
+      <!--icon>/icons/file.gif</icon-->
+      <default-view>view_documents</default-view>
+
+      <layouts mode="any">
+        <layout>heading</layout>
+        <layout>concept</layout>
+      </layouts>        
+    </type>
+
+    <type id="Folder" coretype="Folder">
+      <subtypes>
+        <type>Concept</type>
+      </subtypes>
+    </type>
+    
+    <type id="Workspace" coretype="Workspace">
+      <subtypes>
+        <type>Concept</type>
+      </subtypes>
+    </type>
+
+  </extension>
+</component>
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/layouts-contrib.xml b/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/layouts-contrib.xml
new file mode 100644 (file)
index 0000000..1145b1e
--- /dev/null
@@ -0,0 +1,184 @@
+<?xml version="1.0"?>
+
+<component name="org.collectionspace.concept.layouts.webapp">
+
+       <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
+    point="layouts">
+
+    <layout name="csconceptauthority">
+      <templates>
+        <template mode="any">/layouts/layout_default_template.xhtml</template>
+      </templates>
+      <rows>
+        <row><widget>displayName</widget></row>
+                               <row><widget>shortIdentifier</widget></row>
+        <row><widget>refName</widget></row>
+        <row><widget>vocabType</widget></row>
+      </rows>
+
+      <widget name="displayName" type="text">
+        <labels>
+          <label mode="any">Display Name</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="conceptauthorities_common">displayName</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="shortIdentifier" type="text">
+        <labels>
+          <label mode="any">Short Identifier</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="conceptauthorities_common">shortIdentifier</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="refName" type="text">
+        <labels>
+          <label mode="any">RefName</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="conceptauthorities_common">refName</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="vocabType" type="text">
+        <labels>
+          <label mode="any">Type</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="conceptauthorities_common">vocabType</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+    </layout>
+  </extension>
+
+  <extension target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
+    point="layouts">
+
+               <layout name="concept">
+      <templates>
+        <template mode="any">/layouts/layout_default_template.xhtml</template>
+      </templates>
+      <rows>
+        <row><widget>inAuthority</widget></row>
+                               <row><widget>shortIdentifier</widget></row>
+        <row><widget>refName</widget></row>
+        <row><widget>displayName</widget></row>
+        <row><widget>displayNameComputed</widget></row>
+        <row><widget>conceptType</widget></row>
+        <row><widget>status</widget></row>
+      </rows>
+
+      <widget name="inAuthority" type="text">
+        <labels>
+          <label mode="any">inAuthority (ConceptAuthority)</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="concepts_common">inAuthority</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+
+      <widget name="shortIdentifier" type="text">
+        <labels>
+          <label mode="any">Short Identifier</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="concepts_common">shortIdentifier</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="refName" type="text">
+        <labels>
+          <label mode="any">refName</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="concepts_common">refName</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="displayName" type="text">
+        <labels>
+          <label mode="any">displayName</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="conceptauthorities_common">displayName</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+                       <!-- This should be some kind of checkbox or something -->
+      <widget name="displayNameComputed" type="text">
+        <labels>
+          <label mode="any">displayNameComputed</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="conceptauthorities_common">displayNameComputed</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="conceptType" type="text">
+        <labels>
+          <label mode="any">conceptType</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="concepts_common">conceptType</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+      <widget name="status" type="text">
+        <labels>
+          <label mode="any">status</label>
+        </labels>
+        <translated>true</translated>
+        <fields>
+          <field schema="concepts_common">status</field>
+        </fields>
+        <properties widgetMode="edit">
+          <property name="styleClass">dataInputText</property>
+        </properties>
+      </widget>
+      
+    </layout>
+  </extension>
+</component>
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/life-cycle-contrib.xml b/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/OSGI-INF/life-cycle-contrib.xml
new file mode 100644 (file)
index 0000000..c842e5f
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<component name="org.collectionspace.ecm.platform.concept.LifeCycleManagerExtensions">
+
+  <extension target="org.nuxeo.ecm.core.lifecycle.LifeCycleService"
+             point="types">
+    <types>
+      <type name="Conceptauthority">default</type>
+      <type name="Conceptitem">default</type>
+    </types>
+  </extension>
+
+</component>
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/schemas/conceptauthorities_common.xsd b/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/schemas/conceptauthorities_common.xsd
new file mode 100644 (file)
index 0000000..8628182
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    ConceptAuthority schema (XSD)
+    
+    Entity  : ConceptAuthority
+    Part    : Common
+    Used for: Nuxeo EP core document type
+    
+    $LastChangedRevision: 928 $
+    $LastChangedDate: 2009-11-10 12:25:58 -0800 (Tue, 10 Nov 2009) $
+-->
+
+<xs:schema 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:ns="http://collectionspace.org/services/concept"
+  xmlns="http://collectionspace.org/services/concept"
+  targetNamespace="http://collectionspace.org/services/concept"
+  version="0.1"
+>
+
+<!-- Flattened version of jaxb schema for nuxeo -->
+<!-- See http://wiki.collectionspace.org/display/collectionspace/Concept+Service+Home -->    
+
+               <!--  ConceptAuthority Information Group -->
+               <xs:element name="displayName" type="xs:string"/>
+               <xs:element name="shortIdentifier" type="xs:string"/>
+               <xs:element name="refName" type="xs:string"/>
+               <xs:element name="vocabType" type="xs:string"/>
+               <xs:element name="source" type="xs:string"/>
+               <xs:element name="description" type="xs:string"/>
+
+</xs:schema>
+
diff --git a/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/schemas/concepts_common.xsd b/services/concept/3rdparty/nuxeo-platform-cs-concept/src/main/resources/schemas/concepts_common.xsd
new file mode 100644 (file)
index 0000000..0e23804
--- /dev/null
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    Concept schema (XSD)
+    
+    Entity  : Concept
+    Part    : Common
+    Used for: Nuxeo EP core document type
+    
+    $LastChangedRevision: 860 $
+    $LastChangedDate: 2009-10-14 14:48:05 -0700 (Wed, 14 Oct 2009) $
+-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/services/concept"
+    xmlns="http://collectionspace.org/services/concept"
+    targetNamespace="http://collectionspace.org/services/concept" version="0.1">
+    <!-- See http://wiki.collectionspace.org/display/collectionspace/Concept+Service+Home -->
+
+       <!--  Common Authority Information Group -->
+       <!--  inAuthority is the csid of the owning ConceptAuthority -->
+       <xs:element name="inAuthority" type="xs:string"/>
+       <xs:element name="shortIdentifier" type="xs:string"/>
+       <xs:element name="refName" type="xs:string"/>
+       <xs:element name="termStatus" type="xs:string"/>
+       <xs:element name="displayName" type="xs:string"/>
+       <xs:element name="displayNameComputed" type="xs:boolean"/>
+
+       <!--  Common Concept Information Group -->
+       <xs:element name="conceptType" type="xs:string"/>
+       <xs:element name="scopeNote" type="xs:string"/>
+       <xs:element name="scopeNoteSource" type="xs:string"/>
+       <xs:element name="scopeNoteSourceDetail" type="xs:string"/>
+       <xs:element name="remarks" type="xs:string"/>
+       <xs:element name="displayTermFlag" type="xs:string"/>
+       <xs:element name="otherNameFlags">
+               <xs:complexType>
+                       <xs:sequence>
+                               <xs:element name="otherNameFlag" type="xs:string"
+                                                                               minOccurs="0" maxOccurs="unbounded"/>
+                       </xs:sequence>
+               </xs:complexType>
+       </xs:element>
+       
+       <!--  List of Terms and alternates 
+       <xs:element name="conceptTermGroupList" type="conceptTermGroupList"/>
+                               -->
+       
+       <!--  List of Citations -->
+       <xs:element name="citationGroupList" type="citationGroupList"/>
+       
+       <!--  List of additional Concept Term sources  -->
+       <xs:element name="additionalTermSourceGroupList" 
+                                                       type="additionalTermSourceGroupList"/>
+
+<!-- =================================================================
+        Term Group repeating structure
+        =================================================================
+
+       <xs:complexType name="conceptTermGroupList">
+               <xs:sequence>
+                       <xs:element name="conceptTermGroup" type="conceptTermGroup" minOccurs="0"
+                                               maxOccurs="unbounded"/>
+               </xs:sequence>
+       </xs:complexType>
+
+       <xs:complexType name="conceptTermGroup">
+               <xs:sequence>
+                       <xs:element name="term" type="xs:string"/>
+                       <xs:element name="termType" type="xs:string"/>
+                       <xs:element name="termQualifier" type="xs:string"/>
+                       <xs:element name="termLanguage" type="xs:string"/>
+                       <xs:element name="historicalFlag" type="xs:string"/>
+                       <xs:element name="source" type="xs:string"/>
+                       <xs:element name="sourceDetail" type="xs:string"/>
+                       <xs:element name="sourceUID" type="xs:string"/>
+                       <xs:element name="termDate" type="structuredDateGroup"/>
+        </xs:sequence>
+       </xs:complexType>
+
+        -->
+<!-- =================================================================
+        Citation Group repeating structure
+        ================================================================= -->
+
+       <xs:complexType name="citationGroupList">
+               <xs:sequence>
+                       <xs:element name="citationGroup" type="citationGroup" minOccurs="0"
+                                               maxOccurs="unbounded"/>
+               </xs:sequence>
+       </xs:complexType>
+
+       <xs:complexType name="citationGroup">
+               <xs:sequence>
+                       <xs:element name="source" type="xs:string"/>
+                       <xs:element name="sourceDetail" type="xs:string"/>
+               </xs:sequence>
+       </xs:complexType>
+
+<!-- =================================================================
+        Additional Concept Source Group repeating structure
+        ================================================================= -->
+
+       <xs:complexType name="additionalTermSourceGroupList">
+               <xs:sequence>
+                       <xs:element name="additionalTermSourceGroup" 
+                                               type="additionalTermSourceGroup" minOccurs="0" maxOccurs="unbounded"/>
+               </xs:sequence>
+       </xs:complexType>
+
+       <xs:complexType name="additionalTermSourceGroup">
+               <xs:sequence>
+                       <xs:element name="source" type="xs:string"/>
+                       <xs:element name="sourceDetail" type="xs:string"/>
+                       <xs:element name="sourceUID" type="xs:string"/>
+               </xs:sequence>
+       </xs:complexType>
+
+<!-- =================================================================
+        Structured Date info. Copied from 
+        .../services/common/jaxb/src/main/resources/commonStructuredDateGroup.xsd
+        =================================================================
+       <xs:complexType name="structuredDateGroup">
+               <xs:sequence>
+                       <xs:element name="dateDisplayDate" type="xs:string"/>
+                       <xs:element name="dateAssociation" type="xs:string"/>
+                       <xs:element name="dateEarliestSingleYear" type="xs:integer"/>
+                       <xs:element name="dateEarliestSingleMonth" type="xs:integer"/>
+                       <xs:element name="dateEarliestSingleDay" type="xs:integer"/>
+                       <xs:element name="dateEarliestSingleEra" type="xs:string"/>
+                       <xs:element name="dateEarliestSingleCertainty" type="xs:string"/>
+                       <xs:element name="dateEarliestSingleQualifier" type="xs:string"/>
+                       <xs:element name="dateEarliestSingleQualifierValue" type="xs:integer"/>
+                       <xs:element name="dateEarliestSingleQualifierUnit" type="xs:string"/>
+                       <xs:element name="dateLatestYear" type="xs:integer"/>
+                       <xs:element name="dateLatestMonth" type="xs:integer"/>
+                       <xs:element name="dateLatestDay" type="xs:integer"/>
+                       <xs:element name="dateLatestEra" type="xs:string"/>
+                       <xs:element name="dateLatestCertainty" type="xs:string"/>
+                       <xs:element name="dateLatestQualifier" type="xs:string"/>
+                       <xs:element name="dateLatestQualifierValue" type="xs:integer"/>
+                       <xs:element name="dateLatestQualifierUnit" type="xs:string"/>
+                       <xs:element name="datePeriod" type="xs:string"/>
+                       <xs:element name="dateNote" type="xs:string"/>
+                       <xs:element name="dateEarliestScalarValue" type="xs:date"/>
+                       <xs:element name="dateLatestScalarValue" type="xs:date"/>
+                       <xs:element name="scalarValuesComputed" type="xs:boolean"/>
+               </xs:sequence>
+       </xs:complexType>
+
+        -->
+</xs:schema>
diff --git a/services/concept/3rdparty/pom.xml b/services/concept/3rdparty/pom.xml
new file mode 100644 (file)
index 0000000..b7ebd99
--- /dev/null
@@ -0,0 +1,23 @@
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.concept</artifactId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.concept.3rdparty</artifactId>
+    <name>services.concept.3rdparty</name>
+    <packaging>pom</packaging>
+    <description>
+        3rd party build for concept service
+    </description>
+
+    <modules>
+        <module>nuxeo-platform-cs-concept</module>
+    </modules>
+</project>
diff --git a/services/concept/build.xml b/services/concept/build.xml
new file mode 100644 (file)
index 0000000..d8c445a
--- /dev/null
@@ -0,0 +1,132 @@
+
+<project name="concept" default="package" basedir=".">
+    <description>
+        Concept Authority service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+        <!-- enviornment should be declared before reading build.properties -->
+    <property environment="env" />
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+
+    <target name="package" depends="package-unix,package-windows"
+  description="Package CollectionSpace Services" />
+  
+    <target name="package-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    
+    <target name="package-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="package" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="install" depends="install-unix,install-windows"
+  description="Install" />
+    <target name="install-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="install-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="install" />
+            <arg value="-Dmaven.test.skip=true" />
+            <arg value="-f" />
+            <arg value="${basedir}/pom.xml" />
+            <arg value="-N" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="clean" depends="clean-unix,clean-windows"
+  description="Delete target directories" >
+        <delete dir="${build}"/>
+    </target>
+    <target name="clean-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="clean-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="clean" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="test" depends="test-unix,test-windows" description="Run tests" />
+    <target name="test-unix" if="osfamily-unix">
+        <exec executable="mvn" failonerror="true">
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+    <target name="test-windows" if="osfamily-windows">
+        <exec executable="cmd" failonerror="true">
+            <arg value="/c" />
+            <arg value="mvn.bat" />
+            <arg value="test" />
+            <arg value="${mvn.opts}" />
+        </exec>
+    </target>
+
+    <target name="deploy" depends="install"
+        description="deploy concept service">
+        <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
+    </target>
+
+    <target name="undeploy"
+        description="undeploy concept service">
+        <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
+    </target>
+
+    <target name="dist" depends="package"
+        description="distribute concept service">
+        <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
+    </target>
+
+    <target name="dist_installer" depends="package"
+        description="distribute concept service">        
+        <!-- copy install scripts, etc. -->
+        <copy todir="${services.trunk}/${dist.installer.services}/concept">
+            <fileset dir="${basedir}/installer/"/>
+        </copy>
+        <ant antfile="3rdparty/build.xml" target="dist_installer" inheritall="false"/>
+    </target>
+
+</project>
diff --git a/services/concept/client/pom.xml b/services/concept/client/pom.xml
new file mode 100644 (file)
index 0000000..54db67c
--- /dev/null
@@ -0,0 +1,93 @@
+<?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.concept</artifactId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.collectionspace.services.concept.client</artifactId>
+    <name>services.concept.client</name>
+    
+    <dependencies>
+        <!-- keep slf4j dependencies on the top -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+        <!-- CollectionSpace dependencies -->
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.concept.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.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>
+        </dependency>
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-concept-client</finalName>
+        <plugins>
+        </plugins>
+    </build>
+</project>
+
diff --git a/services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityClient.java b/services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityClient.java
new file mode 100644 (file)
index 0000000..6428c50
--- /dev/null
@@ -0,0 +1,81 @@
+/**    
+ * ConceptAuthorityClient.java
+ *
+ * {Purpose of This Class}
+ *
+ * {Other Notes Relating to This Class (Optional)}
+ *
+ * $LastChangedBy: $
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ *
+ * 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 {Contributing Institution}
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ */
+package org.collectionspace.services.client;
+
+import org.collectionspace.services.concept.ConceptsCommon;
+
+/**
+ * The Class ConceptAuthorityClient.
+ */
+public class ConceptAuthorityClient extends AuthorityClientImpl<ConceptsCommon, ConceptAuthorityProxy> {
+       public static final String SERVICE_NAME = "conceptauthorities";
+       public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;       
+       public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+       public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME;
+       //
+       // Subitem constants
+       //
+       public static final String SERVICE_ITEM_NAME = "concepts";
+       public static final String SERVICE_ITEM_PAYLOAD_NAME = SERVICE_ITEM_NAME;
+       //
+       // Payload Part/Schema part names
+       //
+       public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME + 
+               PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+       public static final String SERVICE_ITEM_COMMON_PART_NAME = SERVICE_ITEM_NAME + 
+               PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
+       
+       @Override
+       public String getServiceName() {
+               return SERVICE_NAME;
+       }
+
+    @Override
+    public String getServicePathComponent() {
+        return SERVICE_PATH_COMPONENT;
+    }
+
+    @Override
+    public String getItemCommonPartName() {
+        return getCommonPartName(SERVICE_ITEM_NAME);
+    }
+
+       @Override
+       public Class<ConceptAuthorityProxy> getProxyClass() {
+               return ConceptAuthorityProxy.class;
+       }
+
+       @Override
+       public String getInAuthority(ConceptsCommon item) {
+               return item.getInAuthority();
+       }
+
+       @Override
+       public void setInAuthority(ConceptsCommon item, String inAuthorityCsid) {
+               item.setInAuthority(inAuthorityCsid);
+       }
+}
diff --git a/services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityClientUtils.java b/services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityClientUtils.java
new file mode 100644 (file)
index 0000000..f817b2d
--- /dev/null
@@ -0,0 +1,149 @@
+package org.collectionspace.services.client;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.Response;
+
+import org.apache.commons.io.FileUtils;
+import org.collectionspace.services.client.test.ServiceRequestType;
+import org.collectionspace.services.concept.ConceptauthoritiesCommon;
+import org.dom4j.DocumentException;
+import org.jboss.resteasy.client.ClientResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ConceptAuthorityClientUtils {
+    private static final Logger logger =
+        LoggerFactory.getLogger(ConceptAuthorityClientUtils.class);
+
+    /**
+     * Creates a new Concept Authority
+     * @param displayName      The displayName used in UI, etc.
+     * @param refName          The proper refName for this authority
+     * @param headerLabel      The common part label
+     * @return The PoxPayloadOut payload for the create call
+     */
+    public static PoxPayloadOut createConceptAuthorityInstance(
+               String displayName, String shortIdentifier, String headerLabel ) {
+        ConceptauthoritiesCommon conceptAuthority = new ConceptauthoritiesCommon();
+        conceptAuthority.setDisplayName(displayName);
+        conceptAuthority.setShortIdentifier(shortIdentifier);
+        conceptAuthority.setVocabType("ConceptAuthority"); //FIXME: REM - Should this really be hard-coded?
+        PoxPayloadOut multipart = new PoxPayloadOut(ConceptAuthorityClient.SERVICE_PAYLOAD_NAME);
+        PayloadOutputPart commonPart = multipart.addPart(conceptAuthority, MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, conceptAuthority common ", 
+                                       conceptAuthority, ConceptauthoritiesCommon.class);
+        }
+
+        return multipart;
+    }
+
+    /**
+     * @param commonPartXML the XML payload for the common part.
+     * @param headerLabel      The common part label
+     * @return The PoxPayloadOut payload for the create call
+     * @throws DocumentException
+     */
+    public static PoxPayloadOut createConceptInstance(
+               String commonPartXML, String headerLabel)  throws DocumentException {
+        PoxPayloadOut multipart = new PoxPayloadOut(ConceptAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);
+        /*
+        PayloadOutputPart commonPart = multipart.addPart(commonPartXML,
+            MediaType.APPLICATION_XML_TYPE);
+        commonPart.setLabel(headerLabel);
+        */
+        PayloadOutputPart commonPart = multipart.addPart(
+                       ConceptAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME,
+                       commonPartXML);
+
+        if(logger.isDebugEnabled()){
+               logger.debug("to be created, concept common ", commonPart.asXML());
+        }
+
+        return multipart;
+    }
+    
+    public static String createItemInAuthority(String vcsid,
+               String commonPartXML,
+               ConceptAuthorityClient client ) throws DocumentException {
+       // Expected status code: 201 Created
+       int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();
+       // Type of service request being tested
+       ServiceRequestType REQUEST_TYPE = ServiceRequestType.CREATE;
+       
+       PoxPayloadOut multipart = 
+               createConceptInstance(commonPartXML, client.getItemCommonPartName());
+       String newID = null;
+       ClientResponse<Response> res = client.createItem(vcsid, multipart);
+        try {
+               int statusCode = res.getStatus();
+       
+               if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {
+                       throw new RuntimeException("Could not create Item: \""+commonPartXML
+                                       +"\" in conceptAuthority: \"" + vcsid
+                                       +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+               }
+               if(statusCode != EXPECTED_STATUS_CODE) {
+                       throw new RuntimeException("Unexpected Status when creating Item: \""+commonPartXML
+                                       +"\" in conceptAuthority: \"" + vcsid +"\", Status:"+ statusCode);
+               }
+               newID = extractId(res);
+        } finally {
+               res.releaseConnection();
+        }
+
+       return newID;
+    }
+    
+    /**
+     * Creates the from xml file.
+     *
+     * @param fileName the file name
+     * @return new CSID as string
+     * @throws Exception the exception
+     */
+    private String createItemInAuthorityFromXmlFile(String vcsid, String commonPartFileName, 
+               ConceptAuthorityClient client) throws Exception {
+        byte[] b = FileUtils.readFileToByteArray(new File(commonPartFileName));
+        String commonPartXML = new String(b);
+       return createItemInAuthority(vcsid, commonPartXML, client );
+    }    
+
+    public static String extractId(ClientResponse<Response> res) {
+        MultivaluedMap<String, Object> mvm = res.getMetadata();
+        String uri = (String) ((ArrayList<Object>) mvm.get("Location")).get(0);
+        if(logger.isDebugEnabled()){
+               logger.debug("extractId:uri=" + uri);
+        }
+        String[] segments = uri.split("/");
+        String id = segments[segments.length - 1];
+        if(logger.isDebugEnabled()){
+               logger.debug("id=" + id);
+        }
+        return id;
+    }
+    
+    /**
+     * Returns an error message indicating that the status code returned by a
+     * specific call to a service does not fall within a set of valid status
+     * codes for that service.
+     *
+     * @param serviceRequestType  A type of service request (e.g. CREATE, DELETE).
+     *
+     * @param statusCode  The invalid status code that was returned in the response,
+     *                    from submitting that type of request to the service.
+     *
+     * @return An error message.
+     */
+    public static String invalidStatusCodeMessage(ServiceRequestType requestType, int statusCode) {
+        return "Status code '" + statusCode + "' in response is NOT within the expected set: " +
+                requestType.validStatusCodesAsString();
+    }
+
+}
diff --git a/services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityProxy.java b/services/concept/client/src/main/java/org/collectionspace/services/client/ConceptAuthorityProxy.java
new file mode 100644 (file)
index 0000000..dfcdf1b
--- /dev/null
@@ -0,0 +1,16 @@
+package org.collectionspace.services.client;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+/**
+ * @version $Revision:$
+ * ILT = Item list type
+ * LT = List type
+ */
+@Path(ConceptAuthorityClient.SERVICE_PATH + "/")
+@Produces("application/xml")
+@Consumes("application/xml")
+public interface ConceptAuthorityProxy extends AuthorityProxy {
+}
diff --git a/services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java b/services/concept/client/src/test/java/org/collectionspace/services/client/test/ConceptAuthorityServiceTest.java
new file mode 100644 (file)
index 0000000..72962d0
--- /dev/null
@@ -0,0 +1,455 @@
+/**
+ * This document is a part of the source code and related artifacts
+ * for CollectionSpace, an open source collections management system
+ * for museums and related institutions:
+ *
+ * http://www.collectionspace.org
+ * http://wiki.collectionspace.org
+ *
+ * Copyright (c)) 2009 Regents of the University of California
+ *
+ * Licensed under the Educational Community License (ECL), Version 2.0.
+ * You may not use this file except in compliance with this License.
+ *
+ * You may obtain a copy of the ECL 2.0 License at
+ * https://source.collectionspace.org/collection-space/LICENSE.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.collectionspace.services.client.test;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.collectionspace.services.ConceptJAXBSchema;
+import org.collectionspace.services.client.AbstractCommonListUtils;
+import org.collectionspace.services.client.AuthorityClient;
+import org.collectionspace.services.client.CollectionSpaceClient;
+import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PoxPayloadIn;
+import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.datetime.GregorianCalendarDateTimeUtils;
+import org.collectionspace.services.client.ConceptAuthorityClient;
+import org.collectionspace.services.client.ConceptAuthorityClientUtils;
+import org.collectionspace.services.jaxb.AbstractCommonList;
+import org.collectionspace.services.concept.ConceptauthoritiesCommon;
+import org.collectionspace.services.concept.ConceptsCommon;
+import org.dom4j.DocumentException;
+
+import org.jboss.resteasy.client.ClientResponse;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.Test;
+
+/**
+ * ConceptAuthorityServiceTest, carries out tests against a
+ * deployed and running ConceptAuthority Service.
+ *
+ * $LastChangedRevision: 753 $
+ * $LastChangedDate: 2009-09-23 11:03:36 -0700 (Wed, 23 Sep 2009) $
+ */
+public class ConceptAuthorityServiceTest extends AbstractAuthorityServiceTest<ConceptauthoritiesCommon, ConceptsCommon> {
+
+       /** The logger. */
+    private final String CLASS_NAME = ConceptAuthorityServiceTest.class.getName();
+    private final Logger logger = LoggerFactory.getLogger(ConceptAuthorityServiceTest.class);
+    private final String REFNAME = "refName";
+    private final String DISPLAYNAME = "displayName";
+    private final static String CURRENT_DATE_UTC =
+        GregorianCalendarDateTimeUtils.currentDateUTC();
+
+       @Override
+       public String getServicePathComponent() {
+               return ConceptAuthorityClient.SERVICE_PATH_COMPONENT;
+       }
+
+       @Override
+       protected String getServiceName() {
+               return ConceptAuthorityClient.SERVICE_NAME;
+       }
+    
+    public String getItemServicePathComponent() {
+        return AuthorityClient.ITEMS;
+    }  
+    
+    // Instance variables specific to this test.
+    
+    final String TEST_NAME = "Concept 1";
+    final String TEST_SHORTID = "concept1";
+    final String TEST_SCOPE_NOTE = "Covers quite a bit";
+    // TODO Make status type be a controlled vocab term.
+    final String TEST_STATUS = "Approved";
+    
+    private String knownConceptTypeRefName = null;
+    
+    /* (non-Javadoc)
+     * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
+     */
+    @Override
+    protected CollectionSpaceClient getClientInstance() {
+       return new ConceptAuthorityClient();
+    }
+    
+    /**
+     * Creates the item in authority.
+     *
+     * @param vcsid the vcsid
+     * @param authRefName the auth ref name
+     * @return the string
+     */
+       @Override
+       protected String createItemInAuthority(String authorityId) {
+
+        final String testName = "createItemInAuthority("+authorityId+")";
+        if(logger.isDebugEnabled()){
+            logger.debug(testName);
+        }
+
+        // Submit the request to the service and store the response.
+        ConceptAuthorityClient client = new ConceptAuthorityClient();
+        
+        String commonPartXML = createCommonPartXMLForItem(TEST_SHORTID, TEST_NAME);
+
+        String newID = null;
+        try {
+               newID = ConceptAuthorityClientUtils.createItemInAuthority(authorityId,
+                       commonPartXML, client );
+        } catch( DocumentException de ) {
+            logger.error("Problem creating item from XML: "+de.getLocalizedMessage());
+            logger.debug("commonPartXML: "+commonPartXML);
+            return null;
+        }
+
+        // Store the ID returned from the first item resource created
+        // for additional tests below.
+        if (knownItemResourceId == null){
+               setKnownItemResource(newID, TEST_SHORTID);
+            if (logger.isDebugEnabled()) {
+                logger.debug(testName + ": knownItemResourceId=" + newID);
+            }
+        }
+
+        // Store the IDs from any item resources created
+        // by tests, along with the IDs of their parents, so these items
+        // can be deleted after all tests have been run.
+        allResourceItemIdsCreated.put(newID, authorityId);
+
+        return newID;
+    }
+    
+    /**
+     * Read item list.
+     */
+    @Test(dataProvider = "testName", groups = {"readList"},
+               dependsOnMethods = {"readList"})
+    public void readItemList(String testName) {
+        readItemList(knownAuthorityWithItems, null);
+    }
+
+    /**
+     * Read item list by authority name.
+     */
+    @Test(dataProvider = "testName", groups = {"readList"},
+               dependsOnMethods = {"readItemList"})
+    public void readItemListByAuthorityName(String testName) {
+        readItemList(null, READITEMS_SHORT_IDENTIFIER);
+    }
+    
+    /**
+     * Read item list.
+     *
+     * @param vcsid the vcsid
+     * @param name the name
+     */
+    private void readItemList(String vcsid, String shortId) {
+
+        String testName = "readItemList";
+
+        // Perform setup.
+        setupReadList();
+        
+        // Submit the request to the service and store the response.
+        ConceptAuthorityClient client = new ConceptAuthorityClient();
+        ClientResponse<AbstractCommonList> res = null;
+        if(vcsid!= null) {
+               res = client.readItemList(vcsid, null, null);
+        } else if(shortId!= null) {
+               res = client.readItemListForNamedAuthority(shortId, null, null);
+        } else {
+               Assert.fail("readItemList passed null csid and name!");
+        }
+               AbstractCommonList list = null;
+        try {
+            assertStatusCode(res, testName);
+               list = res.getEntity();
+           } finally {
+               res.releaseConnection();
+           }
+        List<AbstractCommonList.ListItem> items =
+            list.getListItem();
+        int nItemsReturned = items.size();
+               // There will be 'nItemsToCreateInList'
+               // items created by the createItemList test,
+               // all associated with the same parent resource.
+               int nExpectedItems = nItemsToCreateInList;
+        if(logger.isDebugEnabled()){
+            logger.debug(testName + ": Expected "
+                       + nExpectedItems +" items; got: "+nItemsReturned);
+        }
+        Assert.assertEquals(nItemsReturned, nExpectedItems);
+
+        for (AbstractCommonList.ListItem item : items) {
+               String value = 
+                       AbstractCommonListUtils.ListItemGetElementValue(item, REFNAME);
+            Assert.assertTrue((null != value), "Item refName is null!");
+               value = 
+                       AbstractCommonListUtils.ListItemGetElementValue(item, DISPLAYNAME);
+            Assert.assertTrue((null != value), "Item displayName is null!");
+        }
+        if(logger.isTraceEnabled()){
+               AbstractCommonListUtils.ListItemsInAbstractCommonList(list, logger, testName);
+        }
+    }
+
+   @Override
+   public void delete(String testName) throws Exception {
+       // Do nothing.  See localDelete().  This ensure proper test order.
+   }
+   
+   @Test(dataProvider = "testName", dependsOnMethods = {"localDeleteItem"})    
+   public void localDelete(String testName) throws Exception {
+       super.delete(testName);
+   }
+
+   @Override
+   public void deleteItem(String testName) throws Exception {
+       // Do nothing.  We need to wait until after the test "localDelete" gets run.  When it does,
+       // its dependencies will get run first and then we can call the base class' delete method.
+   }
+   
+   @Test(dataProvider = "testName", groups = {"delete"},
+                  dependsOnMethods = {"readItem", "updateItem"})
+   public void localDeleteItem(String testName) throws Exception {
+          super.deleteItem(testName);
+   }
+
+
+   
+   // ---------------------------------------------------------------
+   // Cleanup of resources created during testing
+   // ---------------------------------------------------------------
+   
+   /**
+    * Deletes all resources created by tests, after all tests have been run.
+    *
+    * This cleanup method will always be run, even if one or more tests fail.
+    * For this reason, it attempts to remove all resources created
+    * at any point during testing, even if some of those resources
+    * may be expected to be deleted by certain tests.
+    */
+
+   @AfterClass(alwaysRun=true)
+   public void cleanUp() {
+       String noTest = System.getProperty("noTestCleanup");
+       if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
+           if (logger.isDebugEnabled()) {
+               logger.debug("Skipping Cleanup phase ...");
+           }
+           return;
+       }
+       if (logger.isDebugEnabled()) {
+           logger.debug("Cleaning up temporary resources created for testing ...");
+       }
+       String parentResourceId;
+       String itemResourceId;
+       // Clean up contact resources.
+       ConceptAuthorityClient client = new ConceptAuthorityClient();
+       parentResourceId = knownResourceId;
+       // Clean up item resources.
+       for (Map.Entry<String, String> entry : allResourceItemIdsCreated.entrySet()) {
+           itemResourceId = entry.getKey();
+           parentResourceId = entry.getValue();
+           // Note: Any non-success responses from the delete operation
+           // below are ignored and not reported.
+           client.deleteItem(parentResourceId, itemResourceId).releaseConnection();
+       }
+       // Clean up parent resources.
+       for (String resourceId : allResourceIdsCreated) {
+           // Note: Any non-success responses from the delete operation
+           // below are ignored and not reported.
+           client.delete(resourceId).releaseConnection();
+       }
+   }
+
+   // ---------------------------------------------------------------
+   // Utility methods used by tests above
+   // ---------------------------------------------------------------
+   /* (non-Javadoc)
+    * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
+    */
+
+   /**
+    * Returns the root URL for the item service.
+    *
+    * This URL consists of a base URL for all services, followed by
+    * a path component for the owning parent, followed by the
+    * path component for the items.
+    *
+    * @param  parentResourceIdentifier  An identifier (such as a UUID) for the
+    * parent authority resource of the relevant item resource.
+    *
+    * @return The root URL for the item service.
+    */
+   protected String getItemServiceRootURL(String parentResourceIdentifier) {
+       return getResourceURL(parentResourceIdentifier) + "/" + getItemServicePathComponent();
+   }
+
+   /**
+    * Returns the URL of a specific item resource managed by a service, and
+    * designated by an identifier (such as a universally unique ID, or UUID).
+    *
+    * @param  parentResourceIdentifier  An identifier (such as a UUID) for the
+    * parent authority resource of the relevant item resource.
+    *
+    * @param  itemResourceIdentifier  An identifier (such as a UUID) for an
+    * item resource.
+    *
+    * @return The URL of a specific item resource managed by a service.
+    */
+   protected String getItemResourceURL(String parentResourceIdentifier, String itemResourceIdentifier) {
+       return getItemServiceRootURL(parentResourceIdentifier) + "/" + itemResourceIdentifier;
+   }
+
+       @Override
+       public void authorityTests(String testName) {
+               // TODO Auto-generated method stub
+               
+       }
+
+       //
+       // Concept specific overrides
+       //
+       
+    @Override
+       protected PoxPayloadOut createInstance(String commonPartName,
+                       String identifier) {
+       ConceptAuthorityClient client = new ConceptAuthorityClient();
+        String shortId = identifier;
+       String displayName = "displayName-" + shortId;
+       // String baseRefName = ConceptAuthorityClientUtils.createConceptAuthRefName(shortId, null);
+       PoxPayloadOut multipart = 
+            ConceptAuthorityClientUtils.createConceptAuthorityInstance(
+           displayName, shortId, commonPartName);
+       return multipart;
+    }
+        
+
+    private String createCommonPartXMLForItem(String shortId, String name ) {
+       
+        String commonPartXML = 
+                       "<ns2:concepts_common xmlns:ns2=\"http://collectionspace.org/services/concept\">" + 
+               " <shortIdentifier>"+shortId+"</shortIdentifier>"+
+               " <displayName>"+name+"</displayName>"+
+               " <displayNameComputed>false</displayNameComputed>"+
+               " <termStatus>Imagined</termStatus>"+
+               /*
+               " <conceptTermGroupList>"+
+               "  <conceptTermGroup>"+
+               "   <term>Another term</term>"+
+               "   <termType>alternate</termType>"+
+               "   <source>My Imagination</source>"+
+               "  </conceptTermGroup>"+
+               " </conceptTermGroupList>"+
+               */
+               "</ns2:concepts_common>";
+        return commonPartXML;
+    }
+
+       @Override
+    protected PoxPayloadOut createNonExistenceInstance(String commonPartName, String identifier) {
+        String displayName = "displayName-NON_EXISTENT_ID";
+       PoxPayloadOut result = ConceptAuthorityClientUtils.createConceptAuthorityInstance(
+                               displayName, "nonEx", commonPartName);
+       return result;
+    }
+
+       @Override
+       protected ConceptauthoritiesCommon updateInstance(ConceptauthoritiesCommon conceptauthoritiesCommon) {
+               ConceptauthoritiesCommon result = new ConceptauthoritiesCommon();
+               
+               result.setDisplayName("updated-" + conceptauthoritiesCommon.getDisplayName());
+               result.setVocabType("updated-" + conceptauthoritiesCommon.getVocabType());
+               
+               return result;
+       }
+
+       @Override
+       protected void compareUpdatedInstances(ConceptauthoritiesCommon original,
+                       ConceptauthoritiesCommon updated) throws Exception {
+        Assert.assertEquals(updated.getDisplayName(),
+                       original.getDisplayName(),
+                "Display name in updated object did not match submitted data.");
+       }
+
+       protected void compareReadInstances(ConceptauthoritiesCommon original,
+                       ConceptauthoritiesCommon fromRead) throws Exception {
+        Assert.assertNotNull(fromRead.getDisplayName());
+        Assert.assertNotNull(fromRead.getShortIdentifier());
+        Assert.assertNotNull(fromRead.getRefName());
+       }
+       
+       @Override
+       protected ConceptsCommon updateItemInstance(ConceptsCommon conceptsCommon) {
+               ConceptsCommon result = new ConceptsCommon();
+               
+        result.setTermStatus("updated-" + conceptsCommon.getTermStatus());
+               result.setDisplayName("updated-" + conceptsCommon.getDisplayName());
+               
+               return result;
+       }
+
+       @Override
+       protected void compareUpdatedItemInstances(ConceptsCommon original,
+                       ConceptsCommon updated) throws Exception {
+        Assert.assertEquals(updated.getTermStatus(), original.getTermStatus(),
+                "Data in updated Concept did not match submitted data.");
+        Assert.assertEquals(updated.getDisplayName(), original.getDisplayName(),
+                "Data in updated Concept did not match submitted data.");
+       }
+
+       @Override
+       protected void verifyReadItemInstance(ConceptsCommon item)
+                       throws Exception {
+               // TODO Auto-generated method stub
+               
+       }
+
+
+       @Override
+       protected PoxPayloadOut createNonExistenceItemInstance(
+                       String commonPartName, String identifier) {
+
+               String commonPartXML = createCommonPartXMLForItem("nonExShortId", "nonExItem");
+
+               try {
+               PoxPayloadOut result = 
+                       ConceptAuthorityClientUtils.createConceptInstance( 
+                                       commonPartXML, commonPartName);
+                       return result;
+        } catch( DocumentException de ) {
+            logger.error("Problem creating item from XML: "+de.getLocalizedMessage());
+            logger.debug("commonPartXML: "+commonPartXML);
+        }
+        return null;
+       }
+
+}
diff --git a/services/concept/client/src/test/resources/log4j.properties b/services/concept/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/concept/installer/build.xml b/services/concept/installer/build.xml
new file mode 100644 (file)
index 0000000..9dd6463
--- /dev/null
@@ -0,0 +1,61 @@
+
+<project name="concept" default="package" basedir=".">
+    <description>
+        concept service
+    </description>
+  <!-- set global properties for this build -->
+    <property name="services.trunk" value="../.."/>
+    <property file="${services.trunk}/build.properties" />
+    <property name="mvn.opts" value="" />
+    <property name="src" location="src"/>
+
+    <condition property="osfamily-unix">
+        <os family="unix" />
+    </condition>
+    <condition property="osfamily-windows">
+        <os family="windows" />
+    </condition>
+    
+    <target name="install" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing concept Service's &apos;install&apos; target." />
+                               </exec>
+                               <!-- Copy the Nuxeo DocType jar files to the Nuxeo app server domain -->
+        <copy todir="${jee.deploy.nuxeo.plugins}">
+            <fileset file="nuxeo/*.jar"/>
+        </copy>                                
+    </target>    
+
+    <target name="config" description="" depends="install">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Concept Service's &apos;config&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="predeploy" description="" depends="config">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Concept Service's &apos;predeploy&apos; target." />
+                               </exec>
+    </target>    
+    
+    <target name="deploy" description="">
+        <exec executable="echo">
+                       <arg value="Installer: Executing Concept Service's &apos;deploy&apos; target." />
+                               </exec>
+    </target>
+    
+    <target name="postdeploy">
+        <exec executable="echo">
+                       <arg value="Installer: Executing installer's &apos;postdeploy&apos; target for the Concept Service." />
+                               </exec>         
+        <exec executable="echo">
+                       <arg value="Importing necessary conceptauthorities." />
+                               </exec>                         
+        <java jar="./postdeploy/collectionspace-services-concept-importer-jar-with-dependencies.jar"
+               fork="true"
+               failonerror="true">
+                               </java> 
+    </target>
+    
+
+</project>
diff --git a/services/concept/jaxb/pom.xml b/services/concept/jaxb/pom.xml
new file mode 100644 (file)
index 0000000..a1232d5
--- /dev/null
@@ -0,0 +1,46 @@
+<?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.concept</artifactId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.concept.jaxb</artifactId>
+    <name>services.concept.jaxb</name>
+
+    <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.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
+    </dependencies>
+
+    <build>
+        <finalName>collectionspace-services-concept-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/concept/jaxb/src/main/java/org/collectionspace/services/ConceptJAXBSchema.java b/services/concept/jaxb/src/main/java/org/collectionspace/services/ConceptJAXBSchema.java
new file mode 100644 (file)
index 0000000..3bb44db
--- /dev/null
@@ -0,0 +1,41 @@
+/**
+ * 
+ */
+package org.collectionspace.services;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
+
+/**
+ * @author pschmitz
+ *
+ */
+public interface ConceptJAXBSchema extends AuthorityItemJAXBSchema {
+       final static String CONCEPTS_COMMON = "concepts_common";
+       final static String CONCEPT_TYPE = "conceptType";
+       final static String CONCEPT_SCOPE_NOTE = "scopeNote";
+       final static String CONCEPT_SCOPE_NOTE_SOURCE = "scopeNoteSource";
+       final static String CONCEPT_SCOPE_NOTE_SOURCE_DETAIL = "scopeNoteSourceDetail";
+       final static String CONCEPT_REMARKS = "remarks";
+       final static String CONCEPT_DISPLAY_TERM_FLAG = "displayTermFlag";
+
+       final static String CONCEPT_TERM_GROUP_LIST = "conceptTermGroupList";
+       final static String CONCEPT_CITATION_GROUP_LIST = "citationGroupList";
+       final static String CONCEPT_ADDL_TERM_SOURCE_GROUP_LIST = "additionalTermSourceGroupList";
+       
+       final static String CONCEPT_TERM_GROUP_TERM = "term";
+       final static String CONCEPT_TERM_GROUP_TERM_TYPE = "termType";
+       final static String CONCEPT_TERM_GROUP_TERM_QUALIFIER = "termQualifier";
+       final static String CONCEPT_TERM_GROUP_TERM_LANGUAGE = "termLanguage";
+       final static String CONCEPT_TERM_GROUP_HISTORICAL_FLAG = "historicalFlag";
+       final static String CONCEPT_TERM_GROUP_SOURCE = "source";
+       final static String CONCEPT_TERM_GROUP_SOURCE_DETAIL = "sourceDetail";
+       final static String CONCEPT_TERM_GROUP_SOURCE_UID = "sourceUID";
+       final static String CONCEPT_TERM_GROUP_TERM_DATE = "termDate";
+       
+       final static String CONCEPT_CITATION_GROUP_SOURCE = "source";
+       final static String CONCEPT_CITATION_GROUP_SOURCE_DETAIL = "sourceDetail";
+
+       final static String CONCEPT_ADDL_TERM_SOURCE_GROUP_SOURCE = "source";
+       final static String CONCEPT_ADDL_TERM_SOURCE_GROUP_DETAIL = "sourceDetail";
+       final static String CONCEPT_ADDL_TERM_SOURCE_GROUP_UID = "sourceUID";
+}
+
diff --git a/services/concept/jaxb/src/main/resources/concept_common.xsd b/services/concept/jaxb/src/main/resources/concept_common.xsd
new file mode 100644 (file)
index 0000000..fcb4149
--- /dev/null
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+    jaxb:version="1.0" elementFormDefault="unqualified"
+    xmlns:ns="http://collectionspace.org/services/concept"
+    xmlns="http://collectionspace.org/services/concept"
+    targetNamespace="http://collectionspace.org/services/concept"
+    version="0.1"
+    >
+    
+    <!-- avoid XmlRootElement nightnmare, see http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html-->
+    <!-- See http://wiki.collectionspace.org/display/collectionspace/Concept+Service+Home -->    
+    
+       <!-- Concept -->
+       <xs:element name="concepts_common">
+               <xs:complexType>
+                       <xs:sequence>
+                               <!--  Common identifier -->
+                               <xs:element name="csid" type="xs:string" />
+                                       
+                               <!--  Common Authority Information Group -->
+                               <!--  inAuthority is the csid of the owning ConceptAuthority -->
+                               <xs:element name="inAuthority" type="xs:string" />
+                               <xs:element name="shortIdentifier" type="xs:string"/>
+                               <xs:element name="refName" type="xs:string"/>
+                               <xs:element name="termStatus" type="xs:string"/>
+                               <xs:element name="displayName" type="xs:string"/>
+                               <xs:element name="displayNameComputed" type="xs:boolean"/>
+
+                               <!--  Common Concept Information Group -->
+
+                               <xs:element name="conceptType" type="xs:string"/>
+                               <xs:element name="scopeNote" type="xs:string"/>
+                               <xs:element name="scopeNoteSource" type="xs:string"/>
+                               <xs:element name="scopeNoteSourceDetail" type="xs:string"/>
+                               <xs:element name="remarks" type="xs:string"/>
+                               <xs:element name="displayTermFlag" type="xs:string"/>
+                               <xs:element name="otherNameFlags">
+                                       <xs:complexType>
+                                               <xs:sequence>
+                                                       <xs:element name="otherNameFlag" type="xs:string"
+                                                                                                       minOccurs="0" maxOccurs="unbounded"/>
+                                               </xs:sequence>
+                                       </xs:complexType>
+                               </xs:element>
+       
+                               <!--  List of Terms and alternates 
+                               <xs:element name="conceptTermGroupList" type="conceptTermGroupList"/>
+                                                       -->
+       
+                               <!--  List of Citations -->
+                               <xs:element name="citationGroupList" type="citationGroupList"/>
+       
+                               <!--  List of additional Concept Term sources  -->
+                               <xs:element name="additionalTermSourceGroupList" 
+                                                                               type="additionalTermSourceGroupList"/>
+                       </xs:sequence>
+               </xs:complexType>
+       </xs:element>
+    
+<!-- =================================================================
+        Term Group repeating structure
+        =================================================================
+
+       <xs:complexType name="conceptTermGroupList">
+               <xs:sequence>
+                       <xs:element name="conceptTermGroup" type="conceptTermGroup" minOccurs="0"
+                                               maxOccurs="unbounded"/>
+               </xs:sequence>
+       </xs:complexType>
+
+       <xs:complexType name="conceptTermGroup">
+               <xs:sequence>
+                       <xs:element name="term" type="xs:string"/>
+                       <xs:element name="termType" type="xs:string"/>
+                       <xs:element name="termQualifier" type="xs:string"/>
+                       <xs:element name="termLanguage" type="xs:string"/>
+                       <xs:element name="historicalFlag" type="xs:string"/>
+                       <xs:element name="source" type="xs:string"/>
+                       <xs:element name="sourceDetail" type="xs:string"/>
+                       <xs:element name="sourceUID" type="xs:string"/>
+                       <xs:element name="termDate" type="structuredDateGroup"/>
+        </xs:sequence>
+       </xs:complexType>
+        -->
+
+<!-- =================================================================
+        Citation Group repeating structure
+        ================================================================= -->
+
+       <xs:complexType name="citationGroupList">
+               <xs:sequence>
+                       <xs:element name="citationGroup" type="citationGroup" minOccurs="0"
+                                               maxOccurs="unbounded"/>
+               </xs:sequence>
+       </xs:complexType>
+
+       <xs:complexType name="citationGroup">
+               <xs:sequence>
+                       <xs:element name="source" type="xs:string"/>
+                       <xs:element name="sourceDetail" type="xs:string"/>
+               </xs:sequence>
+       </xs:complexType>
+
+<!-- =================================================================
+        Additional Concept Source Group repeating structure
+        ================================================================= -->
+
+       <xs:complexType name="additionalTermSourceGroupList">
+               <xs:sequence>
+                       <xs:element name="additionalTermSourceGroup" 
+                                               type="additionalTermSourceGroup" minOccurs="0" maxOccurs="unbounded"/>
+               </xs:sequence>
+       </xs:complexType>
+
+       <xs:complexType name="additionalTermSourceGroup">
+               <xs:sequence>
+                       <xs:element name="source" type="xs:string"/>
+                       <xs:element name="sourceDetail" type="xs:string"/>
+                       <xs:element name="sourceUID" type="xs:string"/>
+               </xs:sequence>
+       </xs:complexType>
+
+<!-- =================================================================
+        Structured Date info. Copied from 
+        .../services/common/jaxb/src/main/resources/commonStructuredDateGroup.xsd
+        =================================================================
+       <xs:complexType name="structuredDateGroup">
+               <xs:sequence>
+                       <xs:element name="dateDisplayDate" type="xs:string"/>
+                       <xs:element name="dateAssociation" type="xs:string"/>
+                       <xs:element name="dateEarliestSingleYear" type="xs:integer"/>
+                       <xs:element name="dateEarliestSingleMonth" type="xs:integer"/>
+                       <xs:element name="dateEarliestSingleDay" type="xs:integer"/>
+                       <xs:element name="dateEarliestSingleEra" type="xs:string"/>
+                       <xs:element name="dateEarliestSingleCertainty" type="xs:string"/>
+                       <xs:element name="dateEarliestSingleQualifier" type="xs:string"/>
+                       <xs:element name="dateEarliestSingleQualifierValue" type="xs:integer"/>
+                       <xs:element name="dateEarliestSingleQualifierUnit" type="xs:string"/>
+                       <xs:element name="dateLatestYear" type="xs:integer"/>
+                       <xs:element name="dateLatestMonth" type="xs:integer"/>
+                       <xs:element name="dateLatestDay" type="xs:integer"/>
+                       <xs:element name="dateLatestEra" type="xs:string"/>
+                       <xs:element name="dateLatestCertainty" type="xs:string"/>
+                       <xs:element name="dateLatestQualifier" type="xs:string"/>
+                       <xs:element name="dateLatestQualifierValue" type="xs:integer"/>
+                       <xs:element name="dateLatestQualifierUnit" type="xs:string"/>
+                       <xs:element name="datePeriod" type="xs:string"/>
+                       <xs:element name="dateNote" type="xs:string"/>
+                       <xs:element name="dateEarliestScalarValue" type="xs:date"/>
+                       <xs:element name="dateLatestScalarValue" type="xs:date"/>
+                       <xs:element name="scalarValuesComputed" type="xs:boolean"/>
+               </xs:sequence>
+       </xs:complexType>
+        -->
+
+</xs:schema>
+
diff --git a/services/concept/jaxb/src/main/resources/conceptauthority_common.xsd b/services/concept/jaxb/src/main/resources/conceptauthority_common.xsd
new file mode 100644 (file)
index 0000000..2cc0404
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!--
+    ConceptAuthority schema (XSD)
+    
+    Entity  : ConceptAuthority
+    Part    : Common
+    Used for: JAXB binding between XML and Java objects
+    
+    $LastChangedRevision: 1055 $
+    $LastChangedDate: 2009-12-09 12:25:15 -0800 (Wed, 09 Dec 2009) $
+-->
+
+<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/concept"
+    xmlns="http://collectionspace.org/services/concept"
+    targetNamespace="http://collectionspace.org/services/concept"
+    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/Concept+Service+Home -->    
+    
+    <!-- ConceptAuthority  -->
+    <xs:element name="conceptauthorities_common">
+        <xs:complexType>
+            <xs:sequence>
+                <!--  Common identifier -->
+                <xs:element name="csid" type="xs:string" />
+                
+                <!--  ConceptAuthority Information Group -->
+                <xs:element name="displayName" type="xs:string"/>
+                                                               <xs:element name="shortIdentifier" type="xs:string"/>
+                <xs:element name="refName" type="xs:string"/>
+                <xs:element name="vocabType" type="xs:string"/>
+                <xs:element name="source" type="xs:string"/>
+                <xs:element name="description" type="xs:string"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    
+</xs:schema>
+
diff --git a/services/concept/pom.xml b/services/concept/pom.xml
new file mode 100644 (file)
index 0000000..77234fb
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <groupId>org.collectionspace.services</groupId>
+        <artifactId>org.collectionspace.services.main</artifactId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.concept</artifactId>
+    <name>services.concept</name>
+    <packaging>pom</packaging>
+
+    <dependencies>
+    </dependencies>
+
+    <modules>
+        <module>jaxb</module>
+        <module>service</module>
+        <module>3rdparty</module>
+        <module>client</module>
+    </modules>
+    
+    <profiles>
+        <profile>
+            <id>samples</id>
+           <modules>
+               <!-- <module>sample</module> -->
+           </modules>
+        </profile>
+    </profiles>
+    
+</project>
+
diff --git a/services/concept/service/pom.xml b/services/concept/service/pom.xml
new file mode 100644 (file)
index 0000000..85709c6
--- /dev/null
@@ -0,0 +1,134 @@
+<?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.concept</artifactId>
+        <version>2.2-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.concept.service</artifactId>
+    <name>services.concept.service</name>
+    <packaging>jar</packaging>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+        </dependency>
+<!-- CollectionSpace dependencies -->        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.concept.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.concept.client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.contact.service</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>
+            <version>5.6</version>
+        </dependency>
+        
+        <!-- apache -->
+        <dependency>
+            <groupId>commons-beanutils</groupId>
+            <artifactId>commons-beanutils</artifactId>
+            <version>1.6.1</version>
+        </dependency>
+        <!-- use explict 1.1 version to prevent errors coming from Nuxeo client -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.1</version>
+        </dependency>
+      <!-- javax -->
+
+
+        <dependency>
+            <groupId>javax.security</groupId>
+            <artifactId>jaas</artifactId>
+            <version>1.0.01</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>dom4j</groupId>
+            <artifactId>dom4j</artifactId>
+            <version>1.6.1</version>
+            <scope>provided</scope>
+        </dependency>
+        
+        <!-- jboss -->
+
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxrs</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>tjws</groupId>
+                    <artifactId>webserver</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-jaxb-provider</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jboss.resteasy</groupId>
+            <artifactId>resteasy-multipart-provider</artifactId>
+        </dependency>
+        
+        <!-- nuxeo -->
+
+        <dependency>
+            <groupId>org.nuxeo.ecm.core</groupId>
+            <artifactId>nuxeo-core-api</artifactId>
+            <exclusions>
+                <exclusion>
+                    <artifactId>jboss-remoting</artifactId>
+                    <groupId>jboss</groupId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <finalName>collectionspace-services-concept</finalName>
+        <plugins>
+        </plugins>
+    </build>
+</project>
+
diff --git a/services/concept/service/src/main/java/org/collectionspace/services/concept/ConceptAuthorityResource.java b/services/concept/service/src/main/java/org/collectionspace/services/concept/ConceptAuthorityResource.java
new file mode 100644 (file)
index 0000000..b2c7afe
--- /dev/null
@@ -0,0 +1,69 @@
+/**
+ *  This document is a part of the source code and related artifacts
+ *  for CollectionSpace, an open source collections management system
+ *  for museums and related institutions:
+
+ *  http://www.collectionspace.org
+ *  http://wiki.collectionspace.org
+
+ *  Copyright 2009 University of California at Berkeley
+
+ *  Licensed under the Educational Community License (ECL), Version 2.0.
+ *  You may not use this file except in compliance with this License.
+
+ *  You may obtain a copy of the ECL 2.0 License at
+
+ *  https://source.collectionspace.org/collection-space/LICENSE.txt
+
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.collectionspace.services.concept;
+
+import org.collectionspace.services.client.ConceptAuthorityClient;
+import org.collectionspace.services.common.vocabulary.AuthorityResource;
+import org.collectionspace.services.concept.nuxeo.ConceptDocumentModelHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.ws.rs.Consumes;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+
+@Path(ConceptAuthorityClient.SERVICE_PATH)
+@Consumes("application/xml")
+@Produces("application/xml")
+public class ConceptAuthorityResource 
+       extends AuthorityResource<ConceptauthoritiesCommon, 
+                                                               ConceptDocumentModelHandler> {
+
+    private final static String conceptAuthorityServiceName = "conceptauthorities";
+       private final static String CONCEPTAUTHORITIES_COMMON = "conceptauthorities_common";
+    
+    private final static String conceptServiceName = "concepts";
+       private final static String CONCEPTS_COMMON = "concepts_common";
+    
+    final Logger logger = LoggerFactory.getLogger(ConceptAuthorityResource.class);
+
+    public ConceptAuthorityResource() {
+               super(ConceptauthoritiesCommon.class, ConceptAuthorityResource.class,
+                               CONCEPTAUTHORITIES_COMMON, CONCEPTS_COMMON);
+    }
+
+    @Override
+    public String getServiceName() {
+        return conceptAuthorityServiceName;
+    }
+
+    public String getItemServiceName() {
+        return conceptServiceName;
+    }
+
+    @Override
+    public Class<ConceptauthoritiesCommon> getCommonPartClass() {
+       return ConceptauthoritiesCommon.class;
+    }
+}
diff --git a/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptAuthorityConstants.java b/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptAuthorityConstants.java
new file mode 100644 (file)
index 0000000..7178d9d
--- /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.concept.nuxeo;
+
+/**
+ * ConceptAuthorityConstants processes CollectionObject document
+ *
+ */
+public class ConceptAuthorityConstants {
+
+    public final static String NUXEO_DOCTYPE = "ConceptAuthority";
+    public final static String NUXEO_SCHEMA_NAME = "conceptauthority";
+    public final static String NUXEO_DC_TITLE = "CollectionSpace-ConceptAuthority";
+}
diff --git a/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptAuthorityDocumentModelHandler.java b/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptAuthorityDocumentModelHandler.java
new file mode 100644 (file)
index 0000000..5b971bd
--- /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.concept.nuxeo;
+
+import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityDocumentModelHandler;
+import org.collectionspace.services.concept.ConceptauthoritiesCommon;
+
+/**
+ * ConceptAuthorityDocumentModelHandler
+ *
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ */
+public class ConceptAuthorityDocumentModelHandler
+        extends AuthorityDocumentModelHandler<ConceptauthoritiesCommon> {
+
+    /**
+     * Common part schema label
+     */
+    private static final String COMMON_PART_LABEL = "conceptauthorities_common";   
+    
+    public ConceptAuthorityDocumentModelHandler() {
+       super(COMMON_PART_LABEL);
+    }
+       
+    /**
+     * getQProperty converts the given property to qualified schema property
+     * @param prop
+     * @return
+     */
+    @Override
+    public String getQProperty(String prop) {
+        return ConceptAuthorityConstants.NUXEO_SCHEMA_NAME + ":" + prop;
+    }
+}
+
diff --git a/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptConstants.java b/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptConstants.java
new file mode 100644 (file)
index 0000000..6995b8f
--- /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.concept.nuxeo;
+
+/**
+ * ConceptConstants processes CollectionObject document
+ *
+ */
+public class ConceptConstants {
+
+    public final static String NUXEO_DOCTYPE = "Concept";
+    public final static String NUXEO_SCHEMA_NAME = "concept";
+    public final static String NUXEO_DC_TITLE = "CollectionSpace-Concept";
+}
diff --git a/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptDocumentModelHandler.java b/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptDocumentModelHandler.java
new file mode 100644 (file)
index 0000000..b67e02b
--- /dev/null
@@ -0,0 +1,66 @@
+/**
+ *  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.concept.nuxeo;
+
+import org.collectionspace.services.client.ConceptAuthorityClient;
+import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
+import org.collectionspace.services.concept.ConceptsCommon;
+
+/**
+ * ConceptDocumentModelHandler
+ *
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ */
+/**
+ * @author pschmitz
+ *
+ */
+public class ConceptDocumentModelHandler
+        extends AuthorityItemDocumentModelHandler<ConceptsCommon> {
+
+    public ConceptDocumentModelHandler() {
+       super(ConceptAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME);
+    }
+
+    @Override
+    public String getAuthorityServicePath(){
+        return ConceptAuthorityClient.SERVICE_PATH_COMPONENT;    //  CSPACE-3932
+    }
+       
+    /**
+     * Note that Concept has no displayName computation support.
+     */
+       
+    /**
+     * getQProperty converts the given property to qualified schema property
+     * @param prop
+     * @return
+     */
+    @Override
+    public String getQProperty(String prop) {
+        return ConceptConstants.NUXEO_SCHEMA_NAME + ":" + prop;
+    }
+}
+
diff --git a/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptValidatorHandler.java b/services/concept/service/src/main/java/org/collectionspace/services/concept/nuxeo/ConceptValidatorHandler.java
new file mode 100644 (file)
index 0000000..5fbe969
--- /dev/null
@@ -0,0 +1,94 @@
+/**
+ *  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.concept.nuxeo;
+
+import java.util.regex.Pattern;
+
+import org.collectionspace.services.concept.ConceptsCommon;
+import org.collectionspace.services.common.context.MultipartServiceContext;
+import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.document.DocumentHandler.Action;
+import org.collectionspace.services.common.document.InvalidDocumentException;
+import org.collectionspace.services.common.document.ValidatorHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * ConceptValidatorHandler
+ * 
+ * Validates data supplied when attempting to create and/or update Concept records.
+ * 
+ * $LastChangedRevision: $
+ * $LastChangedDate: $
+ */
+public class ConceptValidatorHandler implements ValidatorHandler {
+
+    final Logger logger = LoggerFactory.getLogger(ConceptValidatorHandler.class);
+    private static final Pattern shortIdBadPattern = Pattern.compile("[\\W]"); //.matcher(input).matches()
+
+    @Override
+    public void validate(Action action, ServiceContext ctx)
+            throws InvalidDocumentException {
+        if (logger.isDebugEnabled()) {
+            logger.debug("validate() action=" + action.name());
+        }
+        try {
+            MultipartServiceContext mctx = (MultipartServiceContext) ctx;
+            ConceptsCommon concept = (ConceptsCommon) mctx.getInputPart(mctx.getCommonPartLabel(),
+                    ConceptsCommon.class);
+            String msg = "";
+            boolean invalid = false;
+
+            // Validation occurring on both creates and updates
+            String displayName = concept.getDisplayName();
+            if (!concept.isDisplayNameComputed() && ((displayName == null) || displayName.trim().isEmpty())) {
+                invalid = true;
+                msg += "displayName must be non-null and non-blank if displayNameComputed is false";
+            }
+
+            // Validation specific to creates or updates
+            if (action.equals(Action.CREATE)) {
+                String shortId = concept.getShortIdentifier();
+                // Per CSPACE-2215, shortIdentifier values that are null (missing)
+                // oe the empty string are now legally accepted in create payloads.
+                // In either of those cases, a short identifier will be synthesized from
+                // a display name or supplied in another manner.
+                if ((shortId != null) && (shortIdBadPattern.matcher(shortId).find())) {
+                    invalid = true;
+                    msg += "shortIdentifier must only contain standard word characters";
+                }
+            } else if (action.equals(Action.UPDATE)) {
+            }
+
+            if (invalid) {
+                logger.error(msg);
+                throw new InvalidDocumentException(msg);
+            }
+        } catch (InvalidDocumentException ide) {
+            throw ide;
+        } catch (Exception e) {
+            throw new InvalidDocumentException(e);
+        }
+    }
+}
index a72e48426fa071059283ff592a9a25f12f054dca..9ff14e513ee86511c30f423b6ebbc1135e3b2848 100644 (file)
@@ -82,15 +82,6 @@ public class LocationAuthorityServiceTest extends AbstractAuthorityServiceTest<L
     
     // Instance variables specific to this test.
     
-//    /** The SERVICE path component. */
-//    final String SERVICE_PATH_COMPONENT = "locationauthorities";
-//    
-//    /** The ITEM service path component. */
-//    final String ITEM_SERVICE_PATH_COMPONENT = "items";
-//    
-//    /** The CONTACT service path component. */
-//    final String CONTACT_SERVICE_PATH_COMPONENT = "contacts";
-    
     final String TEST_NAME = "Shelf 1";
     final String TEST_SHORTID = "shelf1";
     final String TEST_CONDITION_NOTE = "Basically clean";
@@ -104,11 +95,7 @@ public class LocationAuthorityServiceTest extends AbstractAuthorityServiceTest<L
     final String TEST_STATUS = "Approved";
     
     /** The known resource id. */
-    private String knownResourceShortIdentifer = null;
-    private String knownResourceRefName = null;
-    
     private String knownLocationTypeRefName = null;
-    private String knownContactResourceId = null;
         
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
@@ -596,10 +583,6 @@ public class LocationAuthorityServiceTest extends AbstractAuthorityServiceTest<L
         nonexMap.put(LocationJAXBSchema.SHORT_IDENTIFIER, "nonEx");
         nonexMap.put(LocationJAXBSchema.LOCATION_TYPE, TEST_LOCATION_TYPE);
         nonexMap.put(LocationJAXBSchema.TERM_STATUS, TEST_STATUS);
-        // PoxPayloadOut multipart = 
-       // LocationAuthorityClientUtils.createLocationInstance(
-       //              LocationAuthorityClientUtils.createLocationRefName(knownResourceRefName, "nonEx", "Non Existent"), 
-       //              nonexMap, client.getItemCommonPartName() );
         final String EMPTY_REFNAME = "";
         PoxPayloadOut result = 
                 LocationAuthorityClientUtils.createLocationInstance(EMPTY_REFNAME, 
index a4599ef5033aceaff70af11d6e7050d6205166b9..d0ead7dde40bbf14c7456ef59ad1fefffeb4c1a1 100644 (file)
@@ -59,6 +59,7 @@
         <module>batch</module>
         <module>imports</module>
         <module>location</module>
+                               <module>concept</module>
         <module>taxonomy</module>
         <module>movement</module>
         <module>report</module>
index 083b707cf07db30819d4ab79099b80ebf66ba047..5910603aef48f18da10d0c4f7d8b81ff828cbd23 100644 (file)
             <artifactId>org.collectionspace.services.taxonomy.client</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.concept.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
 \r
       <!-- javax -->\r
 \r
index 2c394b3a325c12c80c90e0461af5f65f317512e6..9a5c0a6671271fb312694b2f238d9a3525e1d77f 100644 (file)
@@ -53,6 +53,7 @@ import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.client.OrgAuthorityClient;
 import org.collectionspace.services.client.LocationAuthorityClient;
 import org.collectionspace.services.client.TaxonomyAuthorityClient;
+import org.collectionspace.services.client.ConceptAuthorityClient;
 
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.jaxb.AbstractCommonList;
@@ -407,6 +408,8 @@ public class RelationDocumentModelHandler
                        common_schema = LocationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
                else if(docType.startsWith("Taxon"))
                        common_schema = TaxonomyAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+               else if(docType.startsWith("Conceptitem"))
+                       common_schema = ConceptAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
                //else leave it null.
        }
        return common_schema;