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 ClientResponse<Response> res = collectionObjectClient.create(multipart);
194 String newCsid = null;
196 assertStatusCode(res, testName);
197 newCsid = extractId(res);
200 res.releaseConnection();
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 ClientResponse<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);
239 * Creates a person item.
241 * @param firstName the person's first name
242 * @param surName the person's surname
243 * @param shortIdentifier the short identifier for the item
244 * @return the CSID of the newly-created person record
246 protected String createPerson(String firstName, String surName, String shortIdentifier ) {
247 Map<String, String> personInfo = new HashMap<String,String>();
248 personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
249 personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
250 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
251 List<PersonTermGroup> personTerms = new ArrayList<PersonTermGroup>();
252 PersonTermGroup term = new PersonTermGroup();
253 String termName = firstName + " " + surName;
254 term.setTermDisplayName(termName);
255 term.setTermName(termName);
256 personTerms.add(term);
257 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
258 PoxPayloadOut multipart =
259 PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
260 personAuthRefName, personInfo, personTerms, personAuthClient.getItemCommonPartName());
261 ClientResponse<Response> res = personAuthClient.createItem(personAuthCSID, multipart);
262 int statusCode = res.getStatus();
264 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
265 invalidStatusCodeMessage(testRequestType, statusCode));
266 Assert.assertEquals(statusCode, STATUS_CREATED);
267 return extractId(res);
271 * Creates multiple Person items within a Person Authority,
272 * and stores the refNames referring to each.
274 protected void createPersonRefs(){
276 createPersonAuthority(PERSON_AUTHORITY_NAME_DISPLAY, PERSON_AUTHORITY_NAME);
280 csid = createPerson("Connie", "ContactPerson", "connieContactPerson");
281 contentPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
282 personIdsCreated.add(csid);
284 // csid = createPerson("Ingrid", "ContentInscriber", "ingridContentInscriber");
285 // contentInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
286 // personIdsCreated.add(csid);
288 // csid = createPerson("Pacifico", "ProductionPerson", "pacificoProductionPerson");
289 // objectProductionPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
290 // personIdsCreated.add(csid);
292 // csid = createPerson("Dessie", "DescriptionInscriber", "dessieDescriptionInscriber");
293 // descriptionInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
294 // personIdsCreated.add(csid);
296 csid = createPerson("Asok", "AssociatedEventPerson", "asokAssociatedEventPerson");
297 assocEventPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
298 personIdsCreated.add(csid);
300 // csid = createPerson("Andrew", "AssociatedPerson", "andrewAssociatedPerson");
301 // assocPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
302 // personIdsCreated.add(csid);
304 csid = createPerson("Owen", "Owner", "owenOwner");
305 ownerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
306 personIdsCreated.add(csid);
308 csid = createPerson("Sally", "Field-CollectionSource", "sallyFieldCollectionSource");
309 fieldCollectionSourceRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
310 personIdsCreated.add(csid);
312 csid = createPerson("Fred", "Lector", "fredLector");
313 fieldCollectorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
314 personIdsCreated.add(csid);
318 * Creates an organization authority.
320 * @param displayName the display name of the authority
321 * @param shortIdentifier the short identifier for the authority
323 private void createOrgAuthority(String displayName, String shortIdentifier) {
324 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
325 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
326 PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
327 displayName, shortIdentifier, orgAuthClient.getCommonPartName());
328 ClientResponse<Response> res = orgAuthClient.create(multipart);
329 int statusCode = res.getStatus();
331 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
332 invalidStatusCodeMessage(testRequestType, statusCode));
333 Assert.assertEquals(statusCode, STATUS_CREATED);
334 orgAuthCSID = extractId(res);
335 orgAuthRefName = OrgAuthorityClientUtils.getAuthorityRefName(orgAuthCSID, null);
339 * Creates an organization item.
341 * @param shortName the organization's short name
342 * @param foundingPlace the organization's founding place
343 * @param shortIdentifier the short identifier for the item
344 * @return the CSID of the newly-created organization record
346 protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) {
347 Map<String, String> orgInfo = new HashMap<String,String>();
348 orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
349 orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
351 List<OrgTermGroup> orgTerms = new ArrayList<OrgTermGroup>();
352 OrgTermGroup term = new OrgTermGroup();
353 term.setTermDisplayName(shortName);
354 term.setTermName(shortName);
357 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
358 PoxPayloadOut multipart =
359 OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName, orgInfo, orgTerms, orgAuthClient.getItemCommonPartName());
360 ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);
361 int statusCode = res.getStatus();
363 Assert.assertTrue(testRequestType.isValidStatusCode(statusCode),
364 invalidStatusCodeMessage(testRequestType, statusCode));
365 Assert.assertEquals(statusCode, STATUS_CREATED);
366 return extractId(res);
370 * Creates multiple Organization items within an Organization Authority,
371 * and stores the refNames referring to each.
373 private void createOrganizationRefs() {
375 createOrgAuthority(ORG_AUTHORITY_NAME, ORG_AUTHORITY_NAME);
379 csid = createOrganization("Content Org", "Content Org Town", "contentOrg");
380 contentOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
381 orgIdsCreated.add(csid);
383 // csid = createOrganization("Production Org", "Production Org Town", "productionOrg");
384 // objectProductionOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
385 // orgIdsCreated.add(csid);
387 csid = createOrganization("Associated Event Org", "Associated Event Org City", "associatedEventOrg");
388 assocEventOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
389 orgIdsCreated.add(csid);
391 // csid = createOrganization("Associated Org", "Associated Org City", "associatedOrg");
392 // assocOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
393 // orgIdsCreated.add(csid);
399 * Read and check auth refs.
401 * @param testName the test name
402 * @throws Exception the exception
404 @Test(dataProvider="testName",
405 dependsOnMethods = {"createWithAuthRefs"})
406 public void readAndCheckAuthRefs(String testName) throws Exception {
408 testSetup(STATUS_OK, ServiceRequestType.READ);
410 // First read the object
412 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
413 ClientResponse<String> res = collectionObjectClient.read(knownResourceId);
414 CollectionobjectsCommon collectionObject = null;
416 assertStatusCode(res, testName);
417 PoxPayloadIn input = new PoxPayloadIn(res.getEntity());
418 collectionObject = (CollectionobjectsCommon) extractPart(input,
419 collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
420 Assert.assertNotNull(collectionObject);
423 res.releaseConnection();
427 // Next, get all of the auth refs and check that the expected number is returned
429 ClientResponse<AuthorityRefList> res2 = collectionObjectClient.getAuthorityRefs(knownResourceId);
430 AuthorityRefList list = null;
432 assertStatusCode(res2, testName);
433 list = res2.getEntity();
436 res2.releaseConnection();
440 List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
441 int numAuthRefsFound = items.size();
442 if(logger.isDebugEnabled()){
443 logger.debug("Expected " + NUM_AUTH_REFS_EXPECTED +
444 " authority references, found " + numAuthRefsFound);
446 Assert.assertEquals(numAuthRefsFound, NUM_AUTH_REFS_EXPECTED,
447 "Did not find all expected authority references! " +
448 "Expected " + NUM_AUTH_REFS_EXPECTED + ", found " + numAuthRefsFound);
450 // Check a sample of one or more person authority ref fields
451 // Assert.assertEquals(collectionObject.getAssocPersons().getAssocPerson().get(0), assocPersonRefName);
452 Assert.assertEquals(collectionObject.getOwners().getOwner().get(0), ownerRefName);
453 Assert.assertEquals(collectionObject.getFieldCollectionSources().getFieldCollectionSource().get(0), fieldCollectionSourceRefName);
455 // Check a sample of one or more organization authority ref fields
456 Assert.assertEquals(collectionObject.getContentOrganizations().getContentOrganization().get(0), contentOrganizationRefName);
457 Assert.assertEquals(collectionObject.getAssocEventOrganizations().getAssocEventOrganization().get(0), assocEventOrganizationRefName);
459 // Optionally output additional data about list members for debugging.
460 logger.info(this.toString());
461 boolean iterateThroughList = true;
462 if(iterateThroughList && logger.isDebugEnabled()){;
464 for(AuthorityRefList.AuthorityRefItem item : items){
465 logger.debug(testName + ": list-item[" + i + "] Field:" +
466 item.getSourceField() + " =" +
467 " item display name = " + item.getAuthDisplayName() +
468 " auth display name = " + item.getItemDisplayName());
469 logger.debug(testName + ": list-item[" + i + "] refName=" +
471 logger.debug(testName + ": list-item[" + i + "] URI=" +
479 // ---------------------------------------------------------------
480 // Cleanup of resources created during testing
481 // ---------------------------------------------------------------
484 * Deletes all resources created by tests, after all tests have been run.
486 * This cleanup method will always be run, even if one or more tests fail.
487 * For this reason, it attempts to remove all resources created
488 * at any point during testing, even if some of those resources
489 * may be expected to be deleted by certain tests.
491 @AfterClass(alwaysRun=true)
492 public void cleanUp() {
493 String noTest = System.getProperty("noTestCleanup");
494 if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
495 if (logger.isDebugEnabled()) {
496 logger.debug("Skipping Cleanup phase ...");
500 if (logger.isDebugEnabled()) {
501 logger.debug("Cleaning up temporary resources created for testing ...");
503 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
504 for (String resourceId : collectionObjectIdsCreated) {
505 // Note: Any non-success responses are ignored and not reported.
506 collectionObjectClient.delete(resourceId).releaseConnection();
508 // Note: Any non-success response is ignored and not reported.
509 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
510 // Delete persons before PersonAuth
511 for (String resourceId : personIdsCreated) {
512 // Note: Any non-success responses are ignored and not reported.
513 personAuthClient.deleteItem(personAuthCSID, resourceId).releaseConnection();
515 personAuthClient.delete(personAuthCSID).releaseConnection();
516 // Note: Any non-success response is ignored and not reported.
517 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
518 // Delete organizations before OrgAuth
519 for (String resourceId : orgIdsCreated) {
520 // Note: Any non-success responses are ignored and not reported.
521 orgAuthClient.deleteItem(orgAuthCSID, resourceId).releaseConnection();
523 orgAuthClient.delete(orgAuthCSID).releaseConnection();
526 // ---------------------------------------------------------------
527 // Utility methods used by tests above
528 // ---------------------------------------------------------------
530 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
533 public String getServicePathComponent() {
534 return SERVICE_PATH_COMPONENT;
538 * Creates the collection object instance.
540 * @param title the title
541 * @param objNum the obj num
542 * @param contentOrganization the content organization
543 * @param contentPeople the content people
544 * @param contentPerson the content person
545 * @param inscriber the inscriber
546 * @return the multipart output
548 private PoxPayloadOut createCollectionObjectInstance(
551 String contentOrganization,
552 String contentPerson,
553 String assocEventOrganization,
554 String assocEventPerson,
556 String fieldCollectionSource,
557 String fieldCollector ) {
558 CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
559 TitleGroupList titleGroupList = new TitleGroupList();
560 List<TitleGroup> titleGroups = titleGroupList.getTitleGroup();
561 TitleGroup titleGroup = new TitleGroup();
562 titleGroup.setTitle("a title");
563 titleGroups.add(titleGroup);
564 collectionObject.setTitleGroupList(titleGroupList);
565 collectionObject.setObjectNumber(objNum);
567 ContentOrganizationList contentOrganizationList = new ContentOrganizationList();
568 List<String> contentOrganizations = contentOrganizationList.getContentOrganization();
569 contentOrganizations.add(contentOrganization);
570 collectionObject.setContentOrganizations(contentOrganizationList);
572 ContentPersonList contentPersonList = new ContentPersonList();
573 List<String> contentPersons = contentPersonList.getContentPerson();
574 contentPersons.add(contentPerson);
575 collectionObject.setContentPersons(contentPersonList);
577 AssocEventOrganizationList assocEventOrganizationList = new AssocEventOrganizationList();
578 List<String> assocEventOrganizations = assocEventOrganizationList.getAssocEventOrganization();
579 assocEventOrganizations.add(assocEventOrganization);
580 collectionObject.setAssocEventOrganizations(assocEventOrganizationList);
582 AssocEventPersonList assocEventPersonList = new AssocEventPersonList();
583 List<String> assocEventPersons = assocEventPersonList.getAssocEventPerson();
584 assocEventPersons.add(assocEventPerson);
585 collectionObject.setAssocEventPersons(assocEventPersonList);
587 // AssocOrganizationList assocOrganizationList = new AssocOrganizationList();
588 // List<String> assocOrganizations = assocOrganizationList.getAssocOrganization();
589 // assocOrganizations.add(assocOrganization);
590 // collectionObject.setAssocOrganizations(assocOrganizationList);
592 // AssocPersonList assocPersonList = new AssocPersonList();
593 // List<String> assocPersons = assocPersonList.getAssocPerson();
594 // assocPersons.add(assocPerson);
595 // collectionObject.setAssocPersons(assocPersonList);
597 OwnerList ownerList = new OwnerList();
598 List<String> owners = ownerList.getOwner();
600 collectionObject.setOwners(ownerList);
602 FieldCollectionSourceList fieldCollectionSourceList = new FieldCollectionSourceList();
603 List<String> fieldCollectionSources = fieldCollectionSourceList.getFieldCollectionSource();
604 fieldCollectionSources.add(fieldCollectionSource);
605 collectionObject.setFieldCollectionSources(fieldCollectionSourceList);
607 FieldCollectorList FieldCollectorList = new FieldCollectorList();
608 List<String> fieldCollectors = FieldCollectorList.getFieldCollector();
609 fieldCollectors.add(fieldCollector);
610 collectionObject.setFieldCollectors(FieldCollectorList);
612 PoxPayloadOut multipart = new PoxPayloadOut(CollectionObjectClient.SERVICE_PAYLOAD_NAME);
613 PayloadOutputPart commonPart =
614 multipart.addPart(collectionObject, MediaType.APPLICATION_XML_TYPE);
615 commonPart.setLabel(new CollectionObjectClient().getCommonPartName());
617 if(logger.isDebugEnabled()){
618 logger.debug("to be created, collectionObject common");
619 logger.debug(objectAsXmlString(collectionObject, CollectionobjectsCommon.class));