manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kish...@apache.org
Subject svn commit: r1792823 - in /manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main: java/org/apache/manifoldcf/crawler/connectors/webcrawler/ resources/org/apache/manifoldcf/crawler/connectors/webcrawler/
Date Wed, 26 Apr 2017 21:49:51 GMT
Author: kishore
Date: Wed Apr 26 21:49:50 2017
New Revision: 1792823

URL: http://svn.apache.org/viewvc?rev=1792823&view=rev
Log:
Updated edit Specification with Velocity template

Added:
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Canonicalization.html.vm   (with props)
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Exclusions.html.vm   (with props)
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Inclusions.html.vm   (with props)
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Mappings.html.vm   (with props)
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Seeds.html.vm   (with props)
Modified:
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java

Modified: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java?rev=1792823&r1=1792822&r2=1792823&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java Wed Apr 26 21:49:50 2017
@@ -2336,46 +2336,120 @@ public class WebcrawlerConnector extends
 
     Messages.outputResourceWithVelocity(out, locale, "editSpecification.js.vm", velocityContext);
   }
-  
-  /** Output the specification body section.
-  * This method is called in the body section of a job page which has selected a repository connection of the
-  * current type.  Its purpose is to present the required form elements for editing.
-  * The coder can presume that the HTML that is output from this configuration will be within appropriate
-  *  <html>, <body>, and <form> tags.  The name of the form is always "editjob".
-  * The connector will be connected before this method can be called.
-  *@param out is the output to which any HTML should be sent.
-  *@param locale is the locale the output is preferred to be in.
-  *@param ds is the current document specification for this job.
-  *@param connectionSequenceNumber is the unique number of this connection within the job.
-  *@param actualSequenceNumber is the connection within the job that has currently been selected.
-  *@param tabName is the current tab name.  (actualSequenceNumber, tabName) form a unique tuple within
-  *  the job.
-  */
-  @Override
-  public void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification ds,
-    int connectionSequenceNumber, int actualSequenceNumber, String tabName)
-    throws ManifoldCFException, IOException
+
+  private void fillInSeedsTab(Map<String,Object> velocityContext, IHTTPOutput out, Specification ds)
   {
-    String seqPrefix = "s"+connectionSequenceNumber+"_";
 
     int i;
-    int k;
+    String seeds = "";
+
+    i = 0;
+    while (i < ds.getChildCount())
+    {
+      SpecificationNode sn = ds.getChild(i++);
+      if (sn.getType().equals(WebcrawlerConfig.NODE_SEEDS))
+      {
+        seeds = sn.getValue();
+        if (seeds == null)
+          seeds = "";
+      }
+    }
+
+    velocityContext.put("SEEDS",seeds);
+
+  }
+
+  private void fillInCanonicalizationTab(Map<String,Object> velocityContext, IHTTPOutput out, Locale locale, Specification ds)
+  {
+
+    int q = 0;
+    List<Map<String,String>> canonicalizationMapList = new ArrayList<>();
+    while (q < ds.getChildCount())
+    {
+      SpecificationNode specNode = ds.getChild(q++);
+      if (specNode.getType().equals(WebcrawlerConfig.NODE_URLSPEC))
+      {
+        Map<String,String> canonicalizationMap = new HashMap<>();
+        // Ok, this node matters to us
+        String regexpString = specNode.getAttributeValue(WebcrawlerConfig.ATTR_REGEXP);
+        String description = specNode.getAttributeValue(WebcrawlerConfig.ATTR_DESCRIPTION);
+        if (description == null)
+          description = "";
+        String allowReorder = specNode.getAttributeValue(WebcrawlerConfig.ATTR_REORDER);
+        String allowReorderOutput;
+        if (allowReorder == null || allowReorder.length() == 0)
+        {
+          allowReorder = WebcrawlerConfig.ATTRVALUE_NO;
+          allowReorderOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
+        }
+        else
+          allowReorderOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
+        String allowJavaSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_JAVASESSIONREMOVAL);
+        String allowJavaSessionRemovalOutput;
+        if (allowJavaSessionRemoval == null || allowJavaSessionRemoval.length() == 0)
+        {
+          allowJavaSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
+          allowJavaSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
+        }
+        else
+          allowJavaSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
+        String allowASPSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_ASPSESSIONREMOVAL);
+        String allowASPSessionRemovalOutput;
+        if (allowASPSessionRemoval == null || allowASPSessionRemoval.length() == 0)
+        {
+          allowASPSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
+          allowASPSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
+        }
+        else
+          allowASPSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
+        String allowPHPSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_PHPSESSIONREMOVAL);
+        String allowPHPSessionRemovalOutput;
+        if (allowPHPSessionRemoval == null || allowPHPSessionRemoval.length() == 0)
+        {
+          allowPHPSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
+          allowPHPSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
+        }
+        else
+          allowPHPSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
+        String allowBVSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_BVSESSIONREMOVAL);
+        String allowBVSessionRemovalOutput;
+        if (allowBVSessionRemoval == null || allowBVSessionRemoval.length() == 0)
+        {
+          allowBVSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
+          allowBVSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
+        }
+        else
+          allowBVSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
+
+        canonicalizationMap.put("regexpString",regexpString);
+        canonicalizationMap.put("description",description);
+        canonicalizationMap.put("allowReorder",allowReorder);
+        canonicalizationMap.put("allowReorderOutput",allowReorderOutput);
+        canonicalizationMap.put("allowJavaSessionRemoval",allowJavaSessionRemoval);
+        canonicalizationMap.put("allowJavaSessionRemovalOutput",allowJavaSessionRemovalOutput);
+        canonicalizationMap.put("allowASPSessionRemoval",allowASPSessionRemoval);
+        canonicalizationMap.put("allowASPSessionRemovalOutput",allowASPSessionRemovalOutput);
+        canonicalizationMap.put("allowPHPSessionRemoval",allowPHPSessionRemoval);
+        canonicalizationMap.put("allowPHPSessionRemovalOutput",allowPHPSessionRemovalOutput);
+        canonicalizationMap.put("allowBVSessionRemoval",allowBVSessionRemoval);
+        canonicalizationMap.put("allowBVSessionRemovalOutput",allowBVSessionRemovalOutput);
+
+        canonicalizationMapList.add(canonicalizationMap);
+      }
+    }
 
