manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From min...@apache.org
Subject svn commit: r1441322 - in /manifoldcf/trunk: ./ connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/ connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/
Date Fri, 01 Feb 2013 07:01:13 GMT
Author: minoru
Date: Fri Feb  1 07:01:12 2013
New Revision: 1441322

URL: http://svn.apache.org/viewvc?rev=1441322&view=rev
Log:
Fix for CONNECTOR-631

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConfig.java
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
    manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_en_US.properties
    manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_ja_JP.properties

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1441322&r1=1441321&r2=1441322&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Feb  1 07:01:12 2013
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 1.2-dev =====================
 
+CONNECTORS-631: Support Znode path by Solr Output Connection.
+(Minoru Osuka)
+
 CONNECTORS-632: Get mvn-bootstrap scripts working again as
 intended.
 (Maciej Li¿ewski, Karl Wright)

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConfig.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConfig.java?rev=1441322&r1=1441321&r2=1441322&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConfig.java
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConfig.java
Fri Feb  1 07:01:12 2013
@@ -44,6 +44,9 @@ public class SolrConfig
   /** Zookeeper port */
   public static final String ATTR_PORT = "port";
   
+  /** Zookeeper znode path */
+  public static final String PARAM_ZOOKEEPER_ZNODE_PATH = "ZooKeeper znode path";
+  
   /** ZooKeeper client timeout */
   public static final String PARAM_ZOOKEEPER_CLIENT_TIMEOUT = "ZooKeeper client timeout";
   /** ZooKeeper connect timeout */

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java?rev=1441322&r1=1441321&r2=1441322&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
Fri Feb  1 07:01:12 2013
@@ -280,7 +280,12 @@ public class SolrConnector extends org.a
             zookeeperString.append(cn.getAttributeValue(SolrConfig.ATTR_HOST)).append(":").append(cn.getAttributeValue(SolrConfig.ATTR_PORT));
           }
         }
-        String zookeeperHost = zookeeperString.toString();
+        
+        String znodePath = params.getParameter(SolrConfig.PARAM_ZOOKEEPER_ZNODE_PATH);
+        if (znodePath == null)
+          znodePath = "";
+        
+        String zookeeperHost = zookeeperString.toString() + znodePath;
         
         // Get collection
         String collection = params.getParameter(SolrConfig.PARAM_COLLECTION);
@@ -777,6 +782,12 @@ public class SolrConnector extends org.a
 "    editconnection.commitwithin.focus();\n"+
 "    return false;\n"+
 "  }\n"+
+"  if (editconnection.znodepath.value != \"\" && editconnection.znodepath.value.substring(0,1)
!= \"/\")\n"+
+"  {\n"+
+"    alert(\""+Messages.getBodyJavascriptString(locale,"SolrConnector.ZnodePathMustStartWithACharacter")+"\");\n"+
+"    editconnection.znodepath.focus();\n"+
+"    return false;\n"+
+"  }\n"+
 "  return true;\n"+
 "}\n"+
 "\n"+
@@ -866,6 +877,12 @@ public class SolrConnector extends org.a
 "    editconnection.commitwithin.focus();\n"+
 "    return false;\n"+
 "  }\n"+
+"  if (editconnection.znodepath.value != \"\" && editconnection.znodepath.value.substring(0,1)
!= \"/\")\n"+
+"  {\n"+
+"    alert(\""+Messages.getBodyJavascriptString(locale,"SolrConnector.ZnodePathMustStartWithACharacter")+"\");\n"+
+"    editconnection.znodepath.focus();\n"+
+"    return false;\n"+
+"  }\n"+
 "  return true;\n"+
 "}\n"+
 "\n"+
@@ -975,6 +992,10 @@ public class SolrConnector extends org.a
     if (core == null)
       core = "";
 
+    String znodePath = parameters.getParameter(SolrConfig.PARAM_ZOOKEEPER_ZNODE_PATH);
+    if (znodePath == null)
+    	znodePath = "";
+    
     String collection = parameters.getParameter(SolrConfig.PARAM_COLLECTION);
     if (collection == null)
       collection = "collection1";
@@ -1319,6 +1340,13 @@ public class SolrConnector extends org.a
 "  </tr>\n"+
 "  <tr><td colspan=\"2\" class=\"separator\"><hr/></td></tr>\n"+
 "  <tr>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"SolrConnector.ZnodePath")
