manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1635631 - in /manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main: java/org/apache/manifoldcf/crawler/connectors/jdbc/ native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/
Date Thu, 30 Oct 2014 22:26:36 GMT
Author: kwright
Date: Thu Oct 30 22:26:35 2014
New Revision: 1635631

URL: http://svn.apache.org/r1635631
Log:
Add more UI support to deal with turning security on or off.

Modified:
    manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java
    manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_en_US.properties
    manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_ja_JP.properties
    manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_zh_CN.properties

Modified: manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java?rev=1635631&r1=1635630&r2=1635631&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java
Thu Oct 30 22:26:35 2014
@@ -1121,6 +1121,27 @@ public class JDBCConnector extends org.a
 "      return false;\n"+
 "    }\n"+
 "  }\n"+
+"  if (editjob."+seqPrefix+"aclquery.value != \"\")\n"+
+"  {\n"+
+"    if (editjob."+seqPrefix+"aclquery.value.indexOf(\"$(IDCOLUMN)\") == -1)\n"+
+"    {\n"+
+"      alert(\"" + Messages.getBodyJavascriptString(locale,"JDBCConnector.MustReturnIDCOLUMNInTheResult")
+ "\");\n"+
+"      editjob."+seqPrefix+"aclquery.focus();\n"+
+"      return false;\n"+
+"    }\n"+
+"    if (editjob."+seqPrefix+"aclquery.value.indexOf(\"$(ACCESSTOKENCOLUMN)\") == -1)\n"+
+"    {\n"+
+"      alert(\"" + Messages.getBodyJavascriptString(locale,"JDBCConnector.MustReturnACCESSTOKENCOLUMNInTheResult")
+ "\");\n"+
+"      editjob."+seqPrefix+"aclquery.focus();\n"+
+"      return false;\n"+
+"    }\n"+
+"    if (editjob."+seqPrefix+"aclquery.value.indexOf(\"$(IDLIST)\") == -1)\n"+
+"    {\n"+
+"      alert(\"" + Messages.getBodyJavascriptString(locale,"JDBCConnector.MustUseIDLISTInWHEREClause")
+ "\");\n"+
+"      editjob."+seqPrefix+"aclquery.focus();\n"+
+"      return false;\n"+
+"    }\n"+
+"  }\n"+
 "  if (editjob."+seqPrefix+"dataquery.value == \"\")\n"+
 "  {\n"+
 "    alert(\"" + Messages.getBodyJavascriptString(locale,"JDBCConnector.EnterADataQuery")
+ "\");\n"+
@@ -1255,11 +1276,32 @@ public class JDBCConnector extends org.a
     // Security tab
     // There is no native security, so all we care about are the tokens.
     i = 0;
+    boolean securityOn = true;
+    while (i < ds.getChildCount())
+    {
+      SpecificationNode sn = ds.getChild(i++);
+      if (sn.getType().equals("security"))
+      {
+        String securityValue = sn.getAttributeValue("value");
+        if (securityValue.equals("off"))
+          securityOn = false;
+        else if (securityValue.equals("on"))
+          securityOn = true;
+      }
+    }
 
     if (tabName.equals(Messages.getString(locale,"JDBCConnector.Security")) && connectionSequenceNumber
== actualSequenceNumber)
     {
       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,"JDBCConnector.SecurityColon")+"</nobr></td>\n"+
+"    <td class=\"value\">\n"+
+"      <input type=\"radio\" name=\""+seqPrefix+"specsecurity\" value=\"on\" "+(securityOn?"checked=\"true\"":"")+"
/>"+Messages.getBodyString(locale,"JDBCConnector.Enabled")+"\n"+
+"      <input type=\"radio\" name=\""+seqPrefix+"specsecurity\" value=\"off\" "+((securityOn==false)?"checked=\"true\"":"")+"
/>"+Messages.getBodyString(locale,"JDBCConnector.Disabled")+"\n"+
+"    </td>\n"+
+"  </tr>\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"
       );
       // Go through forced ACL
@@ -1317,6 +1359,9 @@ public class JDBCConnector extends org.a
     }
     else
     {
+      out.print(
+"<input type=\"hidden\" name=\""+seqPrefix+"specsecurity\" value=\""+(securityOn?"on":"off")+"\"/>\n"
+      );
       // Finally, go through forced ACL
       i = 0;
       int k = 0;
@@ -1420,8 +1465,28 @@ public class JDBCConnector extends org.a
       sn.setValue(dataQuery);
       ds.addChild(ds.getChildCount(),sn);
     }