+    velocityContext.put("CANONICALIZATIONMAPLIST",canonicalizationMapList);
+
+  }
+
+  private void fillInMappingsTab(Map<String,Object> velocityContext, IHTTPOutput out, Specification ds)
+  {
+
+    int i;
     // Find the various strings
-    List<String> regexp = new ArrayList<String>();
+    List<String> regexpList = new ArrayList<String>();
     List<String> matchStrings = new ArrayList<String>();
 
-    String seeds = "";
-    String inclusions = ".*\n";
-    String exclusions = "";
-    String inclusionsIndex = ".*\n";
-    String exclusionsIndex = "";
-    String exclusionsContentIndex = "";
-    
-    boolean includeMatching = true;
-    Set<String> excludedHeaders = new HashSet<String>();
-    
-    // Now, loop through description
     i = 0;
     while (i < ds.getChildCount())
     {
@@ -2386,48 +2460,43 @@ public class WebcrawlerConnector extends
         String map = sn.getAttributeValue(WebcrawlerConfig.ATTR_MAP);
         if (match != null)
         {
-          regexp.add(match);
+          regexpList.add(match);
           if (map == null)
             map = "";
           matchStrings.add(map);
         }
       }
-      else if (sn.getType().equals(WebcrawlerConfig.NODE_SEEDS))
-      {
-        seeds = sn.getValue();
-        if (seeds == null)
-          seeds = "";
-      }
-      else if (sn.getType().equals(WebcrawlerConfig.NODE_INCLUDES))
+    }
+
+    velocityContext.put("REGEXPLIST",regexpList);
+    velocityContext.put("MATCHSTRINGS",matchStrings);
+
+  }
+
+  private void fillInInclusionsTab(Map<String,Object> velocityContext, IHTTPOutput out, Specification ds)
+  {
+
+    int i;
+    String inclusions = ".*\n";
+    String inclusionsIndex = ".*\n";
+    boolean includeMatching = true;
+
+    i = 0;
+    while (i < ds.getChildCount())
+    {
+      SpecificationNode sn = ds.getChild(i++);
+      if (sn.getType().equals(WebcrawlerConfig.NODE_INCLUDES))
       {
         inclusions = sn.getValue();
         if (inclusions == null)
           inclusions = "";
       }
-      else if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDES))
-      {
-        exclusions = sn.getValue();
-        if (exclusions == null)
-          exclusions = "";
-      }
       else if (sn.getType().equals(WebcrawlerConfig.NODE_INCLUDESINDEX))
       {
         inclusionsIndex = sn.getValue();
         if (inclusionsIndex == null)
           inclusionsIndex = "";
       }
-      else if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDESINDEX))
-      {
-        exclusionsIndex = sn.getValue();
-        if (exclusionsIndex == null)
-          exclusionsIndex = "";
-      }
-      else if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDESCONTENTINDEX))
-      {
-        exclusionsContentIndex = sn.getValue();
-        if (exclusionsContentIndex == null)
-        	exclusionsContentIndex = "";
-      }
       else if (sn.getType().equals(WebcrawlerConfig.NODE_LIMITTOSEEDS))
       {
         String value = sn.getAttributeValue(WebcrawlerConfig.ATTR_VALUE);
@@ -2436,372 +2505,132 @@ public class WebcrawlerConnector extends
         else
           includeMatching = true;
       }
-      else if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDEHEADER))
-      {
-        String value = sn.getAttributeValue(WebcrawlerConfig.ATTR_VALUE);
-        excludedHeaders.add(value);
-      }
-
     }
 
-    // Seeds tab
+    velocityContext.put("INCLUSIONS",inclusions);
+    velocityContext.put("INCLUSIONSINDEX",inclusionsIndex);
+    velocityContext.put("INCLUDEMATCHING",includeMatching);
 
-    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Seeds")) && connectionSequenceNumber == actualSequenceNumber)
-    {
-      out.print(
-"<table class=\"displaytable\">\n"+
-"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
-"  <tr>\n"+
-"    <td class=\"value\" colspan=\"2\">\n"+
-"      <textarea rows=\"25\" cols=\"80\" name=\""+seqPrefix+"seeds\">"+Encoder.bodyEscape(seeds)+"</textarea>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"</table>\n"
-      );
-    }
-    else
-    {
-      out.print(
-"<input type=\"hidden\" name=\""+seqPrefix+"seeds\" value=\""+Encoder.attributeEscape(seeds)+"\"/>\n"
-      );
-    }
+  }
 
