2 * This document is a part of the source code and related artifacts
3 * for CollectionSpace, an open source collections management system
4 * for museums and related institutions:
6 * http://www.collectionspace.org
7 * http://wiki.collectionspace.org
9 * Copyright © 2009 Regents of the University of California
11 * Licensed under the Educational Community License (ECL), Version 2.0.
12 * You may not use this file except in compliance with this License.
14 * You may obtain a copy of the ECL 2.0 License at
15 * https://source.collectionspace.org/collection-space/LICENSE.txt
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
23 package org.collectionspace.services.client.test;
25 import java.util.ArrayList;
26 import java.util.HashMap;
27 import java.util.List;
30 import javax.ws.rs.core.MediaType;
31 import javax.ws.rs.core.Response;
33 import org.collectionspace.services.OrganizationJAXBSchema;
34 import org.collectionspace.services.PersonJAXBSchema;
35 import org.collectionspace.services.client.CollectionObjectClient;
36 import org.collectionspace.services.client.CollectionSpaceClient;
37 import org.collectionspace.services.client.OrgAuthorityClient;
38 import org.collectionspace.services.client.OrgAuthorityClientUtils;
39 import org.collectionspace.services.client.PayloadOutputPart;
40 import org.collectionspace.services.client.PersonAuthorityClient;
41 import org.collectionspace.services.client.PersonAuthorityClientUtils;
42 import org.collectionspace.services.client.PoxPayloadIn;
43 import org.collectionspace.services.client.PoxPayloadOut;
44 import org.collectionspace.services.common.authorityref.AuthorityRefList;
45 import org.collectionspace.services.collectionobject.AssocEventOrganizationList;
46 import org.collectionspace.services.collectionobject.AssocEventPersonList;
47 import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
48 import org.collectionspace.services.collectionobject.ContentOrganizationList;
49 import org.collectionspace.services.collectionobject.ContentPersonList;
50 import org.collectionspace.services.collectionobject.OwnerList;
51 import org.collectionspace.services.collectionobject.FieldCollectionSourceList;
52 import org.collectionspace.services.collectionobject.FieldCollectorList;
53 import org.collectionspace.services.collectionobject.TitleGroup;
54 import org.collectionspace.services.collectionobject.TitleGroupList;
55 import org.collectionspace.services.jaxb.AbstractCommonList;
56 import org.collectionspace.services.organization.OrgTermGroup;
57 import org.collectionspace.services.person.PersonTermGroup;
58 import org.testng.Assert;
59 import org.testng.annotations.AfterClass;
60 import org.testng.annotations.Test;
61 import org.slf4j.Logger;
62 import org.slf4j.LoggerFactory;
65 * CollectionObjectAuthRefsTest, carries out tests against a
66 * deployed and running CollectionObject Service.
68 * $LastChangedRevision: 1327 $
69 * $LastChangedDate: 2010-02-12 10:35:11 -0800 (Fri, 12 Feb 2010) $
71 public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
74 protected CollectionSpaceClient getClientInstance() {
75 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
79 protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) {
80 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
84 protected String getServiceName() {
85 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
89 private final String CLASS_NAME = CollectionObjectAuthRefsTest.class.getName();
90 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
92 // Instance variables specific to this test.
93 /** The service path component. */
94 final String SERVICE_PATH_COMPONENT = "collectionobjects";
96 /** The person authority name. */
97 final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
98 final String PERSON_AUTHORITY_NAME_DISPLAY = "TestPersonAuth_DisplayName";
100 /** The organization authority name. */
101 final String ORG_AUTHORITY_NAME = "TestOrgAuth";
103 /** The collection object ids created. */
104 private List<String> collectionObjectIdsCreated = new ArrayList<String>();
106 /** The person ids created. */
107 private List<String> personIdsCreated = new ArrayList<String>();
109 /** The person authority csid and refName. */
110 private String personAuthCSID = null;
111 private String personAuthRefName = null;
113 /** The organization ids created. */
114 private List<String> orgIdsCreated = new ArrayList<String>();
116 /** The org authority csid and refName. */
117 private String orgAuthCSID = null;
118 private String orgAuthRefName = null;
120 private String contentOrganizationRefName = null;
121 private String contentPersonRefName = null;
122 private String assocEventOrganizationRefName = null;
123 private String assocEventPersonRefName = null;
124 private String ownerRefName = null;
125 private String fieldCollectionSourceRefName = null;
126 private String fieldCollectorRefName = null;
128 // FIXME: As of 2012-01-04, the two assocEvent... fields
129 // and the ownerRefName field have been commented out in
130 // the list of authRef fields in CollectionObject, in tenant bindings,
131 // because those fields fall within to-be-created repeatable groups,
133 // As a result, the number of authority references expected to be found
134 // is currently 4, rather than 7. - Aron
135 public String toString(){
136 String result = "CollectionObjectauthRefsTest: "
137 + "\r\npersonAuthCSID: "+personAuthCSID
138 + "\r\npersonAuthRefName: "+personAuthRefName
139 + "\r\norgAuthCSID: "+orgAuthCSID
140 + "\r\norgAuthRefName: "+orgAuthRefName
142 + "\r\n contentOrganizationRefName: "+contentOrganizationRefName
143 + "\r\n contentPersonRefName: "+contentPersonRefName
144 + "\r\n assocEventOrganizationRefName: "+assocEventOrganizationRefName
145 + "\r\n assocEventPersonRefName: "+assocEventPersonRefName
146 + "\r\n ownerRefName: "+ownerRefName
147 + "\r\n fieldCollectionSourceRefName: "+fieldCollectionSourceRefName
148 + "\r\n fieldCollectorRefName: "+fieldCollectorRefName;
153 /** The number of authority references expected. */
154 private final int NUM_AUTH_REFS_EXPECTED = 7;
156 // ---------------------------------------------------------------
157 // CRUD tests : CREATE tests
158 // ---------------------------------------------------------------
161 * Creates the with auth refs.
163 * @param testName the test name
164 * @throws Exception the exception
166 @Test(dataProvider="testName")
167 public void createWithAuthRefs(String testName) throws Exception {
168 // Create all the person refs and entities
171 // Create all the organization refs and entities
172 createOrganizationRefs();
174 // Create an object record payload, containing
175 // authority reference values in a number of its fields
176 String identifier = createIdentifier();
177 PoxPayloadOut multipart =
178 createCollectionObjectInstance(
180 "ObjNum" + "-" + identifier,
181 contentOrganizationRefName,
182 contentPersonRefName,
183 assocEventOrganizationRefName,
184 assocEventPersonRefName,
186 fieldCollectionSourceRefName,
187 fieldCollectorRefName
190 // Submit the request to the service and store the response.
191 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
192 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
193 Response res = collectionObjectClient.create(multipart);
194 String newCsid = null;
196 assertStatusCode(res, testName);
197 newCsid = extractId(res);
203 // Store the ID returned from the first resource created
204 // for additional tests below.
205 if (knownResourceId == null){
206 knownResourceId = newCsid;
207 if (logger.isDebugEnabled()) {
208 logger.debug(testName + ": knownResourceId=" + knownResourceId);
212 // Store the IDs from every resource created by tests,
213 // so they can be deleted after tests have been run.
214 collectionObjectIdsCreated.add(extractId(res));
218 * Creates a Person Authority.
220 * @param displayName the display name of the authority
221 * @param shortIdentifier the short identifier for the authority
224 private void createPersonAuthority(String displayName, String shortIdentifier) throws Exception {
225 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
226 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
227 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
228 displayName, shortIdentifier, personAuthClient.getCommonPartName());
229 Response res = personAuthClient.create(multipart);
230 int statusCode = res.getStatus();
232 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
233 invalidStatusCodeMessage(testRequestType, statusCode));
234 Assert.assertEquals(statusCode, STATUS_CREATED);
235 personAuthCSID = extractId(res);
236 personAuthRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
243 * Creates a person item.
245 * @param firstName the person's first name
246 * @param surName the person's surname
247 * @param shortIdentifier the short identifier for the item
248 * @return the CSID of the newly-created person record
251 protected String createPerson(String firstName, String surName, String shortIdentifier ) throws Exception {
252 String result = null;
254 Map<String, String> personInfo = new HashMap<String,String>();
255 personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
256 personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
257 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
258 List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
259 PersonTermGroup term = new PersonTermGroup();
260 String termName = firstName + " " + surName;
261 term.setTermDisplayName(termName);
262 term.setTermName(termName);
263 personTerms.add(term);
264 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
265 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
266 personAuthRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
267 Response res = personAuthClient.createItem(personAuthCSID, multipart);
269 int statusCode = res.getStatus();
271 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
272 invalidStatusCodeMessage(testRequestType, statusCode));
273 Assert.assertEquals(statusCode, STATUS_CREATED);
274 result = extractId(res);
283 * Creates multiple Person items within a Person Authority,
284 * and stores the refNames referring to each.
287 protected void createPersonRefs() throws Exception{
289 createPersonAuthority(PERSON_AUTHORITY_NAME_DISPLAY, PERSON_AUTHORITY_NAME);
293 csid = createPerson("Connie", "ContactPerson", "connieContactPerson");
294 contentPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
295 personIdsCreated.add(csid);
297 // csid = createPerson("Ingrid", "ContentInscriber", "ingridContentInscriber");
298 // contentInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
299 // personIdsCreated.add(csid);
301 // csid = createPerson("Pacifico", "ProductionPerson", "pacificoProductionPerson");
302 // objectProductionPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
303 // personIdsCreated.add(csid);
305 // csid = createPerson("Dessie", "DescriptionInscriber", "dessieDescriptionInscriber");
306 // descriptionInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
307 // personIdsCreated.add(csid);
309 csid = createPerson("Asok", "AssociatedEventPerson", "asokAssociatedEventPerson");
310 assocEventPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
311 personIdsCreated.add(csid);
313 // csid = createPerson("Andrew", "AssociatedPerson", "andrewAssociatedPerson");
314 // assocPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
315 // personIdsCreated.add(csid);
317 csid = createPerson("Owen", "Owner", "owenOwner");
318 ownerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
319 personIdsCreated.add(csid);
321 csid = createPerson("Sally", "Field-CollectionSource", "sallyFieldCollectionSource");
322 fieldCollectionSourceRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
323 personIdsCreated.add(csid);
325 csid = createPerson("Fred", "Lector", "fredLector");
326 fieldCollectorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
327 personIdsCreated.add(csid);
331 * Creates an organization authority.
333 * @param displayName the display name of the authority
334 * @param shortIdentifier the short identifier for the authority
337 private void createOrgAuthority(String displayName, String shortIdentifier) throws Exception {
338 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
339 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
340 PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
341 displayName, shortIdentifier, orgAuthClient.getCommonPartName());
342 Response res = orgAuthClient.create(multipart);
344 int statusCode = res.getStatus();
346 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
347 invalidStatusCodeMessage(testRequestType, statusCode));
348 Assert.assertEquals(statusCode, STATUS_CREATED);
349 orgAuthCSID = extractId(res);
350 orgAuthRefName = OrgAuthorityClientUtils.getAuthorityRefName(orgAuthCSID, null);
357 * Creates an organization item.
359 * @param shortName the organization's short name
360 * @param foundingPlace the organization's founding place
361 * @param shortIdentifier the short identifier for the item
362 * @return the CSID of the newly-created organization record
365 protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) throws Exception {
366 String result = null;
368 Map<String, String> orgInfo = new HashMap<String,String>();
369 orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
370 orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
372 List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
373 OrgTermGroup term = new OrgTermGroup();
374 term.setTermDisplayName(shortName);
375 term.setTermName(shortName);
378 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
379 PoxPayloadOut multipart =
380 OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName, orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
381 Response res = orgAuthClient.createItem(orgAuthCSID, multipart);
383 int statusCode = res.getStatus();
385 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
386 invalidStatusCodeMessage(testRequestType, statusCode));
387 Assert.assertEquals(statusCode, STATUS_CREATED);
388 result = extractId(res);
397 * Creates multiple Organization items within an Organization Authority,
398 * and stores the refNames referring to each.
401 private void createOrganizationRefs() throws Exception {
402 createOrgAuthority(ORG_AUTHORITY_NAME, ORG_AUTHORITY_NAME);
404 csid = createOrganization("Content Org", "Content Org Town", "contentOrg");
405 contentOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
406 orgIdsCreated.add(csid);
408 // csid = createOrganization("Production Org", "Production Org Town", "productionOrg");
409 // objectProductionOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
410 // orgIdsCreated.add(csid);
412 csid = createOrganization("Associated Event Org", "Associated Event Org City", "associatedEventOrg");
413 assocEventOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
414 orgIdsCreated.add(csid);
416 // csid = createOrganization("Associated Org", "Associated Org City", "associatedOrg");
417 // assocOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
418 // orgIdsCreated.add(csid);
424 * Read and check auth refs.
426 * @param testName the test name
427 * @throws Exception the exception
429 @Test(dataProvider="testName",
430 dependsOnMethods = {"createWithAuthRefs"})
431 public void readAndCheckAuthRefs(String testName) throws Exception {
433 testSetup(STATUS_OK, ServiceRequestType.READ);
435 // First read the object
437 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
438 Response res = collectionObjectClient.read(knownResourceId);
439 CollectionobjectsCommon collectionObject = null;
441 assertStatusCode(res, testName);
442 PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
443 collectionObject = (CollectionobjectsCommon) extractPart(input,
444 collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
445 Assert.assertNotNull(collectionObject);
452 // Next, get all of the auth refs and check that the expected number is returned
454 res = collectionObjectClient.getAuthorityRefs(knownResourceId);
455 AuthorityRefList list = null;
457 assertStatusCode(res, testName);
458 list = (AuthorityRefList)res.readEntity(AuthorityRefList.class);
465 List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
466 int numAuthRefsFound = items.size();
467 if(logger.isDebugEnabled()){
468 logger.debug("Expected " + NUM_AUTH_REFS_EXPECTED +
469 " authority references, found " + numAuthRefsFound);
471 Assert.assertEquals(numAuthRefsFound, NUM_AUTH_REFS_EXPECTED,
472 "Did not find all expected authority references! " +
473 "Expected " + NUM_AUTH_REFS_EXPECTED + ", found " + numAuthRefsFound);
475 // Check a sample of one or more person authority ref fields
476 // Assert.assertEquals(collectionObject.getAssocPersons().getAssocPerson().get(0), assocPersonRefName);
477 Assert.assertEquals(collectionObject.getOwners().getOwner().get(0), ownerRefName);
478 Assert.assertEquals(collectionObject.getFieldCollectionSources().getFieldCollectionSource().get(0), fieldCollectionSourceRefName);
480 // Check a sample of one or more organization authority ref fields
481 Assert.assertEquals(collectionObject.getContentOrganizations().getContentOrganization().get(0), contentOrganizationRefName);
482 Assert.assertEquals(collectionObject.getAssocEventOrganizations().getAssocEventOrganization().get(0), assocEventOrganizationRefName);
484 // Optionally output additional data about list members for debugging.
485 logger.info(this.toString());
486 boolean iterateThroughList = true;
487 if(iterateThroughList && logger.isDebugEnabled()){;
489 for(AuthorityRefList.AuthorityRefItem item : items){
490 logger.debug(testName + ": list-item[" + i + "] Field:" +
491 item.getSourceField() + " =" +
492 " item display name = " + item.getAuthDisplayName() +
493 " auth display name = " + item.getItemDisplayName());
494 logger.debug(testName + ": list-item[" + i + "] refName=" +
496 logger.debug(testName + ": list-item[" + i + "] URI=" +
504 // ---------------------------------------------------------------
505 // Cleanup of resources created during testing
506 // ---------------------------------------------------------------
509 * Deletes all resources created by tests, after all tests have been run.
511 * This cleanup method will always be run, even if one or more tests fail.
512 * For this reason, it attempts to remove all resources created
513 * at any point during testing, even if some of those resources
514 * may be expected to be deleted by certain tests.
517 @AfterClass(alwaysRun=true)
518 public void cleanUp() throws Exception {
519 String noTest = System.getProperty("noTestCleanup");
520 if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
521 if (logger.isDebugEnabled()) {
522 logger.debug("Skipping Cleanup phase ...");
526 if (logger.isDebugEnabled()) {
527 logger.debug("Cleaning up temporary resources created for testing ...");
529 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
530 for (String resourceId : collectionObjectIdsCreated) {
531 // Note: Any non-success responses are ignored and not reported.
532 collectionObjectClient.delete(resourceId).close();
534 // Note: Any non-success response is ignored and not reported.
535 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
536 // Delete persons before PersonAuth
537 for (String resourceId : personIdsCreated) {
538 // Note: Any non-success responses are ignored and not reported.
539 personAuthClient.deleteItem(personAuthCSID, resourceId).close();
541 personAuthClient.delete(personAuthCSID).close();
542 // Note: Any non-success response is ignored and not reported.
543 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
544 // Delete organizations before OrgAuth
545 for (String resourceId : orgIdsCreated) {
546 // Note: Any non-success responses are ignored and not reported.
547 orgAuthClient.deleteItem(orgAuthCSID, resourceId).close();
549 orgAuthClient.delete(orgAuthCSID).close();
552 // ---------------------------------------------------------------
553 // Utility methods used by tests above
554 // ---------------------------------------------------------------
556 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
559 public String getServicePathComponent() {
560 return SERVICE_PATH_COMPONENT;
564 * Creates the collection object instance.
566 * @param title the title
567 * @param objNum the obj num
568 * @param contentOrganization the content organization
569 * @param contentPeople the content people
570 * @param contentPerson the content person
571 * @param inscriber the inscriber
572 * @return the multipart output
575 private PoxPayloadOut createCollectionObjectInstance(
578 String contentOrganization,
579 String contentPerson,
580 String assocEventOrganization,
581 String assocEventPerson,
583 String fieldCollectionSource,
584 String fieldCollector ) throws Exception {
585 CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
586 TitleGroupList titleGroupList = new TitleGroupList();
587 List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
588 TitleGroup titleGroup = new TitleGroup();
589 titleGroup.setTitle("a title");
590 titleGroups.add(titleGroup);
591 collectionObject.setTitleGroupList(titleGroupList);
592 collectionObject.setObjectNumber(objNum);
594 ContentOrganizationList contentOrganizationList = new ContentOrganizationList();
595 List<String> contentOrganizations = contentOrganizationList.getContentOrganization();
596 contentOrganizations.add(contentOrganization);
597 collectionObject.setContentOrganizations(contentOrganizationList);
599 ContentPersonList contentPersonList = new ContentPersonList();
600 List<String> contentPersons = contentPersonList.getContentPerson();
601 contentPersons.add(contentPerson);
602 collectionObject.setContentPersons(contentPersonList);
604 AssocEventOrganizationList assocEventOrganizationList = new AssocEventOrganizationList();
605 List<String> assocEventOrganizations = assocEventOrganizationList.getAssocEventOrganization();
606 assocEventOrganizations.add(assocEventOrganization);
607 collectionObject.setAssocEventOrganizations(assocEventOrganizationList);
609 AssocEventPersonList assocEventPersonList = new AssocEventPersonList();
610 List<String> assocEventPersons = assocEventPersonList.getAssocEventPerson();
611 assocEventPersons.add(assocEventPerson);
612 collectionObject.setAssocEventPersons(assocEventPersonList);
614 // AssocOrganizationList assocOrganizationList = new AssocOrganizationList();
615 // List<String> assocOrganizations = assocOrganizationList.getAssocOrganization();
616 // assocOrganizations.add(assocOrganization);
617 // collectionObject.setAssocOrganizations(assocOrganizationList);
619 // AssocPersonList assocPersonList = new AssocPersonList();
620 // List<String> assocPersons = assocPersonList.getAssocPerson();
621 // assocPersons.add(assocPerson);
622 // collectionObject.setAssocPersons(assocPersonList);
624 OwnerList ownerList = new OwnerList();
625 List<String> owners = ownerList.getOwner();
627 collectionObject.setOwners(ownerList);
629 FieldCollectionSourceList fieldCollectionSourceList = new FieldCollectionSourceList();
630 List<String> fieldCollectionSources = fieldCollectionSourceList.getFieldCollectionSource();
631 fieldCollectionSources.add(fieldCollectionSource);
632 collectionObject.setFieldCollectionSources(fieldCollectionSourceList);
634 FieldCollectorList FieldCollectorList = new FieldCollectorList();
635 List<String> fieldCollectors = FieldCollectorList.getFieldCollector();
636 fieldCollectors.add(fieldCollector);
637 collectionObject.setFieldCollectors(FieldCollectorList);
639 PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME);
640 PayloadOutputPart commonPart =
641 multipart.addPart(collectionObject, MediaType.APPLICATION_XML_TYPE);
642 commonPart.setLabel(new CollectionObjectClient().getCommonPartName());
644 if(logger.isDebugEnabled()){
645 logger.debug("to be created, collectionObject common");
646 logger.debug(objectAsXmlString(collectionObject, CollectionobjectsCommon.class));