<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
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;
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
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
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
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);
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
<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"
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;
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,
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);
</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
<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>
<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"/>
</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
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;
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
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);
<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"/>
<!-- 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>
<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"/>
<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"/>