From 47a071cc7c7e5a51e163c6caba2e062c4e8615de Mon Sep 17 00:00:00 2001 From: Aron Roberts Date: Sat, 24 Jul 2010 00:49:12 +0000 Subject: [PATCH] CSPACE-2529,CSPACE-2549: Multiple changes to Intake records schema, in the services layer: added six new fields (three of them repeatable), and made five existing fields repeatable. Changes the relevant Nuxeo document type schema, and as such requires an 'ant deploy' and a 2-server restart. --- .../main/config/services/tenant-bindings.xml | 16 +++-- .../resources/OSGI-INF/layouts-contrib.xml | 7 +- .../main/resources/schemas/intakes_common.xsd | 65 +++++++++++++++++-- .../client/test/IntakeAuthRefsTest.java | 24 +++++-- .../client/test/IntakeServiceTest.java | 15 +++++ .../test/OrganizationAuthRefDocsTest.java | 16 ++++- .../client/test/PersonAuthRefDocsTest.java | 16 ++++- .../src/main/resources/intakes-common.xsd | 65 +++++++++++++++++-- 8 files changed, 195 insertions(+), 29 deletions(-) diff --git a/services/common/src/main/config/services/tenant-bindings.xml b/services/common/src/main/config/services/tenant-bindings.xml index 75c95ae47..b71e9adcc 100644 --- a/services/common/src/main/config/services/tenant-bindings.xml +++ b/services/common/src/main/config/services/tenant-bindings.xml @@ -133,10 +133,12 @@ authRefcurrentOwner authRefdepositor - authRefconditionCheckerAssessor - authRefinsurer + authReffieldCollectionSources + authReffieldCollectors authRefvaluer - + authRefinsurers + authRefconditionCheckersOrAssessors + authRefcurrentOwner authRefdepositor - authRefconditionCheckerAssessor - authRefinsurer + authReffieldCollectionSources + authReffieldCollectors authRefvaluer - + authRefinsurers + authRefconditionCheckersOrAssessors + depositor depositorsRequirements entryDate - entryMethod + + + entryNote entryNumber entryReason @@ -74,6 +76,7 @@ + + diff --git a/services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/schemas/intakes_common.xsd b/services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/schemas/intakes_common.xsd index 20a375d28..18ef9705e 100644 --- a/services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/schemas/intakes_common.xsd +++ b/services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/schemas/intakes_common.xsd @@ -25,7 +25,13 @@ - + + + + + + + @@ -33,6 +39,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -44,7 +75,13 @@ - + + + + + + + @@ -55,10 +92,28 @@ - + + + + + + + - + + + + + + + - + + + + + + + diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java index 2137d338d..c705daf41 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeAuthRefsTest.java @@ -36,7 +36,9 @@ import org.collectionspace.services.client.IntakeClient; import org.collectionspace.services.client.PersonAuthorityClient; import org.collectionspace.services.client.PersonAuthorityClientUtils; import org.collectionspace.services.common.authorityref.AuthorityRefList; +import org.collectionspace.services.intake.ConditionCheckerOrAssessorList; import org.collectionspace.services.intake.IntakesCommon; +import org.collectionspace.services.intake.InsurerList; import org.collectionspace.services.jaxb.AbstractCommonList; import org.jboss.resteasy.client.ClientResponse; @@ -72,7 +74,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest { private String personAuthCSID = null; private String currentOwnerRefName = null; private String depositorRefName = null; - private String conditionCheckerAssessorRefName = null; + private String conditionCheckerOrAssessorRefName = null; private String insurerRefName = null; private String valuerRefName = null; private final int NUM_AUTH_REFS_EXPECTED = 5; @@ -119,7 +121,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest { "entryDate-" + identifier, currentOwnerRefName, depositorRefName, - conditionCheckerAssessorRefName, + conditionCheckerOrAssessorRefName, insurerRefName, valuerRefName ); ClientResponse res = intakeClient.create(multipart); @@ -176,7 +178,7 @@ public class IntakeAuthRefsTest extends BaseServiceTest { personIdsCreated.add(csid); csid = createPerson("Andrew", "Assessor", "andrewAssessor", authRefName); - conditionCheckerAssessorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null); + conditionCheckerOrAssessorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null); personIdsCreated.add(csid); csid = createPerson("Ingrid", "Insurer", "ingridInsurer", authRefName); @@ -237,7 +239,8 @@ public class IntakeAuthRefsTest extends BaseServiceTest { Assert.assertNotNull(intake); // Check a couple of fields Assert.assertEquals(intake.getCurrentOwner(), currentOwnerRefName); - Assert.assertEquals(intake.getInsurer(), insurerRefName); + Assert.assertEquals(intake.getConditionCheckersOrAssessors().getConditionCheckerOrAssessor().get(0), conditionCheckerOrAssessorRefName); + Assert.assertEquals(intake.getInsurers().getInsurer().get(0), insurerRefName); // Get the auth refs and check them ClientResponse res2 = intakeClient.getAuthorityRefs(knownResourceId); @@ -337,9 +340,18 @@ public class IntakeAuthRefsTest extends BaseServiceTest { intake.setEntryDate(entryDate); intake.setCurrentOwner(currentOwner); intake.setDepositor(depositor); - intake.setConditionCheckerAssessor(conditionCheckerAssessor); - intake.setInsurer(insurer); intake.setValuer(Valuer); + + ConditionCheckerOrAssessorList checkerOrAssessorList = new ConditionCheckerOrAssessorList(); + List checkersOrAssessors = checkerOrAssessorList.getConditionCheckerOrAssessor(); + checkersOrAssessors.add(conditionCheckerAssessor); + intake.setConditionCheckersOrAssessors(checkerOrAssessorList); + + InsurerList insurerList = new InsurerList(); + List insurers = insurerList.getInsurer(); + insurers.add(insurer); + intake.setInsurers(insurerList); + MultipartOutput multipart = new MultipartOutput(); OutputPart commonPart = multipart.addPart(intake, MediaType.APPLICATION_XML_TYPE); diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java index f4be1b5f1..924b71a57 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java @@ -28,6 +28,7 @@ import javax.ws.rs.core.Response; import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.client.IntakeClient; +import org.collectionspace.services.intake.EntryMethodList; import org.collectionspace.services.intake.IntakesCommon; import org.collectionspace.services.intake.IntakesCommonList; import org.collectionspace.services.jaxb.AbstractCommonList; @@ -299,6 +300,13 @@ public class IntakeServiceTest extends AbstractServiceTestImpl { IntakesCommon intake = (IntakesCommon) extractPart(input, client.getCommonPartName(), IntakesCommon.class); Assert.assertNotNull(intake); + + // Verify the number and contents of values in repeatable fields, + // as created in the instance record used for testing. + List entryMethods = + intake.getEntryMethods().getEntryMethod(); + Assert.assertTrue(entryMethods.size() > 0); + Assert.assertNotNull(entryMethods.get(0)); } // Failure outcomes @@ -735,6 +743,13 @@ public class IntakeServiceTest extends AbstractServiceTestImpl { intake.setEntryNumber(entryNumber); intake.setEntryDate(entryDate); intake.setDepositor(depositor); + + EntryMethodList entryMethodsList = new EntryMethodList(); + List entryMethods = entryMethodsList.getEntryMethod(); + entryMethods.add("Left at doorstep"); + entryMethods.add("Received via post"); + intake.setEntryMethods(entryMethodsList); + MultipartOutput multipart = new MultipartOutput(); OutputPart commonPart = multipart.addPart(intake, MediaType.APPLICATION_XML_TYPE); diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java index 246fb1f1a..474fb73de 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java @@ -36,8 +36,9 @@ import org.collectionspace.services.client.IntakeClient; import org.collectionspace.services.client.OrgAuthorityClient; import org.collectionspace.services.client.OrgAuthorityClientUtils; import org.collectionspace.services.common.authorityref.AuthorityRefDocList; +import org.collectionspace.services.intake.ConditionCheckerOrAssessorList; import org.collectionspace.services.intake.IntakesCommon; -//import org.collectionspace.services.intake.IntakesCommonList; +import org.collectionspace.services.intake.InsurerList; import org.collectionspace.services.jaxb.AbstractCommonList; import org.jboss.resteasy.client.ClientResponse; @@ -331,9 +332,18 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest { intake.setEntryDate(entryDate); intake.setCurrentOwner(currentOwner); intake.setDepositor(depositor); - intake.setConditionCheckerAssessor(conditionCheckerAssessor); - intake.setInsurer(insurer); intake.setValuer(Valuer); + + ConditionCheckerOrAssessorList checkerOrAssessorList = new ConditionCheckerOrAssessorList(); + List checkersOrAssessors = checkerOrAssessorList.getConditionCheckerOrAssessor(); + checkersOrAssessors.add(conditionCheckerAssessor); + intake.setConditionCheckersOrAssessors(checkerOrAssessorList); + + InsurerList insurerList = new InsurerList(); + List insurers = insurerList.getInsurer(); + insurers.add(insurer); + intake.setInsurers(insurerList); + MultipartOutput multipart = new MultipartOutput(); OutputPart commonPart = multipart.addPart(intake, MediaType.APPLICATION_XML_TYPE); diff --git a/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java b/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java index 3bc8b4160..674a1f40d 100644 --- a/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java +++ b/services/intake/client/src/test/java/org/collectionspace/services/client/test/PersonAuthRefDocsTest.java @@ -36,8 +36,9 @@ import org.collectionspace.services.client.IntakeClient; import org.collectionspace.services.client.PersonAuthorityClient; import org.collectionspace.services.client.PersonAuthorityClientUtils; import org.collectionspace.services.common.authorityref.AuthorityRefDocList; +import org.collectionspace.services.intake.ConditionCheckerOrAssessorList; import org.collectionspace.services.intake.IntakesCommon; -//import org.collectionspace.services.intake.IntakesCommonList; +import org.collectionspace.services.intake.InsurerList; import org.collectionspace.services.jaxb.AbstractCommonList; import org.jboss.resteasy.client.ClientResponse; @@ -338,9 +339,18 @@ public class PersonAuthRefDocsTest extends BaseServiceTest { intake.setEntryDate(entryDate); intake.setCurrentOwner(currentOwner); intake.setDepositor(depositor); - intake.setConditionCheckerAssessor(conditionCheckerAssessor); - intake.setInsurer(insurer); intake.setValuer(Valuer); + + ConditionCheckerOrAssessorList checkerOrAssessorList = new ConditionCheckerOrAssessorList(); + List checkersOrAssessors = checkerOrAssessorList.getConditionCheckerOrAssessor(); + checkersOrAssessors.add(conditionCheckerAssessor); + intake.setConditionCheckersOrAssessors(checkerOrAssessorList); + + InsurerList insurerList = new InsurerList(); + List insurers = insurerList.getInsurer(); + insurers.add(insurer); + intake.setInsurers(insurerList); + MultipartOutput multipart = new MultipartOutput(); OutputPart commonPart = multipart.addPart(intake, MediaType.APPLICATION_XML_TYPE); diff --git a/services/intake/jaxb/src/main/resources/intakes-common.xsd b/services/intake/jaxb/src/main/resources/intakes-common.xsd index 55b1bdbac..19d4dcdf5 100644 --- a/services/intake/jaxb/src/main/resources/intakes-common.xsd +++ b/services/intake/jaxb/src/main/resources/intakes-common.xsd @@ -38,7 +38,7 @@ - + @@ -46,6 +46,13 @@ + + + + + + + @@ -57,7 +64,7 @@ - + @@ -68,15 +75,63 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.47.3