+ "</nobr></td>\n"+
+"    <td class=\"value\">\n"+
+"      <input name=\"znodepath\" type=\"text\" size=\"16\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(znodePath)+"\"/>\n"+
+"    </td>\n"+
+"  </tr>\n"+
+"  <tr><td colspan=\"2\" class=\"separator\"><hr/></td></tr>\n"+
+"  <tr>\n"+
 "    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"SolrConnector.CollectionName")
+ "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input name=\"collection\" type=\"text\" size=\"16\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(collection)+"\"/>\n"+
@@ -1370,6 +1398,7 @@ public class SolrConnector extends org.a
       }
       out.print(
 "<input type=\"hidden\" name=\"count_zookeeper\" value=\""+k+"\"/>\n"+
+"<input type=\"hidden\" name=\"znodepath\" value=\""+znodePath+"\"/>\n"+
 "<input type=\"hidden\" name=\"zkclienttimeout\" value=\""+zkClientTimeout+"\"/>\n"+
 "<input type=\"hidden\" name=\"zkconnecttimeout\" value=\""+zkConnectTimeout+"\"/>\n"
       );
@@ -1682,6 +1711,10 @@ public class SolrConnector extends org.a
     if (socketTimeout != null)
       parameters.setParameter(SolrConfig.PARAM_SOCKET_TIMEOUT,socketTimeout);
 
+    String znodePath = variableContext.getParameter("znodepath");
+    if (znodePath != null)
+      parameters.setParameter(SolrConfig.PARAM_ZOOKEEPER_ZNODE_PATH,znodePath);
+    
     String zkClientTimeout = variableContext.getParameter("zkclienttimeout");
     if (zkClientTimeout != null)
       parameters.setParameter(SolrConfig.PARAM_ZOOKEEPER_CLIENT_TIMEOUT,zkClientTimeout);

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_en_US.properties?rev=1441322&r1=1441321&r2=1441322&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_en_US.properties
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_en_US.properties
Fri Feb  1 07:01:12 2013
@@ -28,6 +28,7 @@ SolrConnector.SolrCloud=SolrCloud
 SolrConnector.ZookeeperHosts=ZooKeeper hosts:
 SolrConnector.Host=Host
 SolrConnector.Port=Port
+SolrConnector.ZnodePath=Znode path:
 SolrConnector.Protocol=Protocol:
 SolrConnector.ServerName=Server name:
 SolrConnector.Port=Port:
@@ -73,6 +74,7 @@ SolrConnector.ChooseACertificateFile=Cho
 SolrConnector.ZookeeperHostCannotBeNull=ZooKeeper host cannot be null
 SolrConnector.ZookeeperPortCannotBeNull=ZooKeeper port cannot be null
 SolrConnector.ZookeeperPortMustBeAnInteger=ZooKeeper port must be an integer
+SolrConnector.ZnodePathMustStartWithACharacter=Znode path must start with a  '/' character
 SolrConnector.PleaseSupplyAValidSolrServerName=Please supply a valid Solr server name
 SolrConnector.SolrServerPortMustBeAValidInteger=Solr server port must be a valid integer
 SolrConnector.WebApplicationNameCannotHaveCharacters=Web application name cannot have '/'
characters

Modified: manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_ja_JP.properties?rev=1441322&r1=1441321&r2=1441322&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_ja_JP.properties
(original)
+++ manifoldcf/trunk/connectors/solr/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/solr/common_ja_JP.properties
Fri Feb  1 07:01:12 2013
@@ -28,6 +28,7 @@ SolrConnector.SolrCloud=SolrCloud
 SolrConnector.ZookeeperHosts=ZooKeeperホスト:
 SolrConnector.Host=ホスト
 SolrConnector.Port=ポート
+SolrConnector.ZnodePath=Znodeパス:
 SolrConnector.Protocol=プロトコル:
 SolrConnector.ServerName=サーバ名:
 SolrConnector.Port=ポート:
@@ -72,6 +73,7 @@ SolrConnector.AddFieldMapping=フã‚
 SolrConnector.ZookeeperHostCannotBeNull=ZooKeeperホストはNullにできません
 SolrConnector.ZookeeperPortCannotBeNull=ZooKeeperポートはNullにできません
 SolrConnector.ZookeeperPortMustBeAnInteger=ZooKeeperポートには整数を入力してください
+SolrConnector.ZnodePathMustStartWithACharacter=Znodeパスは「/」から始めてください
 SolrConnector.ChooseACertificateFile=証明書ファイルを選択してください
 SolrConnector.PleaseSupplyAValidSolrServerName=正しいSolrサーバ名を入力してください
 SolrConnector.SolrServerPortMustBeAValidInteger=Solrサーバポート番号には整数を入力してください



Mime
View raw message