-	
-    String xc = variableContext.getParameter(seqPrefix+"tokencount");
+
+    String xc = variableContext.getParameter(seqPrefix+"specsecurity");
+    if (xc != null)
+    {
+      // Delete all security entries first
+      int i = 0;
+      while (i < ds.getChildCount())
+      {
+        sn = ds.getChild(i);
+        if (sn.getType().equals("security"))
+          ds.removeChild(i);
+        else
+          i++;
+      }
+
+      SpecificationNode node = new SpecificationNode("security");
+      node.setAttribute("value",xc);
+      ds.addChild(ds.getChildCount(),node);
+
+    }
+
+    xc = variableContext.getParameter(seqPrefix+"tokencount");
     if (xc != null)
     {
       // Delete all tokens first
@@ -1486,7 +1551,8 @@ public class JDBCConnector extends org.a
     String idQuery = "";
     String versionQuery = "";
     String dataQuery = "";
-
+    String aclQuery = "";
+    
     int i = 0;
     while (i < ds.getChildCount())
     {
@@ -1509,6 +1575,12 @@ public class JDBCConnector extends org.a
         if (dataQuery == null)
           dataQuery = "";
       }
+      else if (sn.getType().equals(JDBCConstants.aclQueryNode))
+      {
+        aclQuery = sn.getValue();
+        if (aclQuery == null)
+          aclQuery = "";
+      }
     }
 
     out.print(
@@ -1522,12 +1594,40 @@ public class JDBCConnector extends org.a
 "    <td class=\"value\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(versionQuery)+"</td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"JDBCConnector.AccessTokenQuery")
+ "</nobr></td>\n"+
+"    <td class=\"value\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(aclQuery)+"</td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
 "    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"JDBCConnector.DataQuery")
+ "</nobr></td>\n"+
 "    <td class=\"value\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(dataQuery)+"</td>\n"+
 "  </tr>\n"+
 "\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"
     );
+    // Find whether security is on or off
+    i = 0;
+    boolean securityOn = true;
+    while (i < ds.getChildCount())
+    {
+      SpecificationNode sn = ds.getChild(i++);
+      if (sn.getType().equals("security"))
+      {
+        String securityValue = sn.getAttributeValue("value");
+        if (securityValue.equals("off"))
+          securityOn = false;
+        else if (securityValue.equals("on"))
+          securityOn = true;
+      }
+    }
+    out.print(
+"  <tr>\n"+
+"    <td class=\"description\">"+Messages.getBodyString(locale,"JDBCConnector.SecurityColon")+"</td>\n"+
+"    <td class=\"value\">"+(securityOn?Messages.getBodyString(locale,"JDBCConnector.Enabled"):Messages.getBodyString(locale,"JDBCConnector.Disabled"))+"</td>\n"+
+"  </tr>\n"+
+"\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"
+    );
+
     // Go through looking for access tokens
     boolean seenAny = false;
     i = 0;

Modified: manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_en_US.properties?rev=1635631&r1=1635630&r2=1635631&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_en_US.properties
(original)
+++ manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_en_US.properties
Thu Oct 30 22:26:35 2014
@@ -49,6 +49,7 @@ JDBCConnector.EnterADataQuery=Enter a da
 JDBCConnector.MustReturnIDCOLUMNInTheResult2=Must return $(IDCOLUMN) in the result.\\nExample:
SELECT idfield AS $(IDCOLUMN), ...
 JDBCConnector.MustReturnURLCOLUMNInTheResult=Must return $(URLCOLUMN) in the result, containing
the url to use to reach the document.\\nExample: SELECT urlfield AS $(URLCOLUMN), ...
 JDBCConnector.MustReturnDATACOLUMNInTheResult=Must return $(DATACOLUMN) in the result, containing
the document data.\\nExample: SELECT datafield AS $(DATACOLUMN), ...
+JDBCConnector.MustReturnACCESSTOKENCOLUMNInTheResult=Must return $(ACCESSTOKENCOLUMN) in
the result, containing the access token.\\nExample: SELECT actoken AS $(ACCESSTOKENCOLUMN),
...
 JDBCConnector.DeleteToken=Delete token #
 JDBCConnector.AddAccessToken=Add access token
 JDBCConnector.SeedingQuery=Seeding query:
@@ -58,3 +59,6 @@ JDBCConnector.AccessTokens=Access tokens
 JDBCConnector.AccessTokenQuery=Access token query:
 JDBCConnector.returnIdsAndAccessTokensForASetOfDocuments=(return ids and access tokens for
a set of documents;
 JDBCConnector.leaveBlankIfNoSecurityCapability=leave blank if no security capability)
+JDBCConnector.SecurityColon=Security:
+JDBCConnector.Enabled=Enabled
+JDBCConnector.Disabled=Disabled

Modified: manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_ja_JP.properties?rev=1635631&r1=1635630&r2=1635631&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_ja_JP.properties
(original)
+++ manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_ja_JP.properties
Thu Oct 30 22:26:35 2014
@@ -49,6 +49,7 @@ JDBCConnector.EnterADataQuery=デãƒ
 JDBCConnector.MustReturnIDCOLUMNInTheResult2=結果に$(IDCOLUMN)を返す必要があります。\\n例:SELECT
idfield AS $(IDCOLUMN), ...
 JDBCConnector.MustReturnURLCOLUMNInTheResult=結果にコンテンツを取得するURIを含む$(URLCOLUMN)を返す必要があります。\\n例:SELECT
urlfield AS $(URLCOLUMN), ...
 JDBCConnector.MustReturnDATACOLUMNInTheResult=結果にコンテンツ内容を含む$(DATACOLUMN)を返す必要があります。\\n例:SELECT
datafield AS $(DATACOLUMN), ...
+JDBCConnector.MustReturnACCESSTOKENCOLUMNInTheResult=Must return $(ACCESSTOKENCOLUMN) in
the result, containing the access token.\\nExample: SELECT actoken AS $(ACCESSTOKENCOLUMN),
...
 JDBCConnector.DeleteToken=トークンを削除: #
 JDBCConnector.AddAccessToken=アクセストークンを追加
 JDBCConnector.SeedingQuery=シードクエリー:
@@ -58,3 +59,6 @@ JDBCConnector.AccessTokens=アク�
 JDBCConnector.AccessTokenQuery=Access token query:
 JDBCConnector.returnIdsAndAccessTokensForASetOfDocuments=(return ids and access tokens for
a set of documents;
 JDBCConnector.leaveBlankIfNoSecurityCapability=leave blank if no security capability)
+JDBCConnector.SecurityColon=Security:
+JDBCConnector.Enabled=Enabled
+JDBCConnector.Disabled=Disabled

Modified: manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_zh_CN.properties
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_zh_CN.properties?rev=1635631&r1=1635630&r2=1635631&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_zh_CN.properties
(original)
+++ manifoldcf/branches/CONNECTORS-1089/connectors/jdbc/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jdbc/common_zh_CN.properties
Thu Oct 30 22:26:35 2014
@@ -49,6 +49,7 @@ JDBCConnector.EnterADataQuery=请è¾
 JDBCConnector.MustReturnIDCOLUMNInTheResult2=结果需要返回$(IDCOLUMN)。\\n例:
SELECT idfield AS $(IDCOLUMN), ...
 JDBCConnector.MustReturnURLCOLUMNInTheResult=返回结果必须包含取得文档用URI$(URLCOLUMN)。\\n例:
SELECT urlfield AS $(URLCOLUMN), ...
 JDBCConnector.MustReturnDATACOLUMNInTheResult=返回结果必须包含文档内容$(DATACOLUMN)。\\n例:
SELECT datafield AS $(DATACOLUMN), ...
+JDBCConnector.MustReturnACCESSTOKENCOLUMNInTheResult=Must return $(ACCESSTOKENCOLUMN) in
the result, containing the access token.\\nExample: SELECT actoken AS $(ACCESSTOKENCOLUMN),
...
 JDBCConnector.DeleteToken=删除令牌:  #
 JDBCConnector.AddAccessToken=添加访问令牌
 JDBCConnector.SeedingQuery=播种查询: 
@@ -58,3 +59,6 @@ JDBCConnector.AccessTokens=访问�
 JDBCConnector.AccessTokenQuery=Access token query:
 JDBCConnector.returnIdsAndAccessTokensForASetOfDocuments=(return ids and access tokens for
a set of documents;
 JDBCConnector.leaveBlankIfNoSecurityCapability=leave blank if no security capability)
+JDBCConnector.SecurityColon=Security:
+JDBCConnector.Enabled=Enabled
+JDBCConnector.Disabled=Disabled



Mime
View raw message