manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1449485 - /manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
Date Sun, 24 Feb 2013 14:18:11 GMT
Author: kwright
Date: Sun Feb 24 14:18:11 2013
New Revision: 1449485

URL: http://svn.apache.org/r1449485
Log:
Complete code for history reports.

Modified:
    manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java

Modified: manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java?rev=1449485&r1=1449484&r2=1449485&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
(original)
+++ manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
Sun Feb 24 14:18:11 2013
@@ -2412,9 +2412,32 @@ public class ManifoldCF extends org.apac
         return READRESULT_BADARGS;
       }
       
-      // MHL
-      BucketDescription idBucket = new BucketDescription("()",false);
-      
+      BucketDescription idBucket;
+      List<String> idBucketList = queryParameters.get("idbucket");
+      List<String> idBucketInsensitiveList = queryParameters.get("idbucket_insensitive");
+      if (idBucketList != null && idBucketInsensitiveList != null)
+      {
+        createErrorNode(output,"Either use idbucket or idbucket_insensitive, not both.");
+        return READRESULT_BADARGS;
+      }
+      boolean isInsensitiveIdBucket;
+      if (idBucketInsensitiveList != null)
+      {
+        idBucketList = idBucketInsensitiveList;
+        isInsensitiveIdBucket = true;
+      }
+      else
+        isInsensitiveIdBucket = false;
+      if (idBucketList == null || idBucketList.size() == 0)
+        idBucket = new BucketDescription("()",false);
+      else if (idBucketList.size() > 1)
+      {
+        createErrorNode(output,"Multiple idbucket regexps specified.");
+        return READRESULT_BADARGS;
+      }
+      else
+        idBucket = new BucketDescription(idBucketList.get(0),isInsensitiveIdBucket);
+
       long interval;
       List<String> intervalList = queryParameters.get("interval");
       if (intervalList == null || intervalList.size() == 0)
@@ -2440,8 +2463,31 @@ public class ManifoldCF extends org.apac
         return READRESULT_BADARGS;
       }
       
-      // MHL
-      BucketDescription idBucket = new BucketDescription("()",false);
+      BucketDescription idBucket;
+      List<String> idBucketList = queryParameters.get("idbucket");
+      List<String> idBucketInsensitiveList = queryParameters.get("idbucket_insensitive");
+      if (idBucketList != null && idBucketInsensitiveList != null)
+      {
+        createErrorNode(output,"Either use idbucket or idbucket_insensitive, not both.");
+        return READRESULT_BADARGS;
+      }
+      boolean isInsensitiveIdBucket;
+      if (idBucketInsensitiveList != null)
+      {
+        idBucketList = idBucketInsensitiveList;
+        isInsensitiveIdBucket = true;
+      }
+      else
+        isInsensitiveIdBucket = false;
+      if (idBucketList == null || idBucketList.size() == 0)
+        idBucket = new BucketDescription("()",false);
+      else if (idBucketList.size() > 1)
+      {
+        createErrorNode(output,"Multiple idbucket regexps specified.");
+        return READRESULT_BADARGS;
+      }
+      else
+        idBucket = new BucketDescription(idBucketList.get(0),isInsensitiveIdBucket);
       
       long interval;
       List<String> intervalList = queryParameters.get("interval");
@@ -2460,12 +2506,58 @@ public class ManifoldCF extends org.apac
     }
     else if (reportType.equals("result"))
     {
-      // MHL
-      BucketDescription resultCodeBucket = new BucketDescription("()",false);
-      
-      // MHL
-      BucketDescription idBucket = new BucketDescription("(.*)",false);
-      
+      BucketDescription idBucket;
+      List<String> idBucketList = queryParameters.get("idbucket");
+      List<String> idBucketInsensitiveList = queryParameters.get("idbucket_insensitive");
+      if (idBucketList != null && idBucketInsensitiveList != null)
+      {
+        createErrorNode(output,"Either use idbucket or idbucket_insensitive, not both.");
+        return READRESULT_BADARGS;
+      }
+      boolean isInsensitiveIdBucket;
+      if (idBucketInsensitiveList != null)
+      {
+        idBucketList = idBucketInsensitiveList;
+        isInsensitiveIdBucket = true;
+      }
+      else
+        isInsensitiveIdBucket = false;
+      if (idBucketList == null || idBucketList.size() == 0)
+        idBucket = new BucketDescription("()",false);
+      else if (idBucketList.size() > 1)
+      {
+        createErrorNode(output,"Multiple idbucket regexps specified.");
+        return READRESULT_BADARGS;
+      }
+      else
+        idBucket = new BucketDescription(idBucketList.get(0),isInsensitiveIdBucket);
+
+      BucketDescription resultCodeBucket;
+      List<String> resultCodeBucketList = queryParameters.get("resultcodebucket");
+      List<String> resultCodeBucketInsensitiveList = queryParameters.get("resultcodebucket_insensitive");
+      if (resultCodeBucketList != null && resultCodeBucketInsensitiveList != null)
+      {
+        createErrorNode(output,"Either use resultcodebucket or resultcodebucket_insensitive,
not both.");
+        return READRESULT_BADARGS;
+      }
+      boolean isInsensitiveResultCodeBucket;
+      if (resultCodeBucketInsensitiveList != null)
+      {
+        resultCodeBucketList = resultCodeBucketInsensitiveList;
+        isInsensitiveResultCodeBucket = true;
+      }
+      else
+        isInsensitiveResultCodeBucket = false;
+      if (resultCodeBucketList == null || resultCodeBucketList.size() == 0)
+        resultCodeBucket = new BucketDescription("(.*)",false);
+      else if (resultCodeBucketList.size() > 1)
+      {
+        createErrorNode(output,"Multiple resultcodebucket regexps specified.");
+        return READRESULT_BADARGS;
+      }
+      else
+        resultCodeBucket = new BucketDescription(resultCodeBucketList.get(0),isInsensitiveResultCodeBucket);
+
       result = connectionManager.genHistoryResultCodes(connectionName,filterCriteria,sortOrder,resultCodeBucket,idBucket,startRow,rowCount);
       resultColumns = new String[]{"idbucket","resultcodebucket","eventcount"};
     }



Mime
View raw message