manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1625485 - in /manifoldcf/branches/dev_1x: ./ connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/ connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/e...
Date Wed, 17 Sep 2014 08:25:31 GMT
Author: kwright
Date: Wed Sep 17 08:25:31 2014
New Revision: 1625485

URL: http://svn.apache.org/r1625485
Log:
Undo commit 1625484; we need to be more judicious because javascript default method names
don't change in the dev_1x branch.

Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java
    manifoldcf/branches/dev_1x/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
    manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
    manifoldcf/branches/dev_1x/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java
    manifoldcf/branches/dev_1x/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java
    manifoldcf/branches/dev_1x/connectors/nulloutput/connector/src/main/java/org/apache/manifoldcf/agents/output/nullconnector/NullConnector.java
    manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
    manifoldcf/branches/dev_1x/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
    manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
  Reverse-merged /manifoldcf/trunk:r1621449

Modified: manifoldcf/branches/dev_1x/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/amazoncloudsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/amazoncloudsearch/AmazonCloudSearchConnector.java
Wed Sep 17 08:25:31 2014
@@ -704,4 +704,24 @@ public class AmazonCloudSearchConnector 
         currentTime + 300000L, currentTime + 3 * 60 * 60000L, -1, false);
   }
   
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecificationForSave";
+  }
+
 }

Modified: manifoldcf/branches/dev_1x/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/elasticsearch/connector/src/main/java/org/apache/manifoldcf/agents/output/elasticsearch/ElasticSearchConnector.java
Wed Sep 17 08:25:31 2014
@@ -261,6 +261,26 @@ public class ElasticSearchConnector exte
     outputResource(EDIT_CONFIG_FORWARD_PARAMETERS, out, locale, config, tabName, null, null);
   }
 
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecificationForSave";
+  }
+
   /** 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.
@@ -436,10 +456,10 @@ public class ElasticSearchConnector exte
   }
 
   @Override
-  public boolean checkMimeTypeIndexable(VersionContext outputDescription, String mimeType,
IOutputCheckActivity activities)
-    throws ManifoldCFException, ServiceInterruption
+  public boolean checkMimeTypeIndexable(String outputDescription,
+      String mimeType) throws ManifoldCFException, ServiceInterruption
   {
-    ElasticSearchSpecs specs = getSpecsCache(outputDescription.getVersionString());
+    ElasticSearchSpecs specs = getSpecsCache(outputDescription);
     return specs.checkMimeType(mimeType);
   }
 
@@ -484,24 +504,11 @@ public class ElasticSearchConnector exte
     return new String[0];
   }
 
-  /** Add (or replace) a document in the output data store using the connector.
-  * This method presumes that the connector object has been configured, and it is thus able
to communicate with the output data store should that be
-  * necessary.
-  *@param documentURI is the URI of the document.  The URI is presumed to be the unique identifier
which the output data store will use to process
-  * and serve the document.  This URI is constructed by the repository connector which fetches
the document, and is thus universal across all output connectors.
-  *@param pipelineDescription includes the description string that was constructed for this
document by the getOutputDescription() method.
-  *@param document is the document data to be processed (handed to the output data store).
-  *@param authorityNameString is the name of the authority responsible for authorizing any
access tokens passed in with the repository document.  May be null.
-  *@param activities is the handle to an object that the implementer of a pipeline connector
may use to perform operations, such as logging processing activity,
-  * or sending a modified document to the next stage in the pipeline.
-  *@return the document status (accepted or permanently rejected).
-  *@throws IOException only if there's a stream error reading the document data.
-  */
   @Override
-  public int addOrReplaceDocumentWithException(String documentURI, VersionContext pipelineDescription,
+  public int addOrReplaceDocument(String documentURI, String outputDescription,
       RepositoryDocument document, String authorityNameString,
       IOutputAddActivity activities) throws ManifoldCFException,
-      ServiceInterruption, IOException
+      ServiceInterruption
   {
     HttpClient client = getSession();
     ElasticSearchConfig config = getConfigParameters(null);

Modified: manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/agents/output/filesystem/FileOutputConnector.java
Wed Sep 17 08:25:31 2014
@@ -452,6 +452,26 @@ public class FileOutputConnector extends
     activities.recordActivity(null, REMOVE_ACTIVITY, null, documentURI, "OK", null);
   }
 
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecificationForSave";
+  }
+
   /** 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.

Modified: manifoldcf/branches/dev_1x/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java
Wed Sep 17 08:25:31 2014
@@ -200,7 +200,7 @@ public class GTSConnector extends org.ap
   *@return true if the mime type is indexable by this connector.
   */
   @Override
