]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-787 As part of the work towards introducing the validation handlers, document...
authorSanjay Dalal <sanjay.dalal@berkeley.edu>
Wed, 27 Jan 2010 20:05:08 +0000 (20:05 +0000)
committerSanjay Dalal <sanjay.dalal@berkeley.edu>
Wed, 27 Jan 2010 20:05:08 +0000 (20:05 +0000)
!!THIS CHANGE REQUIRES TO HOTDEPLOY THE SERVICE LAYER AFTER COPYING THE TENANT BINDINGS TO THE CSPACE DOMAIN.!!

test: mvn test at service level

M    services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java
D    services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectHandlerFactory.java
M    services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java
D    services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionHandlerFactory.java
M    services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java
D    services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionHandlerFactory.java
M    services/common/src/main/java/org/collectionspace/services/common/context/ServiceContext.java
M    services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContext.java
M    services/common/src/main/java/org/collectionspace/services/common/document/DocumentHandlerFactory.java
M    services/common/src/main/config/tenant-bindings.xml
M    services/common/src/main/resources/service.xsd
M    services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java
D    services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactHandlerFactory.java
D    services/account/service/src/main/java/org/collectionspace/services/account/storage/AccountHandlerFactory.java
M    services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java
M    services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java
D    services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityHandlerFactory.java
D    services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationHandlerFactory.java
M    services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java
D    services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityHandlerFactory.java
D    services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonHandlerFactory.java
M    services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java
D    services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemHandlerFactory.java
D    services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyHandlerFactory.java
M    services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java
D    services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeHandlerFactory.java
M    services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java
D    services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationHandlerFactory.java

28 files changed:
services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java
services/account/service/src/main/java/org/collectionspace/services/account/storage/AccountHandlerFactory.java [deleted file]
services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java
services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionHandlerFactory.java [deleted file]
services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java
services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectHandlerFactory.java [deleted file]
services/common/src/main/config/tenant-bindings.xml
services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContext.java
services/common/src/main/java/org/collectionspace/services/common/context/ServiceContext.java
services/common/src/main/java/org/collectionspace/services/common/document/DocumentHandlerFactory.java
services/common/src/main/resources/service.xsd
services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java
services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactHandlerFactory.java [deleted file]
services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java
services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionHandlerFactory.java [deleted file]
services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java
services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeHandlerFactory.java [deleted file]
services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java
services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityHandlerFactory.java [deleted file]
services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationHandlerFactory.java [deleted file]
services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java
services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityHandlerFactory.java [deleted file]
services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonHandlerFactory.java [deleted file]
services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationHandlerFactory.java [deleted file]
services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java
services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyHandlerFactory.java [deleted file]
services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemHandlerFactory.java [deleted file]

index eb70332eda497cc421a4912775c127227cc43809..4cbf0f54a35d489f08de5b95284587120643575e 100644 (file)
@@ -31,7 +31,6 @@ import javax.ws.rs.DELETE;
 import javax.ws.rs.POST;
 import javax.ws.rs.PUT;
 import javax.ws.rs.PathParam;
-import javax.ws.rs.QueryParam;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MultivaluedMap;
@@ -39,7 +38,6 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
-import org.collectionspace.services.account.storage.AccountHandlerFactory;
 import org.collectionspace.services.account.storage.AccountStorageClient;
 import org.collectionspace.services.common.AbstractCollectionSpaceResource;
 import org.collectionspace.services.common.context.RemoteServiceContextImpl;
@@ -48,9 +46,9 @@ import org.collectionspace.services.common.document.BadRequestException;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.common.storage.StorageClient;
-import org.collectionspace.services.common.storage.jpa.JpaDocumentFilter;
 import org.jboss.resteasy.util.HttpResponseCodes;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -93,8 +91,8 @@ public class AccountResource
 
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = AccountHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         docHandler.setCommonPart(ctx.getInput());
         return docHandler;
