]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-2541,CSPACE-2711: 'owner' field now a repeatable scalar ('owners->owner')...
authorAron Roberts <aron@socrates.berkeley.edu>
Wed, 25 Aug 2010 22:09:46 +0000 (22:09 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Wed, 25 Aug 2010 22:09:46 +0000 (22:09 +0000)
13 files changed:
services/acquisition/3rdparty/nuxeo-platform-cs-acquisition/src/main/resources/schemas/acquisitions_common.xsd
services/acquisition/client/src/test/java/org/collectionspace/services/client/test/AcquisitionServiceTest.java
services/acquisition/jaxb/src/main/java/org/collectionspace/services/AcquisitionListItemJAXBSchema.java
services/acquisition/jaxb/src/main/resources/acquisitions_common.xsd
services/acquisition/service/src/main/java/org/collectionspace/services/acquisition/nuxeo/AcquisitionDocumentModelHandler.java
services/collectionobject/3rdparty/nuxeo-platform-cs-collectionobject/src/main/resources/schemas/collectionobjects_common.xsd
services/collectionobject/jaxb/src/main/resources/collectionobjects_common.xsd
services/contact/3rdparty/nuxeo-platform-cs-contact/src/main/resources/schemas/contacts_common.xsd
services/intake/3rdparty/nuxeo-platform-cs-intake/src/main/resources/schemas/intakes_common.xsd
services/intake/client/src/test/java/org/collectionspace/services/client/test/IntakeServiceTest.java
services/intake/jaxb/src/main/resources/intakes-common.xsd
services/organization/3rdparty/nuxeo-platform-cs-organization/src/main/resources/schemas/organizations_common.xsd
services/person/3rdparty/nuxeo-platform-cs-person/src/main/resources/schemas/persons_common.xsd

index b2c5bf51f0b343d6584f7ac4630ac390e6da26db..22ab28300b044a0f27557ea9664333e1ca5bcca7 100644 (file)
     <xs:element name="acquisitionProvisos" type="xs:string"/>\r
     <xs:element name="acquisitionReason" type="xs:string"/>\r
     <xs:element name="acquisitionReferenceNumber" type="xs:string"/>\r
-    <xs:element name="owner" type="xs:string"/>\r
+    <!-- FIXME [1.0 alpha] Make owner a repeatable scalar field. DONE -->\r
+    <xs:element name="owners">\r
+        <xs:complexType>\r
+            <xs:sequence>\r
+                <xs:element name="owner" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+            </xs:sequence>\r
+        </xs:complexType>\r
+    </xs:element>\r
     <xs:element name="acquisitionSources">\r
         <xs:complexType>\r
             <xs:sequence>\r
     <xs:element name="transferOfTitleNumber" type="xs:string"/>\r
 \r
     <!-- Object Collection Information Group -->\r
-    <xs:element name="fieldCollectionEventName" type="xs:string"/>\r
+\r
+    <!-- FIXME [1.0 alpha] Make fieldCollectionEventName a repeatable scalar field. DONE -->\r
+    <xs:element name="fieldCollectionEventNames">\r
+        <xs:complexType>\r
+            <xs:sequence>\r
+                <xs:element name="fieldCollectionEventName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+            </xs:sequence>\r
+        </xs:complexType>\r
+    </xs:element>\r
 \r
     <xs:complexType name="acquisitionFundingList">\r
         <xs:sequence>\r
index 6e42681c409c94aaff10bd744fc020abd5e4d5bb..cadcaedc96e0706b826ab3484b0230a1bf3908ea 100644 (file)
@@ -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<String> 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<String> 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<String> 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<String> 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);
index d4a50d826fcfc30f223584897be3f17b96fa9970..9ee57f594d57c8ef909454fd09e501effd738b04 100644 (file)
@@ -3,7 +3,7 @@ package org.collectionspace.services;
 public interface AcquisitionListItemJAXBSchema {\r
        final static String ACQUISITION_REFERENCE_NUMBER = "acquisitionReferenceNumber";\r
        final static String ACQUISITION_SOURCES = "acquisitionSources";\r
-       final static String OWNER = "owner";\r
+       final static String OWNERS = "owners";\r
        final static String CSID = "csid";\r
        final static String URI = "url";\r
 }\r