-  public boolean checkMimeTypeIndexable(VersionContext outputDescription, String mimeType,
IOutputCheckActivity activities)
+  public boolean checkMimeTypeIndexable(String mimeType)
     throws ManifoldCFException, ServiceInterruption
   {
     return (ingestableMimeTypeMap.get(mimeType) != null);
@@ -213,9 +213,11 @@ public class GTSConnector extends org.ap
   *@return true if the file is indexable.
   */
   @Override
-  public boolean checkDocumentIndexable(VersionContext outputDescription, File localFile,
IOutputCheckActivity activities)
+  public boolean checkDocumentIndexable(File localFile)
     throws ManifoldCFException, ServiceInterruption
   {
+    if (!super.checkDocumentIndexable(localFile))
+      return false;
     int docType = fingerprint(localFile);
     return (docType == DT_TEXT ||
       docType == DT_MSWORD ||
@@ -286,22 +288,21 @@ public class GTSConnector extends org.ap
   /** Add (or replace) a document in the output data store using the connector.
   * This method presumes that the connector object has been configured, and it is thus able
to communicate with the output data store should that be
   * necessary.
+  * The OutputSpecification is *not* provided to this method, because the goal is consistency,
and if output is done it must be consistent with the
+  * output description, since that was what was partly used to determine if output should
be taking place.  So it may be necessary for this method to decode
+  * an output description string in order to determine what should be done.
   *@param documentURI is the URI of the document.  The URI is presumed to be the unique identifier
which the output data store will use to process
   * and serve the document.  This URI is constructed by the repository connector which fetches
the document, and is thus universal across all output connectors.
-  *@param pipelineDescription includes the description string that was constructed for this
document by the getOutputDescription() method.
+  *@param outputDescription is the description string that was constructed for this document
by the getOutputDescription() method.
   *@param document is the document data to be processed (handed to the output data store).
   *@param authorityNameString is the name of the authority responsible for authorizing any
access tokens passed in with the repository document.  May be null.
-  *@param activities is the handle to an object that the implementer of a pipeline connector
may use to perform operations, such as logging processing activity,
-  * or sending a modified document to the next stage in the pipeline.
+  *@param activities is the handle to an object that the implementer of an output connector
may use to perform operations, such as logging processing activity.
   *@return the document status (accepted or permanently rejected).
-  *@throws IOException only if there's a stream error reading the document data.
   */
   @Override
-  public int addOrReplaceDocumentWithException(String documentURI, VersionContext pipelineDescription,
RepositoryDocument document, String authorityNameString, IOutputAddActivity activities)
-    throws ManifoldCFException, ServiceInterruption, IOException
+  public int addOrReplaceDocument(String documentURI, String outputDescription, RepositoryDocument
document, String authorityNameString, IOutputAddActivity activities)
+    throws ManifoldCFException, ServiceInterruption
   {
-    String outputDescription = pipelineDescription.getVersionString();
-	  
     // Establish a session
     getSession();
 
@@ -556,6 +557,26 @@ public class GTSConnector extends org.ap
     );
   }
   
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecificationForSave";
+  }
+
   /** 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.

Modified: manifoldcf/branches/dev_1x/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/agents/output/hdfs/HDFSOutputConnector.java
Wed Sep 17 08:25:31 2014
@@ -256,22 +256,22 @@ public class HDFSOutputConnector extends
   }
 
   /** Add (or replace) a document in the output data store using the connector.
-  * This method presumes that the connector object has been configured, and it is thus able
to communicate with the output data store should that be
-  * necessary.
-  *@param documentURI is the URI of the document.  The URI is presumed to be the unique identifier
which the output data store will use to process
-  * and serve the document.  This URI is constructed by the repository connector which fetches
the document, and is thus universal across all output connectors.
-  *@param pipelineDescription includes the description string that was constructed for this
document by the getOutputDescription() method.
-  *@param document is the document data to be processed (handed to the output data store).
-  *@param authorityNameString is the name of the authority responsible for authorizing any
access tokens passed in with the repository document.  May be null.
-  *@param activities is the handle to an object that the implementer of a pipeline connector
may use to perform operations, such as logging processing activity,
-  * or sending a modified document to the next stage in the pipeline.
-  *@return the document status (accepted or permanently rejected).
-  *@throws IOException only if there's a stream error reading the document data.
-  */
+   * This method presumes that the connector object has been configured, and it is thus able
to communicate with the output data store should that be
+   * necessary.
+   * The OutputSpecification is *not* provided to this method, because the goal is consistency,
and if output is done it must be consistent with the
+   * output description, since that was what was partly used to determine if output should
be taking place.  So it may be necessary for this method to decode
+   * an output description string in order to determine what should be done.
+   *@param documentURI is the URI of the document.  The URI is presumed to be the unique
identifier which the output data store will use to process
+   * and serve the document.  This URI is constructed by the repository connector which fetches
the document, and is thus universal across all output connectors.
+   *@param outputDescription is the description string that was constructed for this document
by the getOutputDescription() method.
+   *@param document is the document data to be processed (handed to the output data store).
+   *@param authorityNameString is the name of the authority responsible for authorizing any
access tokens passed in with the repository document.  May be null.
+   *@param activities is the handle to an object that the implementer of an output connector
may use to perform operations, such as logging processing activity.
+   *@return the document status (accepted or permanently rejected).
+   */
   @Override
-  public int addOrReplaceDocumentWithException(String documentURI, VersionContext pipelineDescription,
RepositoryDocument document, String authorityNameString, IOutputAddActivity activities)
-    throws ManifoldCFException, ServiceInterruption, IOException {
-    String outputDescription = pipelineDescription.getVersionString();
+  public int addOrReplaceDocument(String documentURI, String outputDescription, RepositoryDocument
document, String authorityNameString, IOutputAddActivity activities) throws ManifoldCFException,
ServiceInterruption {
+
     try {
       HDFSOutputSpecs specs = new HDFSOutputSpecs(outputDescription);
 
@@ -391,6 +391,26 @@ public class HDFSOutputConnector extends
     outputResource(VIEW_CONFIGURATION_HTML, out, locale, getConfigParameters(parameters),
null, null, null);
   }
 
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecificationForSave";
+  }
+
   /** 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.

Modified: manifoldcf/branches/dev_1x/connectors/nulloutput/connector/src/main/java/org/apache/manifoldcf/agents/output/nullconnector/NullConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/nulloutput/connector/src/main/java/org/apache/manifoldcf/agents/output/nullconnector/NullConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/nulloutput/connector/src/main/java/org/apache/manifoldcf/agents/output/nullconnector/NullConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/nulloutput/connector/src/main/java/org/apache/manifoldcf/agents/output/nullconnector/NullConnector.java
Wed Sep 17 08:25:31 2014
@@ -168,4 +168,24 @@ public class NullConnector extends org.a
     activities.recordActivity(null,JOB_COMPLETE_ACTIVITY,null,"","OK",null);
   }
 
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecificationForSave";
+  }
+
 }

Modified: manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
Wed Sep 17 08:25:31 2014
@@ -37,7 +37,6 @@ import org.apache.http.protocol.HttpRequ
 import org.apache.manifoldcf.agents.interfaces.IOutputAddActivity;
 import org.apache.manifoldcf.agents.interfaces.IOutputNotifyActivity;
 import org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity;
-import org.apache.manifoldcf.agents.interfaces.IOutputCheckActivity;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
 import org.apache.manifoldcf.agents.output.BaseOutputConnector;
@@ -261,6 +260,31 @@ public class OpenSearchServerConnector e
   }
 
   /**
+  * Obtain the name of the form check javascript method to call.
+  *
+  * @param connectionSequenceNumber is the unique number of this connection within the job.
+  * @return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s" + connectionSequenceNumber + "_checkSpecification";
+  }
+
+  /**
+  * Obtain the name of the form presave check javascript method to call.
+  *
+  * @param connectionSequenceNumber is the unique number of this connection within the job.
+  * @return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(
+      int connectionSequenceNumber)
+  {
+    return "s" + connectionSequenceNumber + "_checkSpecificationForSave";
+  }
+
+  /**
   * 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
@@ -407,21 +431,29 @@ public class OpenSearchServerConnector e
   }
 
   @Override
-  public boolean checkLengthIndexable(VersionContext outputDescription, long length, IOutputCheckActivity
activities)
+  public boolean checkLengthIndexable(String outputDescription, long length)
       throws ManifoldCFException, ServiceInterruption
   {
-    OpenSearchServerSpecs specs = getSpecsCache(outputDescription.getVersionString());
+    OpenSearchServerSpecs specs = getSpecsCache(outputDescription);
     long maxFileSize = specs.getMaxFileSize();
     if (length > maxFileSize)
       return false;
+    return super.checkLengthIndexable(outputDescription, length);
+  }
+
+  @Override
+  public boolean checkDocumentIndexable(String outputDescription, File localFile)
+      throws ManifoldCFException, ServiceInterruption
+  {
     return true;
   }
 
   @Override
-  public boolean checkMimeTypeIndexable(VersionContext outputDescription, String mimeType,
IOutputCheckActivity activities)
+  public boolean checkMimeTypeIndexable(String outputDescription,
+      String mimeType)
       throws ManifoldCFException, ServiceInterruption
   {
-    OpenSearchServerSpecs specs = getSpecsCache(outputDescription.getVersionString());
+    OpenSearchServerSpecs specs = getSpecsCache(outputDescription);
     return specs.checkMimeType(mimeType);
   }
 
@@ -437,10 +469,10 @@ public class OpenSearchServerConnector e
    * @return true if the file is indexable.
    */
   @Override
-  public boolean checkURLIndexable(VersionContext outputDescription, String url, IOutputCheckActivity
activities)
+  public boolean checkURLIndexable(String outputDescription, String url)
       throws ManifoldCFException, ServiceInterruption
   {
-    OpenSearchServerSpecs specs = getSpecsCache(outputDescription.getVersionString());
+    OpenSearchServerSpecs specs = getSpecsCache(outputDescription);
     return specs.checkExtension(FilenameUtils.getExtension(url));
   }
 
@@ -518,24 +550,11 @@ public class OpenSearchServerConnector e
     }
   }
 
