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 // ---------------------------------------------------------------
154 // CRUD tests : CREATE tests
155 // ---------------------------------------------------------------
158 * Creates the with auth refs.
160 * @param testName the test name
161 * @throws Exception the exception
163 @Test(dataProvider="testName")
164 public void createWithAuthRefs(String testName) throws Exception {
165 // Create all the person refs and entities
168 // Create all the organization refs and entities
169 createOrganizationRefs();
171 // Create an object record payload, containing
172 // authority reference values in a number of its fields
173 String identifier = createIdentifier();
174 PoxPayloadOut multipart =
175 createCollectionObjectInstance(
177 "ObjNum" + "-" + identifier,
178 contentOrganizationRefName,
179 contentPersonRefName,
180 assocEventOrganizationRefName,
181 assocEventPersonRefName,
183 fieldCollectionSourceRefName,
184 fieldCollectorRefName
187 // Submit the request to the service and store the response.
188 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
189 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
190 Response res = collectionObjectClient.create(multipart);
191 String newCsid = null;
193 assertStatusCode(res, testName);
194 newCsid = extractId(res);
200 // Store the ID returned from the first resource created
201 // for additional tests below.
202 if (knownResourceId == null){
203 knownResourceId = newCsid;
204 if (logger.isDebugEnabled()) {
205 logger.debug(testName + ": knownResourceId=" + knownResourceId);
209 // Store the IDs from every resource created by tests,
210 // so they can be deleted after tests have been run.
211 collectionObjectIdsCreated.add(extractId(res));
215 * Creates a Person Authority.
217 * @param displayName the display name of the authority
218 * @param shortIdentifier the short identifier for the authority
221 private void createPersonAuthority(String displayName, String shortIdentifier) throws Exception {
222 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
223 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
224 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
225 displayName, shortIdentifier, personAuthClient.getCommonPartName());
226 Response res = personAuthClient.create(multipart);
227 int statusCode = res.getStatus();
229 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
230 invalidStatusCodeMessage(testRequestType, statusCode));
231 Assert.assertEquals(statusCode, STATUS_CREATED);
232 personAuthCSID = extractId(res);
233 personAuthRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
240 * Creates a person item.
242 * @param firstName the person's first name
243 * @param surName the person's surname
244 * @param shortIdentifier the short identifier for the item
245 * @return the CSID of the newly-created person record
248 protected String createPerson(String firstName, String surName, String shortIdentifier ) throws Exception {
249 String result = null;
251 Map<String, String> personInfo = new HashMap<String,String>();
252 personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
253 personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
254 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
255 List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
256 PersonTermGroup term = new PersonTermGroup();
257 String termName = firstName + " " + surName;
258 term.setTermDisplayName(termName);
259 term.setTermName(termName);
260 personTerms.add(term);
261 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
262 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
263 personAuthRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
264 Response res = personAuthClient.createItem(personAuthCSID, multipart);
266 int statusCode = res.getStatus();
268 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
269 invalidStatusCodeMessage(testRequestType, statusCode));
270 Assert.assertEquals(statusCode, STATUS_CREATED);
271 result = extractId(res);
280 * Creates multiple Person items within a Person Authority,
281 * and stores the refNames referring to each.
284 protected void createPersonRefs() throws Exception{
286 createPersonAuthority(PERSON_AUTHORITY_NAME_DISPLAY, PERSON_AUTHORITY_NAME);
290 csid = createPerson("Connie", "ContactPerson", "connieContactPerson");
291 contentPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
292 personIdsCreated.add(csid);
294 // csid = createPerson("Ingrid", "ContentInscriber", "ingridContentInscriber");
295 // contentInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
296 // personIdsCreated.add(csid);
298 // csid = createPerson("Pacifico", "ProductionPerson", "pacificoProductionPerson");
299 // objectProductionPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
300 // personIdsCreated.add(csid);
302 // csid = createPerson("Dessie", "DescriptionInscriber", "dessieDescriptionInscriber");
303 // descriptionInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
304 // personIdsCreated.add(csid);
306 csid = createPerson("Asok", "AssociatedEventPerson", "asokAssociatedEventPerson");
307 assocEventPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
308 personIdsCreated.add(csid);
310 // csid = createPerson("Andrew", "AssociatedPerson", "andrewAssociatedPerson");
311 // assocPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
312 // personIdsCreated.add(csid);
314 csid = createPerson("Owen", "Owner", "owenOwner");
315 ownerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
316 personIdsCreated.add(csid);
318 csid = createPerson("Sally", "Field-CollectionSource", "sallyFieldCollectionSource");
319 fieldCollectionSourceRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
320 personIdsCreated.add(csid);
322 csid = createPerson("Fred", "Lector", "fredLector");
323 fieldCollectorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
324 personIdsCreated.add(csid);
328 * Creates an organization authority.
330 * @param displayName the display name of the authority
331 * @param shortIdentifier the short identifier for the authority
334 private void createOrgAuthority(String displayName, String shortIdentifier) throws Exception {
335 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
336 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
337 PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
338 displayName, shortIdentifier, orgAuthClient.getCommonPartName());
339 Response res = orgAuthClient.create(multipart);
341 int statusCode = res.getStatus();
343 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
344 invalidStatusCodeMessage(testRequestType, statusCode));
345 Assert.assertEquals(statusCode, STATUS_CREATED);
346 orgAuthCSID = extractId(res);
347 orgAuthRefName = OrgAuthorityClientUtils.getAuthorityRefName(orgAuthCSID, null);
354 * Creates an organization item.
356 * @param shortName the organization's short name
357 * @param foundingPlace the organization's founding place
358 * @param shortIdentifier the short identifier for the item
359 * @return the CSID of the newly-created organization record
362 protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) throws Exception {
363 String result = null;
365 Map<String, String> orgInfo = new HashMap<String,String>();
366 orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
367 orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
369 List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
370 OrgTermGroup term = new OrgTermGroup();
371 term.setTermDisplayName(shortName);
372 term.setTermName(shortName);
375 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
376 PoxPayloadOut multipart =
377 OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName, orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
378 Response res = orgAuthClient.createItem(orgAuthCSID, multipart);
380 int statusCode = res.getStatus();
382 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
383 invalidStatusCodeMessage(testRequestType, statusCode));
384 Assert.assertEquals(statusCode, STATUS_CREATED);
385 result = extractId(res);
394 * Creates multiple Organization items within an Organization Authority,
395 * and stores the refNames referring to each.
398 private void createOrganizationRefs() throws Exception {
399 createOrgAuthority(ORG_AUTHORITY_NAME, ORG_AUTHORITY_NAME);
401 csid = createOrganization("Content Org", "Content Org Town", "contentOrg");
402 contentOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
403 orgIdsCreated.add(csid);
405 // csid = createOrganization("Production Org", "Production Org Town", "productionOrg");
406 // objectProductionOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
407 // orgIdsCreated.add(csid);
409 csid = createOrganization("Associated Event Org", "Associated Event Org City", "associatedEventOrg");
410 assocEventOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
411 orgIdsCreated.add(csid);
413 // csid = createOrganization("Associated Org", "Associated Org City", "associatedOrg");
414 // assocOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
415 // orgIdsCreated.add(csid);
421 * Read and check auth refs.
423 * @param testName the test name
424 * @throws Exception the exception
426 @Test(dataProvider="testName",
427 dependsOnMethods = {"createWithAuthRefs"})
428 public void readAndCheckAuthRefs(String testName) throws Exception {
430 testSetup(STATUS_OK, ServiceRequestType.READ);
432 // First read the object
434 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
435 Response res = collectionObjectClient.read(knownResourceId);
437 assertStatusCode(res, testName);
438 PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
439 CollectionobjectsCommon collectionObject = (CollectionobjectsCommon) extractPart(input,
440 collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
441 Assert.assertNotNull(collectionObject);
442 // Check a sample of one or more person authority ref fields
443 Assert.assertEquals(collectionObject.getOwners().getOwner().get(0), ownerRefName);
444 Assert.assertEquals(collectionObject.getFieldCollectionSources().getFieldCollectionSource().get(0),
445 fieldCollectionSourceRefName);
447 // Check a sample of one or more organization authority ref fields
448 Assert.assertEquals(collectionObject.getContentOrganizations().getContentOrganization().get(0),
449 contentOrganizationRefName);
450 Assert.assertEquals(collectionObject.getAssocEventOrganizations().getAssocEventOrganization().get(0),
451 assocEventOrganizationRefName);
458 // Next, get all of the auth refs and check that the expected number is returned
460 res = collectionObjectClient.getAuthorityRefs(knownResourceId);
461 AuthorityRefList list = null;
463 assertStatusCode(res, testName);
464 list = (AuthorityRefList)res.readEntity(AuthorityRefList.class);
471 int expectAuthRefs = personIdsCreated.size() + orgIdsCreated.size();
472 List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
473 int numAuthRefsFound = items.size();
474 if (logger.isDebugEnabled()) {
475 logger.debug("Expected " + expectAuthRefs + " authority references, found " + numAuthRefsFound);
478 // Optionally output additional data about list members for debugging.
479 logger.info(this.toString());
480 boolean iterateThroughList = true;
481 if (iterateThroughList && logger.isDebugEnabled()) {
483 for (AuthorityRefList.AuthorityRefItem item : items) {
484 logger.debug(testName + ": list-item[" + i + "] Field:" +
485 item.getSourceField() + " =" +
486 " item display name = " + item.getAuthDisplayName() +
487 " auth display name = " + item.getItemDisplayName());
488 logger.debug(testName + ": list-item[" + i + "] refName=" + item.getRefName());
489 logger.debug(testName + ": list-item[" + i + "] URI=" + item.getUri());
495 // Make sure we saw the correct number of authRefs
496 Assert.assertEquals(numAuthRefsFound, expectAuthRefs,
497 "Did not find all expected authority references! " + "Expected " + expectAuthRefs + ", found " + numAuthRefsFound);
501 // ---------------------------------------------------------------
502 // Cleanup of resources created during testing
503 // ---------------------------------------------------------------
506 * Deletes all resources created by tests, after all tests have been run.
508 * This cleanup method will always be run, even if one or more tests fail.
509 * For this reason, it attempts to remove all resources created
510 * at any point during testing, even if some of those resources
511 * may be expected to be deleted by certain tests.
514 @AfterClass(alwaysRun=true)
515 public void cleanUp() throws Exception {
516 String noTest = System.getProperty("noTestCleanup");
517 if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
518 if (logger.isDebugEnabled()) {
519 logger.debug("Skipping Cleanup phase ...");
523 if (logger.isDebugEnabled()) {
524 logger.debug("Cleaning up temporary resources created for testing ...");
526 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
527 for (String resourceId : collectionObjectIdsCreated) {
528 // Note: Any non-success responses are ignored and not reported.
529 collectionObjectClient.delete(resourceId).close();
533 // Delete persons before PersonAuth
534 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
535 for (String resourceId : personIdsCreated) {
536 // Note: Any non-success responses are ignored and not reported.
537 personAuthClient.deleteItem(personAuthCSID, resourceId).close();
539 personAuthClient.delete(personAuthCSID).close();
542 // Delete organizations before OrgAuth
543 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
544 for (String resourceId : orgIdsCreated) {
545 // Note: Any non-success responses are ignored and not reported.
546 orgAuthClient.deleteItem(orgAuthCSID, resourceId).close();
548 orgAuthClient.delete(orgAuthCSID).close();
551 // ---------------------------------------------------------------
552 // Utility methods used by tests above
553 // ---------------------------------------------------------------
555 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
558 public String getServicePathComponent() {
559 return SERVICE_PATH_COMPONENT;
563 * Creates the collection object instance.
565 * @param title the title
566 * @param objNum the obj num
567 * @param contentOrganization the content organization
568 * @param contentPeople the content people
569 * @param contentPerson the content person
570 * @param inscriber the inscriber
571 * @return the multipart output
574 private PoxPayloadOut createCollectionObjectInstance(
577 String contentOrganization,
578 String contentPerson,
579 String assocEventOrganization,
580 String assocEventPerson,
582 String fieldCollectionSource,
583 String fieldCollector ) throws Exception {
584 CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
585 TitleGroupList titleGroupList = new TitleGroupList();
586 List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
587 TitleGroup titleGroup = new TitleGroup();
588 titleGroup.setTitle("a title");
589 titleGroups.add(titleGroup);
590 collectionObject.setTitleGroupList(titleGroupList);
591 collectionObject.setObjectNumber(objNum);
593 ContentOrganizationList contentOrganizationList = new ContentOrganizationList();
594 List<String> contentOrganizations = contentOrganizationList.getContentOrganization();
595 contentOrganizations.add(contentOrganization);
596 collectionObject.setContentOrganizations(contentOrganizationList);
598 ContentPersonList contentPersonList = new ContentPersonList();
599 List<String> contentPersons = contentPersonList.getContentPerson();
600 contentPersons.add(contentPerson);
601 collectionObject.setContentPersons(contentPersonList);
603 AssocEventOrganizationList assocEventOrganizationList = new AssocEventOrganizationList();
604 List<String> assocEventOrganizations = assocEventOrganizationList.getAssocEventOrganization();
605 assocEventOrganizations.add(assocEventOrganization);
606 collectionObject.setAssocEventOrganizations(assocEventOrganizationList);
608 AssocEventPersonList assocEventPersonList = new AssocEventPersonList();
609 List<String> assocEventPersons = assocEventPersonList.getAssocEventPerson();
610 assocEventPersons.add(assocEventPerson);
611 collectionObject.setAssocEventPersons(assocEventPersonList);
613 // AssocOrganizationList assocOrganizationList = new AssocOrganizationList();
614 // List<String> assocOrganizations = assocOrganizationList.getAssocOrganization();
615 // assocOrganizations.add(assocOrganization);
616 // collectionObject.setAssocOrganizations(assocOrganizationList);
618 // AssocPersonList assocPersonList = new AssocPersonList();
619 // List<String> assocPersons = assocPersonList.getAssocPerson();
620 // assocPersons.add(assocPerson);
621 // collectionObject.setAssocPersons(assocPersonList);
623 OwnerList ownerList = new OwnerList();
624 List<String> owners = ownerList.getOwner();
626 collectionObject.setOwners(ownerList);
628 FieldCollectionSourceList fieldCollectionSourceList = new FieldCollectionSourceList();
629 List<String> fieldCollectionSources = fieldCollectionSourceList.getFieldCollectionSource();
630 fieldCollectionSources.add(fieldCollectionSource);
631 collectionObject.setFieldCollectionSources(fieldCollectionSourceList);
633 FieldCollectorList FieldCollectorList = new FieldCollectorList();
634 List<String> fieldCollectors = FieldCollectorList.getFieldCollector();
635 fieldCollectors.add(fieldCollector);
636 collectionObject.setFieldCollectors(FieldCollectorList);
638 PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME);
639 PayloadOutputPart commonPart =
640 multipart.addPart(collectionObject, MediaType.APPLICATION_XML_TYPE);
641 commonPart.setLabel(new CollectionObjectClient().getCommonPartName());
643 if(logger.isDebugEnabled()){
644 logger.debug("to be created, collectionObject common");
645 logger.debug(objectAsXmlString(collectionObject, CollectionobjectsCommon.class));