manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kish...@apache.org
Subject svn commit: r1792685 - 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 Tue, 25 Apr 2017 23:59:47 GMT
Author: kishore
Date: Tue Apr 25 23:59:47 2017
New Revision: 1792685

URL: http://svn.apache.org/viewvc?rev=1792685&view=rev
Log:
Updated viewConfiguration with Velocity template.

Added:
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/viewConfiguration.html.vm
  (with props)
Modified:
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
    manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editConfiguration_Access.html.vm

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=1792685&r1=1792684&r2=1792685&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
Tue Apr 25 23:59:47 2017
@@ -2293,367 +2293,18 @@ public class WebcrawlerConnector extends
     Locale locale, ConfigParams parameters)
     throws ManifoldCFException, IOException
   {
-    String email = parameters.getParameter(WebcrawlerConfig.PARAMETER_EMAIL);
-    String robots = parameters.getParameter(WebcrawlerConfig.PARAMETER_ROBOTSUSAGE);
-    if (robots.equals("none"))
-      robots = Messages.getBodyString(locale,"WebcrawlerConnector.DontLookAtRobotsTxt");
-    else if (robots.equals("data"))
-      robots = Messages.getBodyString(locale,"WebcrawlerConnector.ObeyRobotsTxtForDataFetchesOnly");
-    else if (robots.equals("all"))
-      robots = Messages.getBodyString(locale,"WebcrawlerConnector.ObeyRobotsTxtForAllFetches");
-    String metaRobotsTagsUsage = parameters.getParameter(WebcrawlerConfig.PARAMETER_META_ROBOTS_TAGS_USAGE);
-    if (metaRobotsTagsUsage == null || metaRobotsTagsUsage.equals("all"))
-      metaRobotsTagsUsage = Messages.getBodyString(locale,"WebcrawlerConnector.ObeyMetaRobotsTags");
-    else if (metaRobotsTagsUsage.equals("none"))
-      metaRobotsTagsUsage = Messages.getBodyString(locale,"WebcrawlerConnector.DontLookAtMetaRobotsTags");
-    String proxyHost = parameters.getParameter(WebcrawlerConfig.PARAMETER_PROXYHOST);
-    if (proxyHost == null)
-      proxyHost = "";
-    String proxyPort = parameters.getParameter(WebcrawlerConfig.PARAMETER_PROXYPORT);
-    if (proxyPort == null)
-      proxyPort = "";
-    String proxyAuthDomain = parameters.getParameter(WebcrawlerConfig.PARAMETER_PROXYAUTHDOMAIN);
-    if (proxyAuthDomain == null)
-      proxyAuthDomain = "";
-    String proxyAuthUsername = parameters.getParameter(WebcrawlerConfig.PARAMETER_PROXYAUTHUSERNAME);
-    if (proxyAuthUsername == null)
-      proxyAuthUsername = "";
 
-    out.print(
-"<table class=\"displaytable\">\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.EmailAddress")+"</nobr></td>\n"+
-"    <td class=\"value\" colspan=\"3\">"+Encoder.bodyEscape(email)+"</td>\n"+
-"  </tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.RobotsUsage")+"</nobr></td>\n"+
-"    <td class=\"value\" colspan=\"1\"><nobr>"+Encoder.bodyEscape(robots)+"</nobr></td>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.MetaRobotsTagsUsage")+"</nobr></td>\n"+
-"    <td class=\"value\" colspan=\"1\">"+Encoder.bodyEscape(metaRobotsTagsUsage)+"</td>\n"+
-"  </tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ProxyHostColon")
+ "</nobr></td>\n"+
-"    <td class=\"value\">"+Encoder.bodyEscape(proxyHost)+"</td>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ProxyPortColon")
+ "</nobr></td>\n"+
-"    <td class=\"value\">"+Encoder.bodyEscape(proxyPort)+"</td>\n"+
-"  </tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ProxyAuthenticationDomainColon")
+ "</nobr></td>\n"+
-"    <td class=\"value\">"+Encoder.bodyEscape(proxyAuthDomain)+"</td>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ProxyAuthenticationUserNameColon")
+ "</nobr></td>\n"+
-"    <td class=\"value\">"+Encoder.bodyEscape(proxyAuthUsername)+"</td>\n"+
-"  </tr>\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.BandwidthThrottling")+"</nobr></td>\n"+
-"    <td class=\"boxcell\" colspan=\"3\">\n"+
-"      <table class=\"formtable\">\n"+
-"        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.BinRegularExpression")+"</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.CaseInsensitive")+"</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.MaxConnections")+"</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.MaxKbytesSec")+"</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>"+Messages.getBodyString(locale,"WebcrawlerConnector.MaxFetchesMin")+"</nobr></td>\n"+
-"        </tr>\n"
-    );
-    int i = 0;
-    int instanceNumber = 0;
-    while (i < parameters.getChildCount())
-    {
-      ConfigNode cn = parameters.getChild(i++);
-      if (cn.getType().equals(WebcrawlerConfig.NODE_BINDESC))
-      {
-        // A bin description node!  Look for all its parameters.
-        String regexp = cn.getAttributeValue(WebcrawlerConfig.ATTR_BINREGEXP);
-        String isCaseInsensitive = cn.getAttributeValue(WebcrawlerConfig.ATTR_INSENSITIVE);
-        String maxConnections = null;
-        String maxKBPerSecond = null;
-        String maxFetchesPerMinute = null;
-        int j = 0;
-        while (j < cn.getChildCount())
-        {
-          ConfigNode childNode = cn.getChild(j++);
-          if (childNode.getType().equals(WebcrawlerConfig.NODE_MAXCONNECTIONS))
-            maxConnections = childNode.getAttributeValue(WebcrawlerConfig.ATTR_VALUE);
-          else if (childNode.getType().equals(WebcrawlerConfig.NODE_MAXKBPERSECOND))
-            maxKBPerSecond = childNode.getAttributeValue(WebcrawlerConfig.ATTR_VALUE);
-          else if (childNode.getType().equals(WebcrawlerConfig.NODE_MAXFETCHESPERMINUTE))
-            maxFetchesPerMinute = childNode.getAttributeValue(WebcrawlerConfig.ATTR_VALUE);
-        }
-        if (maxConnections == null)
-          maxConnections = "Not limited";
-        if (maxKBPerSecond == null)
-          maxKBPerSecond = "Not limited";
-        if (maxFetchesPerMinute == null)
-          maxFetchesPerMinute = "Not limited";
-        if (isCaseInsensitive == null || isCaseInsensitive.length() == 0)
-          isCaseInsensitive = "false";
-        out.print(
-"        <tr class=\""+(((instanceNumber % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
-"          <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(regexp)+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\">"+isCaseInsensitive+"</td>\n"+
-"          <td class=\"formcolumncell\"><nobr>"+maxConnections+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\"><nobr>"+maxKBPerSecond+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\"><nobr>"+maxFetchesPerMinute+"</nobr></td>\n"+
-"        </tr>\n"
-        );
-        instanceNumber++;
-      }
-    }
-    if (instanceNumber == 0)
-    {
-      out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"5\">"+Messages.getBodyString(locale,"WebcrawlerConnector.NoBandwidthThrottling")+"</td></tr>\n"
-      );
-    }
-    out.print(
-"      </table>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"  \n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.PageAccessCredentials")
+ "</nobr></td>\n"+
-"    <td class=\"boxcell\" colspan=\"3\">\n"+
-"      <table class=\"formtable\">\n"+
-"        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression")
+ "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.CredentialType")
+ "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.CredentialDomain")
+ "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.UserName")
+ "</nobr></td>\n"+
-"        </tr>\n"
-    );
-    i = 0;
-    instanceNumber = 0;
-    while (i < parameters.getChildCount())
-    {
-      ConfigNode cn = parameters.getChild(i++);
-      if (cn.getType().equals(WebcrawlerConfig.NODE_ACCESSCREDENTIAL))
-      {
-        // A bin description node!  Look for all its parameters.
-        String type = cn.getAttributeValue(WebcrawlerConfig.ATTR_TYPE);
-        if (!type.equals(WebcrawlerConfig.ATTRVALUE_SESSION))
-        {
-          String regexp = cn.getAttributeValue(WebcrawlerConfig.ATTR_URLREGEXP);
-          // Page-based auth
-          String domain = cn.getAttributeValue(WebcrawlerConfig.ATTR_DOMAIN);
-          if (domain == null)
-            domain = "";
-          String userName = cn.getAttributeValue(WebcrawlerConfig.ATTR_USERNAME);
-          out.print(
-"        <tr>\n"+
-"          <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(regexp)+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\"><nobr>"+type+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(domain)+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(userName)+"</nobr></td>\n"+
-"        </tr>\n"
-          );
-          instanceNumber++;
-        }
-      }
-    }
-    if (instanceNumber == 0)
-    {
-      out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"4\"><nobr>"
+ Messages.getBodyString(locale,"WebcrawlerConnector.NoPageAccessCredentials") + "</nobr></td></tr>\n"
-      );
-    }
-    out.print(
-"      </table>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"\n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.SessionBasedAccessCredentials")
+ "</nobr></td>\n"+
-"    <td class=\"boxcell\" colspan=\"3\">\n"+
-"      <table class=\"formtable\">\n"+
-"        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression")
+ "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.LoginPages")
+ "</nobr></td>\n"+
-"        </tr>\n"
-    );
-    i = 0;
-    instanceNumber = 0;
-    while (i < parameters.getChildCount())
-    {
-      ConfigNode cn = parameters.getChild(i++);
-      if (cn.getType().equals(WebcrawlerConfig.NODE_ACCESSCREDENTIAL))
-      {
-        // A bin description node!  Look for all its parameters.
-        String type = cn.getAttributeValue(WebcrawlerConfig.ATTR_TYPE);
-        if (type.equals(WebcrawlerConfig.ATTRVALUE_SESSION))
-        {
-          String regexp = cn.getAttributeValue(WebcrawlerConfig.ATTR_URLREGEXP);
-          // Session-based auth.  Display this as a nested table.
-          out.print(
-"        <tr class=\""+(((instanceNumber % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
-"          <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(regexp)+"</nobr></td>\n"+
-"          <td class=\"boxcell\">\n"
-          );
-          int q = 0;
-          int authPageInstanceNumber = 0;
-          while (q < cn.getChildCount())
-          {
-            ConfigNode authPageNode = cn.getChild(q++);
-            if (authPageNode.getType().equals(WebcrawlerConfig.NODE_AUTHPAGE))
-            {
-              String authURLRegexp = authPageNode.getAttributeValue(WebcrawlerConfig.ATTR_URLREGEXP);
-              String pageType = authPageNode.getAttributeValue(WebcrawlerConfig.ATTR_TYPE);
-              String authMatchRegexp = authPageNode.getAttributeValue(WebcrawlerConfig.ATTR_MATCHREGEXP);
-              if (authMatchRegexp == null)
-                authMatchRegexp = "";
-              String authOverrideTargetURL = authPageNode.getAttributeValue(WebcrawlerConfig.ATTR_OVERRIDETARGETURL);
-              if (authOverrideTargetURL == null)
-                authOverrideTargetURL = "";
-              if (authPageInstanceNumber == 0)
-              {
-                out.print(
-"            <table class=\"formtable\">\n"+
-"              <tr class=\"formheaderrow\">\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.LoginURLRegularExpression")
+ "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.PageType")
+ "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.FormNamelinkTargetRegularExpression")
+ "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.OverrideTargetURL")
+ "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.OverrideFormParameters")
+ "</nobr></td>\n"+
-"              </tr>\n"
-                );
-              }
-              out.print(
-"              <tr class=\""+(((authPageInstanceNumber % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
-"                <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(authURLRegexp)+"</nobr></td>\n"+
-"                <td class=\"formcolumncell\"><nobr>"+pageType+"</nobr></td>\n"+
-"                <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(authMatchRegexp)+"</nobr></td>\n"+
-"                <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(authOverrideTargetURL)+"</nobr></td>\n"+
-"                <td class=\"formcolumncell\">\n"
-              );
-              if (pageType.equals(WebcrawlerConfig.ATTRVALUE_FORM))
-              {
-                int z = 0;
-                while (z < authPageNode.getChildCount())
-                {
-                  ConfigNode authParameter = authPageNode.getChild(z++);
-                  if (authParameter.getType().equals(WebcrawlerConfig.NODE_AUTHPARAMETER))
-                  {
-                    String paramName = authParameter.getAttributeValue(WebcrawlerConfig.ATTR_NAMEREGEXP);
-                    if (paramName == null)
-                      paramName = "";
-                    String paramValue = authParameter.getAttributeValue(WebcrawlerConfig.ATTR_VALUE);
-                    if (paramValue == null)
-                      paramValue = "";
-                    String password = authParameter.getAttributeValue(WebcrawlerConfig.ATTR_PASSWORD);
-                    if (password != null && password.length() > 0)
-                      paramValue = "*****";
-                    out.print(
-"                  <nobr>"+Encoder.bodyEscape(paramName+": "+paramValue)+"</nobr><br/>\n"
-                    );
-                  }
-                }
-              }
-              out.print(
-"                </td>\n"+
-"              </tr>\n"
-              );
-              authPageInstanceNumber++;
-            }
-          }
-          if (authPageInstanceNumber == 0)
-          {
-            out.print(
-"            <nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoLoginPagesSpecified")
+ "</nobr>\n"
-            );
-          }
-          else
-          {
-            out.print(
-"            </table>\n"
-            );
-          }
-          out.print(
-"          </td>\n"+
-"        </tr>\n"
-          );
-          instanceNumber++;
-        }
-      }
-    }
-    if (instanceNumber == 0)
-    {
-      out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"2\"><nobr>"
+ Messages.getBodyString(locale,"WebcrawlerConnector.NoSessionBasedAccessCredentials") + "</nobr></td></tr>\n"
-      );
-    }
-    out.print(
-"      </table>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"  \n"+
-"  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.TrustCertificates")
+ "</nobr></td>\n"+
-"    <td class=\"boxcell\" colspan=\"3\">\n"+
-"      <table class=\"formtable\">\n"+
-"        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression")
+ "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Certificate")
+ "</nobr></td>\n"+
-"        </tr>\n"
-    );
-    i = 0;
-    instanceNumber = 0;
-    while (i < parameters.getChildCount())
-    {
-      ConfigNode cn = parameters.getChild(i++);
-      if (cn.getType().equals(WebcrawlerConfig.NODE_TRUST))
-      {
-        // A bin description node!  Look for all its parameters.
-        String regexp = cn.getAttributeValue(WebcrawlerConfig.ATTR_URLREGEXP);
-        String trustEverything = cn.getAttributeValue(WebcrawlerConfig.ATTR_TRUSTEVERYTHING);
-        if (trustEverything != null && trustEverything.equals("true"))
-        {
-          // We trust everything that matches this regexp
-          out.print(
-"        <tr class=\""+(((instanceNumber % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
-"          <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(regexp)+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\"><i>" + Messages.getBodyString(locale,"WebcrawlerConnector.TrustEverything")
+ "</i></td>\n"+
-"        </tr>\n"
-          );
-          instanceNumber++;
-        }
-        else
-        {
-          String trustStore = cn.getAttributeValue(WebcrawlerConfig.ATTR_TRUSTSTORE);
-          IKeystoreManager localTruststore = KeystoreManagerFactory.make("",trustStore);
-          String[] truststoreContents = localTruststore.getContents();
-            
-          // Each trust store will have only at most one cert in it at this level.  These
individual certs are assembled into the proper trust store
-          // for each individual url at fetch time.
-            
-          if (truststoreContents.length == 1)
-          {
-            String alias = truststoreContents[0];
-            String description = localTruststore.getDescription(alias);
-            String shortenedDescription = description;
-            if (shortenedDescription.length() > 100)
-              shortenedDescription = shortenedDescription.substring(0,100) + "...";
-            out.print(
-"        <tr class=\""+(((instanceNumber % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
-"          <td class=\"formcolumncell\"><nobr>"+Encoder.bodyEscape(regexp)+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\">"+Encoder.bodyEscape(shortenedDescription)+"</td>\n"+
-"        </tr>\n"
-            );
-            instanceNumber++;
-          }
-        }
-      }
-    }
-    if (instanceNumber == 0)
-    {
-      out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"2\">" + Messages.getBodyString(locale,"WebcrawlerConnector.NoTrustCertificates")
+ "</td></tr>\n"
-      );
-    }
-    out.print(
-"      </table>\n"+
-"    </td>\n"+
-"  </tr>\n"+
-"</table>\n"
-    );
+    final Map<String,Object> velocityContext = new HashMap<String,Object>();
+
+    fillInEmailTab(velocityContext,out,parameters);
+    fillInRobotsTab(velocityContext,out,parameters);
+    fillInBandwidthTab(velocityContext,out,parameters);
+    fillInAccessTab(velocityContext,out,parameters);
+    fillInCertificatesTab(velocityContext,out,parameters);
+    fillInProxyTab(velocityContext,out,parameters);
+
+    Messages.outputResourceWithVelocity(out,locale,"viewConfiguration.html.vm",velocityContext);
+
   }
   
   /** Output the specification header section.

Modified: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editConfiguration_Access.html.vm
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editConfiguration_Access.html.vm?rev=1792685&r1=1792684&r2=1792685&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editConfiguration_Access.html.vm
(original)
+++ manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/editConfiguration_Access.html.vm
Tue Apr 25 23:59:47 2017
@@ -279,7 +279,7 @@
   #set( $COUNTER = 0)
   #foreach($sessionAccessMap in $SESSIONACCESSMAPLIST)
     #set( $PREFIX = "scredential_" + $COUNTER )
-<input type="hidden" name="regexp_$PREFIX" value="$Encoder.attributeEscape($sessionAccessMap["regexp"])"/>
+<input type="hidden" name="${PREFIX}_regexp" value="$Encoder.attributeEscape($sessionAccessMap["regexp"])"/>
     #set( $AUTHPAGECOUNTER = 0 )
     #set( $AUTHPAGEMAPLIST = $sessionAccessMap["authPageMapList"])
     #foreach($authPageMap in $AUTHPAGEMAPLIST)
@@ -296,7 +296,7 @@
 <input type="hidden" name="${AUTHPARAMPREFIX}_op" value="Continue"/>
 <input type="hidden" name="${AUTHPARAMPREFIX}_param" value="$Encoder.attributeEscape($authPageParamMap["param"])"
/>
 <input type="hidden" name="${AUTHPARAMPREFIX}_value" value="$Encoder.attributeEscape($authPageParamMap["value"])"
/>
-<input type="hidden" name="${AUTHPARAMPREFIX}_password" value="$Encoder.attributeEscape($authPageParamMap["value"])"
/>
+<input type="hidden" name="${AUTHPARAMPREFIX}_password" value="$Encoder.attributeEscape($authPageParamMap["password"])"
/>
           #set( $AUTHPARAMCOUNTER = $AUTHPARAMCOUNTER + 1)
         #end
 <input type="hidden" name="${AUTHPAGEPREFIX}_loginparamcount" value="$AUTHPARAMCOUNTER"/>

Added: manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/viewConfiguration.html.vm
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/viewConfiguration.html.vm?rev=1792685&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/viewConfiguration.html.vm
(added)
+++ manifoldcf/branches/CONNECTORS-1403/connectors/webcrawler/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/webcrawler/viewConfiguration.html.vm
Tue Apr 25 23:59:47 2017
@@ -0,0 +1,241 @@
+<!--
+ 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.
+-->
+
+<table class="displaytable">
+  <tr>
+    <td class="description" colspan="1"><nobr>$ResourceBundle.getString('WebcrawlerConnector.EmailAddress')</nobr></td>
+    <td class="value" colspan="3">$Encoder.bodyEscape($EMAIL)</td>
+  </tr>
+  <tr>
+    <td class="description" colspan="1"><nobr>$ResourceBundle.getString('WebcrawlerConnector.RobotsUsage')</nobr></td>
+    <td class="value" colspan="1">
+    #if($ROBOTSUSAGE == 'none')
+      $ResourceBundle.getString('WebcrawlerConnector.DontLookAtRobotsTxt')
+    #elseif($ROBOTUSAGE == 'data')
+      $ResourceBundle.getString('WebcrawlerConnector.ObeyRobotsTxtForDataFetchesOnly')
+    #elseif($ROBOTUSAGE == 'all')
+      $ResourceBundle.getString('WebcrawlerConnector.ObeyRobotsTxtForAllFetches')
+    #end
+    </td>
+    <td class="description" colspan="1"><nobr>$ResourceBundle.getString('WebcrawlerConnector.MetaRobotsTagsUsage')</nobr></td>
+    <td class="value" colspan="1">
+    #if($METAROBOTSTAGSUSAGE == 'none')
+      $ResourceBundle.getString('WebcrawlerConnector.DontLookAtMetaRobotsTags')
+    #elseif($METAROBOTSTAGSUSAGE == 'all')
+      $ResourceBundle.getString('WebcrawlerConnector.ObeyMetaRobotsTags')
+    #end
+    </td>
+  </tr>
+  <tr>
+    <td class="description"><nobr>$ResourceBundle.getString('WebcrawlerConnector.ProxyHostColon')</nobr></td>
+    <td class="value">$Encoder.bodyEscape($PROXYHOST)</td>
+    <td class="description"><nobr>$ResourceBundle.getString('WebcrawlerConnector.ProxyPortColon')</nobr></td>
+    <td class="value">$Encoder.bodyEscape($PROXYPORT)</td>
+  </tr>
+  <tr>
+    <td class="description"><nobr>$ResourceBundle.getString('WebcrawlerConnector.ProxyAuthenticationDomainColon')</nobr></td>
+    <td class="value">$Encoder.bodyEscape($PROXYAUTHDOMAIN)</td>
+    <td class="description"><nobr>$ResourceBundle.getString('WebcrawlerConnector.ProxyAuthenticationUserNameColon')</nobr></td>
+    <td class="value">$Encoder.bodyEscape($PROXYAUTHUSERNAME)</td>
+  </tr>
+  <tr>
+    <td class="description" colspan="1"><nobr>$ResourceBundle.getString('WebcrawlerConnector.BandwidthThrottling')</nobr></td>
+    <td class="boxcell" colspan="3">
+      <table class="formtable">
+        <tr class="formheaderrow">
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.BinRegularExpression')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.CaseInsensitive')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.MaxConnections')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.MaxKbytesSec')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.MaxFetchesMin')</nobr></td>
+        </tr>
+        #set( $BINCOUNTER = 0)
+        #foreach($throttleMap in $THROTTLESMAPLIST)
+        <tr>
+          <td class="formcolumncell">
+            <nobr>$Encoder.bodyEscape($throttleMap.get("regexp"))</nobr>
+          </td>
+          <td class="formcolumncell"><nobr>$throttleMap["isCaseInsensitive"]</nobr></td>
+          <td class="formcolumncell">
+          #if($throttleMap["maxConnections"] == "")
+            Not limited
+          #else
+            $throttleMap["maxConnections"]
+          #end
+          </td>
+          <td class="formcolumncell">
+          #if($throttleMap["maxKBPerSecond"] == "")
+            Not limited
+          #else
+            $throttleMap["maxKBPerSecond"]
+          #end
+          </td>
+          <td class="formcolumncell">
+          #if($throttleMap["maxFetchesPerMinute"] == "")
+            Not limited
+          #else
+            $throttleMap["maxFetchesPerMinute"]
+          #end
+          </td>
+        </tr>
+          #set( $BINCOUNTER = $BINCOUNTER + 1)
+        #end
+        #if($BINCOUNTER == 0)
+        <tr class="formrow"><td class="formmessage" colspan="5">$ResourceBundle.getString('WebcrawlerConnector.NoBandwidthThrottling')</td></tr>
+        #end
+      </table>
+    </td>
+  </tr>
+
+  <tr>
+    <td class="description" colspan="1"><nobr>$ResourceBundle.getString('WebcrawlerConnector.PageAccessCredentials')</nobr></td>
+    <td class="boxcell" colspan="3">
+      <table class="formtable">
+        <tr class="formheaderrow">
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.URLRegularExpression')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.CredentialType')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.CredentialDomain')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.UserName')</nobr></td>
+        </tr>
+        #set( $COUNTER = 0)
+        #foreach($pageAccessMap in $PAGEACCESSMAPLIST)
+        <tr>
+          <td class="formcolumncell">
+            <nobr>$Encoder.bodyEscape($pageAccessMap["regexp"])</nobr>
+          </td>
+          <td class="formcolumncell">
+          $pageAccessMap["type"]
+          </td>
+          <td class="formcolumncell"><nobr>$Encoder.bodyEscape($pageAccessMap["domain"])</nobr></td>
+          <td class="formcolumncell"><nobr>$Encoder.attributeEscape($pageAccessMap["userName"])</nobr></td>
+        </tr>
+          #set( $COUNTER = $COUNTER + 1)
+        #end
+        #if($COUNTER == 0)
+        <tr class="formrow"><td class="formmessage" colspan="4"><nobr>$ResourceBundle.getString('WebcrawlerConnector.NoPageAccessCredentials')</nobr></td></tr>
+        #end
+      </table>
+    </td>
+  </tr>
+
+  <tr>
+    <td class="description" colspan="1"><nobr>$ResourceBundle.getString('WebcrawlerConnector.SessionBasedAccessCredentials')</nobr></td>
+    <td class="boxcell" colspan="3">
+      <table class="formtable">
+        <tr class="formheaderrow">
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.URLRegularExpression')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.LoginPages')</nobr></td>
+        </tr>
+        #set( $COUNTER = 0)
+        #foreach($sessionAccessMap in $SESSIONACCESSMAPLIST)
+        <tr>
+          <td class="formcolumncell"><nobr>$Encoder.bodyEscape($sessionAccessMap["regexp"])</nobr></td>
+          <td class="boxcell">
+            <table class="formtable">
+              <tr class="formheaderrow">
+                <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.LoginURLRegularExpression'))</nobr></td>
+                <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.PageType'))</nobr></td>
+                <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.FormNamelinkTargetRegularExpression'))</nobr></td>
+                <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.OverrideTargetURL'))</nobr></td>
+                <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.OverrideFormParameters'))</nobr></td>
+              </tr>
+              #set( $AUTHPAGECOUNTER = 0 )
+              #set( $AUTHPAGEMAPLIST = $sessionAccessMap["authPageMapList"])
+              #foreach($authPageMap in $AUTHPAGEMAPLIST)
+              <tr>
+                <td class="formcolumncell"><nobr>$Encoder.bodyEscape($authPageMap["pageRegexp"])</nobr></td>
+                <td class="formcolumncell"><nobr>$authPageMap["pageType"]</nobr></td>
+                <td class="formcolumncell"><nobr>$Encoder.bodyEscape($authPageMap["matchRegexp"])</nobr></td>
+                <td class="formcolumncell"><nobr>$Encoder.bodyEscape($authPageMap["overrideTargetURL"])</nobr></td>
+                #if($authPageMap["pageType"] == "form")
+                <td class="boxcell">
+                  <table class="formtable">
+                    <tr class="formheaderrow">
+                      <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.ParameterRegularExpression'))</nobr></td>
+                      <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.Value'))</nobr></td>
+                      <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('WebcrawlerConnector.Password'))</nobr></td>
+                    </tr>
+                  #set( $AUTHPARAMCOUNTER = 0)
+                  #set( $AUTHPAGEPARAMMAPLIST = $authPageMap["authPageParamMapList"] )
+                  #foreach($authPageParamMap in $AUTHPAGEPARAMMAPLIST)
+                    <tr>
+                      <td class="formcolumncell"><nobr>$Encoder.bodyEscape($authPageParamMap["param"])</nobr></td>
+                      <td class="formcolumncell"><nobr>$Encoder.bodyEscape($authPageParamMap["value"])</nobr></td>
+                      <td class="formcolumncell">
+                      #if($authPageParamMap["password"] != "")
+                        *****
+                      #end
+                      </td>
+                    </tr>
+                    #set( $AUTHPARAMCOUNTER = $AUTHPARAMCOUNTER + 1)
+                  #end
+                  </table>
+                </td>
+                #else
+                <td class="formcolumncell"></td>
+                #end
+              </tr>
+                #set( $AUTHPAGECOUNTER = $AUTHPAGECOUNTER + 1 )
+              #end
+              #if($AUTHPAGECOUNTER == 0)
+              <tr><td><nobr>$ResourceBundle.getString('WebcrawlerConnector.NoLoginPagesSpecified')</nobr></td></tr>
+              #end
+            </table>
+          </td>
+        </tr>
+          #set( $COUNTER = $COUNTER + 1)
+        #end
+        #if($COUNTER == 0)
+        <tr class="formrow"><td class="formmessage" colspan="2"><nobr>$ResourceBundle.getString('WebcrawlerConnector.NoSessionBasedAccessCredentials')</nobr></td></tr>
+        #end
+      </table>
+    </td>
+  </tr>
+
+  <tr>
+    <td class="description" colspan="1"><nobr>$ResourceBundle.getString('WebcrawlerConnector.TrustCertificates')</nobr></td>
+    <td class="boxcell" colspan="3">
+      <table class="formtable">
+        <tr class="formheaderrow">
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.URLRegularExpression')</nobr></td>
+          <td class="formcolumnheader"><nobr>$ResourceBundle.getString('WebcrawlerConnector.Certificate')</nobr></td>
+        </tr>
+        #set( $COUNTER = 0)
+        #foreach($trustMap in $TRUSTMAPLIST)
+        <tr>
+          <td class="formcolumncell">
+            <nobr>$Encoder.bodyEscape($trustMap["regexp"])</nobr>
+          </td>
+          #if($trustMap["trustEverything"] == "true")
+          <td class="formcolumncell">
+            <nobr><i>$Encoder.bodyEscape($ResourceBundle.getString("WebcrawlerConnector.TrustEverything"))</i></nobr>
+          </td>
+          #else
+          <td class="formcolumncell">
+            <nobr>$Encoder.bodyEscape($trustMap["shortenedDescription"])</nobr>
+          </td>
+          #end
+          #set( $COUNTER = $COUNTER + 1)
+        #end
+        #if($COUNTER == 0)
+        <tr class="formrow"><td class="formmessage" colspan="2">$ResourceBundle.getString('WebcrawlerConnector.NoTrustCertificates')</td></tr>
+        #end
+      </table>
+    </td>
+  </tr>
+</table>
+

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



Mime
View raw message