manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1626026 [1/11] - in /manifoldcf/branches/dev_1x: ./ connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/al...
Date Thu, 18 Sep 2014 16:57:00 GMT
Author: kwright
Date: Thu Sep 18 16:56:59 2014
New Revision: 1626026

URL: http://svn.apache.org/r1626026
Log:
Pull up repository connection UI changes from trunk, part of CONNECTORS-977.

Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
    manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification.js
    manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification_LuceneQuery.html
    manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
    manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification.js
    manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification_CMISQuery.html
    manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/viewSpecification.html
    manifoldcf/branches/dev_1x/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java
    manifoldcf/branches/dev_1x/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
    manifoldcf/branches/dev_1x/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification.js
    manifoldcf/branches/dev_1x/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification_DropboxPath.html
    manifoldcf/branches/dev_1x/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification_Security.html
    manifoldcf/branches/dev_1x/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/EmailConnector.java
    manifoldcf/branches/dev_1x/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationHeader.js
    manifoldcf/branches/dev_1x/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/Specification_Filter.html
    manifoldcf/branches/dev_1x/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/Specification_Metadata.html
    manifoldcf/branches/dev_1x/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
    manifoldcf/branches/dev_1x/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
    manifoldcf/branches/dev_1x/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java
    manifoldcf/branches/dev_1x/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java
    manifoldcf/branches/dev_1x/connectors/googledrive/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/googledrive/editSpecification_googledrive.js
    manifoldcf/branches/dev_1x/connectors/googledrive/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/googledrive/editSpecification_googledriveQuery.html
    manifoldcf/branches/dev_1x/connectors/googledrive/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/googledrive/editSpecification_googledriveSecurity.html
    manifoldcf/branches/dev_1x/connectors/hdfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/hdfs/HDFSRepositoryConnector.java
    manifoldcf/branches/dev_1x/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
    manifoldcf/branches/dev_1x/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java
    manifoldcf/branches/dev_1x/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
    manifoldcf/branches/dev_1x/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/editSpecification_jira.js
    manifoldcf/branches/dev_1x/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/editSpecification_jiraQuery.html
    manifoldcf/branches/dev_1x/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/editSpecification_jiraSecurity.html
    manifoldcf/branches/dev_1x/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
    manifoldcf/branches/dev_1x/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
    manifoldcf/branches/dev_1x/connectors/rss/   (props changed)
    manifoldcf/branches/dev_1x/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
    manifoldcf/branches/dev_1x/connectors/rss/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/rss/tests/NavigationDerbyUI.java
    manifoldcf/branches/dev_1x/connectors/sharepoint/   (props changed)
    manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
    manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/sharepoint/editSpecification.js
    manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/sharepoint/editSpecification_Metadata.html
    manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/sharepoint/editSpecification_Paths.html
    manifoldcf/branches/dev_1x/connectors/sharepoint/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/sharepoint/editSpecification_Security.html
    manifoldcf/branches/dev_1x/connectors/tika/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/tika/editSpecification.js
    manifoldcf/branches/dev_1x/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
    manifoldcf/branches/dev_1x/connectors/webcrawler/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/webcrawler/tests/NavigationDerbyUI.java
    manifoldcf/branches/dev_1x/connectors/wiki/   (props changed)
    manifoldcf/branches/dev_1x/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
  Reverse-merged /manifoldcf/trunk:r1625856,1625861,1625957
  Merged /manifoldcf/trunk:r1621855,1622740

Modified: manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java?rev=1626026&r1=1626025&r2=1626026&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java (original)
+++ manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java Thu Sep 18 16:56:59 2014
@@ -50,6 +50,7 @@ import org.apache.manifoldcf.core.interf
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.interfaces.Specification;
 import org.apache.manifoldcf.core.interfaces.SpecificationNode;
 import org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector;
 import org.apache.manifoldcf.crawler.interfaces.DocumentSpecification;
@@ -101,6 +102,12 @@ public class AlfrescoRepositoryConnector
   /** Tab name parameter for managin the view of the Web UI */
   private static final String TAB_NAME_PARAM = "TabName";
   
+  /** The sequence number parameter */
+  private static final String SEQ_NUM_PARAM = "SeqNum";
+  
+  /** The selected sequence number parameter */
+  private static final String SELECTED_NUM_PARAM = "SelectedNum";
+  
   /** The Lucene Query label for the configuration tab of the job settings */
   private static final String TAB_LABEL_LUCENE_QUERY_RESOURCE = "AlfrescoConnector.LuceneQuery";
   /** Alfresco Server configuration tab name */