-    // Canonicalization tab
+  private void fillInExclusionsTab(Map<String,Object> velocityContext, IHTTPOutput out, Specification ds)
+  {
 
-    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Canonicalization")) && connectionSequenceNumber == actualSequenceNumber)
+    int i;
+    String exclusions = "";
+    String exclusionsIndex = "";
+    String exclusionsContentIndex = "";
+
+    i = 0;
+    while (i < ds.getChildCount())
     {
-      out.print(
-"<table class=\"displaytable\">\n"+
-"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
-"  <tr>\n"+
-"    <td class=\"boxcell\" colspan=\"2\">\n"+
-"      <input type=\"hidden\" name=\""+seqPrefix+"urlregexpop\" value=\"Continue\"/>\n"+
-"      <input type=\"hidden\" name=\""+seqPrefix+"urlregexpnumber\" value=\"\"/>\n"+
-"      <table class=\"formtable\">\n"+
-"        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Description") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Reorder") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveJSPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveASPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemovePHPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveBVSessions") + "</nobr></td>\n"+
-"        </tr>\n"
-      );
-      int q = 0;
-      int l = 0;
-      while (q < ds.getChildCount())
+      SpecificationNode sn = ds.getChild(i++);
+      if (sn.getType().equals(WebcrawlerConfig.NODE_INCLUDES))
       {
-        SpecificationNode specNode = ds.getChild(q++);
-        if (specNode.getType().equals(WebcrawlerConfig.NODE_URLSPEC))
-        {
-          // Ok, this node matters to us
-          String regexpString = specNode.getAttributeValue(WebcrawlerConfig.ATTR_REGEXP);
-          String description = specNode.getAttributeValue(WebcrawlerConfig.ATTR_DESCRIPTION);
-          if (description == null)
-            description = "";
-          String allowReorder = specNode.getAttributeValue(WebcrawlerConfig.ATTR_REORDER);
-          String allowReorderOutput;
-          if (allowReorder == null || allowReorder.length() == 0)
-          {
-            allowReorder = WebcrawlerConfig.ATTRVALUE_NO;
-            allowReorderOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
-          }
-          else
-            allowReorderOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
-          String allowJavaSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_JAVASESSIONREMOVAL);
-          String allowJavaSessionRemovalOutput;
-          if (allowJavaSessionRemoval == null || allowJavaSessionRemoval.length() == 0)
-          {
-            allowJavaSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
-            allowJavaSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
-          }
-          else
-            allowJavaSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
-          String allowASPSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_ASPSESSIONREMOVAL);
-          String allowASPSessionRemovalOutput;
-          if (allowASPSessionRemoval == null || allowASPSessionRemoval.length() == 0)
-          {
-            allowASPSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
-            allowASPSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
-          }
-          else
-            allowASPSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
-          String allowPHPSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_PHPSESSIONREMOVAL);
-          String allowPHPSessionRemovalOutput;
-          if (allowPHPSessionRemoval == null || allowPHPSessionRemoval.length() == 0)
-          {
-            allowPHPSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
-            allowPHPSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
-          }
-          else
-            allowPHPSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
-          String allowBVSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_BVSESSIONREMOVAL);
-          String allowBVSessionRemovalOutput;
-          if (allowBVSessionRemoval == null || allowBVSessionRemoval.length() == 0)
-          {
-            allowBVSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
-            allowBVSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.no");
-          }
-          else
-            allowBVSessionRemovalOutput = Messages.getBodyString(locale, "WebcrawlerConnector.yes");
-          out.print(
-"        <tr class=\""+(((l % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
-"          <td class=\"formcolumncell\">\n"+
-"            <a name=\""+seqPrefix+"urlregexp_"+Integer.toString(l)+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.DeleteUrlRegexp")+Encoder.attributeEscape(regexpString)+"\" onclick='javascript:"+seqPrefix+"URLRegexpDelete("+Integer.toString(l)+",\""+seqPrefix+"urlregexp_"+Integer.toString(l)+"\");'/>\n"+
-"            </a>\n"+
-"          </td>\n"+
-"          <td class=\"formcolumncell\">\n"+
-"            <input type=\"hidden\" name=\""+seqPrefix+"urlregexp_"+Integer.toString(l)+"\" value=\""+Encoder.attributeEscape(regexpString)+"\"/>\n"+
-"            <input type=\"hidden\" name=\""+seqPrefix+"urlregexpdesc_"+Integer.toString(l)+"\" value=\""+Encoder.attributeEscape(description)+"\"/>\n"+
-"            <input type=\"hidden\" name=\""+seqPrefix+"urlregexpreorder_"+Integer.toString(l)+"\" value=\""+allowReorder+"\"/>\n"+
-"            <input type=\"hidden\" name=\""+seqPrefix+"urlregexpjava_"+Integer.toString(l)+"\" value=\""+allowJavaSessionRemoval+"\"/>\n"+
-"            <input type=\"hidden\" name=\""+seqPrefix+"urlregexpasp_"+Integer.toString(l)+"\" value=\""+allowASPSessionRemoval+"\"/>\n"+
-"            <input type=\"hidden\" name=\""+seqPrefix+"urlregexpphp_"+Integer.toString(l)+"\" value=\""+allowPHPSessionRemoval+"\"/>\n"+
-"            <input type=\"hidden\" name=\""+seqPrefix+"urlregexpbv_"+Integer.toString(l)+"\" value=\""+allowBVSessionRemoval+"\"/>\n"+
-"            <nobr>"+Encoder.bodyEscape(regexpString)+"</nobr>\n"+
-"          </td>\n"+
-"          <td class=\"formcolumncell\">"+Encoder.bodyEscape(description)+"</td>\n"+
-"          <td class=\"formcolumncell\">"+allowReorderOutput+"</td>\n"+
-"          <td class=\"formcolumncell\">"+allowJavaSessionRemovalOutput+"</td>\n"+
-"          <td class=\"formcolumncell\">"+allowASPSessionRemovalOutput+"</td>\n"+
-"          <td class=\"formcolumncell\">"+allowPHPSessionRemovalOutput+"</td>\n"+
-"          <td class=\"formcolumncell\">"+allowBVSessionRemovalOutput+"</td>\n"+
-"        </tr>\n"
-          );
-
-          l++;
-        }
+        exclusions = sn.getValue();
+        if (exclusions == null)
+          exclusions = "";
       }
-      if (l == 0)
+      else if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDESINDEX))
       {
-        out.print(
-"        <tr class=\"formrow\"><td colspan=\"8\" class=\"formcolumnmessage\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoCanonicalizationSpecified") + "</nobr></td></tr>\n"
-        );
-      }
-      out.print(
-"        <tr class=\"formrow\"><td colspan=\"8\" class=\"formseparator\"><hr/></td></tr>\n"+
-"        <tr class=\"formrow\">\n"+
-"          <td class=\"formcolumncell\">\n"+
-"            <a name=\""+seqPrefix+"urlregexp_"+Integer.toString(l)+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.AddUrlRegexp") + "\" onclick='javascript:"+seqPrefix+"URLRegexpAdd(\""+seqPrefix+"urlregexp_"+Integer.toString(l+1)+"\");'/>\n"+
-"              <input type=\"hidden\" name=\""+seqPrefix+"urlregexpcount\" value=\""+Integer.toString(l)+"\"/>\n"+
-"            </a>\n"+
-"          </td>\n"+
-"          <td class=\"formcolumncell\"><input type=\"text\" name=\""+seqPrefix+"urlregexp\" size=\"30\" value=\"\"/></td>\n"+
-"          <td class=\"formcolumncell\"><input type=\"text\" name=\""+seqPrefix+"urlregexpdesc\" size=\"30\" value=\"\"/></td>\n"+
-"          <td class=\"formcolumncell\"><input type=\"checkbox\" name=\""+seqPrefix+"urlregexpreorder\" value=\""+WebcrawlerConfig.ATTRVALUE_YES+"\"/></td>\n"+
-"          <td class=\"formcolumncell\"><input type=\"checkbox\" name=\""+seqPrefix+"urlregexpjava\" value=\""+WebcrawlerConfig.ATTRVALUE_YES+"\" checked=\"true\"/></td>\n"+
-"          <td class=\"formcolumncell\"><input type=\"checkbox\" name=\""+seqPrefix+"urlregexpasp\" value=\""+WebcrawlerConfig.ATTRVALUE_YES+"\" checked=\"true\"/></td>\n"+
-"          <td class=\"formcolumncell\"><input type=\"checkbox\" name=\""+seqPrefix+"urlregexpphp\" value=\""+WebcrawlerConfig.ATTRVALUE_YES+"\" checked=\"true\"/></td>\n"+
-"          <td class=\"formcolumncell\"><input type=\"checkbox\" name=\""+seqPrefix+"urlregexpbv\" value=\""+WebcrawlerConfig.ATTRVALUE_YES+"\" checked=\"true\"/></td>\n"+
-"        </tr>\n"+
-"      </table>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"</table>\n"
-      );
-    }
-    else
-    {
-      // Post the canonicalization specification
-      int q = 0;
-      int l = 0;
-      while (q < ds.getChildCount())
+        exclusionsIndex = sn.getValue();
+        if (exclusionsIndex == null)
+          exclusionsIndex = "";
+      }
+      else if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDESCONTENTINDEX))
       {
-        SpecificationNode specNode = ds.getChild(q++);
-        if (specNode.getType().equals(WebcrawlerConfig.NODE_URLSPEC))
-        {
-          // Ok, this node matters to us
-          String regexpString = specNode.getAttributeValue(WebcrawlerConfig.ATTR_REGEXP);
-          String description = specNode.getAttributeValue(WebcrawlerConfig.ATTR_DESCRIPTION);
-          if (description == null)
-            description = "";
-          String allowReorder = specNode.getAttributeValue(WebcrawlerConfig.ATTR_REORDER);
-          if (allowReorder == null || allowReorder.length() == 0)
-            allowReorder = WebcrawlerConfig.ATTRVALUE_NO;
-          String allowJavaSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_JAVASESSIONREMOVAL);
-          if (allowJavaSessionRemoval == null || allowJavaSessionRemoval.length() == 0)
-            allowJavaSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
-          String allowASPSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_ASPSESSIONREMOVAL);
-          if (allowASPSessionRemoval == null || allowASPSessionRemoval.length() == 0)
-            allowASPSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
-          String allowPHPSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_PHPSESSIONREMOVAL);
-          if (allowPHPSessionRemoval == null || allowPHPSessionRemoval.length() == 0)
-            allowPHPSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
-          String allowBVSessionRemoval = specNode.getAttributeValue(WebcrawlerConfig.ATTR_BVSESSIONREMOVAL);
-          if (allowBVSessionRemoval == null || allowBVSessionRemoval.length() == 0)
-            allowBVSessionRemoval = WebcrawlerConfig.ATTRVALUE_NO;
-          out.print(
-"<input type=\"hidden\" name=\""+seqPrefix+"urlregexp_"+Integer.toString(l)+"\" value=\""+Encoder.attributeEscape(regexpString)+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"urlregexpdesc_"+Integer.toString(l)+"\" value=\""+Encoder.attributeEscape(description)+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"urlregexpreorder_"+Integer.toString(l)+"\" value=\""+allowReorder+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"urlregexpjava_"+Integer.toString(l)+"\" value=\""+allowJavaSessionRemoval+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"urlregexpasp_"+Integer.toString(l)+"\" value=\""+allowASPSessionRemoval+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"urlregexpphp_"+Integer.toString(l)+"\" value=\""+allowPHPSessionRemoval+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"urlregexpbv_"+Integer.toString(l)+"\" value=\""+allowBVSessionRemoval+"\"/>\n"
-          );
-          l++;
-        }
+        exclusionsContentIndex = sn.getValue();
+        if (exclusionsContentIndex == null)
+          exclusionsContentIndex = "";
       }
