!!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
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;
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;
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;
@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;
+++ /dev/null
-/**
- * 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();
- }
-}
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;
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;
@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);
+++ /dev/null
-/**
- * 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);
- }
-}
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;
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;
@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);
+++ /dev/null
-/**
- * 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);
- }
-}
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>
@Override
public String getRepositoryClientName() {
- return serviceBinding.getRepositoryClient();
+ if(serviceBinding.getRepositoryClient() == null) {
+ return null;
+ }
+ return serviceBinding.getRepositoryClient().trim();
}
@Override
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();
*/
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
* 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());
+ }
+ }
}
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"/>
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;
@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);
+++ /dev/null
-/**
- * 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);
- }
-}
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;
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;
@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);
+++ /dev/null
-/**
- * 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);
- }
-}
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;
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;
@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);
+++ /dev/null
-/**
- * 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);
- }
-}
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;
*/
@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);
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) {
+++ /dev/null
-/**
- * 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);
- }
-}
+++ /dev/null
-/**
- * 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);
- }
-}
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;
*/
@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);
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) {
+++ /dev/null
-/**
- * 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);
- }
-}
+++ /dev/null
-/**
- * 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);
- }
-}
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;
@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);
+++ /dev/null
-/**
- * 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);
- }
-}
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;
@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;
*/
@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);
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) {
@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 {
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(
+++ /dev/null
-/**
- * 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);
- }
-}
+++ /dev/null
-/**
- * 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);
- }
-}