index 9e01344d6b2956421a315d618007c6a23b6f9dcd..c6dd5a403e77d4846cfcdf6ae4cf6a97ee3652f5 100644 (file)
@@ -43,7 +43,7 @@
                 <xs:element name="acquisitionProvisos" type="xs:string"/>
                 <xs:element name="acquisitionReason" type="xs:string"/>
                 <xs:element name="acquisitionReferenceNumber" type="xs:string"/>
-                <xs:element name="owner" type="xs:string"/>
+                <xs:element name="owners" type="ownerList"/>
                 <xs:element name="acquisitionSources" type="acquisitionSourceList"/>
                 <xs:element name="groupPurchasePriceCurrency" type="xs:string"/>
                 <xs:element name="groupPurchasePriceValue" type="xs:string"/>
                 <xs:element name="originalObjectPurchasePriceValue" type="xs:string"/>
                 <xs:element name="transferOfTitleNumber" type="xs:string"/>
                 <!-- Object Collection Information Group -->
-                <xs:element name="fieldCollectionEventName" type="xs:string"/>
+                <xs:element name="fieldCollectionEventNames" type="fieldCollectionEventNameList"/>
             </xs:sequence>
         </xs:complexType>
     </xs:element>
 
-    <xs:complexType name="acquisitionSourceList">
-        <xs:sequence>
-            <xs:element name="acquisitionSource" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
-        </xs:sequence>
-    </xs:complexType>
-
     <xs:complexType name="acquisitionDateList">
         <xs:sequence>
             <xs:element name="acquisitionDate" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
                 <xs:element name="acquisitionFundingSourceProvisos" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>
+
+
+    <xs:complexType name="acquisitionSourceList">
+        <xs:sequence>
+            <xs:element name="acquisitionSource" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="ownerList">
+        <xs:sequence>
+            <xs:element name="owner" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="fieldCollectionEventNameList">
+        <xs:sequence>
+            <xs:element name="fieldCollectionEventName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
     
     <!-- This is the base class for paginated lists -->
     <xs:complexType name="abstractCommonList">
                                         minOccurs="1" />
                                     <xs:element name="acquisitionSources" type="acquisitionSourceList"
                                         minOccurs="1" />
-                                    <xs:element name="owner" type="xs:string"
+                                    <xs:element name="owners" type="ownerList"
                                         minOccurs="1" />
                                     <!-- uri to retrive acquisition details -->
                                     <xs:element name="uri" type="xs:anyURI"
index c4afe62a558d158c7044432ee244d8857b44fc22..f06bbc3e609dc6749a2da53b8846a3612f7af987 100644 (file)
@@ -33,6 +33,7 @@ import org.collectionspace.services.acquisition.AcquisitionsCommon;
 import org.collectionspace.services.acquisition.AcquisitionsCommonList;
 import org.collectionspace.services.acquisition.AcquisitionsCommonList.AcquisitionListItem;
 import org.collectionspace.services.acquisition.AcquisitionSourceList;
+import org.collectionspace.services.acquisition.OwnerList;
 import org.collectionspace.services.common.document.DocumentHandler.Action;
 import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
@@ -117,6 +118,7 @@ public class AcquisitionDocumentModelHandler
             AcquisitionListItem listItem = new AcquisitionListItem();
             listItem.setAcquisitionReferenceNumber((String) docModel.getProperty(label,
                     AcquisitionListItemJAXBSchema.ACQUISITION_REFERENCE_NUMBER));
