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;
148 StringBuffer buff = new StringBuffer();
153 /** The number of authority references expected. */
154 private final int NUM_AUTH_REFS_EXPECTED = 7;
156 // ---------------------------------------------------------------
157 // CRUD tests : CREATE tests
158 // ---------------------------------------------------------------
161 * Creates the with auth refs.
163 * @param testName the test name
164 * @throws Exception the exception
166 @Test(dataProvider="testName")
167 public void createWithAuthRefs(String testName) throws Exception {
168 // Create all the person refs and entities
171 // Create all the organization refs and entities
172 createOrganizationRefs();
174 // Create an object record payload, containing
175 // authority reference values in a number of its fields
176 String identifier = createIdentifier();
177 PoxPayloadOut multipart =
178 createCollectionObjectInstance(
180 "ObjNum" + "-" + identifier,
181 contentOrganizationRefName,
182 contentPersonRefName,
183 assocEventOrganizationRefName,
184 assocEventPersonRefName,
186 fieldCollectionSourceRefName,
187 fieldCollectorRefName
190 // Submit the request to the service and store the response.
191 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
192 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
193 Response res = collectionObjectClient.create(multipart);
194 String newCsid = null;
196 assertStatusCode(res, testName);
197 newCsid = extractId(res);
203 // Store the ID returned from the first resource created
204 // for additional tests below.
205 if (knownResourceId == null){
206 knownResourceId = newCsid;
207 if (logger.isDebugEnabled()) {
208 logger.debug(testName + ": knownResourceId=" + knownResourceId);
212 // Store the IDs from every resource created by tests,
213 // so they can be deleted after tests have been run.
214 collectionObjectIdsCreated.add(extractId(res));
218 * Creates a Person Authority.
220 * @param displayName the display name of the authority
221 * @param shortIdentifier the short identifier for the authority
223 private void createPersonAuthority(String displayName, String shortIdentifier) {
224 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
225 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
226 PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
227 displayName, shortIdentifier, personAuthClient.getCommonPartName());
228 Response res = personAuthClient.create(multipart);
229 int statusCode = res.getStatus();
231 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
232 invalidStatusCodeMessage(testRequestType, statusCode));
233 Assert.assertEquals(statusCode, STATUS_CREATED);
234 personAuthCSID = extractId(res);
235 personAuthRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
242 * Creates a person item.
244 * @param firstName the person's first name
245 * @param surName the person's surname
246 * @param shortIdentifier the short identifier for the item
247 * @return the CSID of the newly-created person record
249 protected String createPerson(String firstName, String surName, String shortIdentifier ) {
250 Map<String, String> personInfo = new HashMap<String,String>();
251 personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
252 personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
253 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
254 List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
255 PersonTermGroup term = new PersonTermGroup();
256 String termName = firstName + " " + surName;
257 term.setTermDisplayName(termName);
258 term.setTermName(termName);
259 personTerms.add(term);
260 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
261 PoxPayloadOut multipart =
262 PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
263 personAuthRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
264 ClientResponse<Response> res = personAuthClient.createItem(personAuthCSID, multipart);
265 int statusCode = res.getStatus();
267 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
268 invalidStatusCodeMessage(testRequestType, statusCode));
269 Assert.assertEquals(statusCode, STATUS_CREATED);
270 return extractId(res);
274 * Creates multiple Person items within a Person Authority,
275 * and stores the refNames referring to each.
277 protected void createPersonRefs(){
279 createPersonAuthority(PERSON_AUTHORITY_NAME_DISPLAY, PERSON_AUTHORITY_NAME);
283 csid = createPerson("Connie", "ContactPerson", "connieContactPerson");
284 contentPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
285 personIdsCreated.add(csid);
287 // csid = createPerson("Ingrid", "ContentInscriber", "ingridContentInscriber");
288 // contentInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
289 // personIdsCreated.add(csid);
291 // csid = createPerson("Pacifico", "ProductionPerson", "pacificoProductionPerson");
292 // objectProductionPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
293 // personIdsCreated.add(csid);
295 // csid = createPerson("Dessie", "DescriptionInscriber", "dessieDescriptionInscriber");
296 // descriptionInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
297 // personIdsCreated.add(csid);
299 csid = createPerson("Asok", "AssociatedEventPerson", "asokAssociatedEventPerson");
300 assocEventPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
301 personIdsCreated.add(csid);
303 // csid = createPerson("Andrew", "AssociatedPerson", "andrewAssociatedPerson");
304 // assocPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
305 // personIdsCreated.add(csid);
307 csid = createPerson("Owen", "Owner", "owenOwner");
308 ownerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
309 personIdsCreated.add(csid);
311 csid = createPerson("Sally", "Field-CollectionSource", "sallyFieldCollectionSource");
312 fieldCollectionSourceRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
313 personIdsCreated.add(csid);
315 csid = createPerson("Fred", "Lector", "fredLector");
316 fieldCollectorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
317 personIdsCreated.add(csid);
321 * Creates an organization authority.
323 * @param displayName the display name of the authority
324 * @param shortIdentifier the short identifier for the authority
326 private void createOrgAuthority(String displayName, String shortIdentifier) {
327 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
328 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
329 PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
330 displayName, shortIdentifier, orgAuthClient.getCommonPartName());
331 Response res = orgAuthClient.create(multipart);
333 int statusCode = res.getStatus();
335 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
336 invalidStatusCodeMessage(testRequestType, statusCode));
337 Assert.assertEquals(statusCode, STATUS_CREATED);
338 orgAuthCSID = extractId(res);
339 orgAuthRefName = OrgAuthorityClientUtils.getAuthorityRefName(orgAuthCSID, null);
346 * Creates an organization item.
348 * @param shortName the organization's short name
349 * @param foundingPlace the organization's founding place
350 * @param shortIdentifier the short identifier for the item
351 * @return the CSID of the newly-created organization record
353 protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) {
354 Map<String, String> orgInfo = new HashMap<String,String>();
355 orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
356 orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
358 List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
359 OrgTermGroup term = new OrgTermGroup();
360 term.setTermDisplayName(shortName);
361 term.setTermName(shortName);
364 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
365 PoxPayloadOut multipart =
366 OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName, orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
367 ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);
368 int statusCode = res.getStatus();
370 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
371 invalidStatusCodeMessage(testRequestType, statusCode));
372 Assert.assertEquals(statusCode, STATUS_CREATED);
373 return extractId(res);
377 * Creates multiple Organization items within an Organization Authority,
378 * and stores the refNames referring to each.
380 private void createOrganizationRefs() {
382 createOrgAuthority(ORG_AUTHORITY_NAME, ORG_AUTHORITY_NAME);
386 csid = createOrganization("Content Org", "Content Org Town", "contentOrg");
387 contentOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
388 orgIdsCreated.add(csid);
390 // csid = createOrganization("Production Org", "Production Org Town", "productionOrg");
391 // objectProductionOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
392 // orgIdsCreated.add(csid);
394 csid = createOrganization("Associated Event Org", "Associated Event Org City", "associatedEventOrg");
395 assocEventOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
396 orgIdsCreated.add(csid);
398 // csid = createOrganization("Associated Org", "Associated Org City", "associatedOrg");
399 // assocOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
400 // orgIdsCreated.add(csid);
406 * Read and check auth refs.
408 * @param testName the test name
409 * @throws Exception the exception
411 @Test(dataProvider="testName",
412 dependsOnMethods = {"createWithAuthRefs"})
413 public void readAndCheckAuthRefs(String testName) throws Exception {
415 testSetup(STATUS_OK, ServiceRequestType.READ);
417 // First read the object
419 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
420 ClientResponse<String> res = collectionObjectClient.read(knownResourceId);
421 CollectionobjectsCommon collectionObject = null;
423 assertStatusCode(res, testName);
424 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
425 collectionObject = (CollectionobjectsCommon) extractPart(input,
426 collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
427 Assert.assertNotNull(collectionObject);
430 res.releaseConnection();
434 // Next, get all of the auth refs and check that the expected number is returned
436 ClientResponse<AuthorityRefList> res2 = collectionObjectClient.getAuthorityRefs(knownResourceId);
437 AuthorityRefList list = null;
439 assertStatusCode(res2, testName);
440 list = res2.getEntity();
443 res2.releaseConnection();
447 List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
448 int numAuthRefsFound = items.size();
449 if(logger.isDebugEnabled()){
450 logger.debug("Expected " + NUM_AUTH_REFS_EXPECTED +
451 " authority references, found " + numAuthRefsFound);
453 Assert.assertEquals(numAuthRefsFound, NUM_AUTH_REFS_EXPECTED,
454 "Did not find all expected authority references! " +
455 "Expected " + NUM_AUTH_REFS_EXPECTED + ", found " + numAuthRefsFound);
457 // Check a sample of one or more person authority ref fields
458 // Assert.assertEquals(collectionObject.getAssocPersons().getAssocPerson().get(0), assocPersonRefName);
459 Assert.assertEquals(collectionObject.getOwners().getOwner().get(0), ownerRefName);
460 Assert.assertEquals(collectionObject.getFieldCollectionSources().getFieldCollectionSource().get(0), fieldCollectionSourceRefName);
462 // Check a sample of one or more organization authority ref fields
463 Assert.assertEquals(collectionObject.getContentOrganizations().getContentOrganization().get(0), contentOrganizationRefName);
464 Assert.assertEquals(collectionObject.getAssocEventOrganizations().getAssocEventOrganization().get(0), assocEventOrganizationRefName);
466 // Optionally output additional data about list members for debugging.
467 logger.info(this.toString());
468 boolean iterateThroughList = true;
469 if(iterateThroughList && logger.isDebugEnabled()){;
471 for(AuthorityRefList.AuthorityRefItem item : items){
472 logger.debug(testName + ": list-item[" + i + "] Field:" +
473 item.getSourceField() + " =" +
474 " item display name = " + item.getAuthDisplayName() +
475 " auth display name = " + item.getItemDisplayName());
476 logger.debug(testName + ": list-item[" + i + "] refName=" +
478 logger.debug(testName + ": list-item[" + i + "] URI=" +
486 // ---------------------------------------------------------------
487 // Cleanup of resources created during testing
488 // ---------------------------------------------------------------
491 * Deletes all resources created by tests, after all tests have been run.
493 * This cleanup method will always be run, even if one or more tests fail.
494 * For this reason, it attempts to remove all resources created
495 * at any point during testing, even if some of those resources
496 * may be expected to be deleted by certain tests.
498 @AfterClass(alwaysRun=true)
499 public void cleanUp() {
500 String noTest = System.getProperty("noTestCleanup");
501 if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
502 if (logger.isDebugEnabled()) {
503 logger.debug("Skipping Cleanup phase ...");
507 if (logger.isDebugEnabled()) {
508 logger.debug("Cleaning up temporary resources created for testing ...");
510 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
511 for (String resourceId : collectionObjectIdsCreated) {
512 // Note: Any non-success responses are ignored and not reported.
513 collectionObjectClient.delete(resourceId).releaseConnection();
515 // Note: Any non-success response is ignored and not reported.
516 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
517 // Delete persons before PersonAuth
518 for (String resourceId : personIdsCreated) {
519 // Note: Any non-success responses are ignored and not reported.
520 personAuthClient.deleteItem(personAuthCSID, resourceId).releaseConnection();
522 personAuthClient.delete(personAuthCSID).releaseConnection();
523 // Note: Any non-success response is ignored and not reported.
524 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
525 // Delete organizations before OrgAuth
526 for (String resourceId : orgIdsCreated) {
527 // Note: Any non-success responses are ignored and not reported.
528 orgAuthClient.deleteItem(orgAuthCSID, resourceId).releaseConnection();
530 orgAuthClient.delete(orgAuthCSID).releaseConnection();
533 // ---------------------------------------------------------------
534 // Utility methods used by tests above
535 // ---------------------------------------------------------------
537 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
540 public String getServicePathComponent() {
541 return SERVICE_PATH_COMPONENT;
545 * Creates the collection object instance.
547 * @param title the title
548 * @param objNum the obj num
549 * @param contentOrganization the content organization
550 * @param contentPeople the content people
551 * @param contentPerson the content person
552 * @param inscriber the inscriber
553 * @return the multipart output
555 private PoxPayloadOut createCollectionObjectInstance(
558 String contentOrganization,
559 String contentPerson,
560 String assocEventOrganization,
561 String assocEventPerson,
563 String fieldCollectionSource,
564 String fieldCollector ) {
565 CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
566 TitleGroupList titleGroupList = new TitleGroupList();
567 List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
568 TitleGroup titleGroup = new TitleGroup();
569 titleGroup.setTitle("a title");
570 titleGroups.add(titleGroup);
571 collectionObject.setTitleGroupList(titleGroupList);
572 collectionObject.setObjectNumber(objNum);
574 ContentOrganizationList contentOrganizationList = new ContentOrganizationList();
575 List<String> contentOrganizations = contentOrganizationList.getContentOrganization();
576 contentOrganizations.add(contentOrganization);
577 collectionObject.setContentOrganizations(contentOrganizationList);
579 ContentPersonList contentPersonList = new ContentPersonList();
580 List<String> contentPersons = contentPersonList.getContentPerson();
581 contentPersons.add(contentPerson);
582 collectionObject.setContentPersons(contentPersonList);
584 AssocEventOrganizationList assocEventOrganizationList = new AssocEventOrganizationList();
585 List<String> assocEventOrganizations = assocEventOrganizationList.getAssocEventOrganization();
586 assocEventOrganizations.add(assocEventOrganization);
587 collectionObject.setAssocEventOrganizations(assocEventOrganizationList);
589 AssocEventPersonList assocEventPersonList = new AssocEventPersonList();
590 List<String> assocEventPersons = assocEventPersonList.getAssocEventPerson();
591 assocEventPersons.add(assocEventPerson);
592 collectionObject.setAssocEventPersons(assocEventPersonList);
594 // AssocOrganizationList assocOrganizationList = new AssocOrganizationList();
595 // List<String> assocOrganizations = assocOrganizationList.getAssocOrganization();
596 // assocOrganizations.add(assocOrganization);
597 // collectionObject.setAssocOrganizations(assocOrganizationList);
599 // AssocPersonList assocPersonList = new AssocPersonList();
600 // List<String> assocPersons = assocPersonList.getAssocPerson();
601 // assocPersons.add(assocPerson);
602 // collectionObject.setAssocPersons(assocPersonList);
604 OwnerList ownerList = new OwnerList();
605 List<String> owners = ownerList.getOwner();
607 collectionObject.setOwners(ownerList);
609 FieldCollectionSourceList fieldCollectionSourceList = new FieldCollectionSourceList();
610 List<String> fieldCollectionSources = fieldCollectionSourceList.getFieldCollectionSource();
611 fieldCollectionSources.add(fieldCollectionSource);
612 collectionObject.setFieldCollectionSources(fieldCollectionSourceList);
614 FieldCollectorList FieldCollectorList = new FieldCollectorList();
615 List<String> fieldCollectors = FieldCollectorList.getFieldCollector();
616 fieldCollectors.add(fieldCollector);
617 collectionObject.setFieldCollectors(FieldCollectorList);
619 PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME);
620 PayloadOutputPart commonPart =
621 multipart.addPart(collectionObject, MediaType.APPLICATION_XML_TYPE);
622 commonPart.setLabel(new CollectionObjectClient().getCommonPartName());
624 if(logger.isDebugEnabled()){
625 logger.debug("to be created, collectionObject common");
626 logger.debug(objectAsXmlString(collectionObject, CollectionobjectsCommon.class));