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.person.PersonTermGroup;
58 import org.jboss.resteasy.client.ClientResponse;
60 import org.testng.Assert;
61 import org.testng.annotations.AfterClass;
62 import org.testng.annotations.Test;
64 import org.slf4j.Logger;
65 import org.slf4j.LoggerFactory;
68 * CollectionObjectAuthRefsTest, carries out tests against a
69 * deployed and running CollectionObject Service.
71 * $LastChangedRevision: 1327 $
72 * $LastChangedDate: 2010-02-12 10:35:11 -0800 (Fri, 12 Feb 2010) $
74 public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
77 protected CollectionSpaceClient getClientInstance() {
78 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
82 protected String getServiceName() {
83 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
87 private final String CLASS_NAME = CollectionObjectAuthRefsTest.class.getName();
88 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
90 // Instance variables specific to this test.
91 /** The service path component. */
92 final String SERVICE_PATH_COMPONENT = "collectionobjects";
94 /** The person authority name. */
95 final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
96 final String PERSON_AUTHORITY_NAME_DISPLAY = "TestPersonAuth_DisplayName";
98 /** The organization authority name. */
99 final String ORG_AUTHORITY_NAME = "TestOrgAuth";
101 /** The collection object ids created. */
102 private List<String> collectionObjectIdsCreated = new ArrayList<String>();
104 /** The person ids created. */
105 private List<String> personIdsCreated = new ArrayList<String>();
107 /** The person authority csid and refName. */
108 private String personAuthCSID = null;
109 private String personAuthRefName = null;
111 /** The organization ids created. */
112 private List<String> orgIdsCreated = new ArrayList<String>();
114 /** The org authority csid and refName. */
115 private String orgAuthCSID = null;
116 private String orgAuthRefName = null;
118 private String contentOrganizationRefName = null;
119 private String contentPersonRefName = null;
120 private String assocEventOrganizationRefName = null;
121 private String assocEventPersonRefName = null;
122 private String ownerRefName = null;
123 private String fieldCollectionSourceRefName = null;
124 private String fieldCollectorRefName = null;
126 // FIXME: As of 2012-01-04, the two assocEvent... fields
127 // and the ownerRefName field have been commented out in
128 // the list of authRef fields in CollectionObject, in tenant bindings,
129 // because those fields fall within to-be-created repeatable groups,
131 // As a result, the number of authority references expected to be found
132 // is currently 4, rather than 7. - Aron
133 public String toString(){
134 String result = "CollectionObjectauthRefsTest: "
135 + "\r\npersonAuthCSID: "+personAuthCSID
136 + "\r\npersonAuthRefName: "+personAuthRefName
137 + "\r\norgAuthCSID: "+orgAuthCSID
138 + "\r\norgAuthRefName: "+orgAuthRefName
140 + "\r\n contentOrganizationRefName: "+contentOrganizationRefName
141 + "\r\n contentPersonRefName: "+contentPersonRefName
142 + "\r\n assocEventOrganizationRefName: "+assocEventOrganizationRefName
143 + "\r\n assocEventPersonRefName: "+assocEventPersonRefName
144 + "\r\n ownerRefName: "+ownerRefName
145 + "\r\n fieldCollectionSourceRefName: "+fieldCollectionSourceRefName
146 + "\r\n fieldCollectorRefName: "+fieldCollectorRefName;
147 StringBuffer buff = new StringBuffer();
152 /** The number of authority references expected. */
153 private final int NUM_AUTH_REFS_EXPECTED = 4;
155 // ---------------------------------------------------------------
156 // CRUD tests : CREATE tests
157 // ---------------------------------------------------------------
160 * Creates the with auth refs.
162 * @param testName the test name
163 * @throws Exception the exception
165 @Test(dataProvider="testName")
166 public void createWithAuthRefs(String testName) throws Exception {
167 // Create all the person refs and entities
170 // Create all the organization refs and entities
171 createOrganizationRefs();
173 // Create an object record payload, containing
174 // authority reference values in a number of its fields
175 String identifier = createIdentifier();
176 PoxPayloadOut multipart =
177 createCollectionObjectInstance(
179 "ObjNum" + "-" + identifier,
180 contentOrganizationRefName,
181 contentPersonRefName,
182 assocEventOrganizationRefName,
183 assocEventPersonRefName,
185 fieldCollectionSourceRefName,
186 fieldCollectorRefName
189 // Submit the request to the service and store the response.
190 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
191 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
192 ClientResponse<Response> res = collectionObjectClient.create(multipart);
193 String newCsid = null;
195 assertStatusCode(res, testName);
196 newCsid = extractId(res);
199 res.releaseConnection();
202 // Store the ID returned from the first resource created
203 // for additional tests below.
204 if (knownResourceId == null){
205 knownResourceId = newCsid;
206 if (logger.isDebugEnabled()) {
207 logger.debug(testName + ": knownResourceId=" + knownResourceId);
211 // Store the IDs from every resource created by tests,
212 // so they can be deleted after tests have been run.
213 collectionObjectIdsCreated.add(extractId(res));
217 * Creates a Person Authority.
219 * @param displayName the display name of the authority
220 * @param shortIdentifier the short identifier for the authority
222 private void createPersonAuthority(String displayName, String shortIdentifier) {
223 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
224 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
225 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
226 displayName, shortIdentifier, personAuthClient.getCommonPartName());
227 ClientResponse<Response> res = personAuthClient.create(multipart);
228 int statusCode = res.getStatus();
230 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
231 invalidStatusCodeMessage(testRequestType, statusCode));
232 Assert.assertEquals(statusCode, STATUS_CREATED);
233 personAuthCSID = extractId(res);
234 personAuthRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
238 * Creates a person item.
240 * @param firstName the person's first name
241 * @param surName the person's surname
242 * @param shortIdentifier the short identifier for the item
243 * @return the CSID of the newly-created person record
245 protected String createPerson(String firstName, String surName, String shortIdentifier ) {
246 Map<String, String> personInfo = new HashMap<String,String>();
247 personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
248 personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
249 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
250 List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
251 PersonTermGroup term = new PersonTermGroup();
252 String termName = firstName + " " + surName;
253 term.setTermDisplayName(termName);
254 term.setTermName(termName);
255 personTerms.add(term);
256 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
257 PoxPayloadOut multipart =
258 PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
259 personAuthRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
260 ClientResponse<Response> res = personAuthClient.createItem(personAuthCSID, multipart);
261 int statusCode = res.getStatus();
263 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
264 invalidStatusCodeMessage(testRequestType, statusCode));
265 Assert.assertEquals(statusCode, STATUS_CREATED);
266 return extractId(res);
270 * Creates multiple Person items within a Person Authority,
271 * and stores the refNames referring to each.
273 protected void createPersonRefs(){
275 createPersonAuthority(PERSON_AUTHORITY_NAME_DISPLAY, PERSON_AUTHORITY_NAME);
279 csid = createPerson("Connie", "ContactPerson", "connieContactPerson");
280 contentPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
281 personIdsCreated.add(csid);
283 // csid = createPerson("Ingrid", "ContentInscriber", "ingridContentInscriber");
284 // contentInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
285 // personIdsCreated.add(csid);
287 // csid = createPerson("Pacifico", "ProductionPerson", "pacificoProductionPerson");
288 // objectProductionPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
289 // personIdsCreated.add(csid);
291 // csid = createPerson("Dessie", "DescriptionInscriber", "dessieDescriptionInscriber");
292 // descriptionInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
293 // personIdsCreated.add(csid);
295 csid = createPerson("Asok", "AssociatedEventPerson", "asokAssociatedEventPerson");
296 assocEventPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
297 personIdsCreated.add(csid);
299 // csid = createPerson("Andrew", "AssociatedPerson", "andrewAssociatedPerson");
300 // assocPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
301 // personIdsCreated.add(csid);
303 csid = createPerson("Owen", "Owner", "owenOwner");
304 ownerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
305 personIdsCreated.add(csid);
307 csid = createPerson("Sally", "Field-CollectionSource", "sallyFieldCollectionSource");
308 fieldCollectionSourceRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
309 personIdsCreated.add(csid);
311 csid = createPerson("Fred", "Lector", "fredLector");
312 fieldCollectorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
313 personIdsCreated.add(csid);
317 * Creates an organization authority.
319 * @param displayName the display name of the authority
320 * @param shortIdentifier the short identifier for the authority
322 private void createOrgAuthority(String displayName, String shortIdentifier) {
323 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
324 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
325 PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
326 displayName, shortIdentifier, orgAuthClient.getCommonPartName());
327 ClientResponse<Response> res = orgAuthClient.create(multipart);
328 int statusCode = res.getStatus();
330 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
331 invalidStatusCodeMessage(testRequestType, statusCode));
332 Assert.assertEquals(statusCode, STATUS_CREATED);
333 orgAuthCSID = extractId(res);
334 orgAuthRefName = OrgAuthorityClientUtils.getAuthorityRefName(orgAuthCSID, null);
338 * Creates an organization item.
340 * @param shortName the organization's short name
341 * @param foundingPlace the organization's founding place
342 * @param shortIdentifier the short identifier for the item
343 * @return the CSID of the newly-created organization record
345 protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) {
346 Map<String, String> orgInfo = new HashMap<String,String>();
347 orgInfo.put(OrganizationJAXBSchema.SHORT_NAME, shortName);
348 orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
349 orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
350 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
351 PoxPayloadOut multipart =
352 OrgAuthorityClientUtils.createOrganizationInstance(
353 orgAuthRefName, orgInfo, orgAuthClient.getItemCommonPartName());
354 ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);
355 int statusCode = res.getStatus();
357 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
358 invalidStatusCodeMessage(testRequestType, statusCode));
359 Assert.assertEquals(statusCode, STATUS_CREATED);
360 return extractId(res);
364 * Creates multiple Organization items within an Organization Authority,
365 * and stores the refNames referring to each.
367 private void createOrganizationRefs() {
369 createOrgAuthority(ORG_AUTHORITY_NAME, ORG_AUTHORITY_NAME);
373 csid = createOrganization("Content Org", "Content Org Town", "contentOrg");
374 contentOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
375 orgIdsCreated.add(csid);
377 // csid = createOrganization("Production Org", "Production Org Town", "productionOrg");
378 // objectProductionOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
379 // orgIdsCreated.add(csid);
381 csid = createOrganization("Associated Event Org", "Associated Event Org City", "associatedEventOrg");
382 assocEventOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
383 orgIdsCreated.add(csid);
385 // csid = createOrganization("Associated Org", "Associated Org City", "associatedOrg");
386 // assocOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
387 // orgIdsCreated.add(csid);
393 * Read and check auth refs.
395 * @param testName the test name
396 * @throws Exception the exception
398 @Test(dataProvider="testName",
399 dependsOnMethods = {"createWithAuthRefs"})
400 public void readAndCheckAuthRefs(String testName) throws Exception {
402 testSetup(STATUS_OK, ServiceRequestType.READ);
404 // First read the object
406 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
407 ClientResponse<String> res = collectionObjectClient.read(knownResourceId);
408 CollectionobjectsCommon collectionObject = null;
410 assertStatusCode(res, testName);
411 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
412 collectionObject = (CollectionobjectsCommon) extractPart(input,
413 collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
414 Assert.assertNotNull(collectionObject);
417 res.releaseConnection();
421 // Next, get all of the auth refs and check that the expected number is returned
423 ClientResponse<AuthorityRefList> res2 = collectionObjectClient.getAuthorityRefs(knownResourceId);
424 AuthorityRefList list = null;
426 assertStatusCode(res2, testName);
427 list = res2.getEntity();
430 res2.releaseConnection();
434 List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
435 int numAuthRefsFound = items.size();
436 if(logger.isDebugEnabled()){
437 logger.debug("Expected " + NUM_AUTH_REFS_EXPECTED +
438 " authority references, found " + numAuthRefsFound);
440 Assert.assertEquals(numAuthRefsFound, NUM_AUTH_REFS_EXPECTED,
441 "Did not find all expected authority references! " +
442 "Expected " + NUM_AUTH_REFS_EXPECTED + ", found " + numAuthRefsFound);
444 // Check a sample of one or more person authority ref fields
445 // Assert.assertEquals(collectionObject.getAssocPersons().getAssocPerson().get(0), assocPersonRefName);
446 Assert.assertEquals(collectionObject.getOwners().getOwner().get(0), ownerRefName);
447 Assert.assertEquals(collectionObject.getFieldCollectionSources().getFieldCollectionSource().get(0), fieldCollectionSourceRefName);
449 // Check a sample of one or more organization authority ref fields
450 Assert.assertEquals(collectionObject.getContentOrganizations().getContentOrganization().get(0), contentOrganizationRefName);
451 Assert.assertEquals(collectionObject.getAssocEventOrganizations().getAssocEventOrganization().get(0), assocEventOrganizationRefName);
453 // Optionally output additional data about list members for debugging.
454 logger.info(this.toString());
455 boolean iterateThroughList = true;
456 if(iterateThroughList && logger.isDebugEnabled()){;
458 for(AuthorityRefList.AuthorityRefItem item : items){
459 logger.debug(testName + ": list-item[" + i + "] Field:" +
460 item.getSourceField() + " =" +
461 " item display name = " + item.getAuthDisplayName() +
462 " auth display name = " + item.getItemDisplayName());
463 logger.debug(testName + ": list-item[" + i + "] refName=" +
465 logger.debug(testName + ": list-item[" + i + "] URI=" +
473 // ---------------------------------------------------------------
474 // Cleanup of resources created during testing
475 // ---------------------------------------------------------------
478 * Deletes all resources created by tests, after all tests have been run.
480 * This cleanup method will always be run, even if one or more tests fail.
481 * For this reason, it attempts to remove all resources created
482 * at any point during testing, even if some of those resources
483 * may be expected to be deleted by certain tests.
485 @AfterClass(alwaysRun=true)
486 public void cleanUp() {
487 String noTest = System.getProperty("noTestCleanup");
488 if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
489 if (logger.isDebugEnabled()) {
490 logger.debug("Skipping Cleanup phase ...");
494 if (logger.isDebugEnabled()) {
495 logger.debug("Cleaning up temporary resources created for testing ...");
497 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
498 for (String resourceId : collectionObjectIdsCreated) {
499 // Note: Any non-success responses are ignored and not reported.
500 collectionObjectClient.delete(resourceId).releaseConnection();
502 // Note: Any non-success response is ignored and not reported.
503 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
504 // Delete persons before PersonAuth
505 for (String resourceId : personIdsCreated) {
506 // Note: Any non-success responses are ignored and not reported.
507 personAuthClient.deleteItem(personAuthCSID, resourceId).releaseConnection();
509 personAuthClient.delete(personAuthCSID).releaseConnection();
510 // Note: Any non-success response is ignored and not reported.
511 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
512 // Delete organizations before OrgAuth
513 for (String resourceId : orgIdsCreated) {
514 // Note: Any non-success responses are ignored and not reported.
515 orgAuthClient.deleteItem(orgAuthCSID, resourceId).releaseConnection();
517 orgAuthClient.delete(orgAuthCSID).releaseConnection();
520 // ---------------------------------------------------------------
521 // Utility methods used by tests above
522 // ---------------------------------------------------------------
524 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
527 public String getServicePathComponent() {
528 return SERVICE_PATH_COMPONENT;
532 * Creates the collection object instance.
534 * @param title the title
535 * @param objNum the obj num
536 * @param contentOrganization the content organization
537 * @param contentPeople the content people
538 * @param contentPerson the content person
539 * @param inscriber the inscriber
540 * @return the multipart output
542 private PoxPayloadOut createCollectionObjectInstance(
545 String contentOrganization,
546 String contentPerson,
547 String assocEventOrganization,
548 String assocEventPerson,
550 String fieldCollectionSource,
551 String fieldCollector ) {
552 CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
553 TitleGroupList titleGroupList = new TitleGroupList();
554 List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
555 TitleGroup titleGroup = new TitleGroup();
556 titleGroup.setTitle("a title");
557 titleGroups.add(titleGroup);
558 collectionObject.setTitleGroupList(titleGroupList);
559 collectionObject.setObjectNumber(objNum);
561 ContentOrganizationList contentOrganizationList = new ContentOrganizationList();
562 List<String> contentOrganizations = contentOrganizationList.getContentOrganization();
563 contentOrganizations.add(contentOrganization);
564 collectionObject.setContentOrganizations(contentOrganizationList);
566 ContentPersonList contentPersonList = new ContentPersonList();
567 List<String> contentPersons = contentPersonList.getContentPerson();
568 contentPersons.add(contentPerson);
569 collectionObject.setContentPersons(contentPersonList);
571 AssocEventOrganizationList assocEventOrganizationList = new AssocEventOrganizationList();
572 List<String> assocEventOrganizations = assocEventOrganizationList.getAssocEventOrganization();
573 assocEventOrganizations.add(assocEventOrganization);
574 collectionObject.setAssocEventOrganizations(assocEventOrganizationList);
576 AssocEventPersonList assocEventPersonList = new AssocEventPersonList();
577 List<String> assocEventPersons = assocEventPersonList.getAssocEventPerson();
578 assocEventPersons.add(assocEventPerson);
579 collectionObject.setAssocEventPersons(assocEventPersonList);
581 // AssocOrganizationList assocOrganizationList = new AssocOrganizationList();
582 // List<String> assocOrganizations = assocOrganizationList.getAssocOrganization();
583 // assocOrganizations.add(assocOrganization);
584 // collectionObject.setAssocOrganizations(assocOrganizationList);
586 // AssocPersonList assocPersonList = new AssocPersonList();
587 // List<String> assocPersons = assocPersonList.getAssocPerson();
588 // assocPersons.add(assocPerson);
589 // collectionObject.setAssocPersons(assocPersonList);
591 OwnerList ownerList = new OwnerList();
592 List<String> owners = ownerList.getOwner();
594 collectionObject.setOwners(ownerList);
596 FieldCollectionSourceList fieldCollectionSourceList = new FieldCollectionSourceList();
597 List<String> fieldCollectionSources = fieldCollectionSourceList.getFieldCollectionSource();
598 fieldCollectionSources.add(fieldCollectionSource);
599 collectionObject.setFieldCollectionSources(fieldCollectionSourceList);
601 FieldCollectorList FieldCollectorList = new FieldCollectorList();
602 List<String> fieldCollectors = FieldCollectorList.getFieldCollector();
603 fieldCollectors.add(fieldCollector);
604 collectionObject.setFieldCollectors(FieldCollectorList);
606 PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME);
607 PayloadOutputPart commonPart =
608 multipart.addPart(collectionObject, MediaType.APPLICATION_XML_TYPE);
609 commonPart.setLabel(new CollectionObjectClient().getCommonPartName());
611 if(logger.isDebugEnabled()){
612 logger.debug("to be created, collectionObject common");
613 logger.debug(objectAsXmlString(collectionObject, CollectionobjectsCommon.class));