@@ -638,7 +645,7 @@ public class AlfrescoRepositoryConnector
   public String processConfigurationPost(IThreadContext threadContext,
       IPostParameters variableContext, Locale locale, ConfigParams parameters)
       throws ManifoldCFException {
-
+        
     String username = variableContext.getParameter(AlfrescoConfig.USERNAME_PARAM);
     if (username != null) {
       parameters.setParameter(AlfrescoConfig.USERNAME_PARAM, username);
@@ -684,7 +691,7 @@ public class AlfrescoRepositoryConnector
 
   /** Fill in Velocity parameters for the LuceneQuery tab.
   */
-  private static void fillInLuceneQueryParameters(Map<String,String> paramMap, DocumentSpecification ds)
+  private static void fillInLuceneQueryParameters(Map<String,String> paramMap, Specification ds)
   {
     int i = 0;
     String luceneQuery = "";
@@ -698,47 +705,48 @@ public class AlfrescoRepositoryConnector
     paramMap.put(AlfrescoConfig.LUCENE_QUERY_PARAM, luceneQuery);
   }
 
-  /**
-   * View specification. This method is called in the body section of a job's
-   * view page. Its purpose is to present the document 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 ds
-   *          is the current document specification for this job.
-   */
+  /** View specification.
+  * This method is called in the body section of a job's view page.  Its purpose is to present the document
+  * 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.
+  * The connector will be connected before this method can be called.
+  *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document specification for this job.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  */
   @Override
-  public void viewSpecification(IHTTPOutput out, Locale locale, DocumentSpecification ds)
-      throws ManifoldCFException, IOException {
+  public void viewSpecification(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber)
+    throws ManifoldCFException, IOException {
     Map<String,String> paramMap = new HashMap<String,String>();
         
     // Fill in parameters from all tabs
     fillInLuceneQueryParameters(paramMap, ds);
+    paramMap.put(SEQ_NUM_PARAM, Integer.toString(connectionSequenceNumber));
 
     outputResource(VIEW_SPEC_FORWARD, out, locale, paramMap);
   }
 
-  /**
-   * 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 document specification accordingly. The name of the posted form
-   * is "editjob".
-   * 
-   * @param variableContext
-   *          contains the post data, including binary file-upload information.
-   * @param ds
-   *          is the current document specification for this 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).
-   */
+  /** 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
+  * document specification accordingly.  The name of the posted form is always "editjob".
+  * The connector will be connected before this method can be called.
+  *@param variableContext contains the post data, including binary file-upload information.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document 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, DocumentSpecification ds) throws ManifoldCFException {
-    String luceneQuery = variableContext.getParameter(AlfrescoConfig.LUCENE_QUERY_PARAM);
+  public String processSpecificationPost(IPostParameters variableContext, Locale locale, Specification ds,
+    int connectionSequenceNumber)
+    throws ManifoldCFException {
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
+    String luceneQuery = variableContext.getParameter(seqPrefix + AlfrescoConfig.LUCENE_QUERY_PARAM);
     if (luceneQuery != null) {
       int i = 0;
       while (i < ds.getChildCount()) {
@@ -757,59 +765,81 @@ public class AlfrescoRepositoryConnector
     return null;
   }
 
-  /**
-   * Output the specification body section. This method is called in the body
-   * section of a job page which has selected a repository 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 ds
-   *          is the current document specification for this job.
-   * @param tabName
-   *          is the current tab name.
-   */
+  /** 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 void outputSpecificationBody(IHTTPOutput out, Locale locale,
-      DocumentSpecification ds, String tabName) throws ManifoldCFException,
-      IOException {
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+    //return "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";
+    //return "checkSpecificationForSave";
+  }
+
+  /** Output the specification body section.
+  * This method is called in the body section of a job page which has selected a repository 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 always "editjob".
+  * The connector will be connected before this method can be called.
+  *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document 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.  (actualSequenceNumber, tabName) form a unique tuple within
+  *  the job.
+  */
+  @Override
+  public void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber, int actualSequenceNumber, String tabName)
+    throws ManifoldCFException, IOException {
     
     // Do all tabs in turn.
         
     // LuceneQuery tab
     Map<String,String> paramMap = new HashMap<String,String>();
     paramMap.put(TAB_NAME_PARAM, tabName);
+    paramMap.put(SEQ_NUM_PARAM, Integer.toString(connectionSequenceNumber));
+    paramMap.put(SELECTED_NUM_PARAM, Integer.toString(actualSequenceNumber));
+
     fillInLuceneQueryParameters(paramMap, ds);
     outputResource(EDIT_SPEC_FORWARD_LUCENEQUERY, out, locale, paramMap);
   }
 
-  /**
-   * Output the specification header section. This method is called in the head
-   * section of a job page which has selected a repository 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 ds
-   *          is the current document specification for this job.
-   * @param tabsArray
-   *          is an array of tab names. Add to this array any tab names that are
-   *          specific to the connector.
-   */
+  /** Output the specification header section.
+  * This method is called in the head section of a job page which has selected a repository 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.
+  * The connector will be connected before this method can be called.
+  *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document specification for this job.
+  *@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, DocumentSpecification ds, List<String> tabsArray)
-      throws ManifoldCFException, IOException {
+  public void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber, List<String> tabsArray)
+    throws ManifoldCFException, IOException {
     // Add LuceneQuery tab
     tabsArray.add(Messages.getString(locale,TAB_LABEL_LUCENE_QUERY_RESOURCE));
         
     // Fill in parameters from all tabs
     Map<String,String> paramMap = new HashMap<String,String>();
-        
+    paramMap.put(SEQ_NUM_PARAM, Integer.toString(connectionSequenceNumber));
+
     // LuceneQuery tab
     fillInLuceneQueryParameters(paramMap, ds);
 

Modified: manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification.js
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification.js?rev=1626026&r1=1626025&r2=1626026&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification.js (original)
+++ manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification.js Thu Sep 18 16:56:59 2014
@@ -17,16 +17,5 @@
 
 <script type="text/javascript">
 <!--
-function checkSpecification()
-{
-  // Does nothing right now.
-  return true;
-}
- 
-function SpecOp(n, opValue, anchorvalue)
-{
-  eval("editjob."+n+".value = \""+opValue+"\"");
-  postFormSetAnchor(anchorvalue);
-}
 //-->
 </script>
\ No newline at end of file

Modified: manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification_LuceneQuery.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification_LuceneQuery.html?rev=1626026&r1=1626025&r2=1626026&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification_LuceneQuery.html (original)
+++ manifoldcf/branches/dev_1x/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification_LuceneQuery.html Thu Sep 18 16:56:59 2014
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-#if($TABNAME == $ResourceBundle.getString('AlfrescoConnector.LuceneQuery'))
+#if($TABNAME == $ResourceBundle.getString('AlfrescoConnector.LuceneQuery') && ${SEQNUM} == ${SELECTEDNUM})
 
 <table class="displaytable">
   <tr>
@@ -31,7 +31,7 @@
     </td>
     <td class="value">
       <nobr>
-        <input type="text" size="120" name="luceneQuery" value="$Encoder.attributeEscape($LUCENEQUERY)" />
+        <input type="text" size="120" name="s${SEQNUM}_luceneQuery" value="$Encoder.attributeEscape($LUCENEQUERY)" />
       </nobr>
     </td>
   </tr>
@@ -39,6 +39,6 @@
 
 #else
 
-<input type="hidden" name="luceneQuery" value="$Encoder.attributeEscape($LUCENEQUERY)" />
+<input type="hidden" name="s${SEQNUM}_luceneQuery" value="$Encoder.attributeEscape($LUCENEQUERY)" />
 
 #end

Modified: manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1626026&r1=1626025&r2=1626026&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java (original)
+++ manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java Thu Sep 18 16:56:59 2014
@@ -62,6 +62,7 @@ import org.apache.manifoldcf.core.interf
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.interfaces.Specification;
 import org.apache.manifoldcf.core.interfaces.SpecificationNode;
 import org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector;
 import org.apache.manifoldcf.crawler.interfaces.DocumentSpecification;
@@ -913,7 +914,7 @@ public class CmisRepositoryConnector ext
 
   /** Fill in specification Velocity parameter map for CMISQuery tab.
   */
-  private static void fillInCMISQuerySpecificationMap(Map<String,String> newMap, DocumentSpecification ds)
+  private static void fillInCMISQuerySpecificationMap(Map<String,String> newMap, Specification ds)
   {
     int i = 0;
     String cmisQuery = "";
@@ -927,22 +928,23 @@ public class CmisRepositoryConnector ext
     newMap.put(CmisConfig.CMIS_QUERY_PARAM, cmisQuery);
   }
 
-  /**
-   * View specification. This method is called in the body section of a job's
-   * view page. Its purpose is to present the document 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 ds
-   *          is the current document specification for this job.
-   */
+  /** View specification.
+  * This method is called in the body section of a job's view page.  Its purpose is to present the document
+  * 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.
+  * The connector will be connected before this method can be called.
+  *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document specification for this job.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  */
   @Override
-  public void viewSpecification(IHTTPOutput out, Locale locale, DocumentSpecification ds)
-      throws ManifoldCFException, IOException {
+  public void viewSpecification(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber)
+    throws ManifoldCFException, IOException {
   
     Map<String,String> paramMap = new HashMap<String,String>();
+    paramMap.put("SeqNum", Integer.toString(connectionSequenceNumber));
 
     // Fill in the map with data from all tabs
     fillInCMISQuerySpecificationMap(paramMap, ds);
@@ -950,25 +952,25 @@ public class CmisRepositoryConnector ext
     outputResource(VIEW_SPEC_FORWARD, out, locale, paramMap);
   }
 
-  /**
-   * 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 document specification accordingly. The name of the posted form
-   * is "editjob".
-   * 
-   * @param variableContext
-   *          contains the post data, including binary file-upload information.
-   * @param ds
-   *          is the current document specification for this 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).
-   */
+  /** 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
+  * document specification accordingly.  The name of the posted form is always "editjob".
+  * The connector will be connected before this method can be called.
+  *@param variableContext contains the post data, including binary file-upload information.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document 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,
-      DocumentSpecification ds) throws ManifoldCFException {
-    String cmisQuery = variableContext.getParameter(CmisConfig.CMIS_QUERY_PARAM);
+  public String processSpecificationPost(IPostParameters variableContext, Locale locale, Specification ds,
+    int connectionSequenceNumber)
+    throws ManifoldCFException {
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
+    String cmisQuery = variableContext.getParameter(seqPrefix + CmisConfig.CMIS_QUERY_PARAM);
     if (cmisQuery != null) {
       int i = 0;
       while (i < ds.getChildCount()) {
@@ -987,55 +989,77 @@ public class CmisRepositoryConnector ext
     return null;
   }
 
-  /**
-   * Output the specification body section. This method is called in the body
-   * section of a job page which has selected a repository 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 ds
-   *          is the current document specification for this job.
-   * @param tabName
-   *          is the current tab name.
-   */
+  /** 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 void outputSpecificationBody(IHTTPOutput out,
-      Locale locale, DocumentSpecification ds, String tabName) throws ManifoldCFException,
-      IOException {
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "s"+connectionSequenceNumber+"_checkSpecification";
+    //return "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";
+    //return "checkSpecificationForSave";
+  }
+
+  /** Output the specification body section.
+  * This method is called in the body section of a job page which has selected a repository 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 always "editjob".
+  * The connector will be connected before this method can be called.
+  *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document 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.  (actualSequenceNumber, tabName) form a unique tuple within
+  *  the job.
+  */
+  @Override
+  public void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber, int actualSequenceNumber, String tabName)
+    throws ManifoldCFException, IOException {
 
     // Output CMISQuery tab
     Map<String,String> paramMap = new HashMap<String,String>();
     paramMap.put("TabName", tabName);
+    paramMap.put("SeqNum", Integer.toString(connectionSequenceNumber));
+    paramMap.put("SelectedNum", Integer.toString(actualSequenceNumber));
+
     fillInCMISQuerySpecificationMap(paramMap, ds);
     outputResource(EDIT_SPEC_FORWARD_CMISQUERY, out, locale, paramMap);
   }
 
-  /**
-   * Output the specification header section. This method is called in the head
-   * section of a job page which has selected a repository 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 ds
-   *          is the current document specification for this job.
-   * @param tabsArray
-   *          is an array of tab names. Add to this array any tab names that are
-   *          specific to the connector.
-   */
+  /** Output the specification header section.
+  * This method is called in the head section of a job page which has selected a repository 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.
+  * The connector will be connected before this method can be called.
+  *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
+  *@param ds is the current document specification for this job.
+  *@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, DocumentSpecification ds, List<String> tabsArray)
-      throws ManifoldCFException, IOException {
+  public void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber, List<String> tabsArray)
+    throws ManifoldCFException, IOException {
     tabsArray.add(Messages.getString(locale,CMIS_QUERY_TAB_PROPERTY));
   
     Map<String,String> paramMap = new HashMap<String,String>();
-  
+    paramMap.put("SeqNum", Integer.toString(connectionSequenceNumber));
+
     // Fill in the specification header map, using data from all tabs.
     fillInCMISQuerySpecificationMap(paramMap, ds);
 

Modified: manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification.js
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification.js?rev=1626026&r1=1626025&r2=1626026&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification.js (original)
+++ manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification.js Thu Sep 18 16:56:59 2014
@@ -17,16 +17,5 @@
 
 <script type="text/javascript">
 <!--
-function checkSpecification()
-{
-  // Does nothing right now.
-  return true;
-}
- 
-function SpecOp(n, opValue, anchorvalue)
-{
-  eval("editjob."+n+".value = \""+opValue+"\"");
-  postFormSetAnchor(anchorvalue);
-}
 //-->
 </script>
\ No newline at end of file

Modified: manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification_CMISQuery.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification_CMISQuery.html?rev=1626026&r1=1626025&r2=1626026&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification_CMISQuery.html (original)
+++ manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification_CMISQuery.html Thu Sep 18 16:56:59 2014
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-#if($TABNAME == $ResourceBundle.getString('CmisRepositoryConnector.CMISQuery'))
+#if($TABNAME == $ResourceBundle.getString('CmisRepositoryConnector.CMISQuery') && ${SEQNUM} == ${SELECTEDNUM})
 
 <table class="displaytable">
   <tr>
@@ -31,7 +31,7 @@
     </td>
     <td class="value">
       <nobr>
-        <input type="text" size="120" name="cmisQuery" value="$Encoder.attributeEscape($CMISQUERY)" />
+        <input type="text" size="120" name="s${SEQNUM}_cmisQuery" value="$Encoder.attributeEscape($CMISQUERY)" />
       </nobr>
     </td>
   </tr>
@@ -39,6 +39,6 @@
 
 #else
 
-<input type="hidden" name="cmisQuery" value="$Encoder.attributeEscape($CMISQUERY)" />
+<input type="hidden" name="s${SEQNUM}_cmisQuery" value="$Encoder.attributeEscape($CMISQUERY)" />
 
 #end

Modified: manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/viewSpecification.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/viewSpecification.html?rev=1626026&r1=1626025&r2=1626026&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/viewSpecification.html (original)
+++ manifoldcf/branches/dev_1x/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/viewSpecification.html Thu Sep 18 16:56:59 2014
@@ -18,7 +18,9 @@
 <table class="displaytable">
   <tr>
     <td class="description">
-      $Encoder.bodyEscape($ResourceBundle.getString('CmisRepositoryConnector.CMISQueryColon'))
+      <nobr>
+        $Encoder.bodyEscape($ResourceBundle.getString('CmisRepositoryConnector.CMISQueryColon'))
+      </nobr>
     </td>
     <td class="value">
       $Encoder.bodyEscape($CMISQUERY)

Modified: manifoldcf/branches/dev_1x/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java?rev=1626026&r1=1626025&r2=1626026&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java (original)
+++ manifoldcf/branches/dev_1x/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java Thu Sep 18 16:56:59 2014
@@ -2182,17 +2182,46 @@ public class DCTM extends org.apache.man
     );
   }
   
+  /** 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";
+    //return "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";
+    //return "checkSpecificationForSave";
+  }
+
   /** Output the specification header section.
-  * This method is called in the head section of a job page which has selected a repository 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.
+  * This method is called in the head section of a job page which has selected a repository 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.
+  * The connector will be connected before this method can be called.
   *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
   *@param ds is the current document specification for this job.
+  *@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, DocumentSpecification ds, List<String> tabsArray)
+  public void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber, List<String> tabsArray)
     throws ManifoldCFException, IOException
   {
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
     tabsArray.add(Messages.getString(locale,"DCTM.Paths"));
     tabsArray.add(Messages.getString(locale,"DCTM.DocumentTypes"));
     tabsArray.add(Messages.getString(locale,"DCTM.ContentTypes"));
@@ -2203,62 +2232,62 @@ public class DCTM extends org.apache.man
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
 "\n"+
-"function checkSpecification()\n"+
+"function "+seqPrefix+"checkSpecification()\n"+
 "{\n"+
-"  if (editjob.specmaxdoclength.value != \"\" && !isInteger(editjob.specmaxdoclength.value))\n"+
+"  if (editjob."+seqPrefix+"specmaxdoclength.value != \"\" && !isInteger(editjob."+seqPrefix+"specmaxdoclength.value))\n"+
 "  {\n"+
 "    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.MaximumDocumentLengthMustBeNullOrAnInteger") + "\");\n"+
-"    editjob.specmaxdoclength.focus();\n"+
+"    editjob."+seqPrefix+"specmaxdoclength.focus();\n"+
 "    return false;\n"+
 "  }\n"+
 "  return true;\n"+
 "}\n"+
 "\n"+
-"function SpecOp(n, opValue, anchorvalue)\n"+
+"function "+seqPrefix+"SpecOp(n, opValue, anchorvalue)\n"+
 "{\n"+
 "  eval(\"editjob.\"+n+\".value = \\\"\"+opValue+\"\\\"\");\n"+
 "  postFormSetAnchor(anchorvalue);\n"+
 "}\n"+
 "\n"+
-"function SpecAddToPath(anchorvalue)\n"+
+"function "+seqPrefix+"SpecAddToPath(anchorvalue)\n"+
 "{\n"+
-"  if (editjob.pathaddon.value == \"\")\n"+
+"  if (editjob."+seqPrefix+"pathaddon.value == \"\")\n"+
 "  {\n"+
 "    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.SelectAFolderFirst") + "\");\n"+
-"    editjob.pathaddon.focus();\n"+
+"    editjob."+seqPrefix+"pathaddon.focus();\n"+
 "    return;\n"+
 "  }\n"+
 "\n"+
-"  SpecOp(\"pathop\",\"AddToPath\",anchorvalue);\n"+
+"  "+seqPrefix+"SpecOp(\""+seqPrefix+"pathop\",\"AddToPath\",anchorvalue);\n"+
 "}\n"+
 "\n"+
-"function SpecAddToken(anchorvalue)\n"+
+"function "+seqPrefix+"SpecAddToken(anchorvalue)\n"+
 "{\n"+
-"  if (editjob.spectoken.value == \"\")\n"+
+"  if (editjob."+seqPrefix+"spectoken.value == \"\")\n"+
 "  {\n"+
 "    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.NullTokensNotAllowed") + "\");\n"+
-"    editjob.spectoken.focus();\n"+
+"    editjob."+seqPrefix+"spectoken.focus();\n"+
 "    return;\n"+
 "  }\n"+
 "\n"+
-"  SpecOp(\"accessop\",\"Add\",anchorvalue);\n"+
+"  "+seqPrefix+"SpecOp(\"accessop\",\"Add\",anchorvalue);\n"+
 "}\n"+
 "\n"+
-"function SpecAddMapping(anchorvalue)\n"+
+"function "+seqPrefix+"SpecAddMapping(anchorvalue)\n"+
 "{\n"+
-"  if (editjob.specmatch.value == \"\")\n"+
+"  if (editjob."+seqPrefix+"specmatch.value == \"\")\n"+
 "  {\n"+
 "    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.EnterASpecificationFirst") + "\");\n"+
-"    editjob.specmatch.focus();\n"+
+"    editjob."+seqPrefix+"specmatch.focus();\n"+
 "    return;\n"+
 "  }\n"+
-"  if (!isRegularExpression(editjob.specmatch.value))\n"+
+"  if (!isRegularExpression(editjob."+seqPrefix+"specmatch.value))\n"+
 "  {\n"+
 "    alert(\"" + Messages.getBodyJavascriptString(locale,"DCTM.SpecificationMustBeValidRegularExpression") + "\");\n"+
-"    editjob.specmatch.focus();\n"+
+"    editjob."+seqPrefix+"specmatch.focus();\n"+
 "    return false;\n"+
 "  }\n"+
-"  SpecOp(\"specmappingop\",\"Add\",anchorvalue);\n"+
+"  "+seqPrefix+"SpecOp(\""+seqPrefix+"specmappingop\",\"Add\",anchorvalue);\n"+
 "  }\n"+
 "\n"+
 "//-->\n"+
@@ -2267,22 +2296,31 @@ public class DCTM extends org.apache.man
   }
   
   /** Output the specification body section.
-  * This method is called in the body section of a job page which has selected a repository 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".
+  * This method is called in the body section of a job page which has selected a repository 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 always "editjob".
+  * The connector will be connected before this method can be called.
   *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
   *@param ds is the current document specification for this job.
-  *@param tabName is the current tab name.
+  *@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.  (actualSequenceNumber, tabName) form a unique tuple within
+  *  the job.
   */
   @Override
-  public void outputSpecificationBody(IHTTPOutput out, Locale locale, DocumentSpecification ds, String tabName)
+  public void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber, int actualSequenceNumber, String tabName)
     throws ManifoldCFException, IOException
   {
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
     int i;
     int k;
 
     // Paths tab
-    if (tabName.equals(Messages.getString(locale,"DCTM.Paths")))
+    if (tabName.equals(Messages.getString(locale,"DCTM.Paths")) && connectionSequenceNumber == actualSequenceNumber)
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -2297,14 +2335,15 @@ public class DCTM extends org.apache.man
         if (sn.getType().equals(CONFIG_PARAM_LOCATION))
         {
           String pathDescription = "_" + Integer.toString(k);
-          String pathOpName = "pathop" + pathDescription;
+          String pathName = seqPrefix + "specpath" + pathDescription;
+          String pathOpName = seqPrefix + "pathop" + pathDescription;
           out.print(
 "  <tr>\n"+
 "    <td class=\"description\">\n"+
-"      <input type=\"hidden\" name=\""+"specpath"+pathDescription+"\" value=\""+sn.getAttributeValue("path")+"\"/>\n"+
+"      <input type=\"hidden\" name=\""+pathName+"\" value=\""+sn.getAttributeValue("path")+"\"/>\n"+
 "      <input type=\"hidden\" name=\""+pathOpName+"\" value=\"\"/>\n"+
-"      <a name=\""+"path_"+Integer.toString(k)+"\">\n"+
-"        <input type=\"button\" value=\"Delete\" onClick='Javascript:SpecOp(\""+pathOpName+"\",\"Delete\",\"path_"+Integer.toString(k)+"\")' alt=\"" + Messages.getAttributeString(locale,"DCTM.DeletePath")+Integer.toString(k)+"\"/>\n"+
+"      <a name=\""+seqPrefix+"path_"+Integer.toString(k)+"\">\n"+
+"        <input type=\"button\" value=\"Delete\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+pathOpName+"\",\"Delete\",\""+seqPrefix+"path_"+Integer.toString(k)+"\")' alt=\"" + Messages.getAttributeString(locale,"DCTM.DeletePath")+Integer.toString(k)+"\"/>\n"+
 "      </a>&nbsp;\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -2329,10 +2368,10 @@ public class DCTM extends org.apache.man
       out.print(
 "  <tr>\n"+
 "    <td class=\"description\">\n"+
-"      <input type=\"hidden\" name=\"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"
+"      <input type=\"hidden\" name=\""+seqPrefix+"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"
       );
 	
-      String pathSoFar = (String)currentContext.get("specpath");
+      String pathSoFar = (String)currentContext.get(seqPrefix+"specpath");
       if (pathSoFar == null)
         pathSoFar = "/";
 
@@ -2350,10 +2389,10 @@ public class DCTM extends org.apache.man
         }
         
         out.print(
-"      <a name=\""+"path_"+Integer.toString(k)+"\">\n"+
-"        <input type=\"hidden\" name=\"specpath\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(pathSoFar)+"\"/>\n"+
-"        <input type=\"hidden\" name=\"pathop\" value=\"\"/>\n"+
-"        <input type=\"button\" value=\"Add\" alt=\"" + Messages.getAttributeString(locale,"DCTM.AddPath") + "\" onClick='Javascript:SpecOp(\"pathop\",\"Add\",\"path_"+Integer.toString(k+1)+"\")'/>&nbsp;\n"+
+"      <a name=\""+seqPrefix+"path_"+Integer.toString(k)+"\">\n"+
+"        <input type=\"hidden\" name=\""+seqPrefix+"specpath\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(pathSoFar)+"\"/>\n"+
+"        <input type=\"hidden\" name=\""+seqPrefix+"pathop\" value=\"\"/>\n"+
+"        <input type=\"button\" value=\"Add\" alt=\"" + Messages.getAttributeString(locale,"DCTM.AddPath") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+seqPrefix+"pathop\",\"Add\",\""+seqPrefix+"path_"+Integer.toString(k+1)+"\")'/>&nbsp;\n"+
 "      </a>\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -2362,14 +2401,14 @@ public class DCTM extends org.apache.man
         if (pathSoFar.length() > 1)
         {
           out.print(
-"      <input type=\"button\" value=\"-\" alt=\"" + Messages.getAttributeString(locale,"DCTM.RemoveFromPath") + "\" onClick='Javascript:SpecOp(\"pathop\",\"Up\",\"path_"+Integer.toString(k)+"\")'/>\n"
+"      <input type=\"button\" value=\"-\" alt=\"" + Messages.getAttributeString(locale,"DCTM.RemoveFromPath") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+seqPrefix+"pathop\",\"Up\",\""+seqPrefix+"path_"+Integer.toString(k)+"\")'/>\n"
           );
         }
         if (childList.length > 0)
         {
           out.print(
-"      <input type=\"button\" value=\"+\" alt=\"" + Messages.getAttributeString(locale,"DCTM.AddToPath") + "\" onClick='Javascript:SpecAddToPath(\"path_"+Integer.toString(k)+"\")'/>&nbsp;\n"+
-"      <select multiple=\"false\" name=\"pathaddon\" size=\"2\">\n"+
+"      <input type=\"button\" value=\"+\" alt=\"" + Messages.getAttributeString(locale,"DCTM.AddToPath") + "\" onClick='Javascript:"+seqPrefix+"SpecAddToPath(\""+seqPrefix+"path_"+Integer.toString(k)+"\")'/>&nbsp;\n"+
+"      <select multiple=\"false\" name=\""+seqPrefix+"pathaddon\" size=\"2\">\n"+
 "        <option value=\"\" selected=\"selected\">" + Messages.getBodyString(locale,"DCTM.PickAFolder") + "</option>\n"
           );
           int j = 0;
@@ -2412,14 +2451,15 @@ public class DCTM extends org.apache.man
         if (sn.getType().equals(CONFIG_PARAM_LOCATION))
         {
           String pathDescription = "_" + Integer.toString(k);
+          String pathName = seqPrefix + "specpath" + pathDescription;
           out.print(
-"<input type=\"hidden\" name=\""+"specpath"+pathDescription+"\" value=\""+sn.getAttributeValue("path")+"\"/>\n"
+"<input type=\"hidden\" name=\""+pathName+"\" value=\""+sn.getAttributeValue("path")+"\"/>\n"
           );
           k++;
         }
       }
       out.print(
-"<input type=\"hidden\" name=\"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"
       );
     }
 
@@ -2440,7 +2480,7 @@ public class DCTM extends org.apache.man
       }
     }
 
-    if (tabName.equals(Messages.getString(locale,"DCTM.Security")))
+    if (tabName.equals(Messages.getString(locale,"DCTM.Security")) && connectionSequenceNumber == actualSequenceNumber)
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -2448,8 +2488,8 @@ public class DCTM extends org.apache.man
 "  <tr>\n"+
 "    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"DCTM.Security2") + "</nobr></td>\n"+
 "    <td class=\"value\" colspan=\"1\">\n"+
-"      <input type=\"radio\" name=\"specsecurity\" value=\"on\" "+((securityOn)?"checked=\"true\"":"")+" />Enabled&nbsp;\n"+
-"      <input type=\"radio\" name=\"specsecurity\" value=\"off\" "+((securityOn==false)?"checked=\"true\"":"")+" />Disabled\n"+
+"      <input type=\"radio\" name=\""+seqPrefix+"specsecurity\" value=\"on\" "+((securityOn)?"checked=\"true\"":"")+" />Enabled&nbsp;\n"+
+"      <input type=\"radio\" name=\""+seqPrefix+"specsecurity\" value=\"off\" "+((securityOn==false)?"checked=\"true\"":"")+" />Disabled\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"
@@ -2463,15 +2503,16 @@ public class DCTM extends org.apache.man
         if (sn.getType().equals("access"))
         {
           String accessDescription = "_"+Integer.toString(k);
-          String accessOpName = "accessop"+accessDescription;
+          String accessOpName = seqPrefix+"accessop"+accessDescription;
+          String accessTokenName = seqPrefix+"spectoken"+accessDescription;
           String token = sn.getAttributeValue("token");
           out.print(
 "  <tr>\n"+
 "    <td class=\"description\">\n"+
 "      <input type=\"hidden\" name=\""+accessOpName+"\" value=\"\"/>\n"+
-"      <input type=\"hidden\" name=\""+"spectoken"+accessDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(token)+"\"/>\n"+
-"      <a name=\""+"token_"+Integer.toString(k)+"\">\n"+
-"        <input type=\"button\" value=\"Delete\" alt=\""+Messages.getAttributeString(locale,"DCTM.DeleteAccessToken")+Integer.toString(k)+"\" onClick='Javascript:SpecOp(\""+accessOpName+"\",\"Delete\",\"token_"+Integer.toString(k)+"\")'/>\n"+
+"      <input type=\"hidden\" name=\""+accessTokenName+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(token)+"\"/>\n"+
+"      <a name=\""+seqPrefix+"token_"+Integer.toString(k)+"\">\n"+
+"        <input type=\"button\" value=\"Delete\" alt=\""+Messages.getAttributeString(locale,"DCTM.DeleteAccessToken")+Integer.toString(k)+"\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+accessOpName+"\",\"Delete\",\""+seqPrefix+"token_"+Integer.toString(k)+"\")'/>\n"+
 "      </a>\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -2494,14 +2535,14 @@ public class DCTM extends org.apache.man
 "  <tr><td class=\"lightseparator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
 "    <td class=\"description\">\n"+
-"      <input type=\"hidden\" name=\"tokencount\" value=\""+Integer.toString(k)+"\"/>\n"+
-"      <input type=\"hidden\" name=\"accessop\" value=\"\"/>\n"+
-"      <a name=\""+"token_"+Integer.toString(k)+"\">\n"+
-"        <input type=\"button\" value=\"Add\" alt=\"" + Messages.getAttributeString(locale,"DCTM.AddAccessToken") + "\" onClick='Javascript:SpecAddToken(\"token_"+Integer.toString(k+1)+"\")'/>\n"+
+"      <input type=\"hidden\" name=\""+seqPrefix+"tokencount\" value=\""+Integer.toString(k)+"\"/>\n"+
+"      <input type=\"hidden\" name=\""+seqPrefix+"accessop\" value=\"\"/>\n"+
+"      <a name=\""+seqPrefix+"token_"+Integer.toString(k)+"\">\n"+
+"        <input type=\"button\" value=\"Add\" alt=\"" + Messages.getAttributeString(locale,"DCTM.AddAccessToken") + "\" onClick='Javascript:"+seqPrefix+"SpecAddToken(\""+seqPrefix+"token_"+Integer.toString(k+1)+"\")'/>\n"+
 "      </a>\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
-"      <input type=\"text\" size=\"30\" name=\"spectoken\" value=\"\"/>\n"+
+"      <input type=\"text\" size=\"30\" name=\""+seqPrefix+"spectoken\" value=\"\"/>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "</table>\n"
@@ -2510,7 +2551,7 @@ public class DCTM extends org.apache.man
     else
     {
       out.print(
-"<input type=\"hidden\" name=\"specsecurity\" value=\""+(securityOn?"on":"off")+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specsecurity\" value=\""+(securityOn?"on":"off")+"\"/>\n"
       );
       // Finally, go through forced ACL
       i = 0;
@@ -2523,14 +2564,14 @@ public class DCTM extends org.apache.man
           String accessDescription = "_"+Integer.toString(k);
           String token = sn.getAttributeValue("token");
           out.print(
-"<input type=\"hidden\" name=\""+"spectoken"+accessDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(token)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"spectoken"+accessDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(token)+"\"/>\n"
           );
           k++;
         }
       }
 
       out.print(
-"<input type=\"hidden\" name=\"tokencount\" value=\""+Integer.toString(k)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"tokencount\" value=\""+Integer.toString(k)+"\"/>\n"
       );
     }
 
@@ -2570,7 +2611,7 @@ public class DCTM extends org.apache.man
       }
     }
 
