]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5120: Organization now compiles, excluding test compilation via -Dmaven.test...
authorAron Roberts <aron@socrates.berkeley.edu>
Fri, 4 May 2012 21:02:10 +0000 (14:02 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Fri, 4 May 2012 21:02:10 +0000 (14:02 -0700)
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java

index e8f8f3587dea3bcf614451cc4bcc3d7678407b0f..651a97fbe51859d073a883a3bbabe6eed3bbaa35 100644 (file)
@@ -42,10 +42,10 @@ import org.collectionspace.services.organization.ContactNameList;
 import org.collectionspace.services.organization.FunctionList;\r
 import org.collectionspace.services.organization.GroupList;\r
 import org.collectionspace.services.organization.HistoryNoteList;\r
-import org.collectionspace.services.organization.MainBodyGroupList;\r
 import org.collectionspace.services.organization.OrganizationsCommon;\r
 import org.collectionspace.services.organization.OrgauthoritiesCommon;\r
-import org.collectionspace.services.organization.SubBodyList;\r
+import org.collectionspace.services.organization.OrgTermGroup;\r
+import org.collectionspace.services.organization.OrgTermGroupList;\r
 import org.collectionspace.services.person.PersonauthoritiesCommon;\r
 import org.collectionspace.services.person.PersonsCommon;\r
 import org.jboss.resteasy.client.ClientResponse;\r
@@ -168,8 +168,8 @@ public class OrgAuthorityClientUtils {
      * @return the string\r
      */\r
     public static String createItemInAuthority( String inAuthority,\r
-               String orgAuthorityRefName, Map<String, String> orgInfo,\r
-                Map<String, List<String>> orgRepeatablesInfo, MainBodyGroupList mainBodyList, OrgAuthorityClient client) {\r
+               String orgAuthorityRefName, List<OrgTermGroup> terms, Map<String, String> orgInfo,\r
+                Map<String, List<String>> orgRepeatablesInfo, OrgAuthorityClient client) {\r
        // Expected status code: 201 Created\r
        int EXPECTED_STATUS_CODE = Response.Status.CREATED.getStatusCode();\r
        // Type of service request being tested\r
@@ -182,7 +182,7 @@ public class OrgAuthorityClientUtils {
        }\r
        PoxPayloadOut multipart =\r
                createOrganizationInstance(orgAuthorityRefName, \r
-                               orgInfo, orgRepeatablesInfo, mainBodyList, client.getItemCommonPartName());\r
+                               orgInfo, terms, orgRepeatablesInfo, client.getItemCommonPartName());\r
 \r
        ClientResponse<Response> res = client.createItem(inAuthority, multipart);\r
        String result;\r
@@ -216,12 +216,12 @@ public class OrgAuthorityClientUtils {
      * @return the multipart output\r
      */\r
     public static PoxPayloadOut createOrganizationInstance(\r
-               String orgAuthRefName, Map<String, String> orgInfo, String headerLabel){\r
+               String orgAuthRefName, Map<String, String> orgInfo,\r
+                List<OrgTermGroup> terms, String headerLabel){\r
             final Map<String, List<String>> EMPTY_ORG_REPEATABLES_INFO =\r
                 new HashMap<String, List<String>>();\r
-            final MainBodyGroupList EMPTY_MAIN_BODY_LIST = new MainBodyGroupList();\r
             return createOrganizationInstance(orgAuthRefName,\r
-                    orgInfo, EMPTY_ORG_REPEATABLES_INFO, EMPTY_MAIN_BODY_LIST, headerLabel);\r
+                    orgInfo, terms, EMPTY_ORG_REPEATABLES_INFO, headerLabel);\r
     }\r
 \r
 \r
@@ -236,8 +236,8 @@ public class OrgAuthorityClientUtils {
      * @return the multipart output\r
      */\r
     public static PoxPayloadOut createOrganizationInstance( \r
-               String orgAuthRefName, Map<String, String> orgInfo,\r
-                Map<String, List<String>> orgRepeatablesInfo, MainBodyGroupList mainBodyList, String headerLabel){\r
+               String orgAuthRefName, Map<String, String> orgInfo, List<OrgTermGroup> terms,\r
+                Map<String, List<String>> orgRepeatablesInfo, String headerLabel){\r
         OrganizationsCommon organization = new OrganizationsCommon();\r
        String shortId = orgInfo.get(OrganizationJAXBSchema.SHORT_IDENTIFIER);\r
        if (shortId == null || shortId.isEmpty()) {\r
@@ -246,24 +246,9 @@ public class OrgAuthorityClientUtils {
        organization.setShortIdentifier(shortId);\r
                String value = null;\r
         List<String> values = null;\r
-       value = orgInfo.get(OrganizationJAXBSchema.DISPLAY_NAME_COMPUTED);\r
-       boolean displayNameComputed = (value==null) || value.equalsIgnoreCase("true"); \r
-               organization.setDisplayNameComputed(displayNameComputed);\r
-               if((value = (String)orgInfo.get(OrganizationJAXBSchema.DISPLAY_NAME))!=null)\r
-               organization.setDisplayName(value);\r
-               \r
-       value = orgInfo.get(OrganizationJAXBSchema.SHORT_DISPLAY_NAME_COMPUTED);\r
-       boolean shortDisplayNameComputed = (value==null) || value.equalsIgnoreCase("true"); \r
-               organization.setShortDisplayNameComputed(shortDisplayNameComputed);\r
-               if((value = (String)orgInfo.get(OrganizationJAXBSchema.SHORT_DISPLAY_NAME))!=null)\r
-               organization.setShortDisplayName(value);\r
-               \r
-       //String refName = createOrganizationRefName(orgAuthRefName, shortId, value);\r
-       //organization.setRefName(refName);\r
-\r
-        if (mainBodyList != null) {\r
-            organization.setMainBodyGroupList(mainBodyList);\r
-        }\r
+        \r
+        \r
+               // Handle terms here\r
 \r
         if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.CONTACT_NAMES))!=null) {\r
                 ContactNameList contactsList = new ContactNameList();\r
@@ -289,20 +274,13 @@ public class OrgAuthorityClientUtils {
                functions.addAll(values);\r
                 organization.setFunctions(functionsList);\r
         }\r
-        if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.SUB_BODIES))!=null) {\r
-                SubBodyList subBodiesList = new SubBodyList();\r
-                List<String> subbodies = subBodiesList.getSubBody();\r
-               subbodies.addAll(values);\r
-                organization.setSubBodies(subBodiesList);\r
-        }\r
         if((values = (List<String>)orgRepeatablesInfo.get(OrganizationJAXBSchema.HISTORY_NOTES))!=null) {\r
                 HistoryNoteList historyNotesList = new HistoryNoteList();\r
                 List<String> historyNotes = historyNotesList.getHistoryNote();\r
                historyNotes.addAll(values);\r
                 organization.setHistoryNotes(historyNotesList);\r
         }\r
-        if((value = (String)orgInfo.get(OrganizationJAXBSchema.TERM_STATUS))!=null)\r
-               organization.setTermStatus(value);\r
+\r
         PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_ITEM_PAYLOAD_NAME);\r
         PayloadOutputPart commonPart = multipart.addPart(organization,\r
             MediaType.APPLICATION_XML_TYPE);\r