+            
             // docModel.getProperty returns an ArrayList here.
             List<String> acquisitionSources =
                  (List<String>) 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<String> owners = 
+                 (List<String>) 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);
index c50ed9e5dfd3419ce2db3e0f071a493bd0eb273f..705682ad8365e40004d95015fa5afc4fc7b4bf6e 100644 (file)
             </xs:sequence>\r
         </xs:complexType>\r
     </xs:element>\r
-    <xs:element name="fieldCollectionEventName" type="xs:string"/>\r
+    <!-- FIXME [1.0 alpha] Make fieldCollectionEventName a repeatable scalar field. DONE -->\r
+    <xs:element name="fieldCollectionEventNames">\r
+        <xs:complexType>\r
+            <xs:sequence>\r
+                <xs:element name="fieldCollectionEventName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+            </xs:sequence>\r
+        </xs:complexType>\r
+    </xs:element>\r
 \r
     <xs:complexType name="otherNumberList">\r
         <xs:sequence>\r
index 90d401710550164c92ef2cadb52223cff4985252..aade70e49bce15ece4ea2f0a1836cfdd8fd025d9 100644 (file)
                 <xs:element name="fieldCollectionPlace" type="xs:string"/>
                 <xs:element name="fieldCollectionSources" type="fieldCollectionSourceList"/>
                 <xs:element name="fieldCollectors" type="fieldCollectorList"/>
-                <xs:element name="fieldCollectionEventName" type="xs:string"/>
+                <xs:element name="fieldCollectionEventNames" type="fieldCollectionEventNameList"/>
                                
                 <!-- Object Description Date Information -->
                 <!-- This appears to be a placeholder structured date -->
         </xs:sequence>
     </xs:complexType>
 
+    <xs:complexType name="fieldCollectionEventNameList">
+        <xs:sequence>
+            <xs:element name="fieldCollectionEventName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
     <!-- This is the base class for paginated lists -->
     <xs:complexType name="abstractCommonList">
         <xs:annotation>
index c2d2ade2efae356f6f7986f55a66c874f1df4f81..54cf1ca3b8f1bdc68912ace7386705e1e734035e 100644 (file)
     <xs:element name="csid" type="xs:string" />
     <xs:element name="inAuthority" type="xs:string" />
     <xs:element name="inItem" type="xs:string" />
+
     <xs:element name="addressType" type="xs:string"/>
     <xs:element name="addressPlace" type="xs:string"/>
+    <!-- FIXME After release 1.0, four additional fields are introduced here, -->
+    <!-- and these fields, plus addressType and addressPlace, constitute a -->
+    <!-- repeatable group. -->
+
     <xs:element name="web" type="xs:string"/>
     <xs:element name="email" type="xs:string"/>
     <xs:element name="telephoneNumber" type="xs:string"/>
index 18ef9705ee83cb3113f144503332ab59665c1835..513a48d82f8dd9d8773849b19c61fc11b37c7fa3 100644 (file)
             </xs:sequence>\r
         </xs:complexType>\r
     </xs:element>\r
-    <xs:element name="fieldCollectionEventName" type="xs:string"/>\r
+    <!-- FIXME [1.0 alpha] Make fieldCollectionEventName a repeatable scalar field. DONE -->\r
+    <xs:element name="fieldCollectionEventNames">\r
+        <xs:complexType>\r
+            <xs:sequence>\r
+                <xs:element name="fieldCollectionEventName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+            </xs:sequence>\r
+        </xs:complexType>\r
+    </xs:element>\r
 \r
     <!-- Valuation Information Group -->\r
     <xs:element name="valuationReferenceNumber" type="xs:string"/>\r
     </xs:element>\r
     \r
     <!-- Object Location Information Group -->\r
+\r
+    <!-- FIXME Start of Current location repeatable group -->\r
     <xs:element name="currentLocation" type="xs:string"/>\r
     <xs:element name="currentLocationFitness" type="xs:string"/>\r
     <xs:element name="currentLocationNote" type="xs:string"/>\r
