]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4406: Now including authorities in default refobjs requests
authorRichard Millet <remillet@berkeley.edu>
Tue, 3 Jul 2012 21:11:00 +0000 (14:11 -0700)
committerRichard Millet <remillet@berkeley.edu>
Tue, 3 Jul 2012 21:11:00 +0000 (14:11 -0700)
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
services/common/src/main/java/org/collectionspace/services/common/context/ServiceBindingUtils.java
services/servicegroup/service/src/main/java/org/collectionspace/services/servicegroup/ServiceGroupResource.java

index fcee903af552707dda5f8850e9c5507fb84fd880..567fa058022de4ef1088953f5916282f1eb9ff03 100644 (file)
@@ -796,7 +796,7 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
 
             List<String> serviceTypes = queryParams.remove(ServiceBindingUtils.SERVICE_TYPE_PROP);
             if(serviceTypes == null || serviceTypes.isEmpty()) {
-               serviceTypes = ServiceBindingUtils.getCommonServiceTypes();
+               serviceTypes = ServiceBindingUtils.getCommonServiceTypes(true); //CSPACE-5359: Should now include objects, procedures, and authorities
             }
             
             // Note that we have to create the service context for the Items, not the main service
index 4070c845e26aa4e2978296cd5f1d7584639d7a90..8b3577c80b8455fce2376ca6fae28a44e94f405b 100644 (file)
@@ -197,10 +197,12 @@ public class ServiceBindingUtils {
     private static ArrayList<String> commonServiceTypes = null;\r
     private static ArrayList<String> commonProcedureServiceTypes = null;\r
    \r
-    public static ArrayList<String> getCommonServiceTypes() {\r
+    public static ArrayList<String> getCommonServiceTypes(boolean includeAuthorities) {\r
        if(commonServiceTypes == null) {\r
                commonServiceTypes = new ArrayList<String>();\r
-                               // Problematic at this point:   commonServiceTypes.add(SERVICE_TYPE_AUTHORITY);\r
+               if (includeAuthorities == true) {\r
+                       commonServiceTypes.add(SERVICE_TYPE_AUTHORITY); // REM - CSPACE-5359: Added back authorities to resolve this issue.\r
+               }\r
                commonServiceTypes.add(SERVICE_TYPE_OBJECT);\r
                commonServiceTypes.add(SERVICE_TYPE_PROCEDURE);\r
        }\r
index 0a4ccfec98d0e4faa9f55677c1f93f6fb71b5fe3..87c2bbb4355f78995935d603570b16d1f24ac571 100644 (file)
@@ -82,6 +82,8 @@ public class ServiceGroupResource extends AbstractCollectionSpaceResourceImpl {
 
     protected final Logger logger = LoggerFactory.getLogger(this.getClass());
     
+    private final static boolean EXCLUDE_AUTHORITIES = false;
+    
     @Override
     public String getServiceName(){
         return ServiceGroupClient.SERVICE_NAME;
@@ -170,7 +172,7 @@ public class ServiceGroupResource extends AbstractCollectionSpaceResourceImpl {
             // We need to get all the procedures, authorities, and objects.
                ArrayList<String> groupsList = null;  
                if("common".equalsIgnoreCase(groupname)) {
-                       groupsList = ServiceBindingUtils.getCommonServiceTypes();
+                       groupsList = ServiceBindingUtils.getCommonServiceTypes(false); // CSPACE-5359: Excluding Authority type to stay backward compat with v2.4
                } else {
                        groupsList = new ArrayList<String>();
                        groupsList.add(groupname);
@@ -226,7 +228,7 @@ public class ServiceGroupResource extends AbstractCollectionSpaceResourceImpl {
                                                createDocumentHandler(ctx);
                ArrayList<String> groupsList = null;  
                if("common".equalsIgnoreCase(serviceGroupName)) {
-                       groupsList = ServiceBindingUtils.getCommonServiceTypes();
+                       groupsList = ServiceBindingUtils.getCommonServiceTypes(); //CSPACE-5359: Exclude authorities to remain backward compat with v2.4
                } else {
                        groupsList = new ArrayList<String>();
                        groupsList.add(serviceGroupName);