From 11ec28c89d6a64dedd7bede972925fbb5a368a04 Mon Sep 17 00:00:00 2001 From: Sanjay Dalal Date: Wed, 27 Jan 2010 20:05:08 +0000 Subject: [PATCH] CSPACE-787 As part of the work towards introducing the validation handlers, document handler configuration should be externalized in service binding as well. This checkin removes all service specific document handler factories (phew, one less class to implement!). Service binding now includes the name of the documenthandler class to use. A single non-abstract DocumentHandlerFacotry is used to create document handler based on the class name provided from the service binding. The document handler classes need to be in classpath of cspace-services.war. !!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 --- .../services/account/AccountResource.java | 8 +- .../storage/AccountHandlerFactory.java | 52 --- .../acquisition/AcquisitionResource.java | 7 +- .../nuxeo/AcquisitionHandlerFactory.java | 56 --- .../CollectionObjectResource.java | 6 +- .../nuxeo/CollectionObjectHandlerFactory.java | 55 --- .../src/main/config/tenant-bindings.xml | 353 +++++++++++------- .../context/AbstractServiceContext.java | 18 +- .../common/context/ServiceContext.java | 6 + .../document/DocumentHandlerFactory.java | 24 +- .../common/src/main/resources/service.xsd | 25 +- .../services/contact/ContactResource.java | 6 +- .../contact/nuxeo/ContactHandlerFactory.java | 55 --- .../services/dimension/DimensionResource.java | 6 +- .../nuxeo/DimensionHandlerFactory.java | 55 --- .../services/intake/IntakeResource.java | 7 +- .../intake/nuxeo/IntakeHandlerFactory.java | 55 --- .../organization/OrgAuthorityResource.java | 11 +- .../nuxeo/OrgAuthorityHandlerFactory.java | 56 --- .../nuxeo/OrganizationHandlerFactory.java | 56 --- .../person/PersonAuthorityResource.java | 11 +- .../nuxeo/PersonAuthorityHandlerFactory.java | 56 --- .../person/nuxeo/PersonHandlerFactory.java | 56 --- .../relation/NewRelationResource.java | 6 +- .../nuxeo/RelationHandlerFactory.java | 56 --- .../vocabulary/VocabularyResource.java | 52 ++- .../nuxeo/VocabularyHandlerFactory.java | 56 --- .../nuxeo/VocabularyItemHandlerFactory.java | 56 --- 28 files changed, 325 insertions(+), 941 deletions(-) delete mode 100644 services/account/service/src/main/java/org/collectionspace/services/account/storage/AccountHandlerFactory.java delete mode 100644 services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionHandlerFactory.java delete mode 100644 services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectHandlerFactory.java delete mode 100644 services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactHandlerFactory.java delete mode 100644 services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionHandlerFactory.java delete mode 100644 services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeHandlerFactory.java delete mode 100644 services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityHandlerFactory.java delete mode 100644 services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationHandlerFactory.java delete mode 100644 services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityHandlerFactory.java delete mode 100644 services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonHandlerFactory.java delete mode 100644 services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationHandlerFactory.java delete mode 100644 services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyHandlerFactory.java delete mode 100644 services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemHandlerFactory.java diff --git a/services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java b/services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java index eb70332ed..4cbf0f54a 100644 --- a/services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java +++ b/services/account/service/src/main/java/org/collectionspace/services/account/AccountResource.java @@ -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 index 4e76ed084..000000000 --- a/services/account/service/src/main/java/org/collectionspace/services/account/storage/AccountHandlerFactory.java +++ /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(); - } -} diff --git a/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java b/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java index 6a893d3e5..eaab12852 100644 --- a/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java +++ b/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/AcquisitionResource.java @@ -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 index 292719d08..000000000 --- a/services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionHandlerFactory.java +++ /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); - } -} diff --git a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java index 79efa94a2..caf3e1c69 100644 --- a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java +++ b/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/CollectionObjectResource.java @@ -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 index a1fb1f111..000000000 --- a/services/collectionobject/service/src/main/java/org/collectionspace/services/collectionobject/nuxeo/CollectionObjectHandlerFactory.java +++ /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); - } -} diff --git a/services/common/src/main/config/tenant-bindings.xml b/services/common/src/main/config/tenant-bindings.xml index 1f4d291ec..4c3b3ae69 100644 --- a/services/common/src/main/config/tenant-bindings.xml +++ b/services/common/src/main/config/tenant-bindings.xml @@ -5,44 +5,49 @@ Description: tenant bindings --> + xmlns:tenant='http://collectionspace.org/services/common/tenant' + xsi:schemaLocation='http://collectionspace.org/services/common/tenant http://collectionspace.org/services/common/tenant.xsd' + > - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.collectionobject.nuxeo.CollectionObjectDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="collectionobjects-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="collectionobjects_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/collectionobject" + schemaLocation="http://collectionspace.org/services/collectionobject http://services.collectionspace.org/collectionobject/collectionobjects_common.xsd"> + versionable="true" auditable="false" + label="collectionobjects_naturalhistory" updated="" order="2"> + 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"> @@ -51,26 +56,31 @@ - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.intake.nuxeo.IntakeDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="intakes-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="intakes_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/intake" + schemaLocation="http://collectionspace.org/services/intake http://services.collectionspace.org/intake/intakes_common.xsd"> @@ -79,58 +89,68 @@ - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.vocabulary.nuxeo.VocabularyDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="vocabularies-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="vocabularies_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/vocabulary" + schemaLocation="http://collectionspace.org/services/vocabulary http://services.collectionspace.org/vocabulary/vocabularies_common.xsd"> - - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.vocabulary.nuxeo.VocabularyItemDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="vocabularyitems-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="vocabularyitems_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/vocabulary" + schemaLocation="http://collectionspace.org/services/vocabulary http://services.collectionspace.org/vocabulary/vocabularyitems_common.xsd"> @@ -139,57 +159,67 @@ - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.organization.nuxeo.OrgAuthorityDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="orgauthorities-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="orgauthorities_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/organization" + schemaLocation="http://collectionspace.org/services/organization http://services.collectionspace.org/organization/orgauthorities_common.xsd"> - - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.organization.nuxeo.OrganizationDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="organizations-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="organizations_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/organization" + schemaLocation="http://collectionspace.org/services/organization http://services.collectionspace.org/organization/organizations_common.xsd"> @@ -198,57 +228,67 @@ - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.person.nuxeo.PersonAuthorityDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="personauthorities-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="personauthorities_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/person" + schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/personauthorities_common.xsd"> - - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.person.nuxeo.PersonDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="persons-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="persons_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/person" + schemaLocation="http://collectionspace.org/services/person http://services.collectionspace.org/person/persons_common.xsd"> @@ -257,26 +297,31 @@ - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.acquisition.nuxeo.AcquisitionDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="acquisitions-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="acquisitions_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/acquisition" + schemaLocation="http://collectionspace.org/services/acquisition http://services.collectionspace.org/acquisition/acquisitions_common.xsd"> @@ -285,26 +330,31 @@ - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.relation.nuxeo.RelationDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="relations-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="relations_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/relation" + schemaLocation="http://collectionspace.org/services/relation http://services.collectionspace.org/relation/relations_common.xsd"> @@ -313,25 +363,28 @@ + + org.collectionspace.services.account.storage.AccountDocumentHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="accounts_system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="accounts_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/account" + schemaLocation="http://collectionspace.org/services/account http://services.collectionspace.org/relation/accounts_common.xsd"> @@ -340,26 +393,31 @@ - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.dimension.nuxeo.DimensionDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="dimensions-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="dimensions_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/dimension" + schemaLocation="http://collectionspace.org/services/dimension http://services.collectionspace.org/dimension/dimensions_common.xsd"> @@ -368,26 +426,31 @@ - nuxeo-java + + nuxeo-java + + + org.collectionspace.services.contact.nuxeo.ContactDocumentModelHandler + + xmlns:service='http://collectionspace.org/services/common/service'> + versionable="true" auditable="false" + label="contacts-system" updated="" order="0"> + namespaceURI="http://collectionspace.org/services/common/system" + schemaLocation="http://collectionspace.org/services/common/system http://collectionspace.org/services/common/system/system-response.xsd"> + versionable="true" auditable="false" + label="contacts_common" updated="" order="1"> + namespaceURI="http://collectionspace.org/services/contact" + schemaLocation="http://collectionspace.org/services/contact http://services.collectionspace.org/contact/contacts_common.xsd"> diff --git a/services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContext.java b/services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContext.java index bbe86d973..7c4351581 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContext.java +++ b/services/common/src/main/java/org/collectionspace/services/common/context/AbstractServiceContext.java @@ -130,7 +130,10 @@ public abstract class AbstractServiceContext @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 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(); diff --git a/services/common/src/main/java/org/collectionspace/services/common/context/ServiceContext.java b/services/common/src/main/java/org/collectionspace/services/common/context/ServiceContext.java index cbe2dd3ab..6ce74c0be 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/context/ServiceContext.java +++ b/services/common/src/main/java/org/collectionspace/services/common/context/ServiceContext.java @@ -126,6 +126,12 @@ public interface ServiceContext { */ 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 diff --git a/services/common/src/main/java/org/collectionspace/services/common/document/DocumentHandlerFactory.java b/services/common/src/main/java/org/collectionspace/services/common/document/DocumentHandlerFactory.java index c02f83813..3bd6d7584 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/document/DocumentHandlerFactory.java +++ b/services/common/src/main/java/org/collectionspace/services/common/document/DocumentHandlerFactory.java @@ -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()); + } + } } diff --git a/services/common/src/main/resources/service.xsd b/services/common/src/main/resources/service.xsd index f08ff4175..a944daa64 100644 --- a/services/common/src/main/resources/service.xsd +++ b/services/common/src/main/resources/service.xsd @@ -20,13 +20,13 @@ Derived from Fedora Digtial Object Model and MIME Multipart --> + 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" + > @@ -34,7 +34,14 @@ - + + + + + + + + @@ -137,7 +144,7 @@ - + diff --git a/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java b/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java index 803b14549..6879e24d8 100644 --- a/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java +++ b/services/contact/service/src/main/java/org/collectionspace/services/contact/ContactResource.java @@ -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 index 8a9196996..000000000 --- a/services/contact/service/src/main/java/org/collectionspace/services/contact/nuxeo/ContactHandlerFactory.java +++ /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); - } -} diff --git a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java index 003b5856d..73ed3f3a9 100644 --- a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java +++ b/services/dimension/service/src/main/java/org/collectionspace/services/dimension/DimensionResource.java @@ -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 index 0742a2b07..000000000 --- a/services/dimension/service/src/main/java/org/collectionspace/services/dimension/nuxeo/DimensionHandlerFactory.java +++ /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); - } -} diff --git a/services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java b/services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java index e5772f47f..d84f4138c 100644 --- a/services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java +++ b/services/intake/service/src/main/java/org/collectionspace/services/intake/IntakeResource.java @@ -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 index 9e901be19..000000000 --- a/services/intake/service/src/main/java/org/collectionspace/services/intake/nuxeo/IntakeHandlerFactory.java +++ /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); - } -} diff --git a/services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java b/services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java index 092cc6131..3826866d6 100644 --- a/services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java +++ b/services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java @@ -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 index b85cec657..000000000 --- a/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrgAuthorityHandlerFactory.java +++ /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 index d756258c0..000000000 --- a/services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationHandlerFactory.java +++ /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); - } -} diff --git a/services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java b/services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java index 82415fead..de99b0d5f 100644 --- a/services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java +++ b/services/person/service/src/main/java/org/collectionspace/services/person/PersonAuthorityResource.java @@ -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 index 3f58b471d..000000000 --- a/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonAuthorityHandlerFactory.java +++ /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 index 8b680eac3..000000000 --- a/services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonHandlerFactory.java +++ /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); - } -} diff --git a/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java b/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java index cc8c4b59c..c7c2d3909 100644 --- a/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java +++ b/services/relation/service/src/main/java/org/collectionspace/services/relation/NewRelationResource.java @@ -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 index c669118ac..000000000 --- a/services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationHandlerFactory.java +++ /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); - } -} diff --git a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java index 14e2c8037..6360a229f 100644 --- a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java +++ b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java @@ -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 index 9ee43b31e..000000000 --- a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyHandlerFactory.java +++ /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 index c973f1894..000000000 --- a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemHandlerFactory.java +++ /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); - } -} -- 2.47.3