diff --git a/services/account/service/src/main/java/org/collectionspace/services/account/storage/AccountHandlerFactory.java b/services/account/service/src/main/java/org/collectionspace/services/account/storage/AccountHandlerFactory.java
deleted file mode 100644 (file)
index 4e76ed0..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- *  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.account.storage;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-/**
- * CollectionObjectHandlerFactory creates handlers for collectionobject based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class AccountHandlerFactory implements DocumentHandlerFactory {
-
-    private static final AccountHandlerFactory self = new AccountHandlerFactory();
-
-    private AccountHandlerFactory() {
-    }
-
-    public static AccountHandlerFactory getInstance() {
-        return self;
-    }
-
-    @Override
-    public DocumentHandler getHandler(String clientType) {
-        return new AccountDocumentHandler();
-    }
-}
index 6a893d3e5662bc0c483e6c344f4599ca9e987679..eaab128527eb1ff3b9d779443836c10960b83526 100644 (file)
@@ -38,8 +38,6 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
-import org.collectionspace.services.acquisition.nuxeo.AcquisitionHandlerFactory;
-import org.collectionspace.services.acquisition.AcquisitionsCommonList;
 import org.collectionspace.services.common.AbstractCollectionSpaceResource;
 import org.collectionspace.services.common.context.MultipartServiceContext;
 import org.collectionspace.services.common.context.MultipartServiceContextFactory;
@@ -47,6 +45,7 @@ import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
@@ -79,8 +78,8 @@ public class AcquisitionResource
 
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = AcquisitionHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext) ctx).getInputPart(ctx.getCommonPartLabel(), AcquisitionsCommon.class);
diff --git a/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionHandlerFactory.java b/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionHandlerFactory.java
deleted file mode 100644 (file)
index 292719d..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.acquisition.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-/**
- * AcquisitionHandlerFactory creates handlers for acquisition based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class AcquisitionHandlerFactory  implements DocumentHandlerFactory {
-
-    private static final AcquisitionHandlerFactory self = new AcquisitionHandlerFactory();
-
-    private AcquisitionHandlerFactory() {
-    }
-
-    public static AcquisitionHandlerFactory getInstance() {
-        return self;
-    }
-
-    @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new AcquisitionDocumentModelHandler();
-        }
-        
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
index 79efa94a2249462349b5c7d51c94f61aeb17b7a2..caf3e1c69d62534625daf599b9cb982d99b3376d 100644 (file)
@@ -42,7 +42,6 @@ import javax.ws.rs.core.UriInfo;
 
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.collectionobject.nuxeo.CollectionObjectHandlerFactory;
 import org.collectionspace.services.common.AbstractCollectionSpaceResource;
 import org.collectionspace.services.common.context.MultipartServiceContext;
 import org.collectionspace.services.common.context.MultipartServiceContextFactory;
@@ -50,6 +49,7 @@ import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.DocumentFilter;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -80,8 +80,8 @@ public class CollectionObjectResource
 
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = CollectionObjectHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext) ctx).getInputPart(ctx.getCommonPartLabel(), CollectionobjectsCommon.class);
diff --git a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectHandlerFactory.java b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectHandlerFactory.java
deleted file mode 100644 (file)
index a1fb1f1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- *  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.collectionobject.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-/**
- * CollectionObjectHandlerFactory creates handlers for collectionobject based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class CollectionObjectHandlerFactory implements DocumentHandlerFactory {
-
-    private static final CollectionObjectHandlerFactory self = new CollectionObjectHandlerFactory();
-
-    private CollectionObjectHandlerFactory() {
-    }
-
-    public static CollectionObjectHandlerFactory getInstance() {
-        return self;
-    }
-
-    @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new CollectionObjectDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
index 1f4d291ecc183a1549f99a6c018c1bf224f98c9b..4c3b3ae69464e87a1111afcf5b422d066e9d8308 100644 (file)
@@ -5,44 +5,49 @@
     Description: tenant bindings
 -->
 <tenant:TenantBindingConfig  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
-   xmlns:tenant='http://collectionspace.org/services/common/tenant'
-   xsi:schemaLocation='http://collectionspace.org/services/common/tenant http://collectionspace.org/services/common/tenant.xsd'
-   >
+                             xmlns:tenant='http://collectionspace.org/services/common/tenant'
+                             xsi:schemaLocation='http://collectionspace.org/services/common/tenant http://collectionspace.org/services/common/tenant.xsd'
+                             >
     <!-- begin movingimages.us tenant meta-data -->
     <tenant:tenantBinding
         id="1" name="movingimages.us" displayName="Museum of Moving Images" version="0.1" repositoryDomain="default-domain">
         <tenant:serviceBindings name="CollectionObjects" version="0.1">
             <!-- begin collectionobject service meta-data -->
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.collectionobject.nuxeo.CollectionObjectDocumentModelHandler
+            </service:documentHandler>
             <service:object name="CollectionObject" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="collectionobjects-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="collectionobjects-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="collectionobjects_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="collectionobjects_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/collectionobject"
-                        schemaLocation="http://collectionspace.org/services/collectionobject http://services.collectionspace.org/collectionobject/collectionobjects_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/collectionobject"
+                            schemaLocation="http://collectionspace.org/services/collectionobject http://services.collectionspace.org/collectionobject/collectionobjects_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="2" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="collectionobjects_naturalhistory" updated="" order="2">
+                              versionable="true" auditable="false"
+                              label="collectionobjects_naturalhistory" updated="" order="2">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/collectionobject/domain/naturalhistory"
-                        schemaLocation="http://collectionspace.org/services/collectionobject/domain/naturalhistory http://collectionspace.org/services/collectionobject/domain/collectionobjects_naturalhistory.xsd">
+                            namespaceURI="http://collectionspace.org/services/collectionobject/domain/naturalhistory"
+                            schemaLocation="http://collectionspace.org/services/collectionobject/domain/naturalhistory http://collectionspace.org/services/collectionobject/domain/collectionobjects_naturalhistory.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!--end collectionobject service meta-data -->
         <!-- begin intake service meta-data -->
         <tenant:serviceBindings name="Intakes" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.intake.nuxeo.IntakeDocumentModelHandler
+            </service:documentHandler>
             <service:object name="Intake" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="intakes-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="intakes-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="intakes_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="intakes_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/intake"
-                        schemaLocation="http://collectionspace.org/services/intake http://services.collectionspace.org/intake/intakes_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/intake"
+                            schemaLocation="http://collectionspace.org/services/intake http://services.collectionspace.org/intake/intakes_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!-- end intake service meta-data -->
         <!-- begin vocabulary service meta-data -->
         <tenant:serviceBindings name="Vocabularies" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.vocabulary.nuxeo.VocabularyDocumentModelHandler
+            </service:documentHandler>
             <service:object name="Vocabulary" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="vocabularies-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="vocabularies-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="vocabularies_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="vocabularies_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/vocabulary"
-                        schemaLocation="http://collectionspace.org/services/vocabulary http://services.collectionspace.org/vocabulary/vocabularies_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/vocabulary"
+                            schemaLocation="http://collectionspace.org/services/vocabulary http://services.collectionspace.org/vocabulary/vocabularies_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
             </service:object>
         </tenant:serviceBindings>
         <!-- end vocabulary service meta-data -->
-               <!--
+                <!--
             begin vocabularyitem service meta-data.
-                       Note there is no Vocabularyitem service, but there is a
-                       Repository workspace so we have to configure that.
+                        Note there is no Vocabularyitem service, but there is a
+                        Repository workspace so we have to configure that.
         -->
         <tenant:serviceBindings name="Vocabularyitems" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.vocabulary.nuxeo.VocabularyItemDocumentModelHandler
+            </service:documentHandler>
             <service:object name="Vocabularyitem" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="vocabularyitems-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="vocabularyitems-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="vocabularyitems_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="vocabularyitems_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/vocabulary"
-                        schemaLocation="http://collectionspace.org/services/vocabulary http://services.collectionspace.org/vocabulary/vocabularyitems_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/vocabulary"
+                            schemaLocation="http://collectionspace.org/services/vocabulary http://services.collectionspace.org/vocabulary/vocabularyitems_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!-- end vocabulary service meta-data -->
         <!-- begin orgauthority service meta-data -->
         <tenant:serviceBindings name="Orgauthorities" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.organization.nuxeo.OrgAuthorityDocumentModelHandler
+            </service:documentHandler>
             <service:object id="1" name="Orgauthority" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="orgauthorities-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="orgauthorities-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="orgauthorities_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="orgauthorities_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/organization"
-                        schemaLocation="http://collectionspace.org/services/organization http://services.collectionspace.org/organization/orgauthorities_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/organization"
+                            schemaLocation="http://collectionspace.org/services/organization http://services.collectionspace.org/organization/orgauthorities_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
             </service:object>
         </tenant:serviceBindings>
         <!-- end orgauthority service meta-data -->
-                       <!-- begin organization service meta-data.
-                       Note there is no Organization service, but there is a
-                       Repository workspace so we have to configure that.
+                        <!-- begin organization service meta-data.
+                        Note there is no Organization service, but there is a
+                        Repository workspace so we have to configure that.
         -->
         <tenant:serviceBindings name="Organizations" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.organization.nuxeo.OrganizationDocumentModelHandler
+            </service:documentHandler>
             <service:object id="1" name="Organization" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="organizations-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="organizations-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="organizations_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="organizations_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/organization"
-                        schemaLocation="http://collectionspace.org/services/organization http://services.collectionspace.org/organization/organizations_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/organization"
+                            schemaLocation="http://collectionspace.org/services/organization http://services.collectionspace.org/organization/organizations_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!-- end organization service meta-data -->
         <!-- begin personauthority service meta-data -->
         <tenant:serviceBindings name="Personauthorities" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.person.nuxeo.PersonAuthorityDocumentModelHandler
+            </service:documentHandler>
             <service:object id="1" name="Personauthority" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="personauthorities-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="personauthorities-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="personauthorities_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="personauthorities_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/person"
-                        schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/personauthorities_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/person"
+                            schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/personauthorities_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
             </service:object>
         </tenant:serviceBindings>
         <!-- end personauthority service meta-data -->
-                       <!-- begin person service meta-data.
-                       Note there is no Person service, but there is a
-                       Repository workspace so we have to configure that.
+                        <!-- begin person service meta-data.
+                        Note there is no Person service, but there is a
+                        Repository workspace so we have to configure that.
         -->
         <tenant:serviceBindings name="Persons" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.person.nuxeo.PersonDocumentModelHandler
+            </service:documentHandler>
             <service:object id="1" name="Person" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="persons-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="persons-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="persons_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="persons_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/person"
-                        schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/persons_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/person"
+                            schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/persons_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!-- end person service meta-data -->
         <!-- begin acquisition service meta-data -->
         <tenant:serviceBindings name="Acquisitions" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.acquisition.nuxeo.AcquisitionDocumentModelHandler
+            </service:documentHandler>
             <service:object name="Acquisition" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="acquisitions-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="acquisitions-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="acquisitions_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="acquisitions_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/acquisition"
-                        schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/acquisition"
+                            schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!-- end acquisition service meta-data -->
         <!-- begin relation service meta-data -->
         <tenant:serviceBindings name="Relations" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.relation.nuxeo.RelationDocumentModelHandler
+            </service:documentHandler>
             <service:object name="Relation" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="relations-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="relations-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="relations_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="relations_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/relation"
-                        schemaLocation="http://collectionspace.org/services/relation http://services.collectionspace.org/relation/relations_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/relation"
+                            schemaLocation="http://collectionspace.org/services/relation http://services.collectionspace.org/relation/relations_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!-- end relation service meta-data -->
         <!-- begin account service meta-data -->
         <tenant:serviceBindings name="Accounts" version="0.1">
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.account.storage.AccountDocumentHandler
+            </service:documentHandler>
             <service:object name="Acccount" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="accounts_system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="accounts_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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="accounts_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="accounts_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/account"
-                        schemaLocation="http://collectionspace.org/services/account http://services.collectionspace.org/relation/accounts_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/account"
+                            schemaLocation="http://collectionspace.org/services/account http://services.collectionspace.org/relation/accounts_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!-- end account service meta-data -->
         <!-- begin dimension service meta-data -->
         <tenant:serviceBindings name="Dimensions" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.dimension.nuxeo.DimensionDocumentModelHandler
+            </service:documentHandler>
             <service:object name="Dimension" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="dimensions-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="dimensions-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="dimensions_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="dimensions_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/dimension"
-                        schemaLocation="http://collectionspace.org/services/dimension http://services.collectionspace.org/dimension/dimensions_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/dimension"
+                            schemaLocation="http://collectionspace.org/services/dimension http://services.collectionspace.org/dimension/dimensions_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
         <!-- end dimension service meta-data -->
         <!-- begin contact service meta-data -->
         <tenant:serviceBindings name="Contacts" version="0.1">
-            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>nuxeo-java</service:repositoryClient>
+            <service:repositoryClient xmlns:service='http://collectionspace.org/services/common/service'>
+                nuxeo-java
+            </service:repositoryClient>
+            <service:documentHandler xmlns:service='http://collectionspace.org/services/common/service'>
+                org.collectionspace.services.contact.nuxeo.ContactDocumentModelHandler
+            </service:documentHandler>
             <service:object name="Contact" version="0.1"
-            xmlns:service='http://collectionspace.org/services/common/service'>
+                            xmlns:service='http://collectionspace.org/services/common/service'>
                 <service:part id="0" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="contacts-system" updated="" order="0">
+                              versionable="true" auditable="false"
+                              label="contacts-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">
+                            namespaceURI="http://collectionspace.org/services/common/system"
+                            schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
                 <service:part id="1" control_group="Managed"
-                            versionable="true" auditable="false"
-                            label="contacts_common" updated="" order="1">
+                              versionable="true" auditable="false"
+                              label="contacts_common" updated="" order="1">
                     <service:content contentType="application/xml">
                         <service:xmlContent
-                        namespaceURI="http://collectionspace.org/services/contact"
-                        schemaLocation="http://collectionspace.org/services/contact http://services.collectionspace.org/contact/contacts_common.xsd">
+                            namespaceURI="http://collectionspace.org/services/contact"
+                            schemaLocation="http://collectionspace.org/services/contact http://services.collectionspace.org/contact/contacts_common.xsd">
                         </service:xmlContent>
                     </service:content>
                 </service:part>
index bbe86d97375bcadf7050dc654a0d6824acb137e2..7c43515813a3d4e3745059e3b1c8eb11f5b1fa88 100644 (file)
@@ -130,7 +130,10 @@ public abstract class AbstractServiceContext<IT, OT>
 
     @Override
     public String getRepositoryClientName() {
-        return serviceBinding.getRepositoryClient();
+        if(serviceBinding.getRepositoryClient() == null) {
+            return null;
+        }
+        return serviceBinding.getRepositoryClient().trim();
     }
 
     @Override
@@ -161,6 +164,19 @@ public abstract class AbstractServiceContext<IT, OT>
         return serviceBinding;
     }
 
+    @Override
+    public String getDocumentHandlerClass() {
+        if (serviceBinding.getDocumentHandler() == null
+                || serviceBinding.getDocumentHandler().isEmpty()) {
+            String msg = "Missing documentHandler in service binding for "
+                    + getServiceName() + " for tenant id=" + getTenantId()
+                    + " name=" + getTenantName();
+            logger.error(msg);
+            throw new IllegalStateException(msg);
+        }
+        return serviceBinding.getDocumentHandler().trim();
+    }
+
     @Override
     public String getServiceName() {
         return serviceBinding.getName();
index cbe2dd3ab8ab265a447d88ff03554201ef2d51fc..6ce74c0be91b6cda560fd77beeff754399fb9e80 100644 (file)
@@ -126,6 +126,12 @@ public interface ServiceContext<IT, OT> {
      */
     public String getRepositoryWorkspaceId();
 