-      out.print(
-"<input type=\"hidden\" name=\""+seqPrefix+"urlregexpcount\" value=\""+Integer.toString(l)+"\"/>\n"
-      );
     }
 
-    // Mappings tab
-    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.URLMappings")) && connectionSequenceNumber == actualSequenceNumber)
-    {
-      out.print(
-"<input type=\"hidden\" name=\""+seqPrefix+"rssop\" value=\"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"rssindex\" value=\"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"rssmapcount\" value=\""+Integer.toString(regexp.size())+"\"/>\n"+
-"\n"+
-"<table class=\"displaytable\">\n"+
-"  <tr><td class=\"separator\" colspan=\"4\"><hr/></td></tr>\n"
-      );
-
-      i = 0;
-      while (i < regexp.size())
-      {
-        String prefix = seqPrefix+"rssregexp_"+Integer.toString(i)+"_";
-        out.print(
-"  <tr>\n"+
-"    <td class=\"value\">\n"+
-"      <a name=\""+seqPrefix+"regexp_"+Integer.toString(i)+"\">\n"+
-"        <input type=\"button\" value=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.Remove")+"\" onclick='javascript:"+seqPrefix+"RemoveRegexp("+Integer.toString(i)+",\""+seqPrefix+"regexp_"+Integer.toString(i)+"\")' alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.RemoveRegexp")+Integer.toString(i)+"\"/>\n"+
-"      </a>\n"+
-"    </td>\n"+
-"    <td class=\"value\"><input type=\"hidden\" name=\""+prefix+"match"+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape((String)regexp.get(i))+"\"/>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape((String)regexp.get(i))+"</td>\n"+
-"    <td class=\"value\">--&gt;</td>\n"+
-"    <td class=\"value\">\n"
-        );
-        String match = (String)matchStrings.get(i);
-        out.print(
-"      <input type=\"hidden\" name=\""+prefix+"map"+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(match)+"\"/>\n"
-        );
-        if (match.length() == 0)
-        {
-          out.print(
-"      &lt;as is&gt;\n"
-          );
-        }
-        else
-        {
-          out.print(
-"      "+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(match)+"\n"
-          );
-        }
-        out.print(
-"    </td>\n"+
-"  </tr>\n"
-        );
-        i++;
-      }
-      out.print(
-"  <tr>\n"+
-"    <td class=\"value\"><a name=\""+seqPrefix+"regexp_"+Integer.toString(i)+"\"><input type=\"button\" value=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.Add")+"\" onclick='javascript:"+seqPrefix+"AddRegexp(\""+seqPrefix+"regexp_"+Integer.toString(i+1)+"\")' alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.AddRegexp")+"\"/></a></td>\n"+
-"    <td class=\"value\"><input type=\"text\" name=\""+seqPrefix+"rssmatch\" size=\"16\" value=\"\"/></td>\n"+
-"    <td class=\"value\">--&gt;</td>\n"+
-"    <td class=\"value\"><input type=\"text\" name=\""+seqPrefix+"rssmap\" size=\"16\" value=\"\"/></td>\n"+
-"  </tr>\n"+
-"</table>\n"
-      );
-    }
-    else
+    velocityContext.put("EXCLUSIONS",exclusions);
+    velocityContext.put("EXCLUSIONSINDEX",exclusionsIndex);
+    velocityContext.put("EXCLUSIONSCONTENTINDEX",exclusionsContentIndex);
+
+  }
+
+  /** Output the specification body section.
+  * This method is called in the body section of a job page which has selected a repository connection of the
+  * current type.  Its purpose is to present the required form elements for editing.
+  * The coder can presume that the HTML that is output from this configuration will be within appropriate
+  *  <html>, <body>, and <form> tags.  The name of the form is always "editjob".
+  * The connector will be connected before this method can be called.
+  *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document specification for this job.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@param actualSequenceNumber is the connection within the job that has currently been selected.
+  *@param tabName is the current tab name.  (actualSequenceNumber, tabName) form a unique tuple within
+  *  the job.
+  */
+  @Override
+  public void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber, int actualSequenceNumber, String tabName)
+    throws ManifoldCFException, IOException
+  {
+
+    final Map<String,Object> velocityContext = new HashMap<>();
+    velocityContext.put("TABNAME",tabName);
+    velocityContext.put("SEQNUM", Integer.toString(connectionSequenceNumber));
+    velocityContext.put("SELECTEDNUM", Integer.toString(actualSequenceNumber));
+
+    fillInSeedsTab(velocityContext,out,ds);
+    fillInCanonicalizationTab(velocityContext,out,locale,ds);
+    fillInMappingsTab(velocityContext,out,ds);
+    fillInInclusionsTab(velocityContext,out,ds);
+    fillInExclusionsTab(velocityContext,out,ds);
+
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
+    int i;
+    int k;
+
+
+
+
+    String exclusions = "";
+    String exclusionsIndex = "";
+    String exclusionsContentIndex = "";
+
+    Set<String> excludedHeaders = new HashSet<String>();
+    
+    // Now, loop through description
+    i = 0;
+    while (i < ds.getChildCount())
     {
-      out.print(
-"<input type=\"hidden\" name=\""+seqPrefix+"rssmapcount\" value=\""+Integer.toString(regexp.size())+"\"/>\n"
-      );
-      i = 0;
-      while (i < regexp.size())
-      {
-        String prefix = seqPrefix+"rssregexp_"+Integer.toString(i)+"_";
-        String match = (String)matchStrings.get(i);
-        out.print(
-"<input type=\"hidden\" name=\""+prefix+"match"+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape((String)regexp.get(i))+"\"/>\n"+
-"<input type=\"hidden\" name=\""+prefix+"map"+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(match)+"\"/>\n"
-        );
-        i++;
+      SpecificationNode sn = ds.getChild(i++);
+      if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDES))
+      {
+        exclusions = sn.getValue();
+        if (exclusions == null)
+          exclusions = "";
+      }
+      else if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDESCONTENTINDEX))
+      {
+        exclusionsContentIndex = sn.getValue();
+        if (exclusionsContentIndex == null)
+        	exclusionsContentIndex = "";
+      }
+      else if (sn.getType().equals(WebcrawlerConfig.NODE_EXCLUDEHEADER))
+      {
+        String value = sn.getAttributeValue(WebcrawlerConfig.ATTR_VALUE);
+        excludedHeaders.add(value);
       }
