From: Aron Roberts Date: Fri, 4 May 2012 21:02:10 +0000 (-0700) Subject: CSPACE-5120: Organization now compiles, excluding test compilation via -Dmaven.test... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=33ea65ed8a6d8efa0f95a95018f9455c7f56f61c;p=tmp%2Fjakarta-migration.git CSPACE-5120: Organization now compiles, excluding test compilation via -Dmaven.test.skip=true. --- diff --git a/services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java b/services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java index e8f8f3587..651a97fbe 100644 --- a/services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java +++ b/services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java @@ -42,10 +42,10 @@ import org.collectionspace.services.organization.ContactNameList; import org.collectionspace.services.organization.FunctionList; import org.collectionspace.services.organization.GroupList; import org.collectionspace.services.organization.HistoryNoteList; -import org.collectionspace.services.organization.MainBodyGroupList; import org.collectionspace.services.organization.OrganizationsCommon; import org.collectionspace.services.organization.OrgauthoritiesCommon; -import org.collectionspace.services.organization.SubBodyList; +import org.collectionspace.services.organization.OrgTermGroup; +import org.collectionspace.services.organization.OrgTermGroupList; import org.collectionspace.services.person.PersonauthoritiesCommon; import org.collectionspace.services.person.PersonsCommon; import org.jboss.resteasy.client.ClientResponse; @@ -168,8 +168,8 @@ public class OrgAuthorityClientUtils { * @return the string */ public static String createItemInAuthority( String inAuthority, - String orgAuthorityRefName, Map orgInfo, - Map> orgRepeatablesInfo, MainBodyGroupList mainBodyList, OrgAuthorityClient client) { + String orgAuthorityRefName, List terms, Map orgInfo, + Map> orgRepeatablesInfo, OrgAuthorityClient client) { // Expected status code: 201 Created int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode(); // Type of service request being tested @@ -182,7 +182,7 @@ public class OrgAuthorityClientUtils { } PoxPayloadOut multipart = createOrganizationInstance(orgAuthorityRefName, - orgInfo, orgRepeatablesInfo, mainBodyList, client.getItemCommonPartName()); + orgInfo, terms, orgRepeatablesInfo, client.getItemCommonPartName()); ClientResponse res = client.createItem(inAuthority, multipart); String result; @@ -216,12 +216,12 @@ public class OrgAuthorityClientUtils { * @return the multipart output */ public static PoxPayloadOut createOrganizationInstance( - String orgAuthRefName, Map orgInfo, String headerLabel){ + String orgAuthRefName, Map orgInfo, + List terms, String headerLabel){ final Map> EMPTY_ORG_REPEATABLES_INFO = new HashMap>(); - final MainBodyGroupList EMPTY_MAIN_BODY_LIST = new MainBodyGroupList(); return createOrganizationInstance(orgAuthRefName, - orgInfo, EMPTY_ORG_REPEATABLES_INFO, EMPTY_MAIN_BODY_LIST, headerLabel); + orgInfo, terms, EMPTY_ORG_REPEATABLES_INFO, headerLabel); } @@ -236,8 +236,8 @@ public class OrgAuthorityClientUtils { * @return the multipart output */ public static PoxPayloadOut createOrganizationInstance( - String orgAuthRefName, Map orgInfo, - Map> orgRepeatablesInfo, MainBodyGroupList mainBodyList, String headerLabel){ + String orgAuthRefName, Map orgInfo, List terms, + Map> orgRepeatablesInfo, String headerLabel){ OrganizationsCommon organization = new OrganizationsCommon(); String shortId = orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER); if (shortId == null || shortId.isEmpty()) { @@ -246,24 +246,9 @@ public class OrgAuthorityClientUtils { organization.setShortIdentifier(shortId); String value = null; List values = null; - value = orgInfo.get(OrganizationJAXBSchema.DISPLAY_NAME_COMPUTED); - boolean displayNameComputed = (value==null) || value.equalsIgnoreCase("true"); - organization.setDisplayNameComputed(displayNameComputed); - if((value = (String)orgInfo.get(OrganizationJAXBSchema.DISPLAY_NAME))!=null) - organization.setDisplayName(value); - - value = orgInfo.get(OrganizationJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED); - boolean shortDisplayNameComputed = (value==null) || value.equalsIgnoreCase("true"); - organization.setShortDisplayNameComputed(shortDisplayNameComputed); - if((value = (String)orgInfo.get(OrganizationJAXBSchema.SHORT_DISPLAY_NAME))!=null) - organization.setShortDisplayName(value); - - //String refName = createOrganizationRefName(orgAuthRefName, shortId, value); - //organization.setRefName(refName); - - if (mainBodyList != null) { - organization.setMainBodyGroupList(mainBodyList); - } + + + // Handle terms here if((values = (List)orgRepeatablesInfo.get(OrganizationJAXBSchema.CONTACT_NAMES))!=null) { ContactNameList contactsList = new ContactNameList(); @@ -289,20 +274,13 @@ public class OrgAuthorityClientUtils { functions.addAll(values); organization.setFunctions(functionsList); } - if((values = (List)orgRepeatablesInfo.get(OrganizationJAXBSchema.SUB_BODIES))!=null) { - SubBodyList subBodiesList = new SubBodyList(); - List subbodies = subBodiesList.getSubBody(); - subbodies.addAll(values); - organization.setSubBodies(subBodiesList); - } if((values = (List)orgRepeatablesInfo.get(OrganizationJAXBSchema.HISTORY_NOTES))!=null) { HistoryNoteList historyNotesList = new HistoryNoteList(); List historyNotes = historyNotesList.getHistoryNote(); historyNotes.addAll(values); organization.setHistoryNotes(historyNotesList); } - if((value = (String)orgInfo.get(OrganizationJAXBSchema.TERM_STATUS))!=null) - organization.setTermStatus(value); + PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME); PayloadOutputPart commonPart = multipart.addPart(organization, MediaType.APPLICATION_XML_TYPE);