+    /**
+     * getDocumentHandlerClass returns the class name for document handler
+     * @return class name of document handler
+     */
+    public String getDocumentHandlerClass();
+
     /**
      * Get input parts as received over the wire from service consumer
      * @return the input
index c02f838131ab37c065f6eed506203dde90e619b1..3bd6d758415ba403324ec0bb9b491d8616baea4e 100644 (file)
@@ -28,11 +28,31 @@ package org.collectionspace.services.common.document;
  * DocumentHandlerFactory creates document handler
  *
  */
-public interface DocumentHandlerFactory {
+public class DocumentHandlerFactory {
+
+    private static final DocumentHandlerFactory self = new DocumentHandlerFactory();
+
+    private DocumentHandlerFactory() {
+    }
+
+    public static DocumentHandlerFactory getInstance() {
+        return self;
+    }
 
     /**
      * getHandler returns a document handler. The factory may create a new
      * stateful handler or return an existing stateless handler.
+     * @param clazz name of the class to instantiate. The class should implement
+     * DocumentHandler
      */
-    public DocumentHandler getHandler(String clientType);
+    public DocumentHandler getHandler(String clazz)
+            throws ClassNotFoundException, InstantiationException, IllegalAccessException {
+        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
+        Class c = tccl.loadClass(clazz);
+        if (DocumentHandler.class.isAssignableFrom(c)) {
+            return (DocumentHandler) c.newInstance();
+        } else {
+            throw new IllegalArgumentException("Not of type " + DocumentHandler.class.getCanonicalName());
+        }
+    }
 }
index f08ff4175c610c9a07269825508948b78dea622a..a944daa641c864c6949c52a3d401cf4ce6434efb 100644 (file)
                  Derived from Fedora Digtial Object Model and MIME Multipart
 -->
 <xs:schema
-  xmlns:xs="http://www.w3.org/2001/XMLSchema"
-  xmlns="http://collectionspace.org/services/common/service"
-  xmlns:types="http://collectionspace.org/services/common/types"
-  targetNamespace="http://collectionspace.org/services/common/service"
-  version="0.1"
-  elementFormDefault="qualified"
->
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns="http://collectionspace.org/services/common/service"
+    xmlns:types="http://collectionspace.org/services/common/types"
+    targetNamespace="http://collectionspace.org/services/common/service"
+    version="0.1"
+    elementFormDefault="qualified"
+    >
 
     <xs:import namespace="http://collectionspace.org/services/common/types" schemaLocation="types.xsd" />
 
         <xs:sequence>
             <!-- object representation served by the service -->
             <xs:element name="object" type="ServiceObjectType" minOccurs="1" maxOccurs="1"/>
-
+            <!-- document handler to be used to process the content (need to be in classpath) -->
+            <xs:element name="documentHandler" type="xs:string" minOccurs="1" maxOccurs="1"/>
+            <!-- validator handler(s) to be used to validate the content (need to be in classpath) -->
+            <!-- validator handler is called for create (POST) and update (PUT) requests only -->
+            <xs:element name="validatorHandler" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+            <!-- event handler is called during prepare and complete document handler events -->
+            <!-- event handler is called for create, get, update, delete, index and search requests -->
+            <xs:element name="eventHandler" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
             <!-- name of the repository client (from service-config.xml) -->
             <xs:element name="repositoryClient" type="xs:string" minOccurs="0" maxOccurs="1"/>
             <!-- repositoryWorkspaceId could be workspace id -->
         </xs:attribute>
         <xs:attribute name="value" type="xs:string" use="required"/>
     </xs:complexType>
-    
+
     <xs:complexType name="XmlContentType">
         <xs:sequence>
             <xs:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="1"/>
index 803b145493790aac814f44318b1b6061b507120d..6879e24d8823f2ecfcb6f7bc115f1c6027080c28 100644 (file)
@@ -46,7 +46,7 @@ import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentHandler;
 
-import org.collectionspace.services.contact.nuxeo.ContactHandlerFactory;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
@@ -82,8 +82,8 @@ public class ContactResource extends AbstractCollectionSpaceResource {
 
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = ContactHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext)ctx).getInputPart(ctx.getCommonPartLabel(), ContactsCommon.class);
diff --git a/services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactHandlerFactory.java b/services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactHandlerFactory.java
deleted file mode 100644 (file)
index 8a91969..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- *  This document is a part of the source code and related artifacts
- *  for CollectionSpace, an open source collections management system
- *  for museums and related institutions:
-
- *  http://www.collectionspace.org
- *  http://wiki.collectionspace.org
-
- *  Copyright 2009 Regents of the University of California
-
- *  Licensed under the Educational Community License (ECL), Version 2.0.
- *  You may not use this file except in compliance with this License.
-
- *  You may obtain a copy of the ECL 2.0 License at
-
- *  https://source.collectionspace.org/collection-space/LICENSE.txt
-
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-package org.collectionspace.services.contact.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-/**
- * ContactHandlerFactory creates handlers for contact objects based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class ContactHandlerFactory implements DocumentHandlerFactory {
-
-    private static final ContactHandlerFactory self = new ContactHandlerFactory();
-
-    private ContactHandlerFactory() {
-    }
-
-    public static ContactHandlerFactory getInstance() {
-        return self;
-    }
-
-    @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new ContactDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
index 003b5856de1f9e81761a457c0f8005881a60ee5e..73ed3f3a967e02a639f07b10e525092cbf51889a 100644 (file)
@@ -40,7 +40,6 @@ import javax.ws.rs.core.UriInfo;
 import org.collectionspace.services.common.AbstractCollectionSpaceResource;
 import org.collectionspace.services.dimension.DimensionsCommonList.*;
 
-import org.collectionspace.services.dimension.nuxeo.DimensionHandlerFactory;
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.ServiceMain;
 import org.collectionspace.services.common.context.MultipartServiceContext;
@@ -48,6 +47,7 @@ import org.collectionspace.services.common.context.MultipartServiceContextFactor
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.util.HttpResponseCodes;
@@ -82,8 +82,8 @@ public class DimensionResource extends AbstractCollectionSpaceResource {
 
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = DimensionHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext)ctx).getInputPart(ctx.getCommonPartLabel(), DimensionsCommon.class);
diff --git a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionHandlerFactory.java b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionHandlerFactory.java
deleted file mode 100644 (file)
index 0742a2b..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- *  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.dimension.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-/**
- * IntakeHandlerFactory creates handlers for collectionobject based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class DimensionHandlerFactory  implements DocumentHandlerFactory {
-
-    private static final DimensionHandlerFactory self = new DimensionHandlerFactory();
-
-    private DimensionHandlerFactory() {
-    }
-
-    public static DimensionHandlerFactory getInstance() {
-        return self;
-    }
-
-    @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new DimensionDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
index e5772f47fbdf921e05356a3c210ef187f2fcfb4e..d84f4138c53736369019efcda44a7f6dc75ed9c0 100644 (file)
@@ -38,10 +38,8 @@ import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriInfo;
 
-import org.collectionspace.services.intake.IntakesCommonList;
 import org.collectionspace.services.common.AbstractCollectionSpaceResource;
 
-import org.collectionspace.services.intake.nuxeo.IntakeHandlerFactory;
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.ServiceMain;
 import org.collectionspace.services.common.context.MultipartServiceContext;
@@ -50,6 +48,7 @@ import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.query.QueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
@@ -87,8 +86,8 @@ public class IntakeResource extends AbstractCollectionSpaceResource {
 
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = IntakeHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext) ctx).getInputPart(ctx.getCommonPartLabel(), IntakesCommon.class);
diff --git a/services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeHandlerFactory.java b/services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeHandlerFactory.java
deleted file mode 100644 (file)
index 9e901be..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- *  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.intake.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-/**
- * IntakeHandlerFactory creates handlers for collectionobject based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class IntakeHandlerFactory  implements DocumentHandlerFactory {
-
-    private static final IntakeHandlerFactory self = new IntakeHandlerFactory();
-
-    private IntakeHandlerFactory() {
-    }
-
-    public static IntakeHandlerFactory getInstance() {
-        return self;
-    }
-
-    @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new IntakeDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
index 092cc6131dd038e14284f52619c1a3e7d62a70de..3826866d6007f074570e74815091817c63803a37 100644 (file)
@@ -48,12 +48,11 @@ import org.collectionspace.services.common.context.MultipartServiceContextFactor
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.organization.nuxeo.OrgAuthorityHandlerFactory;
 import org.collectionspace.services.organization.nuxeo.OrganizationDocumentModelHandler;
-import org.collectionspace.services.organization.nuxeo.OrganizationHandlerFactory;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.util.HttpResponseCodes;
@@ -100,8 +99,8 @@ public class OrgAuthorityResource extends AbstractCollectionSpaceResource {
      */
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = OrgAuthorityHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext) ctx).getInputPart(ctx.getCommonPartLabel(), OrgauthoritiesCommon.class);
@@ -115,8 +114,8 @@ public class OrgAuthorityResource extends AbstractCollectionSpaceResource {
     private DocumentHandler createItemDocumentHandler(
             ServiceContext ctx,
             String inAuthority) throws Exception {
-        DocumentHandler docHandler = OrganizationHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         ((OrganizationDocumentModelHandler) docHandler).setInAuthority(inAuthority);
         if (ctx.getInput() != null) {
diff --git a/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityHandlerFactory.java b/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityHandlerFactory.java
deleted file mode 100644 (file)
index b85cec6..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.organization.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-
-/**
- * OrgAuthorityHandlerFactory creates handlers for organization based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class OrgAuthorityHandlerFactory implements DocumentHandlerFactory {
-
-    private static final OrgAuthorityHandlerFactory self = new OrgAuthorityHandlerFactory();
-
-    private OrgAuthorityHandlerFactory() {
-    }
-
-    public static OrgAuthorityHandlerFactory getInstance() {
-        return self;
-    }
-
-               @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new OrgAuthorityDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
diff --git a/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationHandlerFactory.java b/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationHandlerFactory.java
deleted file mode 100644 (file)
index d756258..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.organization.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-
-/**
- * OrganizationHandlerFactory creates handlers for organization based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class OrganizationHandlerFactory implements DocumentHandlerFactory {
-
-    private static final OrganizationHandlerFactory self = new OrganizationHandlerFactory();
-
-    private OrganizationHandlerFactory() {
-    }
-
-    public static OrganizationHandlerFactory getInstance() {
-        return self;
-    }
-
-               @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new OrganizationDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
index 82415feadebe52c287eccf8ca04e3d49412c61c7..de99b0d5f0f6f23b4b35f15bd9dddb3061a16279 100644 (file)
@@ -48,12 +48,11 @@ import org.collectionspace.services.common.context.MultipartServiceContextFactor
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.person.nuxeo.PersonAuthorityHandlerFactory;
 import org.collectionspace.services.person.nuxeo.PersonDocumentModelHandler;
-import org.collectionspace.services.person.nuxeo.PersonHandlerFactory;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.util.HttpResponseCodes;
@@ -100,8 +99,8 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResource {
      */
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = PersonAuthorityHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext) ctx).getInputPart(ctx.getCommonPartLabel(), PersonauthoritiesCommon.class);
@@ -115,8 +114,8 @@ public class PersonAuthorityResource extends AbstractCollectionSpaceResource {
     private DocumentHandler createItemDocumentHandler(
             ServiceContext ctx,
             String inAuthority) throws Exception {
-        DocumentHandler docHandler = PersonHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         ((PersonDocumentModelHandler) docHandler).setInAuthority(inAuthority);
         if (ctx.getInput() != null) {
diff --git a/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityHandlerFactory.java b/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityHandlerFactory.java
deleted file mode 100644 (file)
index 3f58b47..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.person.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-
-/**
- * PersonAuthorityHandlerFactory creates handlers for person based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class PersonAuthorityHandlerFactory implements DocumentHandlerFactory {
-
-    private static final PersonAuthorityHandlerFactory self = new PersonAuthorityHandlerFactory();
-
-    private PersonAuthorityHandlerFactory() {
-    }
-
-    public static PersonAuthorityHandlerFactory getInstance() {
-        return self;
-    }
-
-               @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new PersonAuthorityDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
diff --git a/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonHandlerFactory.java b/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonHandlerFactory.java
deleted file mode 100644 (file)
index 8b680ea..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.person.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-
-/**
- * PersonHandlerFactory creates handlers for person based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class PersonHandlerFactory implements DocumentHandlerFactory {
-
-    private static final PersonHandlerFactory self = new PersonHandlerFactory();
-
-    private PersonHandlerFactory() {
-    }
-
-    public static PersonHandlerFactory getInstance() {
-        return self;
-    }
-
-               @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new PersonDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
index cc8c4b59c33c620ee1a20e3ff6a68a3662f557db..c7c2d3909bdc907523a3c91e392da76579747b0a 100644 (file)
@@ -50,8 +50,8 @@ import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.relation.IRelationsManager;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.collectionspace.services.common.security.UnauthorizedException;
-import org.collectionspace.services.relation.nuxeo.RelationHandlerFactory;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.util.HttpResponseCodes;
@@ -80,8 +80,8 @@ public class NewRelationResource extends AbstractCollectionSpaceResource {
 
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = RelationHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext) ctx).getInputPart(ctx.getCommonPartLabel(), RelationsCommon.class);
diff --git a/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationHandlerFactory.java b/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationHandlerFactory.java
deleted file mode 100644 (file)
index c669118..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.relation.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-/**
- * CollectionObjectHandlerFactory creates handlers for collectionobject based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class RelationHandlerFactory  implements DocumentHandlerFactory {
-
-    private static final RelationHandlerFactory self = new RelationHandlerFactory();
-
-    private RelationHandlerFactory() {
-    }
-
-    public static RelationHandlerFactory getInstance() {
-        return self;
-    }
-
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new RelationDocumentModelHandler();
-//        } else if(ClientType.REST.toString().equals(clientType)) {
-//            return new RelationRepresenationHandler();
-        }
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
index 14e2c803763f68515392d4194ada69156eb7c87c..6360a229fd50b7c6a04b21d3e85dc678e87afc77 100644 (file)
@@ -48,13 +48,11 @@ import org.collectionspace.services.common.context.MultipartServiceContextFactor
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
+import org.collectionspace.services.common.document.DocumentHandlerFactory;
 import org.collectionspace.services.common.document.DocumentNotFoundException;
-import org.collectionspace.services.common.query.IQueryManager;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.collectionspace.services.common.query.IQueryManager;
-import org.collectionspace.services.vocabulary.nuxeo.VocabularyHandlerFactory;
 import org.collectionspace.services.vocabulary.nuxeo.VocabularyItemDocumentModelHandler;
-import org.collectionspace.services.vocabulary.nuxeo.VocabularyItemHandlerFactory;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
 import org.jboss.resteasy.util.HttpResponseCodes;
@@ -78,11 +76,11 @@ public class VocabularyResource extends AbstractCollectionSpaceResource {
 
     @Override
     protected String getVersionString() {
-       /** The last change revision. */
-       final String lastChangeRevision = "$LastChangedRevision$";
-       return lastChangeRevision;
+        /** The last change revision. */
+        final String lastChangeRevision = "$LastChangedRevision$";
+        return lastChangeRevision;
     }
-    
+
     @Override
     public String getServiceName() {
         return vocabularyServiceName;
@@ -101,8 +99,8 @@ public class VocabularyResource extends AbstractCollectionSpaceResource {
      */
     @Override
     public DocumentHandler createDocumentHandler(ServiceContext ctx) throws Exception {
-        DocumentHandler docHandler = VocabularyHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         if (ctx.getInput() != null) {
             Object obj = ((MultipartServiceContext) ctx).getInputPart(ctx.getCommonPartLabel(), VocabulariesCommon.class);
@@ -116,8 +114,8 @@ public class VocabularyResource extends AbstractCollectionSpaceResource {
     private DocumentHandler createItemDocumentHandler(
             ServiceContext ctx,
             String inVocabulary) throws Exception {
-        DocumentHandler docHandler = VocabularyItemHandlerFactory.getInstance().getHandler(
-                ctx.getRepositoryClientType().toString());
+        DocumentHandler docHandler = DocumentHandlerFactory.getInstance().getHandler(
+                ctx.getDocumentHandlerClass());
         docHandler.setServiceContext(ctx);
         ((VocabularyItemDocumentModelHandler) docHandler).setInVocabulary(inVocabulary);
         if (ctx.getInput() != null) {
@@ -407,7 +405,7 @@ public class VocabularyResource extends AbstractCollectionSpaceResource {
     @Produces("application/xml")
     public VocabularyitemsCommonList getVocabularyItemList(
             @PathParam("csid") String parentcsid,
-            @QueryParam (IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
+            @QueryParam(IQueryManager.SEARCH_TYPE_PARTIALTERM) String partialTerm,
             @Context UriInfo ui) {
         VocabularyitemsCommonList vocabularyItemObjectList = new VocabularyitemsCommonList();
         try {
@@ -419,28 +417,28 @@ public class VocabularyResource extends AbstractCollectionSpaceResource {
             myFilter.setPagination(queryParams);
             // "vocabularyitems_common:inVocabulary='" + parentcsid + "'");
             myFilter.setWhereClause(
-                       VocabularyItemJAXBSchema.VOCABULARYITEMS_COMMON + ":" +
-                       VocabularyItemJAXBSchema.IN_VOCABULARY + "=" +
-                       "'" + parentcsid + "'");
-            
+                    VocabularyItemJAXBSchema.VOCABULARYITEMS_COMMON + ":"
+                    + VocabularyItemJAXBSchema.IN_VOCABULARY + "="
+                    + "'" + parentcsid + "'");
+
             // AND vocabularyitems_common:displayName LIKE '%partialTerm%'
             if (partialTerm != null && !partialTerm.isEmpty()) {
-               String ptClause = "AND " +
-                       VocabularyItemJAXBSchema.VOCABULARYITEMS_COMMON + ":" +
-                       VocabularyItemJAXBSchema.DISPLAY_NAME +
-                       " LIKE " +
-                       "'%" + partialTerm + "%'";
-               myFilter.appendWhereClause(ptClause);
+                String ptClause = "AND "
+                        + VocabularyItemJAXBSchema.VOCABULARYITEMS_COMMON + ":"
+                        + VocabularyItemJAXBSchema.DISPLAY_NAME
+                        + " LIKE "
+                        + "'%" + partialTerm + "%'";
+                myFilter.appendWhereClause(ptClause);
             }
-            
+
             if (logger.isDebugEnabled()) {
-               logger.debug("getVocabularyItemList filtered WHERE clause: " +
-                               myFilter.getWhereClause());
+                logger.debug("getVocabularyItemList filtered WHERE clause: "
+                        + myFilter.getWhereClause());
             }
-            
+
             handler.setDocumentFilter(myFilter);
             getRepositoryClient(ctx).getFiltered(ctx, handler);
-            
+
             vocabularyItemObjectList = (VocabularyitemsCommonList) handler.getCommonPartList();
         } catch (UnauthorizedException ue) {
             Response response = Response.status(
diff --git a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyHandlerFactory.java b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyHandlerFactory.java
deleted file mode 100644 (file)
index 9ee43b3..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.vocabulary.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-
-/**
- * VocabularyHandlerFactory creates handlers for vocabulary based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class VocabularyHandlerFactory implements DocumentHandlerFactory {
-
-    private static final VocabularyHandlerFactory self = new VocabularyHandlerFactory();
-
-    private VocabularyHandlerFactory() {
-    }
-
-    public static VocabularyHandlerFactory getInstance() {
-        return self;
-    }
-
-               @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new VocabularyDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}
diff --git a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemHandlerFactory.java b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemHandlerFactory.java
deleted file mode 100644 (file)
index c973f18..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  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.vocabulary.nuxeo;
-
-import org.collectionspace.services.common.ClientType;
-import org.collectionspace.services.common.document.DocumentHandler;
-import org.collectionspace.services.common.document.DocumentHandlerFactory;
-
-
-/**
- * VocabularyItemHandlerFactory creates handlers for vocabularyitem based
- * on type of Nuxeo client used
- *
- * $LastChangedRevision: $
- * $LastChangedDate: $
- */
-public class VocabularyItemHandlerFactory implements DocumentHandlerFactory {
-
-    private static final VocabularyItemHandlerFactory self = new VocabularyItemHandlerFactory();
-
-    private VocabularyItemHandlerFactory() {
-    }
-
-    public static VocabularyItemHandlerFactory getInstance() {
-        return self;
-    }
-
-               @Override
-    public DocumentHandler getHandler(String clientType) {
-        if(ClientType.JAVA.toString().equals(clientType)){
-            return new VocabularyItemDocumentModelHandler();
-        } 
-        throw new IllegalArgumentException("Not supported client=" + clientType);
-    }
-}