From: Aron Roberts Date: Wed, 25 Aug 2010 22:09:46 +0000 (+0000) Subject: CSPACE-2541,CSPACE-2711: 'owner' field now a repeatable scalar ('owners->owner')... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=89c435a127da3eb4ecfc84a2d2738294ed4e2777;p=tmp%2Fjakarta-migration.git CSPACE-2541,CSPACE-2711: 'owner' field now a repeatable scalar ('owners->owner') in Acquisition records. Multiple value instances of 'owner' field now returned in summary items in lists of Acquisition records, as well. 'fieldCollectionEventName' field now a repeatable scalar ('fieldCollectionEventNames->fieldCollectionEventName') in CollectionObject, Intake, and Acquisition records. Changes made to Nuxeo doctype schemas, and thus requires an 'ant deploy' and a 2-server restart to reflect these changes in the services layer. --- diff --git a/services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd b/services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd index b2c5bf51f..22ab28300 100644 --- a/services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd +++ b/services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd @@ -37,7 +37,14 @@ - + + + + + + + + @@ -58,7 +65,15 @@ - + + + + + + + + + diff --git a/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java b/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java index 6e42681c4..cadcaedc9 100644 --- a/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java +++ b/services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java @@ -36,6 +36,7 @@ import org.collectionspace.services.acquisition.AcquisitionDateList; import org.collectionspace.services.acquisition.AcquisitionFunding; import org.collectionspace.services.acquisition.AcquisitionFundingList; import org.collectionspace.services.acquisition.AcquisitionSourceList; +import org.collectionspace.services.acquisition.OwnerList; import org.jboss.resteasy.client.ClientResponse; import org.jboss.resteasy.plugins.providers.multipart.MultipartInput; @@ -331,6 +332,10 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl { Assert.assertTrue(acqDates.size() > 0); Assert.assertNotNull(acqDates.get(0)); + List owners = + acquisitionObject.getOwners().getOwner(); + Assert.assertTrue(owners.size() > 0); + Assert.assertNotNull(owners.get(0)); } // Failure outcomes @@ -801,6 +806,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl { private MultipartOutput createAcquisitionInstance(String identifier) { AcquisitionsCommon acquisition = new AcquisitionsCommon(); acquisition.setAcquisitionReferenceNumber("acquisitionReferenceNumber-" + identifier); + AcquisitionSourceList acqSourcesList = new AcquisitionSourceList(); List acqSources = acqSourcesList.getAcquisitionSource(); // FIXME Use properly formatted refNames for representative acquisition @@ -808,6 +814,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl { acqSources.add("Donor Acquisition Source-" + identifier); acqSources.add("Museum Acquisition Source-" + identifier); acquisition.setAcquisitionSources(acqSourcesList); + AcquisitionDateList acqDatesList = new AcquisitionDateList(); List acqDates = acqDatesList.getAcquisitionDate(); // FIXME Use properly timestamps for representative acquisition @@ -815,7 +822,15 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl { acqDates.add("First Acquisition Date -" + identifier); acqDates.add("Second Acquisition Date-" + identifier); acquisition.setAcquisitionDates(acqDatesList); - acquisition.setOwner("DummyOwner"); + + OwnerList ownersList = new OwnerList(); + List owners = ownersList.getOwner(); + // FIXME Use properly formatted refNames for representative owners + // in this example test record. The following are mere placeholders. + owners.add("First Owner -" + identifier); + owners.add("Second Owner-" + identifier); + acquisition.setOwners(ownersList); + MultipartOutput multipart = new MultipartOutput(); OutputPart commonPart = multipart.addPart(acquisition, MediaType.APPLICATION_XML_TYPE); diff --git a/services/acquisition/jaxb/src/main/java/org/collectionspace/services/AcquisitionListItemJAXBSchema.java b/services/acquisition/jaxb/src/main/java/org/collectionspace/services/AcquisitionListItemJAXBSchema.java index d4a50d826..9ee57f594 100644 --- a/services/acquisition/jaxb/src/main/java/org/collectionspace/services/AcquisitionListItemJAXBSchema.java +++ b/services/acquisition/jaxb/src/main/java/org/collectionspace/services/AcquisitionListItemJAXBSchema.java @@ -3,7 +3,7 @@ package org.collectionspace.services; public interface AcquisitionListItemJAXBSchema { final static String ACQUISITION_REFERENCE_NUMBER = "acquisitionReferenceNumber"; final static String ACQUISITION_SOURCES = "acquisitionSources"; - final static String OWNER = "owner"; + final static String OWNERS = "owners"; final static String CSID = "csid"; final static String URI = "url"; } diff --git a/services/acquisition/jaxb/src/main/resources/acquisitions_common.xsd b/services/acquisition/jaxb/src/main/resources/acquisitions_common.xsd index 9e01344d6..c6dd5a403 100644 --- a/services/acquisition/jaxb/src/main/resources/acquisitions_common.xsd +++ b/services/acquisition/jaxb/src/main/resources/acquisitions_common.xsd @@ -43,7 +43,7 @@ - + @@ -57,17 +57,11 @@ - + - - - - - - @@ -89,6 +83,25 @@ + + + + + + + + + + + + + + + + + + + @@ -112,7 +125,7 @@ minOccurs="1" /> - acquisitionSources = (List) docModel.getProperty(label, @@ -126,8 +128,17 @@ public class AcquisitionDocumentModelHandler acquisitionSourceList.getAcquisitionSource().add(acquisitionSource); } listItem.setAcquisitionSources(acquisitionSourceList); - listItem.setOwner((String) docModel.getProperty(label, - AcquisitionListItemJAXBSchema.OWNER)); + + // and here ... + List owners = + (List) docModel.getProperty(label, + AcquisitionListItemJAXBSchema.OWNERS); + OwnerList ownerList = new OwnerList(); + for (String owner : owners) { + acquisitionSourceList.getAcquisitionSource().add(owner); + } + listItem.setOwners(ownerList); + //need fully qualified context for URI String id = NuxeoUtils.extractId(docModel.getPathAsString()); listItem.setUri(getServiceContextPath() + id); diff --git a/services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/schemas/collectionobjects_common.xsd b/services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/schemas/collectionobjects_common.xsd index c50ed9e5d..705682ad8 100644 --- a/services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/schemas/collectionobjects_common.xsd +++ b/services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/schemas/collectionobjects_common.xsd @@ -544,7 +544,14 @@ - + + + + + + + + diff --git a/services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd b/services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd index 90d401710..aade70e49 100644 --- a/services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd +++ b/services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd @@ -225,7 +225,7 @@ - + @@ -497,6 +497,12 @@ + + + + + + diff --git a/services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/schemas/contacts_common.xsd b/services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/schemas/contacts_common.xsd index c2d2ade2e..54cf1ca3b 100644 --- a/services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/schemas/contacts_common.xsd +++ b/services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/schemas/contacts_common.xsd @@ -21,8 +21,13 @@ + + + + + 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 18ef9705e..513a48d82 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 @@ -64,7 +64,14 @@ - + + + + + + + + @@ -84,9 +91,13 @@ + + + + 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 924b71a57..cbce62640 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 @@ -29,6 +29,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.FieldCollectionEventNameList; import org.collectionspace.services.intake.IntakesCommon; import org.collectionspace.services.intake.IntakesCommonList; import org.collectionspace.services.jaxb.AbstractCommonList; @@ -307,6 +308,11 @@ public class IntakeServiceTest extends AbstractServiceTestImpl { intake.getEntryMethods().getEntryMethod(); Assert.assertTrue(entryMethods.size() > 0); Assert.assertNotNull(entryMethods.get(0)); + + List fieldCollectionEventNames = + intake.getFieldCollectionEventNames().getFieldCollectionEventName(); + Assert.assertTrue(fieldCollectionEventNames.size() > 0); + Assert.assertNotNull(fieldCollectionEventNames.get(0)); } // Failure outcomes @@ -750,6 +756,14 @@ public class IntakeServiceTest extends AbstractServiceTestImpl { entryMethods.add("Received via post"); intake.setEntryMethods(entryMethodsList); + FieldCollectionEventNameList eventNamesList = new FieldCollectionEventNameList(); + List eventNames = eventNamesList.getFieldCollectionEventName(); + // FIXME Use properly formatted refNames for representative event names + // in this example test record. The following are mere placeholders. + eventNames.add("Field Collection Event Name-1"); + eventNames.add("Field Collection Event Name-2"); + intake.setFieldCollectionEventNames(eventNamesList); + 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 665e269e9..cae340d7a 100644 --- a/services/intake/jaxb/src/main/resources/intakes-common.xsd +++ b/services/intake/jaxb/src/main/resources/intakes-common.xsd @@ -53,7 +53,7 @@ - + @@ -109,6 +109,12 @@ + + + + + + diff --git a/services/organization/3rdparty/nuxeo-platform-cs-organization/src/main/resources/schemas/organizations_common.xsd b/services/organization/3rdparty/nuxeo-platform-cs-organization/src/main/resources/schemas/organizations_common.xsd index 6427008d9..baffa3866 100644 --- a/services/organization/3rdparty/nuxeo-platform-cs-organization/src/main/resources/schemas/organizations_common.xsd +++ b/services/organization/3rdparty/nuxeo-platform-cs-organization/src/main/resources/schemas/organizations_common.xsd @@ -24,14 +24,18 @@ - + + + + + diff --git a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd index c53bc976d..ba51601b6 100644 --- a/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd +++ b/services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd @@ -28,6 +28,10 @@ + + + + @@ -35,6 +39,8 @@ + +