manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1364202 - in /manifoldcf/branches/CONNECTORS-488/connectors: documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/ livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/ meridio/con...
Date Sun, 22 Jul 2012 01:07:32 GMT
Author: kwright
Date: Sun Jul 22 01:07:31 2012
New Revision: 1364202

URL: http://svn.apache.org/viewvc?rev=1364202&view=rev
Log:
Finish cache tabs for all authorities that support caching

Modified:
    manifoldcf/branches/CONNECTORS-488/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
    manifoldcf/branches/CONNECTORS-488/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java
    manifoldcf/branches/CONNECTORS-488/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java

Modified: manifoldcf/branches/CONNECTORS-488/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-488/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java?rev=1364202&r1=1364201&r2=1364202&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-488/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-488/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
Sun Jul 22 01:07:31 2012
@@ -1033,6 +1033,8 @@ public class AuthorityConnector extends 
     tabsArray.add(Messages.getString(locale,"DCTM.Docbase"));
     tabsArray.add(Messages.getString(locale,"DCTM.UserMapping"));
     tabsArray.add(Messages.getString(locale,"DCTM.SystemACLs"));
+    tabsArray.add(Messages.getString(locale,"DCTM.Cache"));
+
     out.print(
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
@@ -1059,6 +1061,34 @@ public class AuthorityConnector extends 
 "    editconnection.docbasepassword.focus();\n"+
 "    return false;\n"+
 "  }\n"+
+"  if (editconnection.cachelifetime.value == \"\")\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.CacheLifetimeCannotBeNull")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"DCTM.Cache") + "\");\n"+
+"    editconnection.cachelifetime.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelifetime.value != \"\" && !isInteger(editconnection.cachelifetime.value))\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.CacheLifetimeMustBeAnInteger")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"DCTM.Cache") + "\");\n"+
+"    editconnection.cachelifetime.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelrusize.value == \"\")\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.CacheLRUSizeCannotBeNull")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"DCTM.Cache") + "\");\n"+
+"    editconnection.cachelrusize.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelrusize.value != \"\" && !isInteger(editconnection.cachelrusize.value))\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.CacheLRUSizeMustBeAnInteger")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"DCTM.Cache") + "\");\n"+
+"    editconnection.cachelrusize.focus();\n"+
+"    return false;\n"+
+"  }\n"+
 "  return true;\n"+
 "}\n"+
 "\n"+
@@ -1105,6 +1135,14 @@ public class AuthorityConnector extends 
     if (useSystemAcls == null)
       useSystemAcls = "true";
 
+    String cacheLifetime = parameters.getParameter(CONFIG_PARAM_CACHELIFETIME);
+    if (cacheLifetime == null)
+      cacheLifetime = "1";
+    
+    String cacheLRUsize = parameters.getParameter(CONFIG_PARAM_CACHELRUSIZE);
+    if (cacheLRUsize == null)
+      cacheLRUsize = "1000";    
+
     // "Docbase" tab
     if (tabName.equals(Messages.getString(locale,"DCTM.Docbase")))
     {
@@ -1204,6 +1242,32 @@ public class AuthorityConnector extends 
 "<input type=\"hidden\" name=\"usesystemacls\" value=\""+useSystemAcls+"\"/>\n"
       );
     }
