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;
59 import org.jboss.resteasy.client.ClientResponse;
61 import org.testng.Assert;
62 import org.testng.annotations.AfterClass;
63 import org.testng.annotations.Test;
65 import org.slf4j.Logger;
66 import org.slf4j.LoggerFactory;
69 * CollectionObjectAuthRefsTest, carries out tests against a
70 * deployed and running CollectionObject Service.
72 * $LastChangedRevision: 1327 $
73 * $LastChangedDate: 2010-02-12 10:35:11 -0800 (Fri, 12 Feb 2010) $
75 public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
78 protected CollectionSpaceClient getClientInstance() {
79 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
83 protected String getServiceName() {
84 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
88 private final String CLASS_NAME = CollectionObjectAuthRefsTest.class.getName();
89 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
91 // Instance variables specific to this test.
92 /** The service path component. */
93 final String SERVICE_PATH_COMPONENT = "collectionobjects";
95 /** The person authority name. */
96 final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
97 final String PERSON_AUTHORITY_NAME_DISPLAY = "TestPersonAuth_DisplayName";
99 /** The organization authority name. */
100 final String ORG_AUTHORITY_NAME = "TestOrgAuth";
102 /** The collection object ids created. */
103 private List<String> collectionObjectIdsCreated = new ArrayList<String>();
105 /** The person ids created. */
106 private List<String> personIdsCreated = new ArrayList<String>();
108 /** The person authority csid and refName. */
109 private String personAuthCSID = null;
110 private String personAuthRefName = null;
112 /** The organization ids created. */
113 private List<String> orgIdsCreated = new ArrayList<String>();
115 /** The org authority csid and refName. */
116 private String orgAuthCSID = null;
117 private String orgAuthRefName = null;
119 private String contentOrganizationRefName = null;
120 private String contentPersonRefName = null;
121 private String assocEventOrganizationRefName = null;
122 private String assocEventPersonRefName = null;
123 private String ownerRefName = null;
124 private String fieldCollectionSourceRefName = null;
125 private String fieldCollectorRefName = null;
127 // FIXME: As of 2012-01-04, the two assocEvent... fields
128 // and the ownerRefName field have been commented out in
129 // the list of authRef fields in CollectionObject, in tenant bindings,
130 // because those fields fall within to-be-created repeatable groups,
132 // As a result, the number of authority references expected to be found
133 // is currently 4, rather than 7. - Aron
134 public String toString(){
135 String result = "CollectionObjectauthRefsTest: "
136 + "\r\npersonAuthCSID: "+personAuthCSID
137 + "\r\npersonAuthRefName: "+personAuthRefName
138 + "\r\norgAuthCSID: "+orgAuthCSID
139 + "\r\norgAuthRefName: "+orgAuthRefName
141 + "\r\n contentOrganizationRefName: "+contentOrganizationRefName
142 + "\r\n contentPersonRefName: "+contentPersonRefName
143 + "\r\n assocEventOrganizationRefName: "+assocEventOrganizationRefName
144 + "\r\n assocEventPersonRefName: "+assocEventPersonRefName
145 + "\r\n ownerRefName: "+ownerRefName
146 + "\r\n fieldCollectionSourceRefName: "+fieldCollectionSourceRefName
147 + "\r\n fieldCollectorRefName: "+fieldCollectorRefName;
152 /** The number of authority references expected. */
153 private final int NUM_AUTH_REFS_EXPECTED = 7;
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 Response res = collectionObjectClient.create(multipart);
193 String newCsid = null;
195 assertStatusCode(res, testName);
196 newCsid = extractId(res);
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 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);
241 * Creates a person item.
243 * @param firstName the person's first name
244 * @param surName the person's surname
245 * @param shortIdentifier the short identifier for the item
246 * @return the CSID of the newly-created person record
248 protected String createPerson(String firstName, String surName, String shortIdentifier ) {
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.
283 protected void createPersonRefs(){
285 createPersonAuthority(PERSON_AUTHORITY_NAME_DISPLAY, PERSON_AUTHORITY_NAME);
289 csid = createPerson("Connie", "ContactPerson", "connieContactPerson");
290 contentPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
291 personIdsCreated.add(csid);
293 // csid = createPerson("Ingrid", "ContentInscriber", "ingridContentInscriber");
294 // contentInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
295 // personIdsCreated.add(csid);
297 // csid = createPerson("Pacifico", "ProductionPerson", "pacificoProductionPerson");
298 // objectProductionPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
299 // personIdsCreated.add(csid);
301 // csid = createPerson("Dessie", "DescriptionInscriber", "dessieDescriptionInscriber");
302 // descriptionInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
303 // personIdsCreated.add(csid);
305 csid = createPerson("Asok", "AssociatedEventPerson", "asokAssociatedEventPerson");
306 assocEventPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
307 personIdsCreated.add(csid);
309 // csid = createPerson("Andrew", "AssociatedPerson", "andrewAssociatedPerson");
310 // assocPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
311 // personIdsCreated.add(csid);
313 csid = createPerson("Owen", "Owner", "owenOwner");
314 ownerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
315 personIdsCreated.add(csid);
317 csid = createPerson("Sally", "Field-CollectionSource", "sallyFieldCollectionSource");
318 fieldCollectionSourceRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
319 personIdsCreated.add(csid);
321 csid = createPerson("Fred", "Lector", "fredLector");
322 fieldCollectorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
323 personIdsCreated.add(csid);
327 * Creates an organization authority.
329 * @param displayName the display name of the authority
330 * @param shortIdentifier the short identifier for the authority
332 private void createOrgAuthority(String displayName, String shortIdentifier) {
333 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
334 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
335 PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
336 displayName, shortIdentifier, orgAuthClient.getCommonPartName());
337 Response res = orgAuthClient.create(multipart);
339 int statusCode = res.getStatus();
341 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
342 invalidStatusCodeMessage(testRequestType, statusCode));
343 Assert.assertEquals(statusCode, STATUS_CREATED);
344 orgAuthCSID = extractId(res);
345 orgAuthRefName = OrgAuthorityClientUtils.getAuthorityRefName(orgAuthCSID, null);
352 * Creates an organization item.
354 * @param shortName the organization's short name
355 * @param foundingPlace the organization's founding place
356 * @param shortIdentifier the short identifier for the item
357 * @return the CSID of the newly-created organization record
359 protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) {
360 String result = null;
362 Map<String, String> orgInfo = new HashMap<String,String>();
363 orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
364 orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
366 List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
367 OrgTermGroup term = new OrgTermGroup();
368 term.setTermDisplayName(shortName);
369 term.setTermName(shortName);
372 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
373 PoxPayloadOut multipart =
374 OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName, orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
375 Response res = orgAuthClient.createItem(orgAuthCSID, multipart);
377 int statusCode = res.getStatus();
379 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
380 invalidStatusCodeMessage(testRequestType, statusCode));
381 Assert.assertEquals(statusCode, STATUS_CREATED);
382 result = extractId(res);
391 * Creates multiple Organization items within an Organization Authority,
392 * and stores the refNames referring to each.
394 private void createOrganizationRefs() {
396 createOrgAuthority(ORG_AUTHORITY_NAME, ORG_AUTHORITY_NAME);
400 csid = createOrganization("Content Org", "Content Org Town", "contentOrg");
401 contentOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
402 orgIdsCreated.add(csid);
404 // csid = createOrganization("Production Org", "Production Org Town", "productionOrg");
405 // objectProductionOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
406 // orgIdsCreated.add(csid);
408 csid = createOrganization("Associated Event Org", "Associated Event Org City", "associatedEventOrg");
409 assocEventOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
410 orgIdsCreated.add(csid);
412 // csid = createOrganization("Associated Org", "Associated Org City", "associatedOrg");
413 // assocOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
414 // orgIdsCreated.add(csid);
420 * Read and check auth refs.
422 * @param testName the test name
423 * @throws Exception the exception
425 @Test(dataProvider="testName",
426 dependsOnMethods = {"createWithAuthRefs"})
427 public void readAndCheckAuthRefs(String testName) throws Exception {
429 testSetup(STATUS_OK, ServiceRequestType.READ);
431 // First read the object
433 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
434 Response res = collectionObjectClient.read(knownResourceId);
435 CollectionobjectsCommon collectionObject = null;
437 assertStatusCode(res, testName);
438 PoxPayloadIn input = new PoxPayloadIn((String)res.getEntity());
439 collectionObject = (CollectionobjectsCommon) extractPart(input,
440 collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
441 Assert.assertNotNull(collectionObject);
448 // Next, get all of the auth refs and check that the expected number is returned
450 res = collectionObjectClient.getAuthorityRefs(knownResourceId);
451 AuthorityRefList list = null;
453 assertStatusCode(res, testName);
454 list = (AuthorityRefList)res.getEntity();
461 List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
462 int numAuthRefsFound = items.size();
463 if(logger.isDebugEnabled()){
464 logger.debug("Expected " + NUM_AUTH_REFS_EXPECTED +
465 " authority references, found " + numAuthRefsFound);
467 Assert.assertEquals(numAuthRefsFound, NUM_AUTH_REFS_EXPECTED,
468 "Did not find all expected authority references! " +
469 "Expected " + NUM_AUTH_REFS_EXPECTED + ", found " + numAuthRefsFound);
471 // Check a sample of one or more person authority ref fields
472 // Assert.assertEquals(collectionObject.getAssocPersons().getAssocPerson().get(0), assocPersonRefName);
473 Assert.assertEquals(collectionObject.getOwners().getOwner().get(0), ownerRefName);
474 Assert.assertEquals(collectionObject.getFieldCollectionSources().getFieldCollectionSource().get(0), fieldCollectionSourceRefName);
476 // Check a sample of one or more organization authority ref fields
477 Assert.assertEquals(collectionObject.getContentOrganizations().getContentOrganization().get(0), contentOrganizationRefName);
478 Assert.assertEquals(collectionObject.getAssocEventOrganizations().getAssocEventOrganization().get(0), assocEventOrganizationRefName);
480 // Optionally output additional data about list members for debugging.
481 logger.info(this.toString());
482 boolean iterateThroughList = true;
483 if(iterateThroughList && logger.isDebugEnabled()){;
485 for(AuthorityRefList.AuthorityRefItem item : items){
486 logger.debug(testName + ": list-item[" + i + "] Field:" +
487 item.getSourceField() + " =" +
488 " item display name = " + item.getAuthDisplayName() +
489 " auth display name = " + item.getItemDisplayName());
490 logger.debug(testName + ": list-item[" + i + "] refName=" +
492 logger.debug(testName + ": list-item[" + i + "] URI=" +
500 // ---------------------------------------------------------------
501 // Cleanup of resources created during testing
502 // ---------------------------------------------------------------
505 * Deletes all resources created by tests, after all tests have been run.
507 * This cleanup method will always be run, even if one or more tests fail.
508 * For this reason, it attempts to remove all resources created
509 * at any point during testing, even if some of those resources
510 * may be expected to be deleted by certain tests.
512 @AfterClass(alwaysRun=true)
513 public void cleanUp() {
514 String noTest = System.getProperty("noTestCleanup");
515 if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
516 if (logger.isDebugEnabled()) {
517 logger.debug("Skipping Cleanup phase ...");
521 if (logger.isDebugEnabled()) {
522 logger.debug("Cleaning up temporary resources created for testing ...");
524 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
525 for (String resourceId : collectionObjectIdsCreated) {
526 // Note: Any non-success responses are ignored and not reported.
527 collectionObjectClient.delete(resourceId).close();
529 // Note: Any non-success response is ignored and not reported.
530 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
531 // Delete persons before PersonAuth
532 for (String resourceId : personIdsCreated) {
533 // Note: Any non-success responses are ignored and not reported.
534 personAuthClient.deleteItem(personAuthCSID, resourceId).close();
536 personAuthClient.delete(personAuthCSID).close();
537 // Note: Any non-success response is ignored and not reported.
538 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
539 // Delete organizations before OrgAuth
540 for (String resourceId : orgIdsCreated) {
541 // Note: Any non-success responses are ignored and not reported.
542 orgAuthClient.deleteItem(orgAuthCSID, resourceId).close();
544 orgAuthClient.delete(orgAuthCSID).close();
547 // ---------------------------------------------------------------
548 // Utility methods used by tests above
549 // ---------------------------------------------------------------
551 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
554 public String getServicePathComponent() {
555 return SERVICE_PATH_COMPONENT;
559 * Creates the collection object instance.
561 * @param title the title
562 * @param objNum the obj num
563 * @param contentOrganization the content organization
564 * @param contentPeople the content people
565 * @param contentPerson the content person
566 * @param inscriber the inscriber
567 * @return the multipart output
569 private PoxPayloadOut createCollectionObjectInstance(
572 String contentOrganization,
573 String contentPerson,
574 String assocEventOrganization,
575 String assocEventPerson,
577 String fieldCollectionSource,
578 String fieldCollector ) {
579 CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
580 TitleGroupList titleGroupList = new TitleGroupList();
581 List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
582 TitleGroup titleGroup = new TitleGroup();
583 titleGroup.setTitle("a title");
584 titleGroups.add(titleGroup);
585 collectionObject.setTitleGroupList(titleGroupList);
586 collectionObject.setObjectNumber(objNum);
588 ContentOrganizationList contentOrganizationList = new ContentOrganizationList();
589 List<String> contentOrganizations = contentOrganizationList.getContentOrganization();
590 contentOrganizations.add(contentOrganization);
591 collectionObject.setContentOrganizations(contentOrganizationList);
593 ContentPersonList contentPersonList = new ContentPersonList();
594 List<String> contentPersons = contentPersonList.getContentPerson();
595 contentPersons.add(contentPerson);
596 collectionObject.setContentPersons(contentPersonList);
598 AssocEventOrganizationList assocEventOrganizationList = new AssocEventOrganizationList();
599 List<String> assocEventOrganizations = assocEventOrganizationList.getAssocEventOrganization();
600 assocEventOrganizations.add(assocEventOrganization);
601 collectionObject.setAssocEventOrganizations(assocEventOrganizationList);
603 AssocEventPersonList assocEventPersonList = new AssocEventPersonList();
604 List<String> assocEventPersons = assocEventPersonList.getAssocEventPerson();
605 assocEventPersons.add(assocEventPerson);
606 collectionObject.setAssocEventPersons(assocEventPersonList);
608 // AssocOrganizationList assocOrganizationList = new AssocOrganizationList();
609 // List<String> assocOrganizations = assocOrganizationList.getAssocOrganization();
610 // assocOrganizations.add(assocOrganization);
611 // collectionObject.setAssocOrganizations(assocOrganizationList);
613 // AssocPersonList assocPersonList = new AssocPersonList();
614 // List<String> assocPersons = assocPersonList.getAssocPerson();
615 // assocPersons.add(assocPerson);
616 // collectionObject.setAssocPersons(assocPersonList);
618 OwnerList ownerList = new OwnerList();
619 List<String> owners = ownerList.getOwner();
621 collectionObject.setOwners(ownerList);
623 FieldCollectionSourceList fieldCollectionSourceList = new FieldCollectionSourceList();
624 List<String> fieldCollectionSources = fieldCollectionSourceList.getFieldCollectionSource();
625 fieldCollectionSources.add(fieldCollectionSource);
626 collectionObject.setFieldCollectionSources(fieldCollectionSourceList);
628 FieldCollectorList FieldCollectorList = new FieldCollectorList();
629 List<String> fieldCollectors = FieldCollectorList.getFieldCollector();
630 fieldCollectors.add(fieldCollector);
631 collectionObject.setFieldCollectors(FieldCollectorList);
633 PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME);
634 PayloadOutputPart commonPart =
635 multipart.addPart(collectionObject, MediaType.APPLICATION_XML_TYPE);
636 commonPart.setLabel(new CollectionObjectClient().getCommonPartName());
638 if(logger.isDebugEnabled()){
639 logger.debug("to be created, collectionObject common");
640 logger.debug(objectAsXmlString(collectionObject, CollectionobjectsCommon.class));