-    if (tabName.equals(Messages.getString(locale,"DCTM.DocumentTypes")))
+    if (tabName.equals(Messages.getString(locale,"DCTM.DocumentTypes")) && connectionSequenceNumber == actualSequenceNumber)
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -2595,13 +2636,13 @@ public class DCTM extends org.apache.man
             if (o == null)
             {
               out.print(
-"      <input type=\"checkbox\" name=\"specfiletype\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(strObjectType)+"</input>\n"
+"      <input type=\"checkbox\" name=\""+seqPrefix+"specfiletype\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(strObjectType)+"</input>\n"
               );
             }
             else
             {
               out.print(
-"      <input type=\"checkbox\" name=\"specfiletype\" checked=\"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(strObjectType)+"</input>\n"
+"      <input type=\"checkbox\" name=\""+seqPrefix+"specfiletype\" checked=\"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(strObjectType)+"</input>\n"
               );
 
             }
@@ -2622,8 +2663,8 @@ public class DCTM extends org.apache.man
               attrMap = (HashMap)o;
             }
             out.print(
-"      <input type=\"checkbox\" name=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape("specfileallattrs_"+strObjectType)+"\" value=\"true\" "+(isAll?"checked=\"\"":"")+"/>&nbsp;All metadata<br/>\n"+
-"      <select multiple=\"true\" name=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape("specfileattrs_"+strObjectType)+"\" size=\"3\">\n"
+"      <input type=\"checkbox\" name=\""+seqPrefix+"specfileallattrs_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\" value=\"true\" "+(isAll?"checked=\"\"":"")+"/>&nbsp;All metadata<br/>\n"+
+"      <select multiple=\"true\" name=\""+seqPrefix+"specfileattrs_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\" size=\"3\">\n"
             );
             // Get the attributes for this data type
             String[] values = getIngestableAttributes(strObjectType);
