From: Michael Ritter Date: Wed, 24 Feb 2021 19:05:31 +0000 (-0700) Subject: DRYD-944: Create insurance/indemnity procedure X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=2528b00fe31675df4d8827388ac0898ddd231b28;p=tmp%2Fjakarta-migration.git DRYD-944: Create insurance/indemnity procedure --- diff --git a/services/JaxRsServiceProvider/pom.xml b/services/JaxRsServiceProvider/pom.xml index 5347caf72..ff435a65e 100644 --- a/services/JaxRsServiceProvider/pom.xml +++ b/services/JaxRsServiceProvider/pom.xml @@ -183,6 +183,11 @@ org.collectionspace.services.id.service ${project.version} + + org.collectionspace.services + org.collectionspace.services.insurance.service + ${project.version} + org.collectionspace.services org.collectionspace.services.intake.service diff --git a/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java b/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java index 414eab9e8..a67670a6b 100644 --- a/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java +++ b/services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java @@ -27,6 +27,7 @@ import org.collectionspace.services.account.TenantResource; import org.collectionspace.services.blob.BlobResource; import org.collectionspace.services.collectionobject.CollectionObjectResource; import org.collectionspace.services.id.IDResource; +import org.collectionspace.services.insurance.InsuranceResource; import org.collectionspace.services.media.MediaResource; import org.collectionspace.services.group.GroupResource; import org.collectionspace.services.intake.IntakeResource; @@ -132,6 +133,7 @@ public class CollectionSpaceJaxRsApplication extends Application addResourceToMapAndSingletons(new ContactResource()); addResourceToMapAndSingletons(new CollectionObjectResource()); addResourceToMapAndSingletons(new GroupResource()); + addResourceToMapAndSingletons(new InsuranceResource()); addResourceToMapAndSingletons(new IntakeResource()); addResourceToMapAndSingletons(new DimensionResource()); addResourceToMapAndSingletons(new RelationResource()); diff --git a/services/common/src/main/resources/db/postgresql/load_id_generators.sql b/services/common/src/main/resources/db/postgresql/load_id_generators.sql index 22bc96f55..22a36a18d 100644 --- a/services/common/src/main/resources/db/postgresql/load_id_generators.sql +++ b/services/common/src/main/resources/db/postgresql/load_id_generators.sql @@ -982,4 +982,75 @@ INSERT INTO id_generators ( SELECT csid FROM id_generators - ); \ No newline at end of file + ); +-- INSURANCE_REFERENCE_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + SELECT + 'e6f52346-0d2c-4b68-8a35-0a27dad2f3f4', + 'Insurance Reference Number', + 'Identifies an insurance.', + '9', + '', +' + + + INS + INS + + + + + + . + . + + + 6 + 1 + -1 + + +' + WHERE 'e6f52346-0d2c-4b68-8a35-0a27dad2f3f4' NOT IN + ( + SELECT csid + FROM id_generators + ); + +-- INDEMNITY_REFERENCE_NUMBER + +INSERT INTO id_generators + (csid, displayname, description, priority, last_generated_id, id_generator_state) + SELECT + '26583488-7cb4-42b5-a8e2-4db005c8f5ef', + 'Indemnity Reference Number', + 'Identifies an indemnity.', + '9', + '', +' + + + IND + IND + + + + + + . + . + + + 6 + 1 + -1 + + +' + WHERE '26583488-7cb4-42b5-a8e2-4db005c8f5ef' NOT IN + ( + SELECT csid + FROM id_generators + ); diff --git a/services/insurance/3rdparty/build.xml b/services/insurance/3rdparty/build.xml new file mode 100644 index 000000000..3ce9e7beb --- /dev/null +++ b/services/insurance/3rdparty/build.xml @@ -0,0 +1,130 @@ + + + insurance service 3rdparty + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/insurance/3rdparty/nuxeo-platform-cs-insurance/build.xml b/services/insurance/3rdparty/nuxeo-platform-cs-insurance/build.xml new file mode 100644 index 000000000..96e724997 --- /dev/null +++ b/services/insurance/3rdparty/nuxeo-platform-cs-insurance/build.xml @@ -0,0 +1,161 @@ + + + + insurance nuxeo document type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/insurance/3rdparty/nuxeo-platform-cs-insurance/pom.xml b/services/insurance/3rdparty/nuxeo-platform-cs-insurance/pom.xml new file mode 100644 index 000000000..6b275726d --- /dev/null +++ b/services/insurance/3rdparty/nuxeo-platform-cs-insurance/pom.xml @@ -0,0 +1,54 @@ + + + + org.collectionspace.services + org.collectionspace.services.insurance.3rdparty + ${revision} + + + 4.0.0 + org.collectionspace.services.insurance.3rdparty.nuxeo + services.insurance.3rdparty.nuxeo + jar + + Insurance Nuxeo Document Type + + + + insurance + Insurance + insurances_common + cs_default + + + + + + src/main/resources + true + + + ../../../../3rdparty/nuxeo/nuxeo-doctype/src/main/resources + true + + + + + org.apache.maven.plugins + maven-jar-plugin + + + target/classes/META-INF/MANIFEST.MF + + ${eclipseVersion} + 2 + + + + + + + + diff --git a/services/insurance/3rdparty/nuxeo-platform-cs-insurance/src/main/resources/OSGI-INF/README.txt b/services/insurance/3rdparty/nuxeo-platform-cs-insurance/src/main/resources/OSGI-INF/README.txt new file mode 100644 index 000000000..5f304de86 --- /dev/null +++ b/services/insurance/3rdparty/nuxeo-platform-cs-insurance/src/main/resources/OSGI-INF/README.txt @@ -0,0 +1,16 @@ +Files formerly located in this directory are no longer needed +------------------------------------------------------------- + +In CollectionSpace versions 4.0 and higher, changes were introduced +which streamline and simplify the process through which you configure +fields in CollectionSpace's main record types. + +In most cases now, you will typically change the behavior of existing fields, +or create extension schemas to add new fields specific to your museum and/or +community of practice, merely by editing simpler XML-based configuration +files within CollectionSpace's Application layer. + +Services layer files that were formerly located in this directory and +other, similar directories - which you previously needed to manually +create or edit - are now generated automatically from your configuration +in the Application layer. diff --git a/services/insurance/3rdparty/nuxeo-platform-cs-insurance/src/main/resources/schemas/README.txt b/services/insurance/3rdparty/nuxeo-platform-cs-insurance/src/main/resources/schemas/README.txt new file mode 100644 index 000000000..5f304de86 --- /dev/null +++ b/services/insurance/3rdparty/nuxeo-platform-cs-insurance/src/main/resources/schemas/README.txt @@ -0,0 +1,16 @@ +Files formerly located in this directory are no longer needed +------------------------------------------------------------- + +In CollectionSpace versions 4.0 and higher, changes were introduced +which streamline and simplify the process through which you configure +fields in CollectionSpace's main record types. + +In most cases now, you will typically change the behavior of existing fields, +or create extension schemas to add new fields specific to your museum and/or +community of practice, merely by editing simpler XML-based configuration +files within CollectionSpace's Application layer. + +Services layer files that were formerly located in this directory and +other, similar directories - which you previously needed to manually +create or edit - are now generated automatically from your configuration +in the Application layer. diff --git a/services/insurance/3rdparty/pom.xml b/services/insurance/3rdparty/pom.xml new file mode 100644 index 000000000..6eb281f12 --- /dev/null +++ b/services/insurance/3rdparty/pom.xml @@ -0,0 +1,24 @@ + + + org.collectionspace.services.insurance + org.collectionspace.services + ${revision} + + + 4.0.0 + org.collectionspace.services.insurance.3rdparty + services.insurance.3rdparty + pom + + + 3rd party build for insurance service + + + + + + diff --git a/services/insurance/build.xml b/services/insurance/build.xml new file mode 100644 index 000000000..46356d770 --- /dev/null +++ b/services/insurance/build.xml @@ -0,0 +1,124 @@ + + + + insurance service + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/services/insurance/client/pom.xml b/services/insurance/client/pom.xml new file mode 100644 index 000000000..180b9d413 --- /dev/null +++ b/services/insurance/client/pom.xml @@ -0,0 +1,81 @@ + + + + org.collectionspace.services + org.collectionspace.services.insurance + ${revision} + + + 4.0.0 + org.collectionspace.services.insurance.client + services.insurance.client + + + + + org.collectionspace.services + org.collectionspace.services.authority.jaxb + true + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.jaxb + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.common + true + + + org.collectionspace.services + org.collectionspace.services.client + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.insurance.jaxb + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.person.client + ${project.version} + + + + org.testng + testng + + + org.jboss.resteasy + resteasy-jaxrs + + + + tjws + webserver + + + + + org.jboss.resteasy + resteasy-jaxb-provider + + + org.jboss.resteasy + resteasy-multipart-provider + + + commons-httpclient + commons-httpclient + + + + + collectionspace-services-insurance-client + + diff --git a/services/insurance/client/src/main/java/org/collectionspace/services/client/InsuranceClient.java b/services/insurance/client/src/main/java/org/collectionspace/services/client/InsuranceClient.java new file mode 100644 index 000000000..e8a23854f --- /dev/null +++ b/services/insurance/client/src/main/java/org/collectionspace/services/client/InsuranceClient.java @@ -0,0 +1,53 @@ +/* + * 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 + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services.client; + +import org.collectionspace.services.insurance.InsurancesCommon; + +/** + * InsuranceClient.java + */ +public class InsuranceClient extends AbstractCommonListPoxServiceClientImpl { + + public static final String SERVICE_NAME = "insurances"; + public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME; + public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT; + public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/"; + public static final String SERVICE_PAYLOAD_NAME = SERVICE_NAME; + + public InsuranceClient() throws Exception { + super(); + } + + public InsuranceClient(String clientPropertiesFilename) throws Exception { + super(clientPropertiesFilename); + } + + @Override + public String getServicePathComponent() { + return SERVICE_PATH_COMPONENT; + } + + @Override + public String getServiceName() { + return SERVICE_NAME; + } + + @Override + public Class getProxyClass() { + return InsuranceProxy.class; + } + +} diff --git a/services/insurance/client/src/main/java/org/collectionspace/services/client/InsuranceProxy.java b/services/insurance/client/src/main/java/org/collectionspace/services/client/InsuranceProxy.java new file mode 100644 index 000000000..16157ae68 --- /dev/null +++ b/services/insurance/client/src/main/java/org/collectionspace/services/client/InsuranceProxy.java @@ -0,0 +1,28 @@ +/* + * 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 + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services.client; + +import javax.ws.rs.Consumes; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; + +/** + * InsuranceProxy.java + */ +@Path(InsuranceClient.SERVICE_PATH_PROXY) +@Produces({"application/xml"}) +@Consumes({"application/xml"}) +public interface InsuranceProxy extends CollectionSpaceCommonListPoxProxy { +} diff --git a/services/insurance/jaxb/pom.xml b/services/insurance/jaxb/pom.xml new file mode 100644 index 000000000..b28112b95 --- /dev/null +++ b/services/insurance/jaxb/pom.xml @@ -0,0 +1,33 @@ + + + + org.collectionspace.services.insurance + org.collectionspace.services + ${revision} + + + 4.0.0 + org.collectionspace.services.insurance.jaxb + services.insurance.jaxb + + + + org.collectionspace.services + org.collectionspace.services.jaxb + ${project.version} + + + + + collectionspace-services-insurance-jaxb + install + + + org.jvnet.jaxb2.maven2 + maven-jaxb2-plugin + + + + diff --git a/services/insurance/jaxb/src/main/java/org/collectionspace/services/InsuranceJAXBSchema.java b/services/insurance/jaxb/src/main/java/org/collectionspace/services/InsuranceJAXBSchema.java new file mode 100644 index 000000000..d316841c0 --- /dev/null +++ b/services/insurance/jaxb/src/main/java/org/collectionspace/services/InsuranceJAXBSchema.java @@ -0,0 +1,19 @@ +/* + * 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 + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services; + +public interface InsuranceJAXBSchema { + String INSURANCE_REFERENCE_NUMBER = "insuranceIndemnityReferenceNumber"; +} diff --git a/services/insurance/jaxb/src/main/java/org/collectionspace/services/InsuranceListItemJAXBSchema.java b/services/insurance/jaxb/src/main/java/org/collectionspace/services/InsuranceListItemJAXBSchema.java new file mode 100644 index 000000000..758d0417f --- /dev/null +++ b/services/insurance/jaxb/src/main/java/org/collectionspace/services/InsuranceListItemJAXBSchema.java @@ -0,0 +1,21 @@ +/* + * 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 + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services; + +public interface InsuranceListItemJAXBSchema { + String INSURANCE_REFERENCE_NUMBER = "insuranceIndemnityReferenceNumber"; + String CSID = "csid"; + String URI = "url"; +} \ No newline at end of file diff --git a/services/insurance/jaxb/src/main/resources/insurances_common.xsd b/services/insurance/jaxb/src/main/resources/insurances_common.xsd new file mode 100644 index 000000000..fc43a34cc --- /dev/null +++ b/services/insurance/jaxb/src/main/resources/insurances_common.xsd @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + diff --git a/services/insurance/pom.xml b/services/insurance/pom.xml new file mode 100644 index 000000000..543dcb0c0 --- /dev/null +++ b/services/insurance/pom.xml @@ -0,0 +1,21 @@ + + + + org.collectionspace.services + org.collectionspace.services.main + ${revision} + + + 4.0.0 + org.collectionspace.services.insurance + services.insurance + pom + + + jaxb + service + 3rdparty + client + + + diff --git a/services/insurance/service/pom.xml b/services/insurance/service/pom.xml new file mode 100644 index 000000000..e8d4299f7 --- /dev/null +++ b/services/insurance/service/pom.xml @@ -0,0 +1,94 @@ + + + + + org.collectionspace.services + org.collectionspace.services.insurance + ${revision} + + + 4.0.0 + org.collectionspace.services.insurance.service + services.insurance.service + jar + + + + org.collectionspace.services + org.collectionspace.services.common + + + org.collectionspace.services + org.collectionspace.services.insurance.jaxb + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.insurance.client + ${project.version} + + + org.collectionspace.services + org.collectionspace.services.collectionobject.jaxb + ${project.version} + + + + junit + junit + test + + + org.testng + testng + + + + + + javax.security + jaas + 1.0.01 + provided + + + + + + org.jboss.resteasy + resteasy-jaxrs + + + tjws + webserver + + + + + org.jboss.resteasy + resteasy-jaxb-provider + + + org.jboss.resteasy + resteasy-multipart-provider + + + + + + org.nuxeo.ecm.core + nuxeo-core-api + + + jboss-remoting + jboss + + + + + + + + collectionspace-services-insurance + + diff --git a/services/insurance/service/src/main/java/org/collectionspace/services/insurance/InsuranceResource.java b/services/insurance/service/src/main/java/org/collectionspace/services/insurance/InsuranceResource.java new file mode 100644 index 000000000..20618136a --- /dev/null +++ b/services/insurance/service/src/main/java/org/collectionspace/services/insurance/InsuranceResource.java @@ -0,0 +1,50 @@ +/* + * 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 + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services.insurance; + +import org.collectionspace.services.client.InsuranceClient; +import org.collectionspace.services.common.NuxeoBasedResource; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.ws.rs.Consumes; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; + +@Path(InsuranceClient.SERVICE_PATH) +@Consumes("application/xml") +@Produces("application/xml") +public class InsuranceResource extends NuxeoBasedResource { + + final Logger logger = LoggerFactory.getLogger(InsuranceResource.class); + + @Override + protected String getVersionString() { + final String lastChangeRevision = "$LastChangedRevision$"; + return lastChangeRevision; + } + + @Override + public String getServiceName() { + return InsuranceClient.SERVICE_NAME; + } + + @Override + public Class getCommonPartClass() { + return InsurancesCommon.class; + } + +} + diff --git a/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceConstants.java b/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceConstants.java new file mode 100644 index 000000000..c20469306 --- /dev/null +++ b/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceConstants.java @@ -0,0 +1,27 @@ +/* + * 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 + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services.insurance.nuxeo; + +/** + * InsuranceConstants specifies constants for the Insurance service + * + */ +public class InsuranceConstants { + + public final static String NUXEO_DOCTYPE = "Insurance"; + public final static String NUXEO_SCHEMA_NAME = "insurance"; + public final static String NUXEO_DC_TITLE = "CollectionSpace-Insurance"; + +} diff --git a/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceDocumentModelHandler.java b/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceDocumentModelHandler.java new file mode 100644 index 000000000..cd29d22d1 --- /dev/null +++ b/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceDocumentModelHandler.java @@ -0,0 +1,24 @@ +/** + * 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 + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services.insurance.nuxeo; + +import org.collectionspace.services.insurance.InsurancesCommon; +import org.collectionspace.services.nuxeo.client.java.NuxeoDocumentModelHandler; + +/** + * InsuranceDocumentModelHandler + */ +public class InsuranceDocumentModelHandler extends NuxeoDocumentModelHandler { +} diff --git a/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceValidatorHandler.java b/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceValidatorHandler.java new file mode 100644 index 000000000..a6fa04ffd --- /dev/null +++ b/services/insurance/service/src/main/java/org/collectionspace/services/insurance/nuxeo/InsuranceValidatorHandler.java @@ -0,0 +1,30 @@ +/* + * This document is a part of the source code and related artifacts + * for CollectionSpace, an open source collections management system + * for museums and related institutions: + * + * http://www.collectionspace.org + * http://wiki.collectionspace.org + * + * Licensed under the Educational Community License (ECL), Version 2.0. + * You may not use this file except in compliance with this License. + * + * You may obtain a copy of the ECL 2.0 License at + * https://source.collectionspace.org/collection-space/LICENSE.txt + */ +package org.collectionspace.services.insurance.nuxeo; + +import org.collectionspace.services.common.context.ServiceContext; +import org.collectionspace.services.common.document.InvalidDocumentException; +import org.collectionspace.services.common.document.ValidatorHandler; +import org.collectionspace.services.common.document.DocumentHandler.Action; + +public class InsuranceValidatorHandler implements ValidatorHandler { + + @Override + public void validate(Action action, ServiceContext ctx) throws InvalidDocumentException { + // TODO Auto-generated method stub + System.out.println("InsuranceValidatorHandler executed."); + } + +} diff --git a/services/pom.xml b/services/pom.xml index 01fb2e2f4..3f1d517c2 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -63,6 +63,7 @@ collectionobject servicegroup group + insurance intake loanin loanout