-    }
 
-    // Inclusions tab
-    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Inclusions")) && connectionSequenceNumber == actualSequenceNumber)
-    {
-      out.print(
-"<table class=\"displaytable\">\n"+
-"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeInCrawl") + "</nobr></td>\n"+
-"    <td class=\"value\" colspan=\"1\">\n"+
-"      <textarea rows=\"25\" cols=\"60\" name=\""+seqPrefix+"inclusions\">"+Encoder.bodyEscape(inclusions)+"</textarea>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeInIndex") + "</nobr></td>\n"+
-"    <td class=\"value\" colspan=\"1\">\n"+
-"      <textarea rows=\"10\" cols=\"60\" name=\""+seqPrefix+"inclusionsindex\">"+Encoder.bodyEscape(inclusionsIndex)+"</textarea>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeOnlyHostsMatchingSeeds") + "</nobr></td>\n"+
-"    <td class=\"value\">\n"+
-"      <input type=\"checkbox\" name=\""+seqPrefix+"matchinghosts\" value=\"true\""+(includeMatching?" checked=\"yes\"":"")+"/>\n"+
-"      <input type=\"hidden\" name=\""+seqPrefix+"matchinghosts_present\" value=\"true\"/>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"</table>\n"
-      );
-    }
-    else
-    {
-      out.print(
-"<input type=\"hidden\" name=\""+seqPrefix+"inclusions\" value=\""+Encoder.attributeEscape(inclusions)+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"inclusionsindex\" value=\""+Encoder.attributeEscape(inclusionsIndex)+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"matchinghosts\" value=\""+(includeMatching?"true":"false")+"\"/>\n"+
-"<input type=\"hidden\" name=\""+seqPrefix+"matchinghosts_present\" value=\"true\"/>\n"
-      );
     }
 
