]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4963: Query for referring objects (records which refer to a particular authori...
authorAron Roberts <aron@socrates.berkeley.edu>
Thu, 12 Apr 2012 17:32:41 +0000 (10:32 -0700)
committerAron Roberts <aron@socrates.berkeley.edu>
Thu, 12 Apr 2012 17:32:41 +0000 (10:32 -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

index b43a46cd92bf4dc760eb51f506ee87afb2b59ed1..f2d99cd40be39a31a5806fa4981a615f87556570 100644 (file)
@@ -745,7 +745,9 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
 
             List<String> serviceTypes = queryParams.remove(ServiceBindingUtils.SERVICE_TYPE_PROP);
             if(serviceTypes == null || serviceTypes.isEmpty()) {
-               serviceTypes = ServiceBindingUtils.getCommonServiceTypes();
+                // Temporary workaround for CSPACE-4963
+               // serviceTypes = ServiceBindingUtils.getCommonServiceTypes();
+                serviceTypes = ServiceBindingUtils.getCommonProcedureServiceTypes();
             }
             
             // Note that we have to create the service context for the Items, not the main service
index 58de69b16d7a57110102e16d0ff371d28bd59ba1..ce85932fbc2574611839f265904bc38cd5f2325a 100644 (file)
@@ -206,6 +206,22 @@ public class ServiceBindingUtils {
        return commonServiceTypes;\r
     }\r
     \r
+    // Temporary workaround for CSPACE-4963, to help reduce the\r
+    // number of service types searched for authority references\r
+    // in AuthorityResource.getReferencingObjects(), to in turn\r
+    // help reduce database query complexity.\r
+    //\r
+    // FIXME; this method is intended to be temporary.  It was added in part to\r
+    // make the effect of the workaround more explicit, and in part to avoid\r
+    // breaking the use of the getCommonServiceTypes method in ServiceGroups.\r
+    public static ArrayList<String> getCommonProcedureServiceTypes() {\r
+        if(commonServiceTypes == null) {\r
+               commonServiceTypes = new ArrayList<String>();\r
+               commonServiceTypes.add(SERVICE_TYPE_PROCEDURE);\r
+       }\r
+       return commonServiceTypes;\r
+    }\r
+    \r
 \r
 \r
 }\r