Author: kwright
Date: Tue Sep 23 12:53:02 2014
New Revision: 1626992
URL: http://svn.apache.org/r1626992
Log:
Remove ElasticSearch specification tab. Part of CONNECTORS-982.
Removed:
manifoldcf/trunk/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchSpecs.java
manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editSpecification.js
manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/editSpecification_ElasticSearch.html
manifoldcf/trunk/connectors/elasticsearch/connector/src/main/resources/org/apache/manifoldcf/agents/output/elasticsearch/viewSpecification.html
Modified:
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
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=1626992&r1=1626991&r2=1626992&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
Tue Sep 23 12:53:02 2014
@@ -80,7 +80,6 @@ public class ElasticSearchConnector exte
{ ELASTICSEARCH_INDEXATION_ACTIVITY, ELASTICSEARCH_DELETION_ACTIVITY,
ELASTICSEARCH_OPTIMIZE_ACTIVITY };
- private final static String ELASTICSEARCH_TAB_ELASTICSEARCH =
"ElasticSearchConnector.ElasticSearch";
private final static String ELASTICSEARCH_TAB_PARAMETERS =
"ElasticSearchConnector.Parameters";
/** Forward to the javascript to check the configuration parameters */
@@ -92,15 +91,6 @@ public class ElasticSearchConnector exte
/** Forward to the HTML template to view the configuration parameters */
private static final String VIEW_CONFIG_FORWARD = "viewConfiguration.html";
- /** Forward to the javascript to check the specification parameters for the
job */
- private static final String EDIT_SPEC_HEADER_FORWARD =
"editSpecification.js";
-
- /** Forward to the template to edit the configuration parameters for the job
*/
- private static final String EDIT_SPEC_FORWARD_ELASTICSEARCH =
"editSpecification_ElasticSearch.html";
-
- /** Forward to the template to view the specification parameters for the job
*/
- private static final String VIEW_SPEC_FORWARD = "viewSpecification.html";
-
/** Connection expiration interval */
private static final long EXPIRATION_INTERVAL = 60000L;
@@ -261,108 +251,6 @@ public class ElasticSearchConnector exte
outputResource(EDIT_CONFIG_FORWARD_PARAMETERS, out, locale, config,
tabName, null, null);
}
- /** Output the specification header section.
- * This method is called in the head section of a job page which has selected
a pipeline connection of the current type. Its purpose is to add the required
tabs
- * to the list, and to output any javascript methods that might be needed by
the job editing HTML.
- *@param out is the output to which any HTML should be sent.
- *@param locale is the preferred local of the output.
- *@param os is the current pipeline specification for this connection.
- *@param connectionSequenceNumber is the unique number of this connection
within the job.
- *@param tabsArray is an array of tab names. Add to this array any tab names
that are specific to the connector.
- */
- @Override
- public void outputSpecificationHeader(IHTTPOutput out, Locale locale,
Specification os,
- int connectionSequenceNumber, List<String> tabsArray)
- throws ManifoldCFException, IOException
- {
- super.outputSpecificationHeader(out, locale, os, connectionSequenceNumber,
tabsArray);
- tabsArray.add(Messages.getString(locale, ELASTICSEARCH_TAB_ELASTICSEARCH));
-
- outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, null, null, new
Integer(connectionSequenceNumber), null);
- }
-
- final private SpecificationNode getSpecNode(Specification os)
- {
- int l = os.getChildCount();
- for (int i = 0; i < l; i++)
- {
- SpecificationNode node = os.getChild(i);
- if (ElasticSearchSpecs.ELASTICSEARCH_SPECS_NODE.equals(node.getType()))
- {
- return node;
- }
- }
- return null;
- }
-
- /** Output the specification body section.
- * This method is called in the body section of a job page which has selected
a pipeline connection of the current type. Its purpose is to present the
required form elements for editing.
- * The coder can presume that the HTML that is output from this configuration
will be within appropriate <html>, <body>, and <form> tags. The name of the
- * form is "editjob".
- *@param out is the output to which any HTML should be sent.
- *@param locale is the preferred local of the output.
- *@param os is the current pipeline specification for this job.
- *@param connectionSequenceNumber is the unique number of this connection
within the job.
- *@param actualSequenceNumber is the connection within the job that has
currently been selected.
- *@param tabName is the current tab name.
- */
- @Override
- public void outputSpecificationBody(IHTTPOutput out, Locale locale,
Specification os,
- int connectionSequenceNumber, int actualSequenceNumber, String tabName)
- throws ManifoldCFException, IOException
- {
-
- ElasticSearchSpecs specs = getSpecParameters(os);
-
- outputResource(EDIT_SPEC_FORWARD_ELASTICSEARCH, out, locale, specs,
tabName, new Integer(connectionSequenceNumber), new
Integer(actualSequenceNumber));
- }
-
- /** Process a specification post.
- * This method is called at the start of job's edit or view page, whenever
there is a possibility that form data for a connection has been
- * posted. Its purpose is to gather form information and modify the
transformation specification accordingly.
- * The name of the posted form is "editjob".
- *@param variableContext contains the post data, including binary file-upload
information.
- *@param locale is the preferred local of the output.
- *@param os is the current pipeline specification for this job.
- *@param connectionSequenceNumber is the unique number of this connection
within the job.
- *@return null if all is well, or a string error message if there is an error
that should prevent saving of the job (and cause a redirection to an error
page).
- */
- @Override
- public String processSpecificationPost(IPostParameters variableContext,
Locale locale, Specification os,
- int connectionSequenceNumber)
- throws ManifoldCFException
- {
- ConfigurationNode specNode = getSpecNode(os);
- boolean bAdd = (specNode == null);
- if (bAdd)
- {
- specNode = new SpecificationNode(
- ElasticSearchSpecs.ELASTICSEARCH_SPECS_NODE);
- }
- ElasticSearchSpecs.contextToSpecNode(variableContext, specNode,
connectionSequenceNumber);
- if (bAdd)
- os.addChild(os.getChildCount(), specNode);
- return null;
- }
-
- /** View specification.
- * This method is called in the body section of a job's view page. Its
purpose is to present the pipeline specification information to the user.
- * The coder can presume that the HTML that is output from this configuration
will be within appropriate <html> and <body> tags.
- *@param out is the output to which any HTML should be sent.
- *@param locale is the preferred local of the output.
- *@param connectionSequenceNumber is the unique number of this connection
within the job.
- *@param os is the current pipeline specification for this job.
- */
- @Override
- public void viewSpecification(IHTTPOutput out, Locale locale, Specification
os,
- int connectionSequenceNumber)
- throws ManifoldCFException, IOException
- {
- outputResource(VIEW_SPEC_FORWARD, out, locale, getSpecParameters(os),
null, new Integer(connectionSequenceNumber),null);
-
- }
-
-
/** Build a Set of ElasticSearch parameters. If configParams is null,
* getConfiguration() is used.
*
@@ -375,51 +263,11 @@ public class ElasticSearchConnector exte
return new ElasticSearchConfig(configParams);
}
- final private ElasticSearchSpecs getSpecParameters(Specification os)
- throws ManifoldCFException
- {
- return new ElasticSearchSpecs(getSpecNode(os));
- }
-
@Override
public VersionContext getPipelineDescription(Specification os)
throws ManifoldCFException
{
- ElasticSearchSpecs specs = new ElasticSearchSpecs(getSpecNode(os));
- return new VersionContext(specs.toJson().toString(),params,os);
- }
-
- @Override
- public boolean checkLengthIndexable(VersionContext outputDescription, long
length, IOutputCheckActivity activities)
- throws ManifoldCFException, ServiceInterruption
- {
- ElasticSearchSpecs specs = new
ElasticSearchSpecs(getSpecNode(outputDescription.getSpecification()));
- long maxFileSize = specs.getMaxFileSize();
- if (length > maxFileSize)
- return false;
- return super.checkLengthIndexable(outputDescription, length, activities);
- }
-
- /** Pre-determine whether a document's URL is indexable by this connector.
This method is used by participating repository connectors
- * to help filter out documents that are not worth indexing.
- *@param outputDescription is the document's output version.
- *@param url is the URL of the document.
- *@return true if the file is indexable.
- */
- @Override
- public boolean checkURLIndexable(VersionContext outputDescription, String
url, IOutputCheckActivity activities)
- throws ManifoldCFException, ServiceInterruption
- {
- ElasticSearchSpecs specs = new
ElasticSearchSpecs(getSpecNode(outputDescription.getSpecification()));
- return specs.checkExtension(FilenameUtils.getExtension(url));
- }
-
- @Override
- public boolean checkMimeTypeIndexable(VersionContext outputDescription,
String mimeType, IOutputCheckActivity activities)
- throws ManifoldCFException, ServiceInterruption
- {
- ElasticSearchSpecs specs = new
ElasticSearchSpecs(getSpecNode(outputDescription.getSpecification()));
- return specs.checkMimeType(mimeType);
+ return new VersionContext("",params,os);
}
@Override
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=1626992&r1=1626991&r2=1626992&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
Tue Sep 23 12:53:02 2014
@@ -39,29 +39,7 @@ public class ElasticSearchParam extends
INDEXTYPE("generictype"),
- FIELDLIST(""),
-
- MAXFILESIZE("16777216"),
-
- MIMETYPES(
- "application/msword\n"
- + "application/vnd.ms-excel\n"
- +
"application/vnd.openxmlformats-officedocument.wordprocessingml.document\n"
- +
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\n"
- + "text/html\n"
- + "application/pdf\n"
- + "application/vnd.ms-powerpoint\n"
- +
"application/vnd.openxmlformats-officedocument.presentationml.presentation\n"
- + "application/vnd.oasis.opendocument.text\n"
- + "application/vnd.oasis.opendocument.spreadsheet\n"
- + "application/vnd.oasis.opendocument.formula\n"
- + "application/rtf\n" + "text/plain\n" + "audio/mpeg\n"
- + "audio/x-wav\n" + "audio/ogg\n" + "audio/flac\n"
- + "application/x-bittorrent"),
-
- EXTENSIONS("doc\n" + "docx\n" + "xls\n" + "xlsx\n" + "ppt\n" +
"pptx\n"
- + "html\n" + "pdf\n" + "odt\n" + "ods\n" + "rtf\n" +
"txt\n" + "mp3\n"
- + "mp4\n" + "wav\n" + "ogg\n" + "flac\n" + "torrent");
+ FIELDLIST("");
final protected String defaultValue;