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.PersonAuthorityClient;
40 import org.collectionspace.services.client.PersonAuthorityClientUtils;
41 import org.collectionspace.services.common.authorityref.AuthorityRefList;
42 import org.collectionspace.services.collectionobject.AssocEventOrganizationList;
43 import org.collectionspace.services.collectionobject.AssocEventPersonList;
44 import org.collectionspace.services.collectionobject.AssocOrganizationList;
45 import org.collectionspace.services.collectionobject.AssocPersonList;
46 import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
47 import org.collectionspace.services.collectionobject.ContentOrganizationList;
48 import org.collectionspace.services.collectionobject.ContentPersonList;
49 import org.collectionspace.services.collectionobject.FieldCollectionSourceList;
50 import org.collectionspace.services.collectionobject.FieldCollectorList;
51 import org.collectionspace.services.collectionobject.OwnerList;
52 import org.collectionspace.services.jaxb.AbstractCommonList;
54 import org.jboss.resteasy.client.ClientResponse;
56 import org.jboss.resteasy.plugins.providers.multipart.MultipartInput;
57 import org.jboss.resteasy.plugins.providers.multipart.MultipartOutput;
58 import org.jboss.resteasy.plugins.providers.multipart.OutputPart;
59 import org.testng.Assert;
60 import org.testng.annotations.AfterClass;
61 import org.testng.annotations.Test;
63 import org.slf4j.Logger;
64 import org.slf4j.LoggerFactory;
67 * CollectionObjectAuthRefsTest, carries out tests against a
68 * deployed and running CollectionObject Service.
70 * $LastChangedRevision: 1327 $
71 * $LastChangedDate: 2010-02-12 10:35:11 -0800 (Fri, 12 Feb 2010) $
73 public class CollectionObjectAuthRefsTest extends BaseServiceTest {
76 private final String CLASS_NAME = CollectionObjectAuthRefsTest.class.getName();
77 private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
79 // Instance variables specific to this test.
80 /** The service path component. */
81 final String SERVICE_PATH_COMPONENT = "collectionobjects";
83 /** The person authority name. */
84 final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
86 /** The organization authority name. */
87 final String ORG_AUTHORITY_NAME = "TestOrgAuth";
89 /** The known resource id. */
90 private String knownResourceId = null;
92 /** The collection object ids created. */
93 private List<String> collectionObjectIdsCreated = new ArrayList<String>();
95 /** The person ids created. */
96 private List<String> personIdsCreated = new ArrayList<String>();
98 /** The person authority csid and refName. */
99 private String personAuthCSID = null;
100 private String personAuthRefName = null;
102 /** The organization ids created. */
103 private List<String> orgIdsCreated = new ArrayList<String>();
105 /** The org authority csid and refName. */
106 private String orgAuthCSID = null;
107 private String orgAuthRefName = null;
109 private String contentOrganizationRefName = null;
110 private String contentPersonRefName = null;
111 private String contentInscriberRefName = null;
112 private String descriptionInscriberRefName = null;
113 private String assocEventOrganizationRefName = null;
114 private String assocEventPersonRefName = null;
115 private String assocOrganizationRefName = null;
116 private String assocPersonRefName = null;
117 private String ownerRefName = null;
118 private String fieldCollectionSourceRefName = null;
119 private String fieldCollectorRefName = null;
121 /** The number of authority references expected. */
122 private final int NUM_AUTH_REFS_EXPECTED = 11;
125 * @see org.collectionspace.services.client.test.BaseServiceTest#getClientInstance()
128 protected CollectionSpaceClient getClientInstance() {
129 throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
133 * @see org.collectionspace.services.client.test.BaseServiceTest#getAbstractCommonList(org.jboss.resteasy.client.ClientResponse)
136 protected AbstractCommonList getAbstractCommonList(
137 ClientResponse<AbstractCommonList> response) {
138 throw new UnsupportedOperationException(); //method not supported (or needed) in this test class
141 // ---------------------------------------------------------------
142 // CRUD tests : CREATE tests
143 // ---------------------------------------------------------------
146 * Creates the with auth refs.
148 * @param testName the test name
149 * @throws Exception the exception
151 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class)
152 public void createWithAuthRefs(String testName) throws Exception {
154 if (logger.isDebugEnabled()) {
155 logger.debug(testBanner(testName, CLASS_NAME));
157 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
159 // Create all the person refs and entities
162 // Create all the organization refs and entities
163 createOrganizationRefs();
165 // Create an object record payload, containing
166 // authority reference values in a number of its fields
167 String identifier = createIdentifier();
168 MultipartOutput multipart =
169 createCollectionObjectInstance(
171 "ObjNum" + "-" + identifier,
172 contentOrganizationRefName,
173 contentPersonRefName,
174 contentInscriberRefName,
175 descriptionInscriberRefName,
176 assocEventOrganizationRefName,
177 assocEventPersonRefName,
178 assocOrganizationRefName,
181 fieldCollectionSourceRefName,
182 fieldCollectorRefName
185 // Submit the request to the service and store the response.
186 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
187 ClientResponse<Response> res = collectionObjectClient.create(multipart);
189 int statusCode = res.getStatus();
191 // Check the status code of the response: does it match
192 // the expected response(s)?
195 // Does it fall within the set of valid status codes?
196 // Does it exactly match the expected status code?
197 if(logger.isDebugEnabled()){
198 logger.debug(testName + ": status = " + statusCode);
200 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
201 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
202 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
204 // Store the ID returned from the first resource created
205 // for additional tests below.
206 if (knownResourceId == null){
207 knownResourceId = extractId(res);
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 MultipartOutput multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
228 displayName, shortIdentifier, personAuthClient.getCommonPartName());
229 ClientResponse<Response> res = personAuthClient.create(multipart);
230 int statusCode = res.getStatus();
232 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
233 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
234 Assert.assertEquals(statusCode, STATUS_CREATED);
235 personAuthCSID = extractId(res);
236 personAuthRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
240 * Creates a person item.
242 * @param firstName the person's first name
243 * @param surName the person's surname
244 * @param shortIdentifier the short identifier for the item
245 * @return the CSID of the newly-created person record
247 protected String createPerson(String firstName, String surName, String shortIdentifier ) {
248 Map<String, String> personInfo = new HashMap<String,String>();
249 personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
250 personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
251 personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
252 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
253 MultipartOutput multipart =
254 PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
255 personAuthRefName, personInfo, personAuthClient.getItemCommonPartName());
256 ClientResponse<Response> res = personAuthClient.createItem(personAuthCSID, multipart);
257 int statusCode = res.getStatus();
259 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
260 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
261 Assert.assertEquals(statusCode, STATUS_CREATED);
262 return extractId(res);
266 * Creates multiple Person items within a Person Authority,
267 * and stores the refNames referring to each.
269 protected void createPersonRefs(){
271 createPersonAuthority(PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME);
275 csid = createPerson("Connie", "ContactPerson", "connieContactPerson");
276 contentPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
277 personIdsCreated.add(csid);
279 csid = createPerson("Ingrid", "ContentInscriber", "ingridContentInscriber");
280 contentInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
281 personIdsCreated.add(csid);
283 csid = createPerson("Dessie", "DescriptionInscriber", "dessieDescriptionInscriber");
284 descriptionInscriberRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
285 personIdsCreated.add(csid);
287 csid = createPerson("Asok", "AssociatedEventPerson", "asokAssociatedEventPerson");
288 assocEventPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
289 personIdsCreated.add(csid);
291 csid = createPerson("Andrew", "AssociatedPerson", "andrewAssociatedPerson");
292 assocPersonRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
293 personIdsCreated.add(csid);
295 csid = createPerson("Owen", "Owner", "owenOwner");
296 ownerRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
297 personIdsCreated.add(csid);
299 csid = createPerson("Sally", "Field-CollectionSource", "sallyFieldCollectionSource");
300 fieldCollectionSourceRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
301 personIdsCreated.add(csid);
303 csid = createPerson("Fred", "Lector", "fredLector");
304 fieldCollectorRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
305 personIdsCreated.add(csid);
309 * Creates an organization authority.
311 * @param displayName the display name of the authority
312 * @param shortIdentifier the short identifier for the authority
314 private void createOrgAuthority(String displayName, String shortIdentifier) {
315 testSetup(STATUS_CREATED, ServiceRequestType.CREATE);
316 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
317 MultipartOutput multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
318 displayName, shortIdentifier, orgAuthClient.getCommonPartName());
319 ClientResponse<Response> res = orgAuthClient.create(multipart);
320 int statusCode = res.getStatus();
322 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
323 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
324 Assert.assertEquals(statusCode, STATUS_CREATED);
325 orgAuthCSID = extractId(res);
326 orgAuthRefName = OrgAuthorityClientUtils.getAuthorityRefName(orgAuthCSID, null);
330 * Creates an organization item.
332 * @param shortName the organization's short name
333 * @param foundingPlace the organization's founding place
334 * @param shortIdentifier the short identifier for the item
335 * @return the CSID of the newly-created organization record
337 protected String createOrganization(String shortName, String foundingPlace, String shortIdentifier ) {
338 Map<String, String> orgInfo = new HashMap<String,String>();
339 orgInfo.put(OrganizationJAXBSchema.SHORT_NAME, shortName);
340 orgInfo.put(OrganizationJAXBSchema.FOUNDING_PLACE, foundingPlace);
341 orgInfo.put(OrganizationJAXBSchema.SHORT_IDENTIFIER, shortIdentifier);
342 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
343 MultipartOutput multipart =
344 OrgAuthorityClientUtils.createOrganizationInstance(orgAuthCSID,
345 orgAuthRefName, orgInfo, orgAuthClient.getItemCommonPartName());
346 ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);
347 int statusCode = res.getStatus();
349 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
350 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
351 Assert.assertEquals(statusCode, STATUS_CREATED);
352 return extractId(res);
356 * Creates multiple Organization items within an Organization Authority,
357 * and stores the refNames referring to each.
359 private void createOrganizationRefs() {
361 createOrgAuthority(ORG_AUTHORITY_NAME, ORG_AUTHORITY_NAME);
365 csid = createOrganization("Content Org", "Content Org Town", "contentOrg");
366 contentOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
367 orgIdsCreated.add(csid);
369 csid = createOrganization("Associated Event Org", "Associated Event Org City", "associatedEventOrg");
370 assocEventOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
371 orgIdsCreated.add(csid);
373 csid = createOrganization("Associated Org", "Associated Org City", "associatedOrg");
374 assocOrganizationRefName = OrgAuthorityClientUtils.getOrgRefName(orgAuthCSID, csid, null);
375 orgIdsCreated.add(csid);
381 * Read and check auth refs.
383 * @param testName the test name
384 * @throws Exception the exception
386 @Test(dataProvider="testName", dataProviderClass=AbstractServiceTestImpl.class,
387 dependsOnMethods = {"createWithAuthRefs"})
388 public void readAndCheckAuthRefs(String testName) throws Exception {
390 if (logger.isDebugEnabled()) {
391 logger.debug(testBanner(testName, CLASS_NAME));
394 testSetup(STATUS_OK, ServiceRequestType.READ);
396 // Submit the request to the service and store the response.
397 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
398 ClientResponse<MultipartInput> res = collectionObjectClient.read(knownResourceId);
399 int statusCode = res.getStatus();
401 // Check the status code of the response: does it match
402 // the expected response(s)?
403 if(logger.isDebugEnabled()){
404 logger.debug(testName + ".read: status = " + statusCode);
406 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
407 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
408 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
410 MultipartInput input = (MultipartInput) res.getEntity();
411 CollectionobjectsCommon collectionObject = (CollectionobjectsCommon) extractPart(input,
412 collectionObjectClient.getCommonPartName(), CollectionobjectsCommon.class);
413 Assert.assertNotNull(collectionObject);
415 // Check a sample of one or more person authority ref fields
416 Assert.assertEquals(collectionObject.getInscriptionContentInscriber(), contentInscriberRefName);
417 Assert.assertEquals(collectionObject.getAssocPersons().getAssocPerson().get(0), assocPersonRefName);
418 Assert.assertEquals(collectionObject.getOwners().getOwner().get(0), ownerRefName);
419 Assert.assertEquals(collectionObject.getFieldCollectionSources().getFieldCollectionSource().get(0), fieldCollectionSourceRefName);
421 // Check a sample of one or more organization authority ref fields
422 Assert.assertEquals(collectionObject.getContentOrganizations().getContentOrganization().get(0), contentOrganizationRefName);
423 Assert.assertEquals(collectionObject.getAssocEventOrganizations().getAssocEventOrganization().get(0), assocEventOrganizationRefName);
425 // Get all of the auth refs and check that the expected number is returned
426 ClientResponse<AuthorityRefList> res2 = collectionObjectClient.getAuthorityRefs(knownResourceId);
427 statusCode = res2.getStatus();
429 if(logger.isDebugEnabled()){
430 logger.debug(testName + ".getAuthorityRefs: status = " + statusCode);
432 Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
433 invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
434 Assert.assertEquals(statusCode, EXPECTED_STATUS_CODE);
435 AuthorityRefList list = res2.getEntity();
437 List<AuthorityRefList.AuthorityRefItem> items = list.getAuthorityRefItem();
438 int numAuthRefsFound = items.size();
439 if(logger.isDebugEnabled()){
440 logger.debug("Expected " + NUM_AUTH_REFS_EXPECTED +
441 " authority references, found " + numAuthRefsFound);
443 Assert.assertEquals(numAuthRefsFound, NUM_AUTH_REFS_EXPECTED,
444 "Did not find all expected authority references! " +
445 "Expected " + NUM_AUTH_REFS_EXPECTED + ", found " + numAuthRefsFound);
447 // Optionally output additional data about list members for debugging.
448 boolean iterateThroughList = true;
449 if(iterateThroughList && logger.isDebugEnabled()){;
451 for(AuthorityRefList.AuthorityRefItem item : items){
452 logger.debug(testName + ": list-item[" + i + "] Field:" +
453 item.getSourceField() + " =" +
454 " item display name = " + item.getAuthDisplayName() +
455 " auth display name = " + item.getItemDisplayName());
456 logger.debug(testName + ": list-item[" + i + "] refName=" +
458 logger.debug(testName + ": list-item[" + i + "] URI=" +
466 // ---------------------------------------------------------------
467 // Cleanup of resources created during testing
468 // ---------------------------------------------------------------
471 * Deletes all resources created by tests, after all tests have been run.
473 * This cleanup method will always be run, even if one or more tests fail.
474 * For this reason, it attempts to remove all resources created
475 * at any point during testing, even if some of those resources
476 * may be expected to be deleted by certain tests.
478 @AfterClass(alwaysRun=true)
479 public void cleanUp() {
480 String noTest = System.getProperty("noTestCleanup");
481 if(Boolean.TRUE.toString().equalsIgnoreCase(noTest)) {
482 if (logger.isDebugEnabled()) {
483 logger.debug("Skipping Cleanup phase ...");
487 if (logger.isDebugEnabled()) {
488 logger.debug("Cleaning up temporary resources created for testing ...");
490 CollectionObjectClient collectionObjectClient = new CollectionObjectClient();
491 for (String resourceId : collectionObjectIdsCreated) {
492 // Note: Any non-success responses are ignored and not reported.
493 collectionObjectClient.delete(resourceId).releaseConnection();
495 // Note: Any non-success response is ignored and not reported.
496 PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
497 // Delete persons before PersonAuth
498 for (String resourceId : personIdsCreated) {
499 // Note: Any non-success responses are ignored and not reported.
500 personAuthClient.deleteItem(personAuthCSID, resourceId).releaseConnection();
502 personAuthClient.delete(personAuthCSID).releaseConnection();
503 // Note: Any non-success response is ignored and not reported.
504 OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
505 // Delete organizations before OrgAuth
506 for (String resourceId : orgIdsCreated) {
507 // Note: Any non-success responses are ignored and not reported.
508 orgAuthClient.deleteItem(orgAuthCSID, resourceId).releaseConnection();
510 orgAuthClient.delete(orgAuthCSID).releaseConnection();
513 // ---------------------------------------------------------------
514 // Utility methods used by tests above
515 // ---------------------------------------------------------------
517 * @see org.collectionspace.services.client.test.BaseServiceTest#getServicePathComponent()
520 public String getServicePathComponent() {
521 return SERVICE_PATH_COMPONENT;
525 * Creates the collection object instance.
527 * @param title the title
528 * @param objNum the obj num
529 * @param contentOrganization the content organization
530 * @param contentPeople the content people
531 * @param contentPerson the content person
532 * @param inscriber the inscriber
533 * @return the multipart output
535 private MultipartOutput createCollectionObjectInstance(
538 String contentOrganization,
539 String contentPerson,
540 String contentInscriber,
541 String descriptionInscriber,
542 String assocEventOrganization,
543 String assocEventPerson,
544 String assocOrganization,
547 String fieldCollectionSource,
548 String fieldCollector ) {
549 CollectionobjectsCommon collectionObject = new CollectionobjectsCommon();
550 collectionObject.setTitle(title);
551 collectionObject.setObjectNumber(objNum);
552 collectionObject.setInscriptionContentInscriber(contentInscriber);
553 collectionObject.setInscriptionDescriptionInscriber(descriptionInscriber);
555 ContentOrganizationList contentOrganizationList = new ContentOrganizationList();
556 List<String> contentOrganizations = contentOrganizationList.getContentOrganization();
557 contentOrganizations.add(contentOrganization);
558 collectionObject.setContentOrganizations(contentOrganizationList);
560 ContentPersonList contentPersonList = new ContentPersonList();
561 List<String> contentPersons = contentPersonList.getContentPerson();
562 contentPersons.add(contentPerson);
563 collectionObject.setContentPersons(contentPersonList);
565 AssocEventOrganizationList assocEventOrganizationList = new AssocEventOrganizationList();
566 List<String> assocEventOrganizations = assocEventOrganizationList.getAssocEventOrganization();
567 assocEventOrganizations.add(assocEventOrganization);
568 collectionObject.setAssocEventOrganizations(assocEventOrganizationList);
570 AssocEventPersonList assocEventPersonList = new AssocEventPersonList();
571 List<String> assocEventPersons = assocEventPersonList.getAssocEventPerson();
572 assocEventPersons.add(assocEventPerson);
573 collectionObject.setAssocEventPersons(assocEventPersonList);
575 AssocOrganizationList assocOrganizationList = new AssocOrganizationList();
576 List<String> assocOrganizations = assocOrganizationList.getAssocOrganization();
577 assocOrganizations.add(assocOrganization);
578 collectionObject.setAssocOrganizations(assocOrganizationList);
580 AssocPersonList assocPersonList = new AssocPersonList();
581 List<String> assocPersons = assocPersonList.getAssocPerson();
582 assocPersons.add(assocPerson);
583 collectionObject.setAssocPersons(assocPersonList);
585 OwnerList ownerList = new OwnerList();
586 List<String> owners = ownerList.getOwner();
588 collectionObject.setOwners(ownerList);
590 FieldCollectionSourceList fieldCollectionSourceList = new FieldCollectionSourceList();
591 List<String> fieldCollectionSources = fieldCollectionSourceList.getFieldCollectionSource();
592 fieldCollectionSources.add(fieldCollectionSource);
593 collectionObject.setFieldCollectionSources(fieldCollectionSourceList);
595 FieldCollectorList FieldCollectorList = new FieldCollectorList();
596 List<String> fieldCollectors = FieldCollectorList.getFieldCollector();
597 fieldCollectors.add(fieldCollector);
598 collectionObject.setFieldCollectors(FieldCollectorList);
600 MultipartOutput multipart = new MultipartOutput();
601 OutputPart commonPart =
602 multipart.addPart(collectionObject, MediaType.APPLICATION_XML_TYPE);
603 commonPart.getHeaders().add("label", new CollectionObjectClient().getCommonPartName());
605 if(logger.isDebugEnabled()){
606 logger.debug("to be created, collectionObject common");
607 logger.debug(objectAsXmlString(collectionObject, CollectionobjectsCommon.class));