+    <!-- FIXME End of Current location repeatable group -->\r
+\r
     <xs:element name="locationDate" type="xs:string"/>\r
     <xs:element name="normalLocation" type="xs:string"/>\r
     \r
index 924b71a57301b72f8f7afc2a5f39a66ff8d35213..cbce6264073c407378cc96d73016d4a2a7ab997e 100644 (file)
@@ -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<String> 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<String> 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);
index 665e269e985f3a168344bd195431116944e04a69..cae340d7a6982993a804dcd5aa33cc8cfc9ce861 100644 (file)
@@ -53,7 +53,7 @@
                 <xs:element name="fieldCollectionPlace" type="xs:string"/>
                 <xs:element name="fieldCollectionSources" type="fieldCollectionSourceList"/>
                 <xs:element name="fieldCollectors" type="fieldCollectorList"/>
-                <xs:element name="fieldCollectionEventName" type="xs:string"/>
+                <xs:element name="fieldCollectionEventNames" type="fieldCollectionEventNameList"/>
 
                 <!-- Valuation Information Group -->
                 <xs:element name="valuationReferenceNumber" type="xs:string"/>
         </xs:sequence>
     </xs:complexType>
 
+    <xs:complexType name="fieldCollectionEventNameList">
+        <xs:sequence>
+            <xs:element name="fieldCollectionEventName" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+        </xs:sequence>
+    </xs:complexType>
+
     <xs:complexType name="insurerList">
         <xs:sequence>
             <xs:element name="insurer" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
index 6427008d9af977e95587bdc22de104402c14aad6..baffa38660d30ed9517dc6b2111bb4d0fe570d58 100644 (file)
     <!--  Organization Information Group -->
     <!--  inAuthority is the csid of the owning OrgAuthority -->
     <xs:element name="inAuthority" type="xs:string" />
-               <xs:element name="shortIdentifier" type="xs:string"/>
+    <xs:element name="shortIdentifier" type="xs:string"/>
     <xs:element name="refName" type="xs:string"/>
     <xs:element name="termStatus" type="xs:string"/>
     <xs:element name="displayName" type="xs:string"/>
     <xs:element name="displayNameComputed" type="xs:boolean"/>
+
+    <!-- FIXME Start of main body (represented by 'longName' element) repeatable group -->
     <xs:element name="shortName" type="xs:string"/>
     <xs:element name="longName" type="xs:string"/>
     <xs:element name="nameAdditions" type="xs:string"/>
+    <!-- FIXME End of main body repeatable group -->
+
     <xs:element name="contactNames">
         <xs:complexType>
             <xs:sequence>
index c53bc976d544efad21a97777d57939e4dad8414e..ba51601b64ee8cb457ea9492e46244e5334e9597 100644 (file)
     <xs:element name="termStatus" type="xs:string"/>
     <xs:element name="displayName" type="xs:string"/>
     <xs:element name="displayNameComputed" type="xs:boolean"/>
+
+    <!-- FIXME: Currently marked in repeatability spreadsheet as a -->
+    <!-- repeatable group.  However, multiple personal names for the -->
+    <!-- same individual may ultimately be handled using a different approach. -->
     <xs:element name="foreName" type="xs:string"/>
     <xs:element name="middleName" type="xs:string"/>
     <xs:element name="surName" type="xs:string"/>
@@ -35,6 +39,8 @@
     <xs:element name="salutation" type="xs:string"/>
     <xs:element name="title" type="xs:string"/>
     <xs:element name="nameAdditions" type="xs:string"/>
+    <!-- FIXME: End of provisional repeatable group. -->
+
     <xs:element name="birthDate" type="xs:string"/>
     <xs:element name="deathDate" type="xs:string"/>
     <xs:element name="birthPlace" type="xs:string"/>