+    
+    // "Cache" tab
+    if(tabName.equals(Messages.getString(locale,"DCTM.Cache")))
+    {
+      out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"DCTM.CacheLifetime")
+ "</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"5\" name=\"cachelifetime\"
value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLifetime) + "\"/>
" + Messages.getBodyString(locale,"DCTM.minutes") + "</td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"DCTM.CacheLRUSize")
+ "</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"5\" name=\"cachelrusize\" value=\""
+ org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLRUsize) + "\"/></td>\n"+
+"  </tr>\n"+
+"</table>\n"
+      );
+    }
+    else
+    {
+      // Hiddens for "Cache" tab
+      out.print(
+"<input type=\"hidden\" name=\"cachelifetime\" value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLifetime)
+ "\"/>\n"+
+"<input type=\"hidden\" name=\"cachelrusize\" value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLRUsize)
+ "\"/>\n"
+      );
+    }
   }
   
   /** Process a configuration post.
@@ -1244,6 +1308,14 @@ public class AuthorityConnector extends 
     if (useSystemAcls != null)
       parameters.setParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USESYSTEMACLS,useSystemAcls);
     
+    String cacheLifetime = variableContext.getParameter("cachelifetime");
+    if (cacheLifetime != null)
+      parameters.setParameter(CONFIG_PARAM_CACHELIFETIME,cacheLifetime);
+
+    String cacheLRUsize = variableContext.getParameter("cachelrusize");
+    if (cacheLRUsize != null)
+      parameters.setParameter(CONFIG_PARAM_CACHELRUSIZE,cacheLRUsize);
+
     return null;
   }
   

Modified: manifoldcf/branches/CONNECTORS-488/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-488/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java?rev=1364202&r1=1364201&r2=1364202&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-488/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java
(original)
+++ manifoldcf/branches/CONNECTORS-488/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java
Sun Jul 22 01:07:31 2012
@@ -489,6 +489,8 @@ public class LivelinkAuthority extends o
   {
     tabsArray.add(Messages.getString(locale,"LivelinkConnector.Server"));
     tabsArray.add(Messages.getString(locale,"LivelinkConnector.UserMapping"));
+    tabsArray.add(Messages.getString(locale,"LivelinkConnector.Cache"));
+
     out.print(
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
@@ -532,6 +534,34 @@ public class LivelinkAuthority extends o
 "    editconnection.usernameregexp.focus();\n"+
 "    return false;\n"+
 "  }\n"+
+"  if (editconnection.cachelifetime.value == \"\")\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"LivelinkConnector.CacheLifetimeCannotBeNull")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"LivelinkConnector.Cache") +
"\");\n"+
+"    editconnection.cachelifetime.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelifetime.value != \"\" && !isInteger(editconnection.cachelifetime.value))\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"LivelinkConnector.CacheLifetimeMustBeAnInteger")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"LivelinkConnector.Cache") +
"\");\n"+
+"    editconnection.cachelifetime.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelrusize.value == \"\")\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"LivelinkConnector.CacheLRUSizeCannotBeNull")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"LivelinkConnector.Cache") +
"\");\n"+
+"    editconnection.cachelrusize.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelrusize.value != \"\" && !isInteger(editconnection.cachelrusize.value))\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"LivelinkConnector.CacheLRUSizeMustBeAnInteger")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"LivelinkConnector.Cache") +
"\");\n"+
+"    editconnection.cachelrusize.focus();\n"+
+"    return false;\n"+
+"  }\n"+
 "  return true;\n"+
 "}\n"+
 "\n"+
@@ -557,15 +587,27 @@ public class LivelinkAuthority extends o
     String serverName = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.livelink.LiveLinkParameters.serverName);
     if (serverName == null)
       serverName = "localhost";
+    
     String serverPort = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.livelink.LiveLinkParameters.serverPort);
     if (serverPort == null)
       serverPort = "2099";
+    
     String serverUserName = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.livelink.LiveLinkParameters.serverUsername);
     if (serverUserName == null)
       serverUserName = "";
+    
     String serverPassword = parameters.getObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.livelink.LiveLinkParameters.serverPassword);
     if (serverPassword == null)
       serverPassword = "";
+    
+    String cacheLifetime = parameters.getParameter(LiveLinkParameters.cacheLifetime);
+    if (cacheLifetime == null)
+      cacheLifetime = "1";
+    
+    String cacheLRUsize = parameters.getParameter(LiveLinkParameters.cacheLRUSize);
+    if (cacheLRUsize == null)
+      cacheLRUsize = "1000";    
+
     org.apache.manifoldcf.crawler.connectors.livelink.MatchMap matchMap = null;
     String usernameRegexp = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.livelink.LiveLinkParameters.userNameRegexp);
     String livelinkUserExpr = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.livelink.LiveLinkParameters.livelinkNameSpec);
@@ -648,6 +690,33 @@ public class LivelinkAuthority extends o
 "<input type=\"hidden\" name=\"livelinkuserexpr\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(livelinkUserExpr)+"\"/>\n"
       );
     }
+    
+    // "Cache" tab
+    if(tabName.equals(Messages.getString(locale,"LivelinkConnector.Cache")))
+    {
+      out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"LivelinkConnector.CacheLifetime")
+ "</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"5\" name=\"cachelifetime\"
value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLifetime) + "\"/>
" + Messages.getBodyString(locale,"LivelinkConnector.minutes") + "</td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"LivelinkConnector.CacheLRUSize")
+ "</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"5\" name=\"cachelrusize\" value=\""
+ org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLRUsize) + "\"/></td>\n"+
+"  </tr>\n"+
+"</table>\n"
+      );
+    }
+    else
+    {
+      // Hiddens for "Cache" tab
+      out.print(
+"<input type=\"hidden\" name=\"cachelifetime\" value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLifetime)
+ "\"/>\n"+
+"<input type=\"hidden\" name=\"cachelrusize\" value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLRUsize)
+ "\"/>\n"
+      );
+    }
+
   }
   
   /** Process a configuration post.
@@ -687,6 +756,15 @@ public class LivelinkAuthority extends o
       matchMap.appendMatchPair(usernameRegexp,livelinkUserExpr);
       parameters.setParameter(org.apache.manifoldcf.crawler.connectors.livelink.LiveLinkParameters.userNameMapping,matchMap.toString());
     }
+
+    String cacheLifetime = variableContext.getParameter("cachelifetime");
+    if (cacheLifetime != null)
+      parameters.setParameter(LiveLinkParameters.cacheLifetime,cacheLifetime);
+
+    String cacheLRUsize = variableContext.getParameter("cachelrusize");
+    if (cacheLRUsize != null)
+      parameters.setParameter(LiveLinkParameters.cacheLRUSize,cacheLRUsize);
+
     return null;
   }
   

Modified: manifoldcf/branches/CONNECTORS-488/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-488/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java?rev=1364202&r1=1364201&r2=1364202&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-488/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
(original)
+++ manifoldcf/branches/CONNECTORS-488/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
Sun Jul 22 01:07:31 2012
@@ -703,6 +703,7 @@ public class MeridioAuthority extends or
     tabsArray.add(Messages.getString(locale,"MeridioConnector.RecordsServer"));
     tabsArray.add(Messages.getString(locale,"MeridioConnector.UserServiceServer"));
     tabsArray.add(Messages.getString(locale,"MeridioConnector.Credentials"));
+    tabsArray.add(Messages.getString(locale,"MeridioConnector.Cache"));
     out.print(
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
@@ -807,6 +808,34 @@ public class MeridioAuthority extends or
 "    editconnection.userName.focus();\n"+
 "    return false;\n"+
 "  }\n"+
+"  if (editconnection.cachelifetime.value == \"\")\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"MeridioConnector.CacheLifetimeCannotBeNull")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"MeridioConnector.Cache") +
"\");\n"+
+"    editconnection.cachelifetime.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelifetime.value != \"\" && !isInteger(editconnection.cachelifetime.value))\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"MeridioConnector.CacheLifetimeMustBeAnInteger")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"MeridioConnector.Cache") +
"\");\n"+
+"    editconnection.cachelifetime.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelrusize.value == \"\")\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"MeridioConnector.CacheLRUSizeCannotBeNull")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"MeridioConnector.Cache") +
"\");\n"+
+"    editconnection.cachelrusize.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.cachelrusize.value != \"\" && !isInteger(editconnection.cachelrusize.value))\n"+
+"  {\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"MeridioConnector.CacheLRUSizeMustBeAnInteger")
+ "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"MeridioConnector.Cache") +
"\");\n"+
+"    editconnection.cachelrusize.focus();\n"+
+"    return false;\n"+
+"  }\n"+
 "\n"+
 "  return true;\n"+
 "}\n"+
@@ -926,6 +955,14 @@ public class MeridioAuthority extends or
     else
       localKeystore = KeystoreManagerFactory.make("",meridioKeystore);
 
+    String cacheLifetime = parameters.getParameter("CacheLifetimeMins");
+    if (cacheLifetime == null)
+      cacheLifetime = "1";
+    
+    String cacheLRUsize = parameters.getParameter("CacheLRUSize");
+    if (cacheLRUsize == null)
+      cacheLRUsize = "1000";    
+
     out.print(
 "<input name=\"configop\" type=\"hidden\" value=\"Continue\"/>\n"
     );
@@ -1129,6 +1166,33 @@ public class MeridioAuthority extends or
 "<input type=\"hidden\" name=\"password\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/>\n"
       );
     }
+    
+    // "Cache" tab
+    if(tabName.equals(Messages.getString(locale,"MeridioConnector.Cache")))
+    {
+      out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"MeridioConnector.CacheLifetime")
+ "</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"5\" name=\"cachelifetime\"
value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLifetime) + "\"/>
" + Messages.getBodyString(locale,"MeridioConnector.minutes") + "</td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"MeridioConnector.CacheLRUSize")
+ "</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"5\" name=\"cachelrusize\" value=\""
+ org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLRUsize) + "\"/></td>\n"+
+"  </tr>\n"+
+"</table>\n"
+      );
+    }
+    else
+    {
+      // Hiddens for "Cache" tab
+      out.print(
+"<input type=\"hidden\" name=\"cachelifetime\" value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLifetime)
+ "\"/>\n"+
+"<input type=\"hidden\" name=\"cachelrusize\" value=\"" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(cacheLRUsize)
+ "\"/>\n"
+      );
+    }
+
   }
   
   /** Process a configuration post.
@@ -1284,6 +1348,15 @@ public class MeridioAuthority extends or
         parameters.setParameter("MeridioKeystore",mgr.getString());
       }
     }
+    
+    String cacheLifetime = variableContext.getParameter("cachelifetime");
+    if (cacheLifetime != null)
+      parameters.setParameter("CacheLifetimeMins",cacheLifetime);
+
+    String cacheLRUsize = variableContext.getParameter("cachelrusize");
+    if (cacheLRUsize != null)
+      parameters.setParameter("CacheLRUSize",cacheLRUsize);
+
     return null;
   }
   



Mime
View raw message