manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1847993 - in /manifoldcf/trunk/connectors/elasticsearch/connector/src/main: java/org/apache/manifoldcf/agents/output/elasticsearch/ native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/ resources/org/apache/manifoldcf/agents/outp...
Date Sun, 02 Dec 2018 12:44:21 GMT
Author: kwright
Date: Sun Dec  2 12:44:21 2018
New Revision: 1847993

URL: http://svn.apache.org/viewvc?rev=1847993&view=rev
Log:
Add UI support for SSL keystore ElasticSearch output connector.

Modified:
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConfig.java
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchParam.java
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_en_US.properties
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_es_ES.properties
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_fr_FR.properties
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_ja_JP.properties
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_zh_CN.properties
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration.js
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Parameters.html
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Server.html
    manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/viewConfiguration.html

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConfig.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConfig.java?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConfig.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConfig.java
Sun Dec  2 12:44:21 2018
@@ -19,10 +19,16 @@
 
 package org.apache.manifoldcf.agents.output.elasticsearch;
 
+import org.apache.manifoldcf.core.interfaces.IDFactory;
+import org.apache.manifoldcf.connectorcommon.interfaces.IKeystoreManager;
+import org.apache.manifoldcf.connectorcommon.interfaces.KeystoreManagerFactory;
 import org.apache.manifoldcf.core.interfaces.ConfigParams;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
+import org.apache.manifoldcf.core.interfaces.IThreadContext;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 
 import java.util.Locale;
+import java.io.IOException;
 
 public class ElasticSearchConfig extends ElasticSearchParam
 {
@@ -39,6 +45,7 @@ public class ElasticSearchConfig extends
     ParameterEnum.SERVERLOCATION,
     ParameterEnum.USERNAME,
     ParameterEnum.PASSWORD,
+    ParameterEnum.SERVERKEYSTORE,
     ParameterEnum.INDEXNAME,
     ParameterEnum.INDEXTYPE,
     ParameterEnum.USEMAPPERATTACHMENTS,
@@ -63,22 +70,30 @@ public class ElasticSearchConfig extends
     for (ParameterEnum param : CONFIGURATIONLIST)
     {
       final boolean isPassword = param.name().endsWith("PASSWORD");
+      // Nothing special is needed for keystores here; the keystore in string format is the
value
+      // of the field
+      //final boolean isKeystore = param.name().endsWith("KEYSTORE");
       String value;
-      if (isPassword) {
-        value = params.getObfuscatedParameter(param.name());
-      }
-      else
+      if (isPassword)
       {
-        value = params.getParameter(param.name());
+        put(param, params.getObfuscatedParameter(param.name()), param.defaultValue);
       }
-      if (value == null)
+      else
       {
-        value = param.defaultValue;
+        put(param, params.getParameter(param.name()), param.defaultValue);
       }
-      put(param, value);
     }
   }
 
+  private void put(ParameterEnum param, String value, String defaultValue)
+  {
+    if (value == null) {
+      put(param, defaultValue);
+    } else {
+      put(param, value);
+    }
+  }
+  
   /** @return a unique identifier for one index on one ElasticSearch instance. */
   public String getUniqueIndexIdentifier()
   {
@@ -90,23 +105,85 @@ public class ElasticSearchConfig extends
     return sb.toString();
   }
 