-  /** Add (or replace) a document in the output data store using the connector.
-  * This method presumes that the connector object has been configured, and it is thus able
to communicate with the output data store should that be
-  * necessary.
-  *@param documentURI is the URI of the document.  The URI is presumed to be the unique identifier
which the output data store will use to process
-  * and serve the document.  This URI is constructed by the repository connector which fetches
the document, and is thus universal across all output connectors.
-  *@param pipelineDescription includes the description string that was constructed for this
document by the getOutputDescription() method.
-  *@param document is the document data to be processed (handed to the output data store).
-  *@param authorityNameString is the name of the authority responsible for authorizing any
access tokens passed in with the repository document.  May be null.
-  *@param activities is the handle to an object that the implementer of a pipeline connector
may use to perform operations, such as logging processing activity,
-  * or sending a modified document to the next stage in the pipeline.
-  *@return the document status (accepted or permanently rejected).
-  *@throws IOException only if there's a stream error reading the document data.
-  */
   @Override
-  public int addOrReplaceDocumentWithException(String documentURI, VersionContext pipelineDescription,
+  public int addOrReplaceDocument(String documentURI, String outputDescription,
       RepositoryDocument document, String authorityNameString,
       IOutputAddActivity activities)
-      throws ManifoldCFException, ServiceInterruption, IOException
+      throws ManifoldCFException, ServiceInterruption
   {
     HttpClient client = getSession();
     OpenSearchServerConfig config = getConfigParameters(null);

Modified: manifoldcf/branches/dev_1x/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
Wed Sep 17 08:25:31 2014
@@ -31,7 +31,6 @@ import java.util.HashSet;
 import org.apache.manifoldcf.agents.interfaces.IOutputAddActivity;
 import org.apache.manifoldcf.agents.interfaces.IOutputNotifyActivity;
 import org.apache.manifoldcf.agents.interfaces.IOutputRemoveActivity;
-import org.apache.manifoldcf.agents.interfaces.IOutputCheckActivity;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
 import org.apache.manifoldcf.core.interfaces.Specification;
@@ -517,7 +516,7 @@ public class SolrConnector extends org.a
   *@return true if the mime type is indexable by this connector.
   */
   @Override
-  public boolean checkMimeTypeIndexable(VersionContext outputDescription, String mimeType,
IOutputCheckActivity activities)
+  public boolean checkMimeTypeIndexable(String outputDescription, String mimeType)
     throws ManifoldCFException, ServiceInterruption
   {
     getSession();
@@ -527,7 +526,7 @@ public class SolrConnector extends org.a
         return false;
       if (excludedMimeTypes != null && excludedMimeTypes.get(mimeType) != null)
         return false;
-      return true;
+      return super.checkMimeTypeIndexable(outputDescription,mimeType);
     }
     return acceptableMimeTypes.contains(mimeType.toLowerCase(Locale.ROOT));
   }
@@ -539,33 +538,34 @@ public class SolrConnector extends org.a
   *@return true if the file is indexable.
   */
   @Override
-  public boolean checkLengthIndexable(VersionContext outputDescription, long length, IOutputCheckActivity
activities)
+  public boolean checkLengthIndexable(String outputDescription, long length)
     throws ManifoldCFException, ServiceInterruption
   {
     getSession();
     if (maxDocumentLength != null && length > maxDocumentLength.longValue())
       return false;
-    return true;
+    return super.checkLengthIndexable(outputDescription,length);
   }
 
   /** Add (or replace) a document in the output data store using the connector.
   * This method presumes that the connector object has been configured, and it is thus able
to communicate with the output data store should that be
   * necessary.
+  * The OutputSpecification is *not* provided to this method, because the goal is consistency,
and if output is done it must be consistent with the
+  * output description, since that was what was partly used to determine if output should
be taking place.  So it may be necessary for this method to decode
+  * an output description string in order to determine what should be done.
   *@param documentURI is the URI of the document.  The URI is presumed to be the unique identifier
which the output data store will use to process
   * and serve the document.  This URI is constructed by the repository connector which fetches
the document, and is thus universal across all output connectors.
-  *@param pipelineDescription includes the description string that was constructed for this
document by the getOutputDescription() method.
+  *@param outputDescription is the description string that was constructed for this document
by the getOutputDescription() method.
   *@param document is the document data to be processed (handed to the output data store).
   *@param authorityNameString is the name of the authority responsible for authorizing any
access tokens passed in with the repository document.  May be null.
-  *@param activities is the handle to an object that the implementer of a pipeline connector
may use to perform operations, such as logging processing activity,
-  * or sending a modified document to the next stage in the pipeline.
+  *@param activities is the handle to an object that the implementer of an output connector
may use to perform operations, such as logging processing activity.
   *@return the document status (accepted or permanently rejected).
-  *@throws IOException only if there's a stream error reading the document data.
   */
   @Override
-  public int addOrReplaceDocumentWithException(String documentURI, VersionContext pipelineDescription,
RepositoryDocument document, String authorityNameString, IOutputAddActivity activities)
-    throws ManifoldCFException, ServiceInterruption, IOException
+  public int addOrReplaceDocument(String documentURI, String outputDescription, RepositoryDocument
document, String authorityNameString, IOutputAddActivity activities)
+    throws ManifoldCFException, ServiceInterruption
   {
-    SpecPacker sp = new SpecPacker(pipelineDescription.getVersionString());
+    SpecPacker sp = new SpecPacker(outputDescription);
 
     // Establish a session
     getSession();
@@ -2177,6 +2177,26 @@ public class SolrConnector extends org.a
     );
   }
   
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecificationForSave";
+  }
+
   /** 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.

Modified: manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java?rev=1625485&r1=1625484&r2=1625485&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java
(original)
+++ manifoldcf/branches/dev_1x/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java
Wed Sep 17 08:25:31 2014
@@ -101,9 +101,12 @@ public interface IPipelineConnector exte
   /** Add (or replace) a document in the output data store using the connector.
   * This method presumes that the connector object has been configured, and it is thus able
to communicate with the output data store should that be
   * necessary.
+  * The OutputSpecification is *not* provided to this method, because the goal is consistency,
and if output is done it must be consistent with the
+  * output description, since that was what was partly used to determine if output should
be taking place.  So it may be necessary for this method to decode
+  * an output description string in order to determine what should be done.
   *@param documentURI is the URI of the document.  The URI is presumed to be the unique identifier
which the output data store will use to process
   * and serve the document.  This URI is constructed by the repository connector which fetches
the document, and is thus universal across all output connectors.
-  *@param pipelineDescription includes the description string that was constructed for this
document by the getOutputDescription() method.
+  *@param outputDescription is the description string that was constructed for this document
by the getOutputDescription() method.
   *@param document is the document data to be processed (handed to the output data store).
   *@param authorityNameString is the name of the authority responsible for authorizing any
access tokens passed in with the repository document.  May be null.
   *@param activities is the handle to an object that the implementer of a pipeline connector
may use to perform operations, such as logging processing activity,



Mime
View raw message