manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1630439 - in /manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter: DocumentFilter.java DocumentFilterConfig.java
Date Thu, 09 Oct 2014 13:27:49 GMT
Author: kwright
Date: Thu Oct  9 13:27:49 2014
New Revision: 1630439

URL: http://svn.apache.org/r1630439
Log:
Add actual date check; now all we need is the UI

Modified:
    manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilter.java
    manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilterConfig.java

Modified: manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilter.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilter.java?rev=1630439&r1=1630438&r2=1630439&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilter.java
(original)
+++ manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilter.java
Thu Oct  9 13:27:49 2014
@@ -407,8 +407,10 @@ public class DocumentFilter extends org.
     private final Set<String> mimeTypes;
     private final Long minLength;
     private final Long lengthCutoff;
+    private final Long minDate;
     
     public SpecPacker(Specification os) {
+      Long minDate = null;
       Long minLength = null;
       Long lengthCutoff = null;
       String extensions = null;
@@ -426,8 +428,12 @@ public class DocumentFilter extends org.
         } else if (sn.getType().equals(DocumentFilterConfig.NODE_MINLENGTH)) {
           String value = sn.getAttributeValue(DocumentFilterConfig.ATTRIBUTE_VALUE);
           minLength = new Long(value);
+        } else if (sn.getType().equals(DocumentFilterConfig.NODE_MINDATE)) {
+          String value = sn.getAttributeValue(DocumentFilterConfig.ATTRIBUTE_VALUE);
+          minDate = new Long(value);
         }
       }
+      this.minDate = minDate;
       this.minLength = minLength;
       this.lengthCutoff = lengthCutoff;
       this.extensions = fillSet(extensions);
@@ -484,6 +490,14 @@ public class DocumentFilter extends org.
         pack(sb,minLength.toString(),'+');
       }
       
+      // Min date
+      if (minDate == null)
+        sb.append('-');
+      else {
+        sb.append('+');
+        pack(sb,minDate.toString(),'+');
+      }
+
       return sb.toString();
     }
     
@@ -496,7 +510,8 @@ public class DocumentFilter extends org.
     }
     
     public boolean checkDate(Date date) {
-      // MHL
+      if (minDate != null && date != null && date.getTime() < minDate)
+        return false;
       return true;
     }
     

Modified: manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilterConfig.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilterConfig.java?rev=1630439&r1=1630438&r2=1630439&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilterConfig.java
(original)
+++ manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/java/org/apache/manifoldcf/agents/transformation/documentfilter/DocumentFilterConfig.java
Thu Oct  9 13:27:49 2014
@@ -52,5 +52,6 @@ public class DocumentFilterConfig {
                     "*\n" + "log\n" + "doc\n" + "docx\n" + "xls\n" + "xlsx\n" + "ppt\n" +
"pptx\n"
 		    + "html\n" + "pdf\n" + "odt\n" + "ods\n" + "rtf\n" + "txt\n" + "mp3\n"
 		    + "mp4\n" + "wav\n" + "ogg\n" + "flac\n" + "torrent";
+  public static final String NODE_MINDATE = "mindate";
   public static final String ATTRIBUTE_VALUE = "value";
 }



Mime
View raw message