-  public final static void contextToConfig(IPostParameters variableContext,
-      ConfigParams parameters)
+  public final static String contextToConfig(IThreadContext threadContext,
+      IPostParameters variableContext,
+      ConfigParams parameters) throws ManifoldCFException
   {
+    String rval = null;
     for (ParameterEnum param : CONFIGURATIONLIST)
     {
       final String paramName = param.name().toLowerCase(Locale.ROOT);
       final boolean isPassword = param.name().endsWith("PASSWORD");
-      String p = variableContext.getParameter(paramName);
-      if (p != null)
+      final boolean isKeystore = param.name().endsWith("KEYSTORE");
+      if (isKeystore)
       {
-        if (isPassword)
+        String keystoreValue = variableContext.getParameter(paramName); //parameters.getParameter(SharePointConfig.PARAM_SERVERKEYSTORE);
+        IKeystoreManager mgr;
+        if (keystoreValue != null && keystoreValue.length() > 0)
+          mgr = KeystoreManagerFactory.make("",keystoreValue);
+        else
+          mgr = KeystoreManagerFactory.make("");
+
+        // All the functionality needed to gather keystore-related variables must go here.
+        // Specifically, we need to also handle add/delete signals from the UI as well as
+        // preserving the original keystore and making sure it gets gathered if no other
signal
+        // is present.
+        String configOp = variableContext.getParameter(paramName + "_op");
+        if (configOp != null)
         {
-          parameters.setObfuscatedParameter(param.name(), p);
+          if (configOp.equals("Delete"))
+          {
+            String alias = variableContext.getParameter(paramName + "_alias");
+            mgr.remove(alias);
+          }
+          else if (configOp.equals("Add"))
+          {
+            String alias = IDFactory.make(threadContext);
+            byte[] certificateValue = variableContext.getBinaryBytes(paramName + "_certificate");
+            java.io.InputStream is = new java.io.ByteArrayInputStream(certificateValue);
+            String certError = null;
+            try
+            {
+              mgr.importCertificate(alias,is);
+            }
+            catch (Throwable e)
+            {
+              certError = e.getMessage();
+            }
+            finally
+            {
+              try
+              {
+                is.close();
+              }
+              catch (IOException e)
+              {
+                // Don't report anything
+              }
+            }
+
+            if (certError != null)
+            {
+              // Redirect to error page
+              rval = "Illegal certificate: "+certError;
+            }
+          }
         }
-        else
+        parameters.setParameter(param.name(), mgr.getString());
+      }
+      else
+      {
+        String p = variableContext.getParameter(paramName);
+        if (p != null)
         {
-          parameters.setParameter(param.name(), p);
+          if (isPassword)
+          {
+            parameters.setObfuscatedParameter(param.name(), p);
+          }
+          else
+          {
+            parameters.setParameter(param.name(), p);
+          }
         }
       }
     }
@@ -119,6 +196,8 @@ public class ElasticSearchConfig extends
         useMapperAttachments = "false";
       parameters.setParameter(ParameterEnum.USEMAPPERATTACHMENTS.name(), useMapperAttachments);
     }