+    // Seeds tab
+    Messages.outputResourceWithVelocity(out,locale,"editSpecification_Seeds.html.vm",velocityContext);
+    // Canonicalization tab
+    Messages.outputResourceWithVelocity(out,locale,"editSpecification_Canonicalization.html.vm",velocityContext);
+    // Mappings tab
+    Messages.outputResourceWithVelocity(out,locale,"editSpecification_Mappings.html.vm",velocityContext);
+    // Inclusions tab
+    Messages.outputResourceWithVelocity(out,locale,"editSpecification_Inclusions.html.vm",velocityContext);
     // Exclusions tab
-
-    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Exclusions")) && connectionSequenceNumber == actualSequenceNumber)
-    {
-      out.print(
-"<table class=\"displaytable\">\n"+
-"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ExcludeFromCrawl") + "</nobr></td>\n"+
-"    <td class=\"value\" colspan=\"1\">\n"+
-"      <textarea rows=\"25\" cols=\"60\" name=\""+seqPrefix+"exclusions\">"+Encoder.bodyEscape(exclusions)+"</textarea>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ExcludeFromIndex") + "</nobr></td>\n"+
-"    <td class=\"value\" colspan=\"1\">\n"+
-"      <textarea rows=\"10\" cols=\"60\" name=\""+seqPrefix+"exclusionsindex\">"+Encoder.bodyEscape(exclusionsIndex)+"</textarea>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ExcludeContentFromIndex") + "</nobr></td>\n"+
-"    <td class=\"value\" colspan=\"1\">\n"+
-"      <textarea rows=\"10\" cols=\"60\" name=\""+seqPrefix+"exclusionscontentindex\">"+Encoder.bodyEscape(exclusionsContentIndex)+"</textarea>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"</table>\n"
-      );
-    }
-    else
-    {
-      out.print(
-              "<input type=\"hidden\" name=\"" + seqPrefix + "exclusions\" value=\"" + Encoder.attributeEscape(exclusions) + "\"/>\n" +
-                      "<input type=\"hidden\" name=\"" + seqPrefix + "exclusionsindex\" value=\"" + Encoder.attributeEscape(exclusionsIndex) + "\"/>\n" +
-                      "<input type=\"hidden\" name=\"" + seqPrefix + "exclusionscontentindex\" value=\"" + Encoder.attributeEscape(exclusionsContentIndex) + "\"/>\n"
-      );
-    }
+    Messages.outputResourceWithVelocity(out,locale,"editSpecification_Exclusions.html.vm",velocityContext);
   
     // Security tab
     // There is no native security, so all we care about are the tokens.

