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.testng.Assert;
60 import org.testng.annotations.AfterClass;
61 import org.testng.annotations.Test;
62 import org.slf4j.Logger;
63 import org.slf4j.LoggerFactory;
66 * CollectionObjectAuthRefsTest, carries out tests against a
67 * deployed and running CollectionObject Service.
69 * $LastChangedRevision: 1327 $
70 * $LastChangedDate: 2010-02-12 10:35:11 -0800 (Fri, 12 Feb 2010) $
72 public class CollectionObjectAuthRefsTest extends BaseServiceTest<AbstractCommonList> {
75 protected CollectionSpaceClient getClientInstance() {
76 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
80 protected CollectionSpaceClient getClientInstance(String clientPropertiesFilename) {
81 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
85 protected String getServiceName() {
86 throw new UnsupportedOperationException(); //FIXME: REM - See http://issues.collectionspace.org/browse/CSPACE-3498
90 private final String CLASS_NAME = CollectionObjectAuthRefsTest.class.getName();
91 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
93 // Instance variables specific to this test.
94 /** The service path component. */
95 final String SERVICE_PATH_COMPONENT = "collectionobjects";
97 /** The person authority name. */
98 final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
99 final String PERSON_AUTHORITY_NAME_DISPLAY = "TestPersonAuth_DisplayName";
101 /** The organization authority name. */
102 final String ORG_AUTHORITY_NAME = "TestOrgAuth";
104 /** The collection object ids created. */
105 private List<String> collectionObjectIdsCreated = new ArrayList<String>();
107 /** The person ids created. */
108 private List<String> personIdsCreated = new ArrayList<String>();
110 /** The person authority csid and refName. */
111 private String personAuthCSID = null;
112 private String personAuthRefName = null;
114 /** The organization ids created. */
115 private List<String> orgIdsCreated = new ArrayList<String>();
117 /** The org authority csid and refName. */
118 private String orgAuthCSID = null;
119 private String orgAuthRefName = null;
121 private String contentOrganizationRefName = null;
122 private String contentPersonRefName = null;
123 private String assocEventOrganizationRefName = null;
124 private String assocEventPersonRefName = null;
125 private String ownerRefName = null;
126 private String fieldCollectionSourceRefName = null;
127 private String fieldCollectorRefName = null;
129 // FIXME: As of 2012-01-04, the two assocEvent... fields
130 // and the ownerRefName field have been commented out in
131 // the list of authRef fields in CollectionObject, in tenant bindings,
132 // because those fields fall within to-be-created repeatable groups,
134 // As a result, the number of authority references expected to be found
135 // is currently 4, rather than 7. - Aron
136 public String toString(){
137 String result = "CollectionObjectauthRefsTest: "
138 + "\r\npersonAuthCSID: "+personAuthCSID
139 + "\r\npersonAuthRefName: "+personAuthRefName
140 + "\r\norgAuthCSID: "+orgAuthCSID
141 + "\r\norgAuthRefName: "+orgAuthRefName
143 + "\r\n contentOrganizationRefName: "+contentOrganizationRefName
144 + "\r\n contentPersonRefName: "+contentPersonRefName
145 + "\r\n assocEventOrganizationRefName: "+assocEventOrganizationRefName
146 + "\r\n assocEventPersonRefName: "+assocEventPersonRefName
147 + "\r\n ownerRefName: "+ownerRefName
148 + "\r\n fieldCollectionSourceRefName: "+fieldCollectionSourceRefName
149 + "\r\n fieldCollectorRefName: "+fieldCollectorRefName;
154 /** The number of authority references expected. */
155 private final int NUM_AUTH_REFS_EXPECTED = 7;
157 // ---------------------------------------------------------------
158 // CRUD tests : CREATE tests
159 // ---------------------------------------------------------------
162 * Creates the with auth refs.
164 * @param testName the test name
165 * @throws Exception the exception
167 @Test(dataProvider="testName")
168 public void createWithAuthRefs(String testName) throws Exception {
169 // Create all the person refs and entities
172 // Create all the organization refs and entities
173 createOrganizationRefs();
175 // Create an object record payload, containing
176 // authority reference values in a number of its fields
177 String identifier = createIdentifier();
178 PoxPayloadOut multipart =
179 createCollectionObjectInstance(
181 "ObjNum" + "-" + identifier,
182 contentOrganizationRefName,
183 contentPersonRefName,
184 assocEventOrganizationRefName,
185 assocEventPersonRefName,
187 fieldCollectionSourceRefName,
188 fieldCollectorRefName
191 // Submit the request to the service and store the response.
192 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
193 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
194 Response res = collectionObjectClient.create(multipart);
195 String newCsid = null;
197 assertStatusCode(res, testName);
198 newCsid = extractId(res);
204 // Store the ID returned from the first resource created
205 // for additional tests below.
206 if (knownResourceId == null){
207 knownResourceId = newCsid;
208 if (logger.isDebugEnabled()) {
209 logger.debug(testName + ": knownResourceId=" + knownResourceId);
213 // Store the IDs from every resource created by tests,
214 // so they can be deleted after tests have been run.
215 collectionObjectIdsCreated.add(extractId(res));
219 * Creates a Person Authority.
221 * @param displayName the display name of the authority
222 * @param shortIdentifier the short identifier for the authority
224 private void createPersonAuthority(String displayName, String shortIdentifier) {
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
250 protected String createPerson(String firstName, String surName, String shortIdentifier ) {
251 String result = null;
253 Map<String, String> personInfo = new HashMap<String,String>();
254 personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
255 personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
256 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
257 List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
258 PersonTermGroup term = new PersonTermGroup();
259 String termName = firstName + " " + surName;
260 term.setTermDisplayName(termName);
261 term.setTermName(termName);
262 personTerms.add(term);
263 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
264 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
265 personAuthRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
266 Response res = personAuthClient.createItem(personAuthCSID, multipart);
268 int statusCode = res.getStatus();
270 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
271 invalidStatusCodeMessage(testRequestType, statusCode));
272 Assert.assertEquals(statusCode, STATUS_CREATED);
273 result = extractId(res);
282 * Creates multiple Person items within a Person Authority,
283 * and stores the refNames referring to each.
285 protected void createPersonRefs(){
287 createPersonAuthority(PERSON_AUTHORITY_NAME_DISPLAY, PERSON_AUTHORITY_NAME);
291 csid = createPerson("Connie", "ContactPerson", "connieContactPerson");
292 contentPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
293 personIdsCreated.add(csid);
295 // csid = createPerson("Ingrid", "ContentInscriber", "ingridContentInscriber");
296 // contentInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
297 // personIdsCreated.add(csid);
299 // csid = createPerson("Pacifico", "ProductionPerson", "pacificoProductionPerson");
300 // objectProductionPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
301 // personIdsCreated.add(csid);
303 // csid = createPerson("Dessie", "DescriptionInscriber", "dessieDescriptionInscriber");
304 // descriptionInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
305 // personIdsCreated.add(csid);
307 csid = createPerson("Asok", "AssociatedEventPerson", "asokAssociatedEventPerson");
308 assocEventPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
309 personIdsCreated.add(csid);
311 // csid = createPerson("Andrew", "AssociatedPerson", "andrewAssociatedPerson");
312 // assocPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
313 // personIdsCreated.add(csid);
315 csid = createPerson("Owen", "Owner", "owenOwner");
316 ownerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
317 personIdsCreated.add(csid);
319 csid = createPerson("Sally", "Field-CollectionSource", "sallyFieldCollectionSource");
320 fieldCollectionSourceRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
321 personIdsCreated.add(csid);
323 csid = createPerson("Fred", "Lector", "fredLector");
324 fieldCollectorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
325 personIdsCreated.add(csid);
329 * Creates an organization authority.
331 * @param displayName the display name of the authority
332 * @param shortIdentifier the short identifier for the authority
334 private void createOrgAuthority(String displayName, String shortIdentifier) {
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
361 protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) {
362 String result = null;
364 Map<String, String> orgInfo = new HashMap<String,String>();
365 orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
366 orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
368 List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
369 OrgTermGroup term = new OrgTermGroup();
370 term.setTermDisplayName(shortName);
371 term.setTermName(shortName);
374 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
375 PoxPayloadOut multipart =
376 OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName, orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
377 Response res = orgAuthClient.createItem(orgAuthCSID, multipart);
379 int statusCode = res.getStatus();
381 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
382 invalidStatusCodeMessage(testRequestType, statusCode));
383 Assert.assertEquals(statusCode, STATUS_CREATED);
384 result = extractId(res);
393 * Creates multiple Organization items within an Organization Authority,
394 * and stores the refNames referring to each.
396 private void createOrganizationRefs() {
398 createOrgAuthority(ORG_AUTHORITY_NAME, ORG_AUTHORITY_NAME);
402 csid = createOrganization("Content Org", "Content Org Town", "contentOrg");
403 contentOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
404 orgIdsCreated.add(csid);
406 // csid = createOrganization("Production Org", "Production Org Town", "productionOrg");
407 // objectProductionOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
408 // orgIdsCreated.add(csid);
410 csid = createOrganization("Associated Event Org", "Associated Event Org City", "associatedEventOrg");
411 assocEventOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
412 orgIdsCreated.add(csid);
414 // csid = createOrganization("Associated Org", "Associated Org City", "associatedOrg");
415 // assocOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
416 // orgIdsCreated.add(csid);
422 * Read and check auth refs.
424 * @param testName the test name
425 * @throws Exception the exception
427 @Test(dataProvider="testName",
428 dependsOnMethods = {"createWithAuthRefs"})
429 public void readAndCheckAuthRefs(String testName) throws Exception {
431 testSetup(STATUS_OK, ServiceRequestType.READ);
433 // First read the object
435 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
436 Response res = collectionObjectClient.read(knownResourceId);
437 CollectionobjectsCommon collectionObject = null;
439 assertStatusCode(res, testName);
440 PoxPayloadIn input = new PoxPayloadIn((String)res.readEntity(String.class));
441 collectionObject = (CollectionobjectsCommon) extractPart(input,
442 collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
443 Assert.assertNotNull(collectionObject);
450 // Next, get all of the auth refs and check that the expected number is returned
452 res = collectionObjectClient.getAuthorityRefs(knownResourceId);
453 AuthorityRefList list = null;
455 assertStatusCode(res, testName);
456 list = (AuthorityRefList)res.readEntity(AuthorityRefList.class);
463 List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
464 int numAuthRefsFound = items.size();
465 if(logger.isDebugEnabled()){
466 logger.debug("Expected " + NUM_AUTH_REFS_EXPECTED +
467 " authority references, found " + numAuthRefsFound);
469 Assert.assertEquals(numAuthRefsFound, NUM_AUTH_REFS_EXPECTED,
470 "Did not find all expected authority references! " +
471 "Expected " + NUM_AUTH_REFS_EXPECTED + ", found " + numAuthRefsFound);
473 // Check a sample of one or more person authority ref fields
474 // Assert.assertEquals(collectionObject.getAssocPersons().getAssocPerson().get(0), assocPersonRefName);
475 Assert.assertEquals(collectionObject.getOwners().getOwner().get(0), ownerRefName);
476 Assert.assertEquals(collectionObject.getFieldCollectionSources().getFieldCollectionSource().get(0), fieldCollectionSourceRefName);
478 // Check a sample of one or more organization authority ref fields
479 Assert.assertEquals(collectionObject.getContentOrganizations().getContentOrganization().get(0), contentOrganizationRefName);
480 Assert.assertEquals(collectionObject.getAssocEventOrganizations().getAssocEventOrganization().get(0), assocEventOrganizationRefName);
482 // Optionally output additional data about list members for debugging.
483 logger.info(this.toString());
484 boolean iterateThroughList = true;
485 if(iterateThroughList && logger.isDebugEnabled()){;
487 for(AuthorityRefList.AuthorityRefItem item : items){
488 logger.debug(testName + ": list-item[" + i + "] Field:" +
489 item.getSourceField() + " =" +
490 " item display name = " + item.getAuthDisplayName() +
491 " auth display name = " + item.getItemDisplayName());
492 logger.debug(testName + ": list-item[" + i + "] refName=" +
494 logger.debug(testName + ": list-item[" + i + "] URI=" +
502 // ---------------------------------------------------------------
503 // Cleanup of resources created during testing
504 // ---------------------------------------------------------------
507 * Deletes all resources created by tests, after all tests have been run.
509 * This cleanup method will always be run, even if one or more tests fail.
510 * For this reason, it attempts to remove all resources created
511 * at any point during testing, even if some of those resources
512 * may be expected to be deleted by certain tests.
514 @AfterClass(alwaysRun=true)
515 public void cleanUp() {
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();
531 // Note: Any non-success response is ignored and not reported.
532 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
533 // Delete persons before PersonAuth
534 for (String resourceId : personIdsCreated) {
535 // Note: Any non-success responses are ignored and not reported.
536 personAuthClient.deleteItem(personAuthCSID, resourceId).close();
538 personAuthClient.delete(personAuthCSID).close();
539 // Note: Any non-success response is ignored and not reported.
540 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
541 // Delete organizations before OrgAuth
542 for (String resourceId : orgIdsCreated) {
543 // Note: Any non-success responses are ignored and not reported.
544 orgAuthClient.deleteItem(orgAuthCSID, resourceId).close();
546 orgAuthClient.delete(orgAuthCSID).close();
549 // ---------------------------------------------------------------
550 // Utility methods used by tests above
551 // ---------------------------------------------------------------
553 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
556 public String getServicePathComponent() {
557 return SERVICE_PATH_COMPONENT;
561 * Creates the collection object instance.
563 * @param title the title
564 * @param objNum the obj num
565 * @param contentOrganization the content organization
566 * @param contentPeople the content people
567 * @param contentPerson the content person
568 * @param inscriber the inscriber
569 * @return the multipart output
571 private PoxPayloadOut createCollectionObjectInstance(
574 String contentOrganization,
575 String contentPerson,
576 String assocEventOrganization,
577 String assocEventPerson,
579 String fieldCollectionSource,
580 String fieldCollector ) {
581 CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
582 TitleGroupList titleGroupList = new TitleGroupList();
583 List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
584 TitleGroup titleGroup = new TitleGroup();
585 titleGroup.setTitle("a title");
586 titleGroups.add(titleGroup);
587 collectionObject.setTitleGroupList(titleGroupList);
588 collectionObject.setObjectNumber(objNum);
590 ContentOrganizationList contentOrganizationList = new ContentOrganizationList();
591 List<String> contentOrganizations = contentOrganizationList.getContentOrganization();
592 contentOrganizations.add(contentOrganization);
593 collectionObject.setContentOrganizations(contentOrganizationList);
595 ContentPersonList contentPersonList = new ContentPersonList();
596 List<String> contentPersons = contentPersonList.getContentPerson();
597 contentPersons.add(contentPerson);
598 collectionObject.setContentPersons(contentPersonList);
600 AssocEventOrganizationList assocEventOrganizationList = new AssocEventOrganizationList();
601 List<String> assocEventOrganizations = assocEventOrganizationList.getAssocEventOrganization();
602 assocEventOrganizations.add(assocEventOrganization);
603 collectionObject.setAssocEventOrganizations(assocEventOrganizationList);
605 AssocEventPersonList assocEventPersonList = new AssocEventPersonList();
606 List<String> assocEventPersons = assocEventPersonList.getAssocEventPerson();
607 assocEventPersons.add(assocEventPerson);
608 collectionObject.setAssocEventPersons(assocEventPersonList);
610 // AssocOrganizationList assocOrganizationList = new AssocOrganizationList();
611 // List<String> assocOrganizations = assocOrganizationList.getAssocOrganization();
612 // assocOrganizations.add(assocOrganization);
613 // collectionObject.setAssocOrganizations(assocOrganizationList);
615 // AssocPersonList assocPersonList = new AssocPersonList();
616 // List<String> assocPersons = assocPersonList.getAssocPerson();
617 // assocPersons.add(assocPerson);
618 // collectionObject.setAssocPersons(assocPersonList);
620 OwnerList ownerList = new OwnerList();
621 List<String> owners = ownerList.getOwner();
623 collectionObject.setOwners(ownerList);
625 FieldCollectionSourceList fieldCollectionSourceList = new FieldCollectionSourceList();
626 List<String> fieldCollectionSources = fieldCollectionSourceList.getFieldCollectionSource();
627 fieldCollectionSources.add(fieldCollectionSource);
628 collectionObject.setFieldCollectionSources(fieldCollectionSourceList);
630 FieldCollectorList FieldCollectorList = new FieldCollectorList();
631 List<String> fieldCollectors = FieldCollectorList.getFieldCollector();
632 fieldCollectors.add(fieldCollector);
633 collectionObject.setFieldCollectors(FieldCollectorList);
635 PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME);
636 PayloadOutputPart commonPart =
637 multipart.addPart(collectionObject, MediaType.APPLICATION_XML_TYPE);
638 commonPart.setLabel(new CollectionObjectClient().getCommonPartName());
640 if(logger.isDebugEnabled()){
641 logger.debug("to be created, collectionObject common");
642 logger.debug(objectAsXmlString(collectionObject, CollectionobjectsCommon.class));