+    
+    return rval;
   }
 
   final public String getServerLocation()

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
Sun Dec  2 12:44:21 2018
@@ -208,7 +208,7 @@ public class ElasticSearchConnector exte
       Locale locale, ElasticSearchParam params,
       String tabName, Integer sequenceNumber, Integer currentSequenceNumber) throws ManifoldCFException
   {
-    Map<String,String> paramMap = null;
+    Map<String,Object> paramMap = null;
     if (params != null) {
       paramMap = params.buildMap(out);
       if (tabName != null) {
@@ -219,12 +219,12 @@ public class ElasticSearchConnector exte
     }
     else
     {
-      paramMap = new HashMap<String,String>();
+      paramMap = new HashMap<String,Object>();
     }
     if (sequenceNumber != null)
       paramMap.put("SeqNum",sequenceNumber.toString());
 
-    Messages.outputResourceWithVelocity(out, locale, resName, paramMap, true);
+    Messages.outputResourceWithVelocity(out, locale, resName, paramMap);
   }
 
   @Override
@@ -244,11 +244,15 @@ public class ElasticSearchConnector exte
       IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName)
       throws ManifoldCFException, IOException
   {
+    try {
     super.outputConfigurationBody(threadContext, out, locale, parameters,
         tabName);
     ElasticSearchConfig config = this.getConfigParameters(parameters);
     outputResource(EDIT_CONFIG_FORWARD_SERVER, out, locale, config, tabName, null, null);
     outputResource(EDIT_CONFIG_FORWARD_PARAMETERS, out, locale, config, tabName, null, null);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
   }
 
   /** Build a Set of ElasticSearch parameters. If configParams is null,
@@ -284,8 +288,7 @@ public class ElasticSearchConnector exte
       IPostParameters variableContext, ConfigParams parameters)
       throws ManifoldCFException
   {
-    ElasticSearchConfig.contextToConfig(variableContext, parameters);
-    return null;
+    return ElasticSearchConfig.contextToConfig(threadContext, variableContext, parameters);
   }
 
   /** Convert an unqualified ACL to qualified form.

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchParam.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchParam.java?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchParam.java
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchParam.java
Sun Dec  2 12:44:21 2018
@@ -21,8 +21,13 @@ package org.apache.manifoldcf.agents.out
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.connectorcommon.interfaces.IKeystoreManager;
+import org.apache.manifoldcf.connectorcommon.interfaces.KeystoreManagerFactory;
 
 import org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchParam.ParameterEnum;
 
@@ -43,6 +48,8 @@ public class ElasticSearchParam extends
 
     PASSWORD(""),
 
+    SERVERKEYSTORE(""),
+    
     INDEXTYPE("generic"),
 
     USEMAPPERATTACHMENTS("false"),
@@ -78,18 +85,44 @@ public class ElasticSearchParam extends
     super(params.length);
   }
 
-  final public Map<String, String> buildMap(IHTTPOutput out)
+  final public Map<String, Object> buildMap(IHTTPOutput out) throws ManifoldCFException
   {
-    Map<String, String> rval = new HashMap<String, String>();
+    Map<String, Object> rval = new HashMap<>();
     for (Map.Entry<ParameterEnum, String> entry : this.entrySet())
     {
       final String key = entry.getKey().name();
       final boolean isPassword = key.endsWith("PASSWORD");
+      final boolean isKeystore = key.endsWith("KEYSTORE");
       if (isPassword) 
       {
         // Do not put passwords in plain text in forms
         rval.put(key, out.mapPasswordToKey(entry.getValue()));
       }
+      else if (isKeystore)
+      {
+        String keystore = entry.getValue();
+        IKeystoreManager localKeystore;
+        if (keystore == null || keystore.length() == 0)
+          localKeystore = KeystoreManagerFactory.make("");
+        else
+          localKeystore = KeystoreManagerFactory.make("",keystore);
+
+        List<Map<String,String>> certificates = new ArrayList<Map<String,String>>();
+        
+        String[] contents = localKeystore.getContents();
+        for (String alias : contents)
+        {
+          String description = localKeystore.getDescription(alias);
+          if (description.length() > 128)
+            description = description.substring(0,125) + "...";
+          Map<String,String> certificate = new HashMap<String,String>();
+          certificate.put("ALIAS", alias);
+          certificate.put("DESCRIPTION", description);
+          certificates.add(certificate);
+        }
+        rval.put(key, keystore);
+        rval.put(key + "_LIST", certificates);
+      }
       else
       {
         rval.put(key, entry.getValue());

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_en_US.properties?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_en_US.properties
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_en_US.properties
Sun Dec  2 12:44:21 2018
@@ -21,6 +21,13 @@ ElasticSearchConnector.ServerLocation=Se
 ElasticSearchConnector.URLColon=(URL):
 ElasticSearchConnector.UserNameColon=User name:
 ElasticSearchConnector.PasswordColon=User password:
+ElasticSearchConnector.SSLCertificateListColon=SSL certificate list:
+ElasticSearchConnector.NoCertificatesPresent=No certificates present
+ElasticSearchConnector.DeleteCert=Delete certificate
+ElasticSearchConnector.Delete=Delete
+ElasticSearchConnector.AddCert=Add certificate
+ElasticSearchConnector.Add=Add
+ElasticSearchConnector.Certificate=Certificate
 ElasticSearchConnector.IndexNameColon=Index name:
 ElasticSearchConnector.IndexTypeColon=Index type:
 ElasticSearchConnector.UseMapperAttachmentsColon=Use mapper-attachments:
@@ -32,6 +39,7 @@ ElasticSearchConnector.IndexingDateAttri
 ElasticSearchConnector.MimeTypeAttributeNameColon=Mime type field name:
 
 ElasticSearchConnector.PleaseSupplyValidElasticSearchLocation=Please supply a valid ElasticSearch
server location
+ElasticSearchConnector.ChooseACertificateFile=Please choose a certificate file
 ElasticSearchConnector.PleaseSupplyValidIndexName=Please supply a valid index name
 ElasticSearchConnector.PleaseSupplyValidIndexType=Please supply a valid index type
 ElasticSearchConnector.ContentAttributeNameRequiredUnlessMapperAttachments=Content field
name required unless using mapper attachments

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_es_ES.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_es_ES.properties?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_es_ES.properties
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_es_ES.properties
Sun Dec  2 12:44:21 2018
@@ -21,6 +21,13 @@ ElasticSearchConnector.ServerLocation=Ub
 ElasticSearchConnector.URLColon=(URL):
 ElasticSearchConnector.UserNameColon=User name:
 ElasticSearchConnector.PasswordColon=User password:
+ElasticSearchConnector.SSLCertificateListColon=SSL certificate list:
+ElasticSearchConnector.NoCertificatesPresent=No certificates present
+ElasticSearchConnector.DeleteCert=Delete certificate
+ElasticSearchConnector.Delete=Delete
+ElasticSearchConnector.AddCert=Add certificate
+ElasticSearchConnector.Add=Add
+ElasticSearchConnector.Certificate=Certificate
 ElasticSearchConnector.IndexNameColon=El nombre de índice:
 ElasticSearchConnector.IndexTypeColon=tipo de índice:
 ElasticSearchConnector.UseMapperAttachmentsColon=Use mapper-attachments:
@@ -32,6 +39,7 @@ ElasticSearchConnector.IndexingDateAttri
 ElasticSearchConnector.MimeTypeAttributeNameColon=Mime type field name:
 
 ElasticSearchConnector.PleaseSupplyValidElasticSearchLocation=Por favor suministre una posición
de servidor válida elástica de búsqueda
+ElasticSearchConnector.ChooseACertificateFile=Please choose a certificate file
 ElasticSearchConnector.PleaseSupplyValidIndexName=Por favor proporcione un nombre de índice
válido
 ElasticSearchConnector.PleaseSupplyValidIndexType=Por favor, facilite un tipo de índice
válido
 

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_fr_FR.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_fr_FR.properties?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_fr_FR.properties
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_fr_FR.properties
Sun Dec  2 12:44:21 2018
@@ -20,10 +20,18 @@ ElasticSearchConnector.ServerLocation=Em
 ElasticSearchConnector.URLColon=(URL):
 ElasticSearchConnector.UserNameColon=User name:
 ElasticSearchConnector.PasswordColon=User password:
+ElasticSearchConnector.SSLCertificateListColon=SSL certificate list:
+ElasticSearchConnector.NoCertificatesPresent=No certificates present
+ElasticSearchConnector.DeleteCert=Delete certificate
+ElasticSearchConnector.Delete=Delete
+ElasticSearchConnector.AddCert=Add certificate
+ElasticSearchConnector.Add=Add
+ElasticSearchConnector.Certificate=Certificate
 ElasticSearchConnector.IndexNameColon=Nom de l'index:
 ElasticSearchConnector.IndexTypeColon=Type d'index:
 
 ElasticSearchConnector.PleaseSupplyValidElasticSearchLocation=Veuillez fournir en emplacement
valide pour le serveur Elasticsearch
+ElasticSearchConnector.ChooseACertificateFile=Please choose a certificate file
 ElasticSearchConnector.PleaseSupplyValidIndexName=Veuillez fournir un nom valide pour l'index
 ElasticSearchConnector.PleaseSupplyValidIndexType=Veuillez fournir un type d'index valide
 

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_ja_JP.properties?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_ja_JP.properties
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_ja_JP.properties
Sun Dec  2 12:44:21 2018
@@ -21,6 +21,13 @@ ElasticSearchConnector.ServerLocation=ã
 ElasticSearchConnector.URLColon=(URL):
 ElasticSearchConnector.UserNameColon=User name:
 ElasticSearchConnector.PasswordColon=User password:
+ElasticSearchConnector.SSLCertificateListColon=SSL certificate list:
+ElasticSearchConnector.NoCertificatesPresent=No certificates present
+ElasticSearchConnector.DeleteCert=Delete certificate
+ElasticSearchConnector.Delete=Delete
+ElasticSearchConnector.AddCert=Add certificate
+ElasticSearchConnector.Add=Add
+ElasticSearchConnector.Certificate=Certificate
 ElasticSearchConnector.IndexNameColon=インデックス名:
 ElasticSearchConnector.IndexTypeColon=タイプ名:
 ElasticSearchConnector.UseMapperAttachmentsColon=Use mapper-attachments:
@@ -32,6 +39,7 @@ ElasticSearchConnector.IndexingDateAttri
 ElasticSearchConnector.MimeTypeAttributeNameColon=Mime type field name:
 
 ElasticSearchConnector.PleaseSupplyValidElasticSearchLocation=正しいElasticSearchサーバURLを入力してください
+ElasticSearchConnector.ChooseACertificateFile=Please choose a certificate file
 ElasticSearchConnector.PleaseSupplyValidIndexName=正しいインデックス名を入力してください
 ElasticSearchConnector.PleaseSupplyValidIndexType=正しいタイプ名を入力してください
 ElasticSearchConnector.ContentAttributeNameRequiredUnlessMapperAttachments=Content field
name required unless using mapper attachments

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_zh_CN.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_zh_CN.properties?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_zh_CN.properties
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/native2ascii/org/apache/manifoldcf/agents/output/elasticsearch/common_zh_CN.properties
Sun Dec  2 12:44:21 2018
@@ -21,6 +21,13 @@ ElasticSearchConnector.ServerLocation=æ
 ElasticSearchConnector.URLColon=(URL):
 ElasticSearchConnector.UserNameColon=User name:
 ElasticSearchConnector.PasswordColon=User password:
+ElasticSearchConnector.SSLCertificateListColon=SSL certificate list:
+ElasticSearchConnector.NoCertificatesPresent=No certificates present
+ElasticSearchConnector.DeleteCert=Delete certificate
+ElasticSearchConnector.Delete=Delete
+ElasticSearchConnector.AddCert=Add certificate
+ElasticSearchConnector.Add=Add
+ElasticSearchConnector.Certificate=Certificate
 ElasticSearchConnector.IndexNameColon=索引名: 
 ElasticSearchConnector.IndexTypeColon=索引类型: 
 ElasticSearchConnector.UseMapperAttachmentsColon=Use mapper-attachments:
@@ -32,6 +39,7 @@ ElasticSearchConnector.IndexingDateAttri
 ElasticSearchConnector.MimeTypeAttributeNameColon=Mime type field name:
 
 ElasticSearchConnector.PleaseSupplyValidElasticSearchLocation=请输入有效的Elasticsearch服务器URL
+ElasticSearchConnector.ChooseACertificateFile=Please choose a certificate file
 ElasticSearchConnector.PleaseSupplyValidIndexName=请输入有效的索引名
 ElasticSearchConnector.PleaseSupplyValidIndexType=请输入有效的索引类型
 ElasticSearchConnector.ContentAttributeNameRequiredUnlessMapperAttachments=Content field
name required unless using mapper attachments

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration.js
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration.js?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration.js
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration.js
Sun Dec  2 12:44:21 2018
@@ -83,5 +83,27 @@ function checkConfigForSave() {
   }
   return true;
 }
+
+function ServerKeystoreDeleteCertificate(aliasName)
+{
+  editconnection.serverkeystore_alias.value = aliasName;
+  editconnection.serverkeystore_op.value = "Delete";
+  postForm();
+}
+
+function ServerKeystoreAddCertificate()
+{
+  if (editconnection.serverkeystore_certificate.value == "")
+  {
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('ElasticSearchConnector.ChooseACertificateFile'))");
+    editconnection.serverkeystore_certificate.focus();
+  }
+  else
+  {
+    editconnection.serverkeystore_op.value = "Add";
+    postForm();
+  }
+}
+
 //-->
 </script>

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Parameters.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Parameters.html?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Parameters.html
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Parameters.html
Sun Dec  2 12:44:21 2018
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-#if($TABNAME == $ResourceBundle.getString('ElasticSearchConnector.Parameters'))
+#if($TabName == $ResourceBundle.getString('ElasticSearchConnector.Parameters'))
 
 <table class="displaytable">
   <tr>

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Server.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Server.html?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Server.html
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editConfiguration_Server.html
Sun Dec  2 12:44:21 2018
@@ -15,7 +15,9 @@
  limitations under the License.
 -->
 
-#if($TABNAME == $ResourceBundle.getString('ElasticSearchConnector.Server'))
+<input type="hidden" name="serverkeystore" value="$Encoder.attributeEscape($SERVERKEYSTORE)"/>
+
+#if($TabName == $ResourceBundle.getString('ElasticSearchConnector.Server'))
 
 <table class="displaytable">
   <tr>
@@ -39,6 +41,36 @@
     <td class="value"><input name="password" type="password" value="$Encoder.attributeEscape($PASSWORD)"
size="24" />
     </td>
   </tr>
+
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ElasticSearchConnector.SSLCertificateListColon'))</nobr></td>
+    <td class="value">
+      <input type="hidden" name="serverkeystore_op" value="Continue"/>
+      <input type="hidden" name="serverkeystore_alias" value=""/>
+      <table class="displaytable">
+  #if($SERVERKEYSTORE_LIST.size() == 0)
+        <tr><td class="message" colspan="2">$Encoder.bodyEscape($ResourceBundle.getString('ElasticSearchConnector.NoCertificatesPresent'))</td></tr>
+  #else
+    #foreach($certificate in $SERVERKEYSTORE_LIST)
+        <tr>
+          <td class="description">
+            <input type="button" onclick='Javascript:ServerKeystoreDeleteCertificate("$Encoder.attributeJavascriptEscape($certificate.get('ALIAS'))")'
alt="$Encoder.attributeEscape($ResourceBundle.getString('ElasticSearchConnector.DeleteCert'))$Encoder.attributeEscape($certificate.get('ALIAS'))"
value="$Encoder.attributeEscape($ResourceBundle.getString('ElasticSearchConnector.Delete'))"/>
+          </td>
+          <td class="value">
+            $Encoder.bodyEscape($certificate.get('DESCRIPTION'))
+          </td>
+        </tr>
+    #end
+  #end
+      </table>
+      <input type="button" onclick='Javascript:ServerKeystoreAddCertificate()' alt="$Encoder.attributeEscape($ResourceBundle.getString('ElasticSearchConnector.AddCert'))"
value="$Encoder.attributeEscape($ResourceBundle.getString('ElasticSearchConnector.Add'))"/>&nbsp;
+      $Encoder.bodyEscape($ResourceBundle.getString('ElasticSearchConnector.Certificate'))&nbsp;
+      <input name="serverkeystore_certificate" size="50" type="file"/>
+    </td>
+  </tr>
+
 </table>
 
 #else

Modified: manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/viewConfiguration.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/viewConfiguration.html?rev=1847993&r1=1847992&r2=1847993&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/viewConfiguration.html
(original)
+++ manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/viewConfiguration.html
Sun Dec  2 12:44:21 2018
@@ -31,6 +31,27 @@
   </tr>
   
   <tr><td class="separator" colspan="2"><hr/></td></tr>
+  
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ElasticSearchConnector.SSLCertificateListColon'))</nobr></td>
+    <td class="value">
+      <table class="displaytable">
+  #if($SERVERKEYSTORE_LIST.size() == 0)
+        <tr><td class="message" colspan="1">$Encoder.bodyEscape($ResourceBundle.getString('ElasticSearchConnector.NoCertificatesPresent'))</td></tr>
+  #else
+    #foreach($certificate in $SERVERKEYSTORE_LIST)
+        <tr>
+          <td class="value">
+            $Encoder.bodyEscape($certificate.get('DESCRIPTION'))
+          </td>
+        </tr>
+    #end
+  #end
+      </table>
+    </td>
+  </tr>
+
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
 
   <tr>
     <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ElasticSearchConnector.IndexNameColon'))</nobr></td>
@@ -68,4 +89,5 @@
     <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ElasticSearchConnector.MimeTypeAttributeNameColon'))</nobr></td>
     <td class="value">$Encoder.bodyEscape($MIMETYPEATTRIBUTENAME)</td>
   </tr>
+  
 </table>
\ No newline at end of file



Mime
View raw message