Added: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Canonicalization.html.vm
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Canonicalization.html.vm?rev=1792823&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Canonicalization.html.vm (added)
+++ manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Canonicalization.html.vm Wed Apr 26 21:49:50 2017
@@ -0,0 +1,98 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+#set( $SEQPREFIX = 's' + $SEQNUM + '_' )
+#if($TABNAME == $ResourceBundle.getString('WebcrawlerConnector.Canonicalization') && ${SEQNUM} == ${SELECTEDNUM})
+<table class="displaytable">
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+  <tr>
+    <td class="boxcell" colspan="2">
+      <input type="hidden" name="${SEQPREFIX}urlregexpop}" value="Continue"/>
+      <input type="hidden" name="${SEQPREFIX}urlregexpnumber" value=""/>
+      <table class="formtable">
+        <tr class="formheaderrow">
+          <td class="formcolumnheader"></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.URLRegularExpression'))</nobr></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.Description'))</nobr></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.Reorder'))</nobr></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.RemoveJSPSessions'))</nobr></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.RemoveASPSessions'))</nobr></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.RemovePHPSessions'))</nobr></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.RemoveBVSessions'))</nobr></td>
+        </tr>
+        #foreach($canonicalizationMap in $CANONICALIZATIONMAPLIST)
+        <tr>
+          <td class="formcolumncell">
+            <a name="${SEQPREFIX}urlregexp_$foreach.index">
+              <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.Delete'))" alt="$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.DeleteUrlRegexp'))$Encoder.attributeEscape($canonicalizationMap["regexpString"])" onclick='javascript:${SEQPREFIX}URLRegexpDelete($foreach.index,"${SEQPREFIX}urlregexp_${foreach.index}");'/>
+            </a>
+          </td>
+          <td class="formcolumncell">
+            <input type="hidden" name="${SEQPREFIX}urlregexp_$foreach.index" value="$Encoder.attributeEscape($canonicalizationMap["regexpString"])"/>
+            <input type="hidden" name="${SEQPREFIX}urlregexpdesc_$foreach.index" value="$Encoder.attributeEscape($canonicalizationMap["description"])"/>
+            <input type="hidden" name="${SEQPREFIX}urlregexpreorder_$foreach.index" value="$canonicalizationMap["allowReorder"]"/>
+            <input type="hidden" name="${SEQPREFIX}urlregexpjava_$foreach.index" value="$canonicalizationMap["allowJavaSessionRemoval"]"/>
+            <input type="hidden" name="${SEQPREFIX}urlregexpasp_$foreach.index" value="$canonicalizationMap["allowASPSessionRemoval"]"/>
+            <input type="hidden" name="${SEQPREFIX}urlregexpphp_$foreach.index" value="$canonicalizationMap["allowPHPSessionRemoval"]"/>
+            <input type="hidden" name="${SEQPREFIX}urlregexpbv_$foreach.index" value="$$canonicalizationMap["allowBVSessionRemoval"]"/>
+            <nobr>$Encoder.bodyEscape($canonicalizationMap["regexpString"])</nobr>
+          </td>
+          <td class="formcolumncell">$Encoder.bodyEscape($canonicalizationMap["description"])</td>
+          <td class="formcolumncell">$canonicalizationMap["allowReorderOutput"]</td>
+          <td class="formcolumncell">$canonicalizationMap["allowJavaSessionRemovalOutput"]</td>
+          <td class="formcolumncell">$canonicalizationMap["allowASPSessionRemovalOutput"]</td>
+          <td class="formcolumncell">$canonicalizationMap["allowPHPSessionRemovalOutput"]</td>
+          <td class="formcolumncell">$canonicalizationMap["allowBVSessionRemovalOutput"]</td>
+        </tr>
+        #end
+        #set( $COUNTER = $CANONICALIZATIONMAPLIST.size())
+        #if($COUNTER == 0)
+        <tr class="formrow"><td colspan="8" class="formcolumnmessage"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NoCanonicalizationSpecified'))</nobr></td></tr>
+        #end
+        <tr class="formrow"><td colspan="8" class="formseparator"><hr/></td></tr>
+        <tr class="formrow">
+          <td class="formcolumncell">
+            <a name="${SEQPREFIX}urlregexp_${COUNTER}">
+              <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.Add'))" alt="$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.AddUrlRegexp'))" onclick='javascript:${SEQPREFIX}URLRegexpAdd("${SEQPREFIX}urlregexp_${COUNTER}");'/>
+              <input type="hidden" name="${SEQPREFIX}urlregexpcount" value="$COUNTER"/>
+            </a>
+          </td>
+          <td class="formcolumncell"><input type="text" name="${SEQPREFIX}urlregexp" size="30" value=""/></td>
+          <td class="formcolumncell"><input type="text" name="${SEQPREFIX}urlregexpdesc" size="30" value=""/></td>
+          <td class="formcolumncell"><input type="checkbox" name="${SEQPREFIX}urlregexpreorder" value="yes"/></td>
+          <td class="formcolumncell"><input type="checkbox" name="${SEQPREFIX}urlregexpjava" value="yes" checked="true"/></td>
+          <td class="formcolumncell"><input type="checkbox" name="${SEQPREFIX}urlregexpasp" value="yes" checked="true"/></td>
+          <td class="formcolumncell"><input type="checkbox" name="${SEQPREFIX}urlregexpphp" value="yes" checked="true"/></td>
+          <td class="formcolumncell"><input type="checkbox" name="${SEQPREFIX}urlregexpbv" value="yes" checked="true"/></td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+</table>
+#else
+  #foreach($canonicalizationMap in $CANONICALIZATIONMAPLIST)
+<input type="hidden" name="${SEQPREFIX}urlregexp_$foreach.index" value="$Encoder.attributeEscape($canonicalizationMap["regexpString"])"/>
+<input type="hidden" name="${SEQPREFIX}urlregexpdesc_$foreach.index" value="$Encoder.attributeEscape($canonicalizationMap["description"])"/>
+<input type="hidden" name="${SEQPREFIX}urlregexpreorder_$foreach.index" value="$canonicalizationMap["allowReorder"]"/>
+<input type="hidden" name="${SEQPREFIX}urlregexpjava_$foreach.index" value="$canonicalizationMap["allowJavaSessionRemoval"]"/>
+<input type="hidden" name="${SEQPREFIX}urlregexpasp_$foreach.index" value="$canonicalizationMap["allowASPSessionRemoval"]"/>
+<input type="hidden" name="${SEQPREFIX}urlregexpphp_$foreach.index" value="$canonicalizationMap["allowPHPSessionRemoval"]"/>
+<input type="hidden" name="${SEQPREFIX}urlregexpbv_$foreach.index" value="$canonicalizationMap["allowBVSessionRemoval"]"/>
+  #end
+  #set( $COUNTER = $CANONICALIZATIONMAPLIST.size())
+<input type="hidden" name="${SEQPREFIX}urlregexpcount" value="$COUNTER"/>
+#end

Propchange: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Canonicalization.html.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Exclusions.html.vm
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Exclusions.html.vm?rev=1792823&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Exclusions.html.vm (added)
+++ manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Exclusions.html.vm Wed Apr 26 21:49:50 2017
@@ -0,0 +1,45 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+#set( $SEQPREFIX = 's' + $SEQNUM + '_' )
+#if($TABNAME == $ResourceBundle.getString('WebcrawlerConnector.Exclusions') && ${SEQNUM} == ${SELECTEDNUM})
+<table class="displaytable">
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+  <tr>
+    <td class="description" colspan="1"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.ExcludeFromCrawl'))</nobr></td>
+    <td class="value" colspan="1">
+      <textarea rows="25" cols="60" name="${SEQPREFIX}exclusions">$Encoder.bodyEscape($EXCLUSIONS)</textarea>
+    </td>
+  </tr>
+  <tr>
+    <td class="description" colspan="1"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.ExcludeFromIndex'))</nobr></td>
+    <td class="value" colspan="1">
+      <textarea rows="10" cols="60" name="${SEQPREFIX}exclusionsindex">$Encoder.bodyEscape($EXCLUSIONSINDEX)</textarea>
+    </td>
+  </tr>
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.ExcludeContentFromIndex'))</nobr></td>
+    <td class="value">
+      <textarea rows="10" cols="60" name="${SEQPREFIX}exclusionscontentindex">$Encoder.bodyEscape($EXCLUSIONSCONTENTINDEX)</textarea>
+    </td>
+  </tr>
+</table>
+#else
+<input type="hidden" name="${SEQPREFIX}exclusions" value="$Encoder.attributeEscape($INCLUSIONS)"/>
+<input type="hidden" name="${SEQPREFIX}exclusionsindex" value="$Encoder.attributeEscape($INCLUSIONSINDEX)"/>
+<input type="hidden" name="${SEQPREFIX}exclusionscontentindex" value="$Encoder.attributeEscape($INCLUSIONSCONTENTINDEX)"/>
+#end