@@ -2686,13 +2727,13 @@ public class DCTM extends org.apache.man
         String strObjectType = (String)iter.next();
         Object o = dtMap.get(strObjectType);
         out.print(
-"<input type=\"hidden\" name=\"specfiletype\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specfiletype\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\"/>\n"
         );
         if (o instanceof Boolean)
         {
           Boolean b = (Boolean)o;
           out.print(
-"<input type=\"hidden\" name=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape("specfileallattrs_"+strObjectType)+"\" value=\""+(b.booleanValue()?"true":"false")+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specfileallattrs_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\" value=\""+(b.booleanValue()?"true":"false")+"\"/>\n"
           );
         }
         else
@@ -2703,7 +2744,7 @@ public class DCTM extends org.apache.man
           {
             String attrName = (String)iter2.next();
             out.print(
-"<input type=\"hidden\" name=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape("specfileattrs_"+strObjectType)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(attrName)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specfileattrs_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strObjectType)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(attrName)+"\"/>\n"
             );
           }
         }
@@ -2730,7 +2771,7 @@ public class DCTM extends org.apache.man
       }
     }
 
-    if (tabName.equals(Messages.getString(locale,"DCTM.ContentTypes")))
+    if (tabName.equals(Messages.getString(locale,"DCTM.ContentTypes")) && connectionSequenceNumber == actualSequenceNumber)
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -2753,13 +2794,13 @@ public class DCTM extends org.apache.man
             if (ctMap == null || ctMap.get(strMimeType) != null)
             {
               out.print(
-"      <input type=\"checkbox\" name=\"specmimetype\" checked=\"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strMimeType)+"\"></input>\n"
+"      <input type=\"checkbox\" name=\""+seqPrefix+"specmimetype\" checked=\"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strMimeType)+"\"></input>\n"
               );
             }
             else
             {
               out.print(
-"      <input type=\"checkbox\" name=\"specmimetype\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strMimeType)+"\"></input>\n"
+"      <input type=\"checkbox\" name=\""+seqPrefix+"specmimetype\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strMimeType)+"\"></input>\n"
               );
             }
             out.print(
@@ -2805,7 +2846,7 @@ public class DCTM extends org.apache.man
         {
           String strMimeType = (String)iter.next();
           out.print(
-"<input type=\"hidden\" name=\"specmimetype\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strMimeType)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specmimetype\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(strMimeType)+"\"/>\n"
           );
         }
       }
