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;
private String personAuthCSID = null;
private String acquisitionAuthorizerRefName = null;
private List<String> acquisitionFundingSourcesRefNames = new ArrayList<String>();
+ private List<String> ownersRefNames = new ArrayList<String>();
private List<String> acquisitionSourcesRefNames = new ArrayList<String>();
- private final int NUM_AUTH_REFS_EXPECTED = 3;
+ private final int NUM_AUTH_REFS_EXPECTED = 5;
/* (non-Javadoc)
* @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
"April 1, 2010",
acquisitionAuthorizerRefName,
acquisitionFundingSourcesRefNames,
+ ownersRefNames,
acquisitionSourcesRefNames);
AcquisitionClient acquisitionClient = new AcquisitionClient();
acquisitionFundingSourcesRefNames.add(PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null));
personIdsCreated.add(csid);
*/
+
+ csid = createPerson("Owen", "OwnerOne", "owenOwnerOne", authRefName);
+ ownersRefNames.add(PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null));
+ personIdsCreated.add(csid);
+
+ csid = createPerson("Orelia", "OwnerTwo", "oreliaOwnerTwo", authRefName);
+ ownersRefNames.add(PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null));
+ personIdsCreated.add(csid);
csid = createPerson("Sammy", "SourceOne", "sammySourceOne", authRefName);
acquisitionSourcesRefNames.add(PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null));
*/
// In scalar repeatable fields
+ OwnerList ownersList = acquisition.getOwners();
+ List<String> owners = ownersList.getOwner();
+ for (String refName : owners) {
+ Assert.assertTrue(ownersRefNames.contains(refName));
+ }
+
AcquisitionSourceList acquisitionSources = acquisition.getAcquisitionSources();
List<String> sources = acquisitionSources.getAcquisitionSource();
for (String refName : sources) {
String accessionDate,
String acquisitionAuthorizer,
List<String> acquisitionFundingSources,
+ List<String> acqOwners,
List<String> acquisitionSources) {
AcquisitionsCommon acquisition = new AcquisitionsCommon();
acquisition.setAccessionDate(accessionDate);
acquisition.setAcquisitionAuthorizer(acquisitionAuthorizer);
+ // AcquisitionFunding-related authrefs fields are *not* currently
+ // enabled, as described in issue CSPACE-2818
+
/*
AcquisitionFundingList acqFundingsList = new AcquisitionFundingList();
List<AcquisitionFunding> acqFundings = acqFundingsList.getAcquisitionFunding();
acquisition.setAcquisitionFundingList(acqFundingsList);
*/
+ OwnerList ownersList = new OwnerList();
+ List<String> owners = ownersList.getOwner();
+ for (String owner: acqOwners) {
+ owners.add(owner);
+ }
+ acquisition.setOwners(ownersList);
+
AcquisitionSourceList acqSourcesList = new AcquisitionSourceList();
List<String> acqSources = acqSourcesList.getAcquisitionSource();
for (String acqSource: acquisitionSources) {
label="acquisitions_common" updated="" order="1">
<service:properties>
<types:item><types:key>authRef</types:key><types:value>acquisitionAuthorizer</types:value></types:item>
+ <types:item><types:key>authRef</types:key><types:value>owners|owner</types:value></types:item>
<types:item><types:key>authRef</types:key><types:value>acquisitionSources|acquisitionSource</types:value></types:item>
<!-- Commented out for now, as searching within a field in a complexType breaks searches for referenced objects -->
<!-- <types:item><types:key>authRef</types:key><types:value>acquisitionFundingList|acquisitionFundingSource</types:value></types:item> -->
label="acquisitions_common" updated="" order="1">
<service:properties>
<types:item><types:key>authRef</types:key><types:value>acquisitionAuthorizer</types:value></types:item>
+ <types:item><types:key>authRef</types:key><types:value>owners|owner</types:value></types:item>
<types:item><types:key>authRef</types:key><types:value>acquisitionSources|acquisitionSource</types:value></types:item>
<!-- Commented out for now, as searching within a field in a complexType breaks searches for referenced objects -->
<!-- <types:item><types:key>authRef</types:key><types:value>acquisitionFundingList|acquisitionFundingSource</types:value></types:item> -->