Propchange: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Exclusions.html.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Inclusions.html.vm
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Inclusions.html.vm?rev=1792823&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Inclusions.html.vm (added)
+++ manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Inclusions.html.vm Wed Apr 26 21:49:50 2017
@@ -0,0 +1,47 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+#set( $SEQPREFIX = 's' + $SEQNUM + '_' )
+#if($TABNAME == $ResourceBundle.getString('WebcrawlerConnector.Inclusions') && ${SEQNUM} == ${SELECTEDNUM})
+<table class="displaytable">
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+  <tr>
+    <td class="description" colspan="1"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.IncludeInCrawl'))</nobr></td>
+    <td class="value" colspan="1">
+      <textarea rows="25" cols="60" name="${SEQPREFIX}inclusions">$Encoder.bodyEscape($INCLUSIONS)</textarea>
+    </td>
+  </tr>
+  <tr>
+    <td class="description" colspan="1"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.IncludeInIndex'))</nobr></td>
+    <td class="value" colspan="1">
+      <textarea rows="10" cols="60" name="${SEQPREFIX}inclusionsindex">$Encoder.bodyEscape($INCLUSIONSINDEX)</textarea>
+    </td>
+  </tr>
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.IncludeOnlyHostsMatchingSeeds'))</nobr></td>
+    <td class="value">
+      <input type="checkbox" name="${SEQPREFIX}matchinghosts" value="true" #if($INCLUDEMATCHING) checked="yes" #end />
+      <input type="hidden" name="${SEQPREFIX}matchinghosts_present" value="true"/>
+    </td>
+  </tr>
+</table>
+#else
+<input type="hidden" name="${SEQPREFIX}inclusions" value="$Encoder.attributeEscape($INCLUSIONS)"/>
+<input type="hidden" name="${SEQPREFIX}inclusionsindex" value="$Encoder.attributeEscape($INCLUSIONSINDEX)"/>
+<input type="hidden" name="${SEQPREFIX}matchinghosts" value="#if($INCLUDEMATCHING)true#{else}false#end" />
+<input type="hidden" name="${SEQPREFIX}matchinghosts_present" value="true"/>
+#end

Propchange: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Inclusions.html.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Mappings.html.vm
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Mappings.html.vm?rev=1792823&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Mappings.html.vm (added)
+++ manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Mappings.html.vm Wed Apr 26 21:49:50 2017
@@ -0,0 +1,70 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+#set( $SEQPREFIX = 's' + $SEQNUM + '_' )
+#if($TABNAME == $ResourceBundle.getString('WebcrawlerConnector.URLMappings') && ${SEQNUM} == ${SELECTEDNUM})
+<input type="hidden" name="${SEQPREFIX}rssop" value=""/>
+<input type="hidden" name="${SEQPREFIX}rssindex" value=""/>
+<input type="hidden" name="${SEQPREFIX}rssmapcount" value="$REGEXP.size()"/>
+
+<table class="displaytable">
+  <tr><td class="separator" colspan="4"><hr/></td></tr>
+  #foreach($REGEXP in $REGEXPLIST)
+    #set( $PREFIX = $SEQPREFIX + "rssregexp_" + $foreach.index +"_" )
+  <tr>
+    <td class="value">
+      <a name="${SEQPREFIX}regexp_$foreach.index">
+        <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.Remove'))" onclick='javascript:${SEQPREFIX}RemoveRegexp($foreach.index,"${SEQPREFIX}regexp_$foreach.index")' alt="$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.RemoveRegexp'))$foreach.index"/>
+      </a>
+    </td>
+    <td class="value"><input type="hidden" name="${PREFIX}match" value="$Encoder.attributeEscape($REGEXP)"/>$Encoder.bodyEscape($REGEXP)</td>
+    <td class="value">--&gt;</td>
+    <td class="value">
+    #set( $MATCH = $MATCHSTRINGS.get($foreach.index))
+      <input type="hidden" name="${PREFIX}map" value="$Encoder.attributeEscape($MATCH)"/>
+    #if($MATCH)
+      $Encoder.bodyEscape($MATCH)
+    #else
+    &lt;as is&gt;
+    #end
+    </td>
+  </tr>
+  #end
+  #set( $COUNTER = $REGEXPLIST.size() )
+  #set( $NEXTCOUNTER = $COUNTER + 1 )
+  <tr>
+    <td class="value">
+        <a name="${SEQPREFIX}regexp_${COUNTER}">
+            <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.Add'))" onclick='javascript:${SEQPREFIX}AddRegexp("${SEQPREFIX}regexp_${NEXTCOUNTER}")' alt="$Encoder.attributeEscape($ResourceBundle.getString('WebcrawlerConnector.AddRegexp'))" />
+        </a>
+    </td>
+    <td class="value"><input type="text" name="${SEQPREFIX}rssmatch" size="16" value=""/></td>
+    <td class="value">--&gt;</td>
+    <td class="value"><input type="text" name="${SEQPREFIX}rssmap" size="16" value=""/></td>
+  </tr>
+</table>
+
+#else
+  #set( $COUNTER = $REGEXPLIST.size() )
+  <input type="hidden" name="${SEQPREFIX}rssmapcount" value="$COUNTER"/>
+  #foreach($REGEXP in $REGEXPLIST)
+    #set( $PREFIX = $SEQPREFIX + "rssregexp_" + $foreach.index +"_" )
+  <input type="hidden" name="${PREFIX}match" value="$Encoder.attributeEscape($REGEXP)"/>$Encoder.bodyEscape($REGEXP)</td>
+    #set( $MATCH = $MATCHSTRINGS.get($foreach.index))
+  <input type="hidden" name="${PREFIX}map" value="$Encoder.attributeEscape($MATCH)"/>
+  #end
+#end

Propchange: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Mappings.html.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Seeds.html.vm
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Seeds.html.vm?rev=1792823&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Seeds.html.vm (added)
+++ manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Seeds.html.vm Wed Apr 26 21:49:50 2017
@@ -0,0 +1,30 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+#set( $SEQPREFIX = 's' + $SEQNUM + '_' )
+#if($TABNAME == $ResourceBundle.getString('WebcrawlerConnector.Seeds') && ${SEQNUM} == ${SELECTEDNUM})
+<table class="displaytable">
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+  <tr>
+    <td class="value" colspan="2">
+      <textarea rows="25" cols="80" name="${SEQPREFIX}seeds">$Encoder.bodyEscape($SEEDS)</textarea>
+    </td>
+  </tr>
+</table>
+#else
+<input type="hidden" name="${SEQPREFIX}seeds" value="$Encoder.attributeEscape($SEEDS)"/>
+#end

Propchange: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editSpecification_Seeds.html.vm
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message