@@ -2826,7 +2867,7 @@ public class DCTM extends org.apache.man
       }
     }
 
-    if (tabName.equals(Messages.getString(locale,"DCTM.ContentLength")))
+    if (tabName.equals(Messages.getString(locale,"DCTM.ContentLength")) && connectionSequenceNumber == actualSequenceNumber)
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -2836,7 +2877,7 @@ public class DCTM extends org.apache.man
 "  <tr>\n"+
 "    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"DCTM.ContentLength") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
-"      <input name=\"specmaxdoclength\" type=\"text\" size=\"10\" value=\""+maxDocLength+"\"/>\n"+
+"      <input name=\""+seqPrefix+"specmaxdoclength\" type=\"text\" size=\"10\" value=\""+maxDocLength+"\"/>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "</table>\n"
@@ -2845,7 +2886,7 @@ public class DCTM extends org.apache.man
     else
     {
       out.print(
-"<input type=\"hidden\" name=\"specmaxdoclength\" value=\""+maxDocLength+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specmaxdoclength\" value=\""+maxDocLength+"\"/>\n"
       );
     }
 
@@ -2878,18 +2919,18 @@ public class DCTM extends org.apache.man
       }
     }
 
-    if (tabName.equals(Messages.getString(locale,"DCTM.PathMetadata")))
+    if (tabName.equals(Messages.getString(locale,"DCTM.PathMetadata")) && connectionSequenceNumber == actualSequenceNumber)
     {
       out.print(
-"<input type=\"hidden\" name=\"specmappingcount\" value=\""+Integer.toString(matchMap.getMatchCount())+"\"/>\n"+
-"<input type=\"hidden\" name=\"specmappingop\" value=\"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"specmappingcount\" value=\""+Integer.toString(matchMap.getMatchCount())+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"specmappingop\" value=\"\"/>\n"+
 "\n"+
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"4\"><hr/></td></tr>\n"+
 "  <tr>\n"+
 "    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"DCTM.PathAttributeName") + "</nobr></td>\n"+
 "    <td class=\"value\" colspan=\"3\">\n"+
-"      <input type=\"text\" name=\"specpathnameattribute\" size=\"20\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(pathNameAttribute)+"\"/>\n"+
+"      <input type=\"text\" name=\""+seqPrefix+"specpathnameattribute\" size=\"20\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(pathNameAttribute)+"\"/>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr><td class=\"separator\" colspan=\"4\"><hr/></td></tr>\n"
@@ -2901,14 +2942,14 @@ public class DCTM extends org.apache.man
         String replaceString = matchMap.getReplaceString(i);
         out.print(
 "  <tr>\n"+
-"    <td class=\"description\"><input type=\"hidden\" name=\""+"specmappingop_"+Integer.toString(i)+"\" value=\"\"/>\n"+
-"      <a name=\""+"mapping_"+Integer.toString(i)+"\">\n"+
-"        <input type=\"button\" onClick='Javascript:SpecOp(\"specmappingop_"+Integer.toString(i)+"\",\"" + Messages.getAttributeJavascriptString(locale,"DCTM.Delete") + "\",\"mapping_"+Integer.toString(i)+"\")' alt=\"" + Messages.getAttributeString(locale,"DCTM.DeleteMapping") + Integer.toString(i)+"\" value=\"Delete\"/>\n"+
+"    <td class=\"description\"><input type=\"hidden\" name=\""+seqPrefix+"specmappingop_"+Integer.toString(i)+"\" value=\"\"/>\n"+
+"      <a name=\""+seqPrefix+"mapping_"+Integer.toString(i)+"\">\n"+
+"        <input type=\"button\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+seqPrefix+"specmappingop_"+Integer.toString(i)+"\",\"" + Messages.getAttributeJavascriptString(locale,"DCTM.Delete") + "\",\""+seqPrefix+"mapping_"+Integer.toString(i)+"\")' alt=\"" + Messages.getAttributeString(locale,"DCTM.DeleteMapping") + Integer.toString(i)+"\" value=\"Delete\"/>\n"+
 "      </a>\n"+
 "    </td>\n"+
-"    <td class=\"value\"><input type=\"hidden\" name=\"specmatch_"+Integer.toString(i)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchString)+"\"/>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(matchString)+"</td>\n"+
+"    <td class=\"value\"><input type=\"hidden\" name=\""+seqPrefix+"specmatch_"+Integer.toString(i)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchString)+"\"/>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(matchString)+"</td>\n"+
 "    <td class=\"value\">==></td>\n"+
-"    <td class=\"value\"><input type=\"hidden\" name=\"specreplace_"+Integer.toString(i)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(replaceString)+"\"/>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(replaceString)+"</td>\n"+
+"    <td class=\"value\"><input type=\"hidden\" name=\""+seqPrefix+"specreplace_"+Integer.toString(i)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(replaceString)+"\"/>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(replaceString)+"</td>\n"+
 "  </tr>\n"
         );
         i++;
