]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-2528: Made acquisitionDate field a repeatable field in Acquisition records...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 22 Jul 2010 22:06:47 +0000 (22:06 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 22 Jul 2010 22:06:47 +0000 (22:06 +0000)
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/resources/acquisitions_common.xsd

index c67a953567b9f7587883a75007e1b55c53ae8003..d246ae475894b32f491a71acaadadc9fb065de5f 100644 (file)
     <xs:element name="accessionDate" type="xs:string"/>\r
     <xs:element name="acquisitionAuthorizer" type="xs:string"/>\r
     <xs:element name="acquisitionAuthorizerDate" type="xs:string"/>\r
-    <xs:element name="acquisitionDate" type="xs:string"/>\r
+    <xs:element name="acquisitionDates">\r
+        <xs:complexType>\r
+            <xs:sequence>\r
+                <xs:element name="acquisitionDate" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>\r
+            </xs:sequence>\r
+        </xs:complexType>\r
+    </xs:element>\r
     <xs:element name="acquisitionFundingCurrency" type="xs:string"/>\r
     <xs:element name="acquisitionFundingValue" type="xs:string"/>\r
     <xs:element name="acquisitionFundingSource" type="xs:string"/>\r
index 81cc31267d2b0dcfb652638304b90e4d4fdfb3c1..e1b84e226c33147fa4fb7f279e1612f05f873316 100644 (file)
@@ -32,6 +32,7 @@ import org.collectionspace.services.jaxb.AbstractCommonList;
 
 import org.collectionspace.services.acquisition.AcquisitionsCommon;
 import org.collectionspace.services.acquisition.AcquisitionsCommonList;
+import org.collectionspace.services.acquisition.AcquisitionDateList;
 import org.collectionspace.services.acquisition.AcquisitionSourceList;
 import org.jboss.resteasy.client.ClientResponse;
 
@@ -91,7 +92,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
         if (logger.isDebugEnabled()) {
             logger.debug(testBanner(testName, CLASS_NAME));
-        };
+        }
         
         // Perform setup, such as initializing the type of service request
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
@@ -247,7 +248,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
         if (logger.isDebugEnabled()) {
             logger.debug(testBanner(testName, CLASS_NAME));
-        };
+        }
         
         // Perform setup.
         setupRead();
@@ -272,6 +273,18 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
                 client.getCommonPartName(), AcquisitionsCommon.class);
         Assert.assertNotNull(acquisitionObject);
 
+        // Verify the number and contents of values in repeatable fields,
+        // as created in the instance record used for testing.
+        List<String> acqSources =
+                acquisitionObject.getAcquisitionSources().getAcquisitionSource();
+        Assert.assertTrue(acqSources.size() > 0);
+        Assert.assertNotNull(acqSources.get(0));
+
+        List<String> acqDates =
+                acquisitionObject.getAcquisitionDates().getAcquisitionDate();
+        Assert.assertTrue(acqDates.size() > 0);
+        Assert.assertNotNull(acqDates.get(0));
+
     }
 
     // Failure outcomes
@@ -285,7 +298,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
         if (logger.isDebugEnabled()) {
             logger.debug(testBanner(testName, CLASS_NAME));
-        };
+        }
 
         // Perform setup.
         setupReadNonExistent();
@@ -319,7 +332,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
         if (logger.isDebugEnabled()) {
             logger.debug(testBanner(testName, CLASS_NAME));
-        };
+        }
         
         // Perform setup.
         setupReadList();
@@ -381,7 +394,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
         if (logger.isDebugEnabled()) {
             logger.debug(testBanner(testName, CLASS_NAME));
-        };
+        }
         
         // Perform setup.
         setupUpdate();
@@ -592,7 +605,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
         if (logger.isDebugEnabled()) {
             logger.debug(testBanner(testName, CLASS_NAME));
-        };
+        }
         
         // Perform setup.
         setupUpdateNonExistent();
@@ -661,7 +674,7 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
 
         if (logger.isDebugEnabled()) {
             logger.debug(testBanner(testName, CLASS_NAME));
-        };
+        }
         
         // Perform setup.
         setupDeleteNonExistent();
@@ -733,12 +746,19 @@ public class AcquisitionServiceTest extends AbstractServiceTestImpl {
         AcquisitionsCommon acquisition = new AcquisitionsCommon();
         acquisition.setAcquisitionReferenceNumber("acquisitionReferenceNumber-"  + identifier);
         AcquisitionSourceList acqSourcesList = new AcquisitionSourceList();
-        List<String> sources = acqSourcesList.getAcquisitionSource();
-        // @TODO Use properly formatted refNames for representative acquisition
+        List<String> acqSources = acqSourcesList.getAcquisitionSource();
+        // FIXME Use properly formatted refNames for representative acquisition
         // sources in this example test record. The following are mere placeholders.
-        sources.add("Donor Acquisition Source-" + identifier);
-        sources.add("Museum Acquisition Source-" + identifier);
+        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
+        // dates in this example test record. The following are mere placeholders.
+        acqDates.add("First Acquisition Date -" + identifier);
+        acqDates.add("Second Acquisition Date-" + identifier);
+        acquisition.setAcquisitionDates(acqDatesList);
         MultipartOutput multipart = new MultipartOutput();
         OutputPart commonPart = multipart.addPart(acquisition,
             MediaType.APPLICATION_XML_TYPE);
index 8dbfeefa3c5394ca6f6f428b3e014a40cfb6f2e3..ae2afcfa9e254502f910ee36a37df0bfb34629d9 100644 (file)
@@ -36,7 +36,7 @@
                 <xs:element name="accessionDate" type="xs:string"/>
                 <xs:element name="acquisitionAuthorizer" type="xs:string"/>
                 <xs:element name="acquisitionAuthorizerDate" type="xs:string"/>
-                <xs:element name="acquisitionDate" type="xs:string"/>
+                <xs:element name="acquisitionDates" type="acquisitionDateList"/>
                 <xs:element name="acquisitionFundingCurrency" type="xs:string"/>
                 <xs:element name="acquisitionFundingValue" type="xs:string"/>
                 <xs:element name="acquisitionFundingSource" type="xs:string"/>
             <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:sequence>
+    </xs:complexType>
     
     <!-- This is the base class for paginated lists -->
     <xs:complexType name="abstractCommonList">