manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1630613 - in /manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main: java/org/apache/manifoldcf/agents/transformation/documentfilter/ resources/org/apache/manifoldcf/agents/transformation/documentfilter/
Date Thu, 09 Oct 2014 22:54:32 GMT
Author: kwright
Date: Thu Oct  9 22:54:32 2014
New Revision: 1630613

URL: http://svn.apache.org/r1630613
Log:
Add minimum date editing and viewing code

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/resources/org/apache/manifoldcf/agents/transformation/documentfilter/editSpecification_Contents.html
    manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/viewSpecification.html

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=1630613&r1=1630612&r2=1630613&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 22:54:32 2014
@@ -289,6 +289,36 @@ public class DocumentFilter extends org.
     throws ManifoldCFException {
     String seqPrefix = "s"+connectionSequenceNumber+"_";
 
+    String minDateYear = variableContext.getParameter(seqPrefix+"mindateyear");
+    String minDateMonth = variableContext.getParameter(seqPrefix+"mindatemonth");
+    String minDateDay = variableContext.getParameter(seqPrefix + "mindateday");
+    String minDateHour = variableContext.getParameter(seqPrefix + "mindatehour");
+    String minDateMinute = variableContext.getParameter(seqPrefix + "mindateminute");
+    if (minDateYear != null && minDateMonth != null && minDateDay != null
&& minDateHour != null && minDateMinute != null)
+    {
+      Calendar c = new GregorianCalendar();
+      try
+      {
+        c.set(Integer.parseInt(minDateYear),Integer.parseInt(minDateMonth),Integer.parseInt(minDateDay),Integer.parseInt(minDateHour),Integer.parseInt(minDateMinute));
+      }
+      catch (Exception e)
+      {
+      }
+      long theTime = c.getTimeInMillis();
+      int i = 0;
+      while (i < os.getChildCount())
+      {
+        SpecificationNode node = os.getChild(i);
+        if (node.getType().equals(DocumentFilterConfig.NODE_MINDATE))
+          os.removeChild(i);
+        else
+          i++;
+      }
+      SpecificationNode sn = new SpecificationNode(DocumentFilterConfig.NODE_MINDATE);
+      sn.setAttribute(DocumentFilterConfig.ATTRIBUTE_VALUE,new Long(theTime).toString());
+      os.addChild(os.getChildCount(),sn);
+    }
+    
     String x;
 
     x = variableContext.getParameter(seqPrefix+"minfilesize");

Modified: manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/editSpecification_Contents.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/editSpecification_Contents.html?rev=1630613&r1=1630612&r2=1630613&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/editSpecification_Contents.html
(original)
+++ manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/editSpecification_Contents.html
Thu Oct  9 22:54:32 2014
@@ -19,6 +19,61 @@
 
 <table class="displaytable">
   <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('DocumentFilter.MinDateColon'))</nobr></td>
+    <td class="value">
+      <nobr>
+        <select name="s${SEQNUM}_mindateyear" size="5">
+  #foreach ($year in [1969..2020])
+    #if ($MINDATEYEAR == $year)
+          <option value="$year" selected="true">$year</option>
+    #else
+          <option value="$year">$year</option>
+    #end
+  #end
+        </select>
+        <select name="s${SEQNUM}_mindatemonth" size="5">
+  #foreach ($month in [0..11])
+    #set ($monthkey = "DocumentFilter.Month_${month}")
+    #if ($MINDATEMONTH == $month)
+          <option value="$month" selected="true">$Encoder.bodyEscape($ResourceBundle.getString($monthkey))</option>
+    #else
+          <option value="$month">$Encoder.bodyEscape($ResourceBundle.getString($monthkey))</option>
+    #end
+  #end
+        </select>
+        <select name="s${SEQNUM}_mindateday" size="5">
+  #foreach ($day in [1..31])
+    #set ($dayvalue = $day)
+    #if ($MINDATEDAY == $day)
+          <option value="$day" selected="true">$dayvalue</option>
+    #else
+          <option value="$day">$dayvalue</option>
+    #end
+  #end
+        </select>
+        <select name="s${SEQNUM}_mindatehour" size="5">
+  #foreach ($hour in [0..23])
+    #if ($MINDATEHOUR == $hour)
+          <option value="$hour" selected="true">$hour</option>
+    #else
+          <option value="$hour">$hour</option>
+    #end
+  #end
+        </select>
+        :
+        <select name="s${SEQNUM}_mindateminute" size="5">
+  #foreach ($minute in ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"])
+    #if ($MINDATEMINUTE == $minute)
+          <option value="$minute" selected="true">$minute</option>
+    #else
+          <option value="$minute">$minute</option>
+    #end
+  #end
+        </select>
+      </nobr>
+    </td>
+  </tr>
+  <tr>
     <td class="description">
       <nobr>$Encoder.bodyEscape($ResourceBundle.getString('DocumentFilter.MinFileSizeBytesColon'))</nobr>
     </td>

Modified: manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/viewSpecification.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/viewSpecification.html?rev=1630613&r1=1630612&r2=1630613&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/viewSpecification.html
(original)
+++ manifoldcf/branches/CONNECTORS-1068/connectors/documentfilter/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/documentfilter/viewSpecification.html
Thu Oct  9 22:54:32 2014
@@ -22,7 +22,8 @@
     <td class="value">
       <nobr>
         $MINDATEYEAR $Encoder.bodyEscape($ResourceBundle.getString($month)) $MINDATEDAY $MINDATEHOUR:$MINDATEMINUTE
-      </nobr></td>
+      </nobr>
+    </td>
   </tr>
   <tr>
     <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('DocumentFilter.MinFileSizeBytesColon'))</nobr></td>



Mime
View raw message