@@ -2924,13 +2965,13 @@ public class DCTM extends org.apache.man
 "\n"+
 "  <tr>\n"+
 "    <td class=\"description\">\n"+
-"      <a name=\""+"mapping_"+Integer.toString(i)+"\">\n"+
-"        <input type=\"button\" onClick='Javascript:SpecAddMapping(\"mapping_"+Integer.toString(i+1)+"\")' alt=\"" + Messages.getAttributeString(locale,"DCTM.AddToMappings") + "\" value=\"" + Messages.getAttributeString(locale,"DCTM.Add") + "\"/>\n"+
+"      <a name=\""+seqPrefix+"mapping_"+Integer.toString(i)+"\">\n"+
+"        <input type=\"button\" onClick='Javascript:"+seqPrefix+"SpecAddMapping(\""+seqPrefix+"mapping_"+Integer.toString(i+1)+"\")' alt=\"" + Messages.getAttributeString(locale,"DCTM.AddToMappings") + "\" value=\"" + Messages.getAttributeString(locale,"DCTM.Add") + "\"/>\n"+
 "      </a>\n"+
 "    </td>\n"+
-"    <td class=\"value\">" + Messages.getBodyString(locale,"DCTM.MatchRegexp") + "&nbsp;<input type=\"text\" name=\"specmatch\" size=\"32\" value=\"\"/></td>\n"+
+"    <td class=\"value\">" + Messages.getBodyString(locale,"DCTM.MatchRegexp") + "&nbsp;<input type=\"text\" name=\""+seqPrefix+"specmatch\" size=\"32\" value=\"\"/></td>\n"+
 "    <td class=\"value\">==></td>\n"+
-"    <td class=\"value\">" + Messages.getBodyString(locale,"DCTM.ReplaceString") + "&nbsp;<input type=\"text\" name=\"specreplace\" size=\"32\" value=\"\"/></td>\n"+
+"    <td class=\"value\">" + Messages.getBodyString(locale,"DCTM.ReplaceString") + "&nbsp;<input type=\"text\" name=\""+seqPrefix+"specreplace\" size=\"32\" value=\"\"/></td>\n"+
 "  </tr>\n"+
 "</table>\n"
       );
@@ -2938,8 +2979,8 @@ public class DCTM extends org.apache.man
     else
     {
       out.print(
-"<input type=\"hidden\" name=\"specmappingcount\" value=\""+Integer.toString(matchMap.getMatchCount())+"\"/>\n"+
-"<input type=\"hidden\" name=\"specpathnameattribute\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(pathNameAttribute)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specmappingcount\" value=\""+Integer.toString(matchMap.getMatchCount())+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"specpathnameattribute\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(pathNameAttribute)+"\"/>\n"
       );
       i = 0;
       while (i < matchMap.getMatchCount())
@@ -2947,8 +2988,8 @@ public class DCTM extends org.apache.man
         String matchString = matchMap.getMatchString(i);
         String replaceString = matchMap.getReplaceString(i);
         out.print(
-"<input type=\"hidden\" name=\""+"specmatch_"+Integer.toString(i)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchString)+"\"/>\n"+
-"<input type=\"hidden\" name=\""+"specreplace_"+Integer.toString(i)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(replaceString)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specmatch_"+Integer.toString(i)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchString)+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"specreplace_"+Integer.toString(i)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(replaceString)+"\"/>\n"
         );
         i++;
       }
@@ -2956,18 +2997,25 @@ public class DCTM extends org.apache.man
   }
   
   /** 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 document specification accordingly.
-  * The name of the posted form is "editjob".
+  * 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
+  * document specification accordingly.  The name of the posted form is always "editjob".
+  * The connector will be connected before this method can be called.
   *@param variableContext contains the post data, including binary file-upload information.
+  *@param locale is the locale the output is preferred to be in.
   *@param ds is the current document specification for this 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).
+  *@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, DocumentSpecification ds)
+  public String processSpecificationPost(IPostParameters variableContext, Locale locale, Specification ds,
+    int connectionSequenceNumber)
     throws ManifoldCFException
   {
-    String x = variableContext.getParameter("pathcount");
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
+    String x = variableContext.getParameter(seqPrefix+"pathcount");
     if (x != null)
     {
       // Delete all path specs first
@@ -2988,7 +3036,8 @@ public class DCTM extends org.apache.man
       while (i < pathCount)
       {
       	String pathDescription = "_"+Integer.toString(i);
-      	String pathOpName = "pathop"+pathDescription;
+      	String pathOpName = seqPrefix+"pathop"+pathDescription;
+        String pathName = seqPrefix+"specpath"+pathDescription;
       	x = variableContext.getParameter(pathOpName);
       	if (x != null && x.equals("Delete"))
       	{
@@ -2997,7 +3046,7 @@ public class DCTM extends org.apache.man
           continue;
       	}
       	// Path inserts won't happen until the very end
-      	String path = variableContext.getParameter("specpath"+pathDescription);
+      	String path = variableContext.getParameter(pathName);
       	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_LOCATION);
       	node.setAttribute("path",path);
       	ds.addChild(ds.getChildCount(),node);
@@ -3005,10 +3054,10 @@ public class DCTM extends org.apache.man
       }
 
       // See if there's a global add operation
-      String op = variableContext.getParameter("pathop");
+      String op = variableContext.getParameter(seqPrefix+"pathop");
       if (op != null && op.equals("Add"))
       {
-      	String path = variableContext.getParameter("specpath");
+      	String path = variableContext.getParameter(seqPrefix+"specpath");
       	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_LOCATION);
       	node.setAttribute("path",path);
       	ds.addChild(ds.getChildCount(),node);
@@ -3016,18 +3065,18 @@ public class DCTM extends org.apache.man
       else if (op != null && op.equals("Up"))
       {
       	// Strip off end
-      	String path = variableContext.getParameter("specpath");
+      	String path = variableContext.getParameter(seqPrefix+"specpath");
       	int k = path.lastIndexOf("/");
       	if (k != -1)
           path = path.substring(0,k);
       	if (path.length() == 0)
           path = "/";
-      	currentContext.save("specpath",path);
+      	currentContext.save(seqPrefix+"specpath",path);
       }
       else if (op != null && op.equals("AddToPath"))
       {
-      	String path = variableContext.getParameter("specpath");
-      	String addon = variableContext.getParameter("pathaddon");
+      	String path = variableContext.getParameter(seqPrefix+"specpath");
+      	String addon = variableContext.getParameter(seqPrefix+"pathaddon");
       	if (addon != null && addon.length() > 0)
       	{
           if (path.length() == 1)
@@ -3035,11 +3084,11 @@ public class DCTM extends org.apache.man
           else
             path += "/" + addon;
       	}
-      	currentContext.save("specpath",path);
+      	currentContext.save(seqPrefix+"specpath",path);
       }
     }
 
-    x = variableContext.getParameter("specsecurity");
+    x = variableContext.getParameter(seqPrefix+"specsecurity");
     if (x != null)
     {
       // Delete all security entries first
@@ -3059,7 +3108,7 @@ public class DCTM extends org.apache.man
 
     }
 
-    x = variableContext.getParameter("tokencount");
+    x = variableContext.getParameter(seqPrefix+"tokencount");
     if (x != null)
     {
       // Delete all file specs first
@@ -3078,7 +3127,7 @@ public class DCTM extends org.apache.man
       while (i < accessCount)
       {
       	String accessDescription = "_"+Integer.toString(i);
-      	String accessOpName = "accessop"+accessDescription;
+      	String accessOpName = seqPrefix+"accessop"+accessDescription;
       	x = variableContext.getParameter(accessOpName);
       	if (x != null && x.equals("Delete"))
       	{
@@ -3087,24 +3136,24 @@ public class DCTM extends org.apache.man
           continue;
       	}
       	// Get the stuff we need
-      	String accessSpec = variableContext.getParameter("spectoken"+accessDescription);
+      	String accessSpec = variableContext.getParameter(seqPrefix+"spectoken"+accessDescription);
       	SpecificationNode node = new SpecificationNode("access");
       	node.setAttribute("token",accessSpec);
       	ds.addChild(ds.getChildCount(),node);
       	i++;
       }
 
-      String op = variableContext.getParameter("accessop");
+      String op = variableContext.getParameter(seqPrefix+"accessop");
       if (op != null && op.equals("Add"))
       {
-      	String accessspec = variableContext.getParameter("spectoken");
+      	String accessspec = variableContext.getParameter(seqPrefix+"spectoken");
       	SpecificationNode node = new SpecificationNode("access");
       	node.setAttribute("token",accessspec);
       	ds.addChild(ds.getChildCount(),node);
       }
     }
 
-    String[] y = variableContext.getParameterValues("specfiletype");
+    String[] y = variableContext.getParameterValues(seqPrefix+"specfiletype");
     if (y != null)
     {
       // Delete all file specs first
@@ -3125,10 +3174,10 @@ public class DCTM extends org.apache.man
       	String fileType = y[i++];
       	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_OBJECTTYPE);
       	node.setAttribute("token",fileType);
-      	String isAll = variableContext.getParameter("specfileallattrs_"+fileType);
+      	String isAll = variableContext.getParameter(seqPrefix+"specfileallattrs_"+fileType);
       	if (isAll != null)
           node.setAttribute("all",isAll);
-      	String[] z = variableContext.getParameterValues("specfileattrs_"+fileType);
+      	String[] z = variableContext.getParameterValues(seqPrefix+"specfileattrs_"+fileType);
       	if (z != null)
       	{
           int k = 0;
@@ -3143,7 +3192,7 @@ public class DCTM extends org.apache.man
       }
     }
 
-    y = variableContext.getParameterValues("specmimetype");
+    y = variableContext.getParameterValues(seqPrefix+"specmimetype");
     if (y != null)
     {
       // Delete all file specs first
@@ -3168,7 +3217,7 @@ public class DCTM extends org.apache.man
       }
     }
 
-    x = variableContext.getParameter("specmaxdoclength");
+    x = variableContext.getParameter(seqPrefix+"specmaxdoclength");
     if (x != null)
     {
       // Delete all security entries first
@@ -3190,7 +3239,7 @@ public class DCTM extends org.apache.man
       }
     }
 
-    String xc = variableContext.getParameter("specpathnameattribute");
+    String xc = variableContext.getParameter(seqPrefix+"specpathnameattribute");
     if (xc != null)
     {
       // Delete old one
@@ -3211,7 +3260,7 @@ public class DCTM extends org.apache.man
       }
     }
 
-    xc = variableContext.getParameter("specmappingcount");
+    xc = variableContext.getParameter(seqPrefix+"specmappingcount");
     if (xc != null)
     {
       // Delete old spec
@@ -3233,7 +3282,7 @@ public class DCTM extends org.apache.man
       while (i < mappingCount)
       {
       	String pathDescription = "_"+Integer.toString(i);
-      	String pathOpName = "specmappingop"+pathDescription;
+      	String pathOpName = seqPrefix+"specmappingop"+pathDescription;
       	xc = variableContext.getParameter(pathOpName);
       	if (xc != null && xc.equals("Delete"))
       	{
@@ -3242,8 +3291,8 @@ public class DCTM extends org.apache.man
           continue;
       	}
       	// Inserts won't happen until the very end
-      	String match = variableContext.getParameter("specmatch"+pathDescription);
-      	String replace = variableContext.getParameter("specreplace"+pathDescription);
+      	String match = variableContext.getParameter(seqPrefix+"specmatch"+pathDescription);
+      	String replace = variableContext.getParameter(seqPrefix+"specreplace"+pathDescription);
       	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_PATHMAP);
       	node.setAttribute("match",match);
       	node.setAttribute("replace",replace);
@@ -3252,11 +3301,11 @@ public class DCTM extends org.apache.man
       }
 
       // Check for add
-      xc = variableContext.getParameter("specmappingop");
+      xc = variableContext.getParameter(seqPrefix+"specmappingop");
       if (xc != null && xc.equals("Add"))
       {
-      	String match = variableContext.getParameter("specmatch");
-      	String replace = variableContext.getParameter("specreplace");
+      	String match = variableContext.getParameter(seqPrefix+"specmatch");
+      	String replace = variableContext.getParameter(seqPrefix+"specreplace");
       	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_PATHMAP);
       	node.setAttribute("match",match);
       	node.setAttribute("replace",replace);
@@ -3267,13 +3316,18 @@ public class DCTM extends org.apache.man
   }
   
   /** View specification.
-  * This method is called in the body section of a job's view page.  Its purpose is to present the document 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.
+  * This method is called in the body section of a job's view page.  Its purpose is to present the document
+  * 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.
+  * The connector will be connected before this method can be called.
   *@param out is the output to which any HTML should be sent.
+  *@param locale is the locale the output is preferred to be in.
   *@param ds is the current document specification for this job.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
   */
   @Override
-  public void viewSpecification(IHTTPOutput out, Locale locale, DocumentSpecification ds)
+  public void viewSpecification(IHTTPOutput out, Locale locale, Specification ds,
+    int connectionSequenceNumber)
     throws ManifoldCFException, IOException
   {
     out.print(



Mime
View raw message