manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1622740 [2/9] - in /manifoldcf/trunk: connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/ connec...
Date Fri, 05 Sep 2014 16:48:07 GMT
Modified: manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java?rev=1622740&r1=1622739&r2=1622740&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java (original)
+++ manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java Fri Sep  5 16:48:06 2014
@@ -1908,6 +1908,8 @@ public class FilenetConnector extends or
     int connectionSequenceNumber, List<String> tabsArray)
     throws ManifoldCFException, IOException
   {
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
     tabsArray.add(Messages.getString(locale,"FilenetConnector.DocumentClasses"));
     tabsArray.add(Messages.getString(locale,"FilenetConnector.MimeTypes"));
     tabsArray.add(Messages.getString(locale,"FilenetConnector.Folders"));
@@ -1916,56 +1918,51 @@ public class FilenetConnector extends or
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
 "\n"+
-"function checkSpecification()\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,"FilenetConnector.SelectAFolderFirst") + "\");\n"+
-"    editjob.pathaddon.focus();\n"+
+"    editjob."+seqPrefix+"pathaddon.focus();\n"+
 "    return;\n"+
 "  }\n"+
-"  SpecOp(\"pathop\",\"AddToPath\",anchorvalue);\n"+
+"  "+seqPrefix+"SpecOp(\""+seqPrefix+"pathop\",\"AddToPath\",anchorvalue);\n"+
 "}\n"+
 "\n"+
-"function SpecAddMatch(docclass, anchorvalue)\n"+
+"function "+seqPrefix+"SpecAddMatch(docclass, anchorvalue)\n"+
 "{\n"+
-"  if (eval(\"editjob.matchfield_\"+docclass+\".value\") == \"\")\n"+
+"  if (eval(\"editjob."+seqPrefix+"matchfield_\"+docclass+\".value\") == \"\")\n"+
 "  {\n"+
 "    alert(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.SelectAFieldFirst") + "\");\n"+
-"    eval(\"editjob.matchfield_\"+docclass+\".focus()\");\n"+
+"    eval(\"editjob."+seqPrefix+"matchfield_\"+docclass+\".focus()\");\n"+
 "    return;\n"+
 "  }\n"+
-"  if (eval(\"editjob.matchtype_\"+docclass+\".value\") == \"\")\n"+
+"  if (eval(\"editjob."+seqPrefix+"matchtype_\"+docclass+\".value\") == \"\")\n"+
 "  {\n"+
 "    alert(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.SelectAMatchType") + "\");\n"+
-"    eval(\"editjob.matchtype_\"+docclass+\".focus()\");\n"+
+"    eval(\"editjob."+seqPrefix+"matchtype_\"+docclass+\".focus()\");\n"+
 "    return;\n"+
 "  }\n"+
 "\n"+
-"  SpecOp(\"matchop_\"+docclass,\"Add\",anchorvalue);\n"+
+"  "+seqPrefix+"SpecOp(\""+seqPrefix+"matchop_\"+docclass,\"Add\",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,"FilenetConnector.NullTokensNotAllowed") + "\");\n"+
-"    editjob.spectoken.focus();\n"+
+"    editjob."+seqPrefix+"spectoken.focus();\n"+
 "    return;\n"+
 "  }\n"+
 "\n"+
-"  SpecOp(\"accessop\",\"Add\",anchorvalue);\n"+
+"  "+seqPrefix+"SpecOp(\""+seqPrefix+"accessop\",\"Add\",anchorvalue);\n"+
 "}\n"+
 "\n"+
 "//-->\n"+
@@ -1992,6 +1989,8 @@ public class FilenetConnector extends or
     int connectionSequenceNumber, int actualSequenceNumber, String tabName)
     throws ManifoldCFException, IOException
   {
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
     int i;
     int k;
     Iterator iter;
@@ -2013,7 +2012,7 @@ public class FilenetConnector extends or
     }
 
     // Folders tab
-    if (tabName.equals(Messages.getString(locale,"FilenetConnector.Folders")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.Folders")) && actualSequenceNumber == connectionSequenceNumber)
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -2030,17 +2029,17 @@ public class FilenetConnector extends or
         if (sn.getType().equals(SPEC_NODE_FOLDER))
         {
           String pathDescription = "_"+Integer.toString(k);
-          String pathOpName = "pathop"+pathDescription;
+          String pathOpName = seqPrefix+"pathop"+pathDescription;
           String startPath = sn.getAttributeValue(SPEC_ATTRIBUTE_VALUE);
           out.print(
 "  <tr>\n"+
 "    <td class=\"value\">\n"+
-"      <a name=\""+"path_"+Integer.toString(k)+"\">\n"+
-"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"FilenetConnector.DeletePath")+Integer.toString(k)+"\" onClick='Javascript:SpecOp(\""+pathOpName+"\",\"Delete\",\"path_"+Integer.toString(k)+"\")'/>\n"+
+"      <a name=\""+seqPrefix+"path_"+Integer.toString(k)+"\">\n"+
+"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"FilenetConnector.DeletePath")+Integer.toString(k)+"\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+pathOpName+"\",\"Delete\",\""+seqPrefix+"path_"+Integer.toString(k)+"\")'/>\n"+
 "      </a>&nbsp;\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
-"      <input type=\"hidden\" name=\""+"specpath"+pathDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(startPath)+"\"/>\n"+
+"      <input type=\"hidden\" name=\""+seqPrefix+"specpath"+pathDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(startPath)+"\"/>\n"+
 "      <input type=\"hidden\" name=\""+pathOpName+"\" value=\"\"/>\n"+
 "      <nobr>"+((startPath.length() == 0)?"(root)":org.apache.manifoldcf.ui.util.Encoder.bodyEscape(startPath))+"</nobr>\n"+
 "    </td>\n"+
@@ -2062,11 +2061,11 @@ public class FilenetConnector extends or
 "  <tr>\n"+
 "    <td class=\"value\" colspan=\"2\">\n"+
 "      <nobr>\n"+
-"        <input type=\"hidden\" name=\"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"+
-"        <a name=\""+"path_"+Integer.toString(k)+"\">\n"
+"        <input type=\"hidden\" name=\""+seqPrefix+"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"+
+"        <a name=\""+seqPrefix+"path_"+Integer.toString(k)+"\">\n"
       );
 	
-      String pathSoFar = (String)currentContext.get("specpath");
+      String pathSoFar = (String)currentContext.get(seqPrefix+"specpath");
       if (pathSoFar == null)
         pathSoFar = "/";
 
@@ -2084,23 +2083,23 @@ public class FilenetConnector extends or
             throw new ManifoldCFException("Can't find any children for root folder");
         }
         out.print(
-"          <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=\"" + Messages.getAttributeString(locale,"FilenetConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.AddPath") + "\" onClick='Javascript:SpecOp(\"pathop\",\"Add\",\"path_"+Integer.toString(k+1)+"\")'/>\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=\"" + Messages.getAttributeString(locale,"FilenetConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.AddPath") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\"pathop\",\"Add\",\""+seqPrefix+"path_"+Integer.toString(k+1)+"\")'/>\n"+
 "          &nbsp;"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(pathSoFar)+"\n"
         );
         if (pathSoFar.length() > 0 && !pathSoFar.equals("/"))
         {
           out.print(
-"          <input type=\"button\" value=\"-\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.RemoveFromPath") + "\" onClick='Javascript:SpecOp(\"pathop\",\"Up\",\"path_"+Integer.toString(k)+"\")'/>\n"
+"          <input type=\"button\" value=\"-\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.RemoveFromPath") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\"pathop\",\"Up\",\"path_"+Integer.toString(k)+"\")'/>\n"
           );
         }
         if (childList.length > 0)
         {
           out.print(
 "          <nobr>\n"+
-"            <input type=\"button\" value=\"+\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.AddToPath") + "\" onClick='Javascript:SpecAddToPath(\"path_"+Integer.toString(k)+"\")'/>&nbsp;\n"+
-"            <select multiple=\"false\" name=\"pathaddon\" size=\"4\">\n"+
+"            <input type=\"button\" value=\"+\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.AddToPath") + "\" onClick='Javascript:"+seqPrefix+"SpecAddToPath(\""+seqPrefix+"path_"+Integer.toString(k)+"\")'/>&nbsp;\n"+
+"            <select multiple=\"false\" name=\""+seqPrefix+"pathaddon\" size=\"4\">\n"+
 "              <option value=\"\" selected=\"selected\">-- " + Messages.getBodyString(locale,"FilenetConnector.PickAFolder") + " --</option>\n"
           );
           int j = 0;
@@ -2150,21 +2149,21 @@ public class FilenetConnector extends or
           String pathDescription = "_"+Integer.toString(k);
           String startPath = sn.getAttributeValue(SPEC_ATTRIBUTE_VALUE);
           out.print(
-"<input type=\"hidden\" name=\""+"specpath"+pathDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(startPath)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specpath"+pathDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(startPath)+"\"/>\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"
       );
     }
     
     // Document classes tab
-    if (tabName.equals(Messages.getString(locale,"FilenetConnector.DocumentClasses")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.DocumentClasses")) && actualSequenceNumber == connectionSequenceNumber)
     {
       out.print(
-"<input type=\"hidden\" name=\"hasdocumentclasses\" value=\"true\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"hasdocumentclasses\" value=\"true\"/>\n"+
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"
       );
@@ -2219,7 +2218,7 @@ public class FilenetConnector extends or
 "            <nobr>" + Messages.getBodyString(locale,"FilenetConnector.Include") + "</nobr>\n"+
 "          </td>\n"+
 "          <td class=\"value\">\n"+
-"            <nobr><input type=\"checkbox\" name=\"documentclasses\" "+((spec != null)?"checked=\"true\"":"")+" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\"></input></nobr>\n"+
+"            <nobr><input type=\"checkbox\" name=\""+seqPrefix+"documentclasses\" "+((spec != null)?"checked=\"true\"":"")+" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\"></input></nobr>\n"+
 "          </td>\n"+
 "        </tr>\n"+
 "        <tr>\n"+
@@ -2248,26 +2247,26 @@ public class FilenetConnector extends or
             String matchType = spec.getMatchType(q);
             String matchField = spec.getMatchField(q);
             String matchValue = spec.getMatchValue(q);
-            String opName = "matchop_" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass) + "_" +Integer.toString(q);
-            String labelName = "match_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q);
+            String opName = seqPrefix+"matchop_" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass) + "_" +Integer.toString(q);
+            String labelName = seqPrefix+"match_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q);
             out.print(
 "              <tr>\n"+
 "                <td class=\"description\">\n"+
 "                  <input type=\"hidden\" name=\""+opName+"\" value=\"\"/>\n"+
 "                  <a name=\""+labelName+"\">\n"+
-"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + "\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + documentClass+" match # "+Integer.toString(q)+"\" onClick='Javascript:SpecOp(\""+opName+"\",\"Delete\",\""+labelName+"\")'/>\n"+
+"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + "\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + documentClass+" match # "+Integer.toString(q)+"\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+opName+"\",\"Delete\",\""+labelName+"\")'/>\n"+
 "                  </a>\n"+
 "                </td>\n"+
 "                <td class=\"value\">\n"+
-"                  <input type=\"hidden\" name=\"matchfield_" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass) + "_" + Integer.toString(q)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchField)+"\"/>\n"+
+"                  <input type=\"hidden\" name=\""+seqPrefix+"matchfield_" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass) + "_" + Integer.toString(q)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchField)+"\"/>\n"+
 "                  <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(matchField)+"</nobr>\n"+
 "                </td>\n"+
 "                <td class=\"value\">\n"+
-"                  <input type=\"hidden\" name=\"matchtype_" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass) + "_" + Integer.toString(q)+"\" value=\""+matchType+"\"/>\n"+
+"                  <input type=\"hidden\" name=\""+seqPrefix+"matchtype_" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass) + "_" + Integer.toString(q)+"\" value=\""+matchType+"\"/>\n"+
 "                  <nobr>"+matchType+"</nobr>\n"+
 "                </td>\n"+
 "                <td class=\"value\">\n"+
-"                  <input type=\"hidden\" name=\"matchvalue_" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass) + "_" + Integer.toString(q)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchValue)+"\"/>\n"+
+"                  <input type=\"hidden\" name=\""+seqPrefix+"matchvalue_" + org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass) + "_" + Integer.toString(q)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchValue)+"\"/>\n"+
 "                  <nobr>\""+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(matchValue)+"\"</nobr>\n"+
 "                </td>\n"+
 "              </tr>\n"
@@ -2280,20 +2279,20 @@ public class FilenetConnector extends or
 "              <tr><td class=\"message\" colspan=\"4\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.NoCriteriaSpecified") + "</nobr></td></tr>\n"
             );
           }
-          String addLabelName = "match_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q);
-          String addOpName = "matchop_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass);
+          String addLabelName = seqPrefix+"match_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q);
+          String addOpName = seqPrefix+"matchop_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass);
           out.print(
 "              <tr><td class=\"lightseparator\" colspan=\"4\"><hr/></td></tr>\n"+
 "              <tr>\n"+
 "                <td class=\"description\">\n"+
-"                  <input type=\"hidden\" name=\""+"matchcount_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\""+Integer.toString(matchCount)+"\"/>\n"+
+"                  <input type=\"hidden\" name=\""+seqPrefix+"matchcount_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\""+Integer.toString(matchCount)+"\"/>\n"+
 "                  <input type=\"hidden\" name=\""+addOpName+"\" value=\"\"/>\n"+
 "                  <a name=\""+addLabelName+"\">\n"+
-"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.AddMatchFor") +org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" onClick='Javascript:SpecAddMatch(\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\",\"match_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q+1)+"\")'/>\n"+
+"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.AddMatchFor") +org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" onClick='Javascript:"+seqPrefix+"SpecAddMatch(\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\",\""+seqPrefix+"match_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q+1)+"\")'/>\n"+
 "                  </a>\n"+
 "                </td>\n"+
 "                <td class=\"value\">\n"+
-"                  <select name=\"matchfield_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" size=\"5\">\n"
+"                  <select name=\""+seqPrefix+"matchfield_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" size=\"5\">\n"
           );
           q = 0;
           while (q < fieldArray.length)
@@ -2308,14 +2307,14 @@ public class FilenetConnector extends or
 "                  </select>\n"+
 "                </td>\n"+
 "                <td class=\"value\">\n"+
-"                  <select name=\"matchtype_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\">\n"+
+"                  <select name=\""+seqPrefix+"matchtype_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\">\n"+
 "                    <option value=\"=\">" + Messages.getBodyString(locale,"FilenetConnector.Equals") + "</option>\n"+
 "                    <option value=\"!=\">" + Messages.getBodyString(locale,"FilenetConnector.NotEquals") + "</option>\n"+
 "                    <option value=\"LIKE\">" + Messages.getBodyString(locale,"FilenetConnector.Like") + "</option>\n"+
 "                  </select>\n"+
 "                </td>\n"+
 "                <td class=\"value\">\n"+
-"                  <input name=\"matchvalue_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" type=\"text\" size=\"32\" value=\"\"/>\n"+
+"                  <input name=\""+seqPrefix+"matchvalue_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" type=\"text\" size=\"32\" value=\"\"/>\n"+
 "                </td>\n"+
 "              </tr>\n"+
           
@@ -2327,7 +2326,7 @@ public class FilenetConnector extends or
 "            <nobr>" + Messages.getBodyString(locale,"FilenetConnector.IngestAllMetadataFields") + "</nobr>\n"+
 "          </td>\n"+
 "          <td class=\"value\">\n"+
-"            <nobr><input type=\"checkbox\" name=\"allmetadata_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\"true\" "+((spec != null && spec.getAllMetadata())?"checked=\"\"":"")+"></input></nobr><br/>\n"+
+"            <nobr><input type=\"checkbox\" name=\""+seqPrefix+"allmetadata_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\"true\" "+((spec != null && spec.getAllMetadata())?"checked=\"\"":"")+"></input></nobr><br/>\n"+
 "          </td>\n"+
 "        </tr>\n"+
 "        <tr>\n"+
@@ -2336,7 +2335,7 @@ public class FilenetConnector extends or
 "          </td>\n"+
 "          <td class=\"value\">\n"+
 "            <nobr>\n"+
-"              <select name=\""+"metadatafield_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" multiple=\"true\" size=\"5\">\n"
+"              <select name=\""+seqPrefix+"metadatafield_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" multiple=\"true\" size=\"5\">\n"
           );
           j = 0;
           while (j < fieldArray.length)
@@ -2366,7 +2365,7 @@ public class FilenetConnector extends or
     else
     {
       out.print(
-"<input type=\"hidden\" name=\"hasdocumentclasses\" value=\"true\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"hasdocumentclasses\" value=\"true\"/>\n"
       );
       iter = documentClasses.keySet().iterator();
       while (iter.hasNext())
@@ -2376,7 +2375,7 @@ public class FilenetConnector extends or
         if (spec.getAllMetadata())
         {
           out.print(
-"<input type=\"hidden\" name=\""+"allmetadata_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\"true\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"allmetadata_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\"true\"/>\n"
           );
         }
         else
@@ -2387,7 +2386,7 @@ public class FilenetConnector extends or
           {
             String field = metadataFields[q++];
             out.print(
-"<input type=\"hidden\" name=\""+"metadatafield_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(field)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"metadatafield_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(field)+"\"/>\n"
             );
           }
         }
@@ -2401,15 +2400,15 @@ public class FilenetConnector extends or
           String matchField = spec.getMatchField(q);
           String matchValue = spec.getMatchValue(q);
           out.print(
-"<input type=\"hidden\" name=\""+"matchfield_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchField)+"\"/>\n"+
-"<input type=\"hidden\" name=\""+"matchtype_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q)+"\" value=\""+matchType+"\"/>\n"+
-"<input type=\"hidden\" name=\""+"matchvalue_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchValue)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"matchfield_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchField)+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"matchtype_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q)+"\" value=\""+matchType+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"matchvalue_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"_"+Integer.toString(q)+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(matchValue)+"\"/>\n"
           );
           q++;
         }
         out.print(
-"<input type=\"hidden\" name=\""+"matchcount_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\""+Integer.toString(matchCount)+"\"/>\n"+
-"<input type=\"hidden\" name=\"documentclasses\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"matchcount_"+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\" value=\""+Integer.toString(matchCount)+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"documentclasses\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(documentClass)+"\"/>\n"
         );
       }
     }
@@ -2429,10 +2428,10 @@ public class FilenetConnector extends or
       }
     }
 
-    if (tabName.equals(Messages.getString(locale,"FilenetConnector.MimeTypes")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.MimeTypes")) && actualSequenceNumber == connectionSequenceNumber)
     {
       out.print(
-"<input type=\"hidden\" name=\"hasmimetypes\" value=\"true\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"hasmimetypes\" value=\"true\"/>\n"+
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"
       );
@@ -2465,7 +2464,7 @@ public class FilenetConnector extends or
         out.print(
 "    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.MimeTypesToInclude") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
-"      <select name=\"mimetypes\" size=\"10\" multiple=\"true\">\n"
+"      <select name=\""+seqPrefix+"mimetypes\" size=\"10\" multiple=\"true\">\n"
         );
         i = 0;
         while (i < mimeTypesArray.length)
@@ -2501,7 +2500,7 @@ public class FilenetConnector extends or
     else
     {
       out.print(
-"<input type=\"hidden\" name=\"hasmimetypes\" value=\"true\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"hasmimetypes\" value=\"true\"/>\n"
       );
       if (mimeTypes != null)
       {
@@ -2510,7 +2509,7 @@ public class FilenetConnector extends or
         {
           String mimeType = (String)iter.next();
           out.print(
-"<input type=\"hidden\" name=\"mimetypes\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(mimeType)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"mimetypes\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(mimeType)+"\"/>\n"
           );
         }
       }
@@ -2533,7 +2532,7 @@ public class FilenetConnector extends or
       }
     }
 
-    if (tabName.equals(Messages.getString(locale,"FilenetConnector.Security")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.Security")) && actualSequenceNumber == connectionSequenceNumber)
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -2541,8 +2540,8 @@ public class FilenetConnector extends or
 "  <tr>\n"+
 "    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.Security2") + "</nobr></td>\n"+
 "    <td class=\"value\" colspan=\"1\">\n"+
-"      <input type=\"radio\" name=\"specsecurity\" value=\"on\" "+((securityOn)?"checked=\"true\"":"")+" />" + Messages.getBodyString(locale,"FilenetConnector.Enabled") +
-"      <input type=\"radio\" name=\"specsecurity\" value=\"off\" "+((securityOn==false)?"checked=\"true\"":"")+" />" + Messages.getBodyString(locale,"FilenetConnector.Disabled") + 
+"      <input type=\"radio\" name=\""+seqPrefix+"specsecurity\" value=\"on\" "+((securityOn)?"checked=\"true\"":"")+" />" + Messages.getBodyString(locale,"FilenetConnector.Enabled") +
+"      <input type=\"radio\" name=\""+seqPrefix+"specsecurity\" value=\"off\" "+((securityOn==false)?"checked=\"true\"":"")+" />" + Messages.getBodyString(locale,"FilenetConnector.Disabled") + 
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"
@@ -2556,15 +2555,15 @@ public class FilenetConnector extends or
         if (sn.getType().equals("access"))
         {
           String accessDescription = "_"+Integer.toString(k);
-          String accessOpName = "accessop"+accessDescription;
+          String accessOpName = seqPrefix+"accessop"+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=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + "\" alt=\""+ Messages.getAttributeString(locale,"FilenetConnector.DeleteAccessToken")+Integer.toString(k)+"\" onClick='Javascript:SpecOp(\""+accessOpName+"\",\"Delete\",\"token_"+Integer.toString(k)+"\")'/>\n"+
+"      <input type=\"hidden\" name=\""+seqPrefix+"spectoken"+accessDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(token)+"\"/>\n"+
+"      <a name=\""+seqPrefix+"token_"+Integer.toString(k)+"\">\n"+
+"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + "\" alt=\""+ Messages.getAttributeString(locale,"FilenetConnector.DeleteAccessToken")+Integer.toString(k)+"\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+accessOpName+"\",\"Delete\",\""+seqPrefix+"token_"+Integer.toString(k)+"\")'/>\n"+
 "      </a>\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -2587,14 +2586,14 @@ public class FilenetConnector extends or
 "  <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=\"" + Messages.getAttributeString(locale,"FilenetConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.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=\"" + Messages.getAttributeString(locale,"FilenetConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.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"
@@ -2603,7 +2602,7 @@ public class FilenetConnector extends or
     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;
@@ -2616,13 +2615,13 @@ public class FilenetConnector extends or
           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"
       );
     }
   }
@@ -2644,11 +2643,13 @@ public class FilenetConnector extends or
     int connectionSequenceNumber)
     throws ManifoldCFException
   {
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
     String[] x;
     String y;
     int i;
 
-    if (variableContext.getParameter("hasdocumentclasses") != null)
+    if (variableContext.getParameter(seqPrefix+"hasdocumentclasses") != null)
     {
       i = 0;
       while (i < ds.getChildCount())
@@ -2658,7 +2659,7 @@ public class FilenetConnector extends or
         else
           i++;
       }
-      x = variableContext.getParameterValues("documentclasses");
+      x = variableContext.getParameterValues(seqPrefix+"documentclasses");
       if (x != null)
       {
         i = 0;
@@ -2668,14 +2669,14 @@ public class FilenetConnector extends or
           SpecificationNode node = new SpecificationNode(SPEC_NODE_DOCUMENTCLASS);
           node.setAttribute(SPEC_ATTRIBUTE_VALUE,value);
           // Get the allmetadata value for this document class
-          String allmetadata = variableContext.getParameter("allmetadata_"+value);
+          String allmetadata = variableContext.getParameter(seqPrefix+"allmetadata_"+value);
           if (allmetadata == null)
             allmetadata = "false";
           if (allmetadata.equals("true"))
             node.setAttribute(SPEC_ATTRIBUTE_ALLMETADATA,allmetadata);
           else
           {
-            String[] fields = variableContext.getParameterValues("metadatafield_"+value);
+            String[] fields = variableContext.getParameterValues(seqPrefix+"metadatafield_"+value);
             if (fields != null)
             {
               int j = 0;
@@ -2690,15 +2691,15 @@ public class FilenetConnector extends or
           }
 			
           // Now, gather up matches too
-          String matchCountString = variableContext.getParameter("matchcount_"+value);
+          String matchCountString = variableContext.getParameter(seqPrefix+"matchcount_"+value);
           int matchCount = Integer.parseInt(matchCountString);
           int q = 0;
           while (q < matchCount)
           {
-            String matchOp = variableContext.getParameter("matchop_"+value+"_"+Integer.toString(q));
-            String matchType = variableContext.getParameter("matchtype_"+value+"_"+Integer.toString(q));
-            String matchField = variableContext.getParameter("matchfield_"+value+"_"+Integer.toString(q));
-            String matchValue = variableContext.getParameter("matchvalue_"+value+"_"+Integer.toString(q));
+            String matchOp = variableContext.getParameter(seqPrefix+"matchop_"+value+"_"+Integer.toString(q));
+            String matchType = variableContext.getParameter(seqPrefix+"matchtype_"+value+"_"+Integer.toString(q));
+            String matchField = variableContext.getParameter(seqPrefix+"matchfield_"+value+"_"+Integer.toString(q));
+            String matchValue = variableContext.getParameter(seqPrefix+"matchvalue_"+value+"_"+Integer.toString(q));
             if (matchOp == null || !matchOp.equals("Delete"))
             {
               SpecificationNode matchNode = new SpecificationNode(SPEC_NODE_MATCH);
@@ -2714,12 +2715,12 @@ public class FilenetConnector extends or
           ds.addChild(ds.getChildCount(),node);
 			
           // Look for the add operation
-          String addMatchOp = variableContext.getParameter("matchop_"+value);
+          String addMatchOp = variableContext.getParameter(seqPrefix+"matchop_"+value);
           if (addMatchOp != null && addMatchOp.equals("Add"))
           {
-            String matchType = variableContext.getParameter("matchtype_"+value);
-            String matchField = variableContext.getParameter("matchfield_"+value);
-            String matchValue = variableContext.getParameter("matchvalue_"+value);
+            String matchType = variableContext.getParameter(seqPrefix+"matchtype_"+value);
+            String matchField = variableContext.getParameter(seqPrefix+"matchfield_"+value);
+            String matchValue = variableContext.getParameter(seqPrefix+"matchvalue_"+value);
             SpecificationNode matchNode = new SpecificationNode(SPEC_NODE_MATCH);
             matchNode.setAttribute(SPEC_ATTRIBUTE_MATCHTYPE,matchType);
             matchNode.setAttribute(SPEC_ATTRIBUTE_FIELDNAME,matchField);
@@ -2733,7 +2734,7 @@ public class FilenetConnector extends or
       }
     }
 	
-    if (variableContext.getParameter("hasmimetypes") != null)
+    if (variableContext.getParameter(seqPrefix+"hasmimetypes") != null)
     {
       i = 0;
       while (i < ds.getChildCount())
@@ -2743,7 +2744,7 @@ public class FilenetConnector extends or
         else
           i++;
       }
-      x = variableContext.getParameterValues("mimetypes");
+      x = variableContext.getParameterValues(seqPrefix+"mimetypes");
       if (x != null)
       {
         i = 0;
@@ -2757,7 +2758,7 @@ public class FilenetConnector extends or
       }
     }
 
-    y = variableContext.getParameter("pathcount");
+    y = variableContext.getParameter(seqPrefix+"pathcount");
     if (y != null)
     {
       // Delete all path specs first
@@ -2778,7 +2779,7 @@ public class FilenetConnector extends or
       while (i < pathCount)
       {
         String pathDescription = "_"+Integer.toString(i);
-        String pathOpName = "pathop"+pathDescription;
+        String pathOpName = seqPrefix+"pathop"+pathDescription;
         y = variableContext.getParameter(pathOpName);
         if (y != null && y.equals("Delete"))
         {
@@ -2787,7 +2788,7 @@ public class FilenetConnector extends or
           continue;
         }
         // Path inserts won't happen until the very end
-        String path = variableContext.getParameter("specpath"+pathDescription);
+        String path = variableContext.getParameter(seqPrefix+"specpath"+pathDescription);
         SpecificationNode node = new SpecificationNode(SPEC_NODE_FOLDER);
         node.setAttribute(SPEC_ATTRIBUTE_VALUE,path);
 
@@ -2796,10 +2797,10 @@ public class FilenetConnector extends or
       }
 
       // 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(SPEC_NODE_FOLDER);
         node.setAttribute(SPEC_ATTRIBUTE_VALUE,path);
         ds.addChild(ds.getChildCount(),node);
@@ -2807,18 +2808,18 @@ public class FilenetConnector extends or
       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 <= 0)
           path = "/";
         else
           path = path.substring(0,k);
-        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)
@@ -2826,11 +2827,11 @@ public class FilenetConnector extends or
           else
             path += "/" + addon;
         }
-        currentContext.save("specpath",path);
+        currentContext.save(seqPrefix+"specpath",path);
       }
     }
 
-    y = variableContext.getParameter("specsecurity");
+    y = variableContext.getParameter(seqPrefix+"specsecurity");
     if (y != null)
     {
       // Delete all security entries first
@@ -2850,7 +2851,7 @@ public class FilenetConnector extends or
 
     }
 
-    y = variableContext.getParameter("tokencount");
+    y = variableContext.getParameter(seqPrefix+"tokencount");
     if (y != null)
     {
       // Delete all file specs first
@@ -2869,7 +2870,7 @@ public class FilenetConnector extends or
       while (i < accessCount)
       {
         String accessDescription = "_"+Integer.toString(i);
-        String accessOpName = "accessop"+accessDescription;
+        String accessOpName = seqPrefix+"accessop"+accessDescription;
         y = variableContext.getParameter(accessOpName);
         if (y != null && y.equals("Delete"))
         {
@@ -2878,17 +2879,17 @@ public class FilenetConnector extends or
           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);

Modified: manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java?rev=1622740&r1=1622739&r2=1622740&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java (original)
+++ manifoldcf/trunk/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java Fri Sep  5 16:48:06 2014
@@ -515,16 +515,13 @@ public class FileConnector extends org.a
   {
     tabsArray.add(Messages.getString(locale,"FileConnector.Paths"));
 
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
     out.print(
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
-"function checkSpecification()\n"+
-"{\n"+
-"  // Does nothing right now.\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"+
@@ -553,11 +550,13 @@ public class FileConnector extends org.a
     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,"FileConnector.Paths")))
+    if (tabName.equals(Messages.getString(locale,"FileConnector.Paths")) && connectionSequenceNumber == actualSequenceNumber)
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -581,7 +580,7 @@ public class FileConnector extends org.a
         if (sn.getType().equals("startpoint"))
         {
           String pathDescription = "_"+Integer.toString(k);
-          String pathOpName = "specop"+pathDescription;
+          String pathOpName = seqPrefix+"specop"+pathDescription;
 
           String path = sn.getAttributeValue("path");
           String convertToURIString = sn.getAttributeValue("converttouri");
@@ -594,9 +593,9 @@ public class FileConnector extends org.a
 "        <tr class=\""+(((k % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <input type=\"hidden\" name=\""+pathOpName+"\" value=\"\"/>\n"+
-"            <input type=\"hidden\" name=\""+"specpath"+pathDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(sn.getAttributeValue("path"))+"\"/>\n"+
-"            <a name=\""+"path_"+Integer.toString(k)+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Delete") + "\" onClick='Javascript:SpecOp(\""+pathOpName+"\",\"Delete\",\"path_"+Integer.toString(k)+"\")' alt=\""+Messages.getAttributeString(locale,"FileConnector.DeletePath")+Integer.toString(k)+"\"/>\n"+
+"            <input type=\"hidden\" name=\""+seqPrefix+"specpath"+pathDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(sn.getAttributeValue("path"))+"\"/>\n"+
+"            <a name=\""+seqPrefix+"path_"+Integer.toString(k)+"\">\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Delete") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+pathOpName+"\",\"Delete\",\""+seqPrefix+"path_"+Integer.toString(k)+"\")' alt=\""+Messages.getAttributeString(locale,"FileConnector.DeletePath")+Integer.toString(k)+"\"/>\n"+
 "            </a>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
@@ -605,13 +604,13 @@ public class FileConnector extends org.a
 "            </nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
-"            <input type=\"hidden\" name=\"converttouri"+pathDescription+"\" value=\""+(convertToURI?"true":"false")+"\">\n"+
+"            <input type=\"hidden\" name=\""+seqPrefix+"converttouri"+pathDescription+"\" value=\""+(convertToURI?"true":"false")+"\">\n"+
 "            <nobr>\n"+
 "              "+(convertToURI?Messages.getBodyString(locale,"FileConnector.Yes"):Messages.getBodyString(locale,"FileConnector.No"))+" \n"+
 "            </nobr>\n"+
 "          </td>\n"+
 "          <td class=\"boxcell\">\n"+
-"            <input type=\"hidden\" name=\""+"specchildcount"+pathDescription+"\" value=\""+Integer.toString(sn.getChildCount())+"\"/>\n"+
+"            <input type=\"hidden\" name=\""+seqPrefix+"specchildcount"+pathDescription+"\" value=\""+Integer.toString(sn.getChildCount())+"\"/>\n"+
 "            <table class=\"formtable\">\n"+
 "              <tr class=\"formheaderrow\">\n"+
 "                <td class=\"formcolumnheader\"></td>\n"+
@@ -625,7 +624,7 @@ public class FileConnector extends org.a
           {
             SpecificationNode excludeNode = sn.getChild(j);
             String instanceDescription = "_"+Integer.toString(k)+"_"+Integer.toString(j);
-            String instanceOpName = "specop" + instanceDescription;
+            String instanceOpName = seqPrefix + "specop" + instanceDescription;
 
             String nodeFlavor = excludeNode.getType();
             String nodeType = excludeNode.getAttributeValue("type");
@@ -634,12 +633,12 @@ public class FileConnector extends org.a
 "              <tr class=\"evenformrow\">\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.InsertHere") + "\" onClick='Javascript:SpecOp(\"specop"+instanceDescription+"\",\"Insert Here\",\"match_"+Integer.toString(k)+"_"+Integer.toString(j+1)+"\")' alt=\""+Messages.getAttributeString(locale,"FileConnector.InsertNewMatchForPath")+Integer.toString(k)+" before position #"+Integer.toString(j)+"\"/>\n"+
+"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.InsertHere") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+instanceOpName+"\",\"Insert Here\",\""+seqPrefix+"match_"+Integer.toString(k)+"_"+Integer.toString(j+1)+"\")' alt=\""+Messages.getAttributeString(locale,"FileConnector.InsertNewMatchForPath")+Integer.toString(k)+" before position #"+Integer.toString(j)+"\"/>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <select name=\""+"specflavor"+instanceDescription+"\">\n"+
+"                    <select name=\""+seqPrefix+"specflavor"+instanceDescription+"\">\n"+
 "                      <option value=\"include\">" + Messages.getBodyString(locale,"FileConnector.include") + "</option>\n"+
 "                      <option value=\"exclude\">" + Messages.getBodyString(locale,"FileConnector.exclude") + "</option>\n"+
 "                    </select>\n"+
@@ -647,7 +646,7 @@ public class FileConnector extends org.a
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <select name=\""+"spectype"+instanceDescription+"\">\n"+
+"                    <select name=\""+seqPrefix+"spectype"+instanceDescription+"\">\n"+
 "                      <option value=\"file\">" + Messages.getBodyString(locale,"FileConnector.File") + "</option>\n"+
 "                      <option value=\"directory\">" + Messages.getBodyString(locale,"FileConnector.Directory") + "</option>\n"+
 "                    </select>\n"+
@@ -655,19 +654,19 @@ public class FileConnector extends org.a
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <input type=\"text\" size=\"10\" name=\""+"specmatch"+instanceDescription+"\" value=\"\"/>\n"+
+"                    <input type=\"text\" size=\"10\" name=\""+seqPrefix+"specmatch"+instanceDescription+"\" value=\"\"/>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
 "              </tr>\n"+
 "              <tr class=\"oddformrow\">\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <input type=\"hidden\" name=\""+"specop"+instanceDescription+"\" value=\"\"/>\n"+
-"                    <input type=\"hidden\" name=\""+"specfl"+instanceDescription+"\" value=\""+nodeFlavor+"\"/>\n"+
-"                    <input type=\"hidden\" name=\""+"specty"+instanceDescription+"\" value=\""+nodeType+"\"/>\n"+
-"                    <input type=\"hidden\" name=\""+"specma"+instanceDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(nodeMatch)+"\"/>\n"+
-"                    <a name=\""+"match_"+Integer.toString(k)+"_"+Integer.toString(j)+"\">\n"+
-"                      <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Delete") + "\" onClick='Javascript:SpecOp(\"specop"+instanceDescription+"\",\"Delete\",\"match_"+Integer.toString(k)+"_"+Integer.toString(j)+"\")' alt=\""+Messages.getAttributeString(locale,"FileConnector.DeletePath")+Integer.toString(k)+", match spec #"+Integer.toString(j)+"\"/>\n"+
+"                    <input type=\"hidden\" name=\""+instanceOpName+"\" value=\"\"/>\n"+
+"                    <input type=\"hidden\" name=\""+seqPrefix+"specfl"+instanceDescription+"\" value=\""+nodeFlavor+"\"/>\n"+
+"                    <input type=\"hidden\" name=\""+seqPrefix+"specty"+instanceDescription+"\" value=\""+nodeType+"\"/>\n"+
+"                    <input type=\"hidden\" name=\""+seqPrefix+"specma"+instanceDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(nodeMatch)+"\"/>\n"+
+"                    <a name=\""+seqPrefix+"match_"+Integer.toString(k)+"_"+Integer.toString(j)+"\">\n"+
+"                      <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Delete") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+instanceOpName+"\",\"Delete\",\""+seqPrefix+"match_"+Integer.toString(k)+"_"+Integer.toString(j)+"\")' alt=\""+Messages.getAttributeString(locale,"FileConnector.DeletePath")+Integer.toString(k)+", match spec #"+Integer.toString(j)+"\"/>\n"+
 "                    </a>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
@@ -700,13 +699,13 @@ public class FileConnector extends org.a
 "              <tr class=\"formrow\"><td class=\"lightseparator\" colspan=\"4\"><hr/></td></tr>\n"+
 "              <tr class=\"formrow\">\n"+
 "                <td class=\"formcolumncell\">\n"+
-"                  <a name=\""+"match_"+Integer.toString(k)+"_"+Integer.toString(j)+"\">\n"+
-"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Add") + "\" onClick='Javascript:SpecOp(\""+pathOpName+"\",\"Add\",\"match_"+Integer.toString(k)+"_"+Integer.toString(j+1)+"\")' alt=\""+Messages.getAttributeString(locale,"FileConnector.AddNewMatchForPath")+Integer.toString(k)+"\"/>\n"+
+"                  <a name=\""+seqPrefix+"match_"+Integer.toString(k)+"_"+Integer.toString(j)+"\">\n"+
+"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Add") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+pathOpName+"\",\"Add\",\""+seqPrefix+"match_"+Integer.toString(k)+"_"+Integer.toString(j+1)+"\")' alt=\""+Messages.getAttributeString(locale,"FileConnector.AddNewMatchForPath")+Integer.toString(k)+"\"/>\n"+
 "                  </a>\n"+
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <select name=\""+"specflavor"+pathDescription+"\">\n"+
+"                    <select name=\""+seqPrefix+"specflavor"+pathDescription+"\">\n"+
 "                      <option value=\"include\">" + Messages.getBodyString(locale,"FileConnector.include") + "</option>\n"+
 "                      <option value=\"exclude\">" + Messages.getBodyString(locale,"FileConnector.exclude") + "</option>\n"+
 "                    </select>\n"+
@@ -714,7 +713,7 @@ public class FileConnector extends org.a
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <select name=\""+"spectype"+pathDescription+"\">\n"+
+"                    <select name=\""+seqPrefix+"spectype"+pathDescription+"\">\n"+
 "                      <option value=\"file\">" + Messages.getBodyString(locale,"FileConnector.File") + "</option>\n"+
 "                      <option value=\"directory\">" + Messages.getBodyString(locale,"FileConnector.Directory") + "</option>\n"+
 "                    </select>\n"+
@@ -722,7 +721,7 @@ public class FileConnector extends org.a
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <input type=\"text\" size=\"10\" name=\""+"specmatch"+pathDescription+"\" value=\"\"/>\n"+
+"                    <input type=\"text\" size=\"10\" name=\""+seqPrefix+"specmatch"+pathDescription+"\" value=\"\"/>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
 "              </tr>\n"+
@@ -744,21 +743,21 @@ public class FileConnector extends org.a
 "        <tr class=\"formrow\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <nobr>\n"+
-"              <a name=\""+"path_"+Integer.toString(k)+"\">\n"+
-"                <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Add") + "\" onClick='Javascript:SpecOp(\"specop\",\"Add\",\"path_"+Integer.toString(i+1)+"\")' alt=\"" + Messages.getAttributeString(locale,"FileConnector.AddNewPath") + "\"/>\n"+
-"                <input type=\"hidden\" name=\"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"+
-"                <input type=\"hidden\" name=\"specop\" value=\"\"/>\n"+
+"              <a name=\""+seqPrefix+"path_"+Integer.toString(k)+"\">\n"+
+"                <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Add") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\""+seqPrefix+"specop\",\"Add\",\""+seqPrefix+"path_"+Integer.toString(i+1)+"\")' alt=\"" + Messages.getAttributeString(locale,"FileConnector.AddNewPath") + "\"/>\n"+
+"                <input type=\"hidden\" name=\""+seqPrefix+"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"+
+"                <input type=\"hidden\" name=\""+seqPrefix+"specop\" value=\"\"/>\n"+
 "              </a>\n"+
 "            </nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <nobr>\n"+
-"              <input type=\"text\" size=\"30\" name=\"specpath\" value=\"\"/>\n"+
+"              <input type=\"text\" size=\"30\" name=\""+seqPrefix+"specpath\" value=\"\"/>\n"+
 "            </nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <nobr>\n"+
-"              <input name=\"converttouri\" type=\"checkbox\" value=\"true\"/>\n"+
+"              <input name=\""+seqPrefix+"converttouri\" type=\"checkbox\" value=\"true\"/>\n"+
 "            </nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
@@ -789,9 +788,9 @@ public class FileConnector extends org.a
             convertToURI = true;
 
           out.print(
-"<input type=\"hidden\" name=\"specpath"+pathDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(path)+"\"/>\n"+
-"<input type=\"hidden\" name=\"converttouri"+pathDescription+"\" value=\""+(convertToURI?"true":"false")+"\">\n"+
-"<input type=\"hidden\" name=\"specchildcount"+pathDescription+"\" value=\""+Integer.toString(sn.getChildCount())+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specpath"+pathDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(path)+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"converttouri"+pathDescription+"\" value=\""+(convertToURI?"true":"false")+"\">\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"specchildcount"+pathDescription+"\" value=\""+Integer.toString(sn.getChildCount())+"\"/>\n"
           );
 
           int j = 0;
@@ -804,9 +803,9 @@ public class FileConnector extends org.a
             String nodeType = excludeNode.getAttributeValue("type");
             String nodeMatch = excludeNode.getAttributeValue("match");
             out.print(
-"<input type=\"hidden\" name=\"specfl"+instanceDescription+"\" value=\""+nodeFlavor+"\"/>\n"+
-"<input type=\"hidden\" name=\"specty"+instanceDescription+"\" value=\""+nodeType+"\"/>\n"+
-"<input type=\"hidden\" name=\"specma"+instanceDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(nodeMatch)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"specfl"+instanceDescription+"\" value=\""+nodeFlavor+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"specty"+instanceDescription+"\" value=\""+nodeType+"\"/>\n"+
+"<input type=\"hidden\" name=\""+seqPrefix+"specma"+instanceDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(nodeMatch)+"\"/>\n"
             );
             j++;
           }
@@ -814,7 +813,7 @@ public class FileConnector extends org.a
         }
       }
       out.print(
-"<input type=\"hidden\" name=\"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"
+"<input type=\"hidden\" name=\""+seqPrefix+"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"
       );
     }
     
@@ -837,7 +836,9 @@ public class FileConnector extends org.a
     int connectionSequenceNumber)
     throws ManifoldCFException
   {
-    String x = variableContext.getParameter("pathcount");
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
+    String x = variableContext.getParameter(seqPrefix+"pathcount");
     if (x != null)
     {
       ds.clearChildren();
@@ -849,7 +850,7 @@ public class FileConnector extends org.a
       while (i < pathCount)
       {
         String pathDescription = "_"+Integer.toString(i);
-        String pathOpName = "specop"+pathDescription;
+        String pathOpName = seqPrefix+"specop"+pathDescription;
         x = variableContext.getParameter(pathOpName);
         if (x != null && x.equals("Delete"))
         {
@@ -858,8 +859,8 @@ public class FileConnector extends org.a
           continue;
         }
         // Path inserts won't happen until the very end
-        String path = variableContext.getParameter("specpath"+pathDescription);
-        String convertToURI = variableContext.getParameter("converttouri"+pathDescription);
+        String path = variableContext.getParameter(seqPrefix+"specpath"+pathDescription);
+        String convertToURI = variableContext.getParameter(seqPrefix+"converttouri"+pathDescription);
 
         SpecificationNode node = new SpecificationNode("startpoint");
         node.setAttribute("path",path);
@@ -867,7 +868,7 @@ public class FileConnector extends org.a
           node.setAttribute("converttouri",convertToURI);
 
         // Now, get the number of children
-        String y = variableContext.getParameter("specchildcount"+pathDescription);
+        String y = variableContext.getParameter(seqPrefix+"specchildcount"+pathDescription);
         int childCount = Integer.parseInt(y);
         int j = 0;
         int w = 0;
@@ -875,7 +876,7 @@ public class FileConnector extends org.a
         {
           String instanceDescription = "_"+Integer.toString(i)+"_"+Integer.toString(j);
           // Look for an insert or a delete at this point
-          String instanceOp = "specop"+instanceDescription;
+          String instanceOp = seqPrefix+"specop"+instanceDescription;
           String z = variableContext.getParameter(instanceOp);
           String flavor;
           String type;
@@ -890,17 +891,17 @@ public class FileConnector extends org.a
           if (z != null && z.equals("Insert Here"))
           {
             // Process the insertion as we gather.
-            flavor = variableContext.getParameter("specflavor"+instanceDescription);
-            type = variableContext.getParameter("spectype"+instanceDescription);
-            match = variableContext.getParameter("specmatch"+instanceDescription);
+            flavor = variableContext.getParameter(seqPrefix+"specflavor"+instanceDescription);
+            type = variableContext.getParameter(seqPrefix+"spectype"+instanceDescription);
+            match = variableContext.getParameter(seqPrefix+"specmatch"+instanceDescription);
             sn = new SpecificationNode(flavor);
             sn.setAttribute("type",type);
             sn.setAttribute("match",match);
             node.addChild(w++,sn);
           }
-          flavor = variableContext.getParameter("specfl"+instanceDescription);
-          type = variableContext.getParameter("specty"+instanceDescription);
-          match = variableContext.getParameter("specma"+instanceDescription);
+          flavor = variableContext.getParameter(seqPrefix+"specfl"+instanceDescription);
+          type = variableContext.getParameter(seqPrefix+"specty"+instanceDescription);
+          match = variableContext.getParameter(seqPrefix+"specma"+instanceDescription);
           sn = new SpecificationNode(flavor);
           sn.setAttribute("type",type);
           sn.setAttribute("match",match);
@@ -910,9 +911,9 @@ public class FileConnector extends org.a
         if (x != null && x.equals("Add"))
         {
           // Process adds to the end of the rules in-line
-          String match = variableContext.getParameter("specmatch"+pathDescription);
-          String type = variableContext.getParameter("spectype"+pathDescription);
-          String flavor = variableContext.getParameter("specflavor"+pathDescription);
+          String match = variableContext.getParameter(seqPrefix+"specmatch"+pathDescription);
+          String type = variableContext.getParameter(seqPrefix+"spectype"+pathDescription);
+          String flavor = variableContext.getParameter(seqPrefix+"specflavor"+pathDescription);
           SpecificationNode sn = new SpecificationNode(flavor);
           sn.setAttribute("type",type);
           sn.setAttribute("match",match);
@@ -923,11 +924,11 @@ public class FileConnector extends org.a
       }
 
       // See if there's a global add operation
-      String op = variableContext.getParameter("specop");
+      String op = variableContext.getParameter(seqPrefix+"specop");
       if (op != null && op.equals("Add"))
       {
-        String path = variableContext.getParameter("specpath");
-        String convertToURI = variableContext.getParameter("converttouri");
+        String path = variableContext.getParameter(seqPrefix+"specpath");
+        String convertToURI = variableContext.getParameter(seqPrefix+"converttouri");
 
         SpecificationNode node = new SpecificationNode("startpoint");
         node.setAttribute("path",path);

Modified: manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java?rev=1622740&r1=1622739&r2=1622740&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java (original)
+++ manifoldcf/trunk/connectors/generic/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/generic/GenericConnector.java Fri Sep  5 16:48:06 2014
@@ -442,7 +442,7 @@ public class GenericConnector extends Ba
             try {
               // Can only index while background thread is running!
               doc.setBinary(is, fileLength);
-              activities.ingestDocument(documentIdentifiers[i], versions[i], item.url, doc);
+              activities.ingestDocumentWithException(documentIdentifiers[i], versions[i], item.url, doc);
             } finally {
               is.close();
             }
@@ -613,35 +613,33 @@ public class GenericConnector extends Ba
     tabsArray.add(Messages.getString(locale, "generic.Parameters"));
     tabsArray.add(Messages.getString(locale, "generic.Security"));
 
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
     out.print(
       "<script type=\"text/javascript\">\n"
       + "<!--\n"
-      + "function SpecOp(n, opValue, anchorvalue) {\n"
+      + "function "+seqPrefix+"SpecOp(n, opValue, anchorvalue) {\n"
       + "  eval(\"editjob.\"+n+\".value = \\\"\"+opValue+\"\\\"\");\n"
       + "  postFormSetAnchor(anchorvalue);\n"
       + "}\n"
       + "\n"
-      + "function checkSpecification() {\n"
-      + "  return true;\n"
-      + "}\n"
-      + "\n"
-      + "function SpecAddToken(anchorvalue) {\n"
-      + "  if (editjob.spectoken.value == \"\")\n"
+      + "function "+seqPrefix+"SpecAddToken(anchorvalue) {\n"
+      + "  if (editjob."+seqPrefix+"spectoken.value == \"\")\n"
       + "  {\n"
       + "    alert(\"" + Messages.getBodyJavascriptString(locale, "generic.TypeInAnAccessToken") + "\");\n"
-      + "    editjob.spectoken.focus();\n"
+      + "    editjob."+seqPrefix+"spectoken.focus();\n"
       + "    return;\n"
       + "  }\n"
-      + "  SpecOp(\"accessop\",\"Add\",anchorvalue);\n"
+      + "  "+seqPrefix+"SpecOp(\""+seqPrefix+"accessop\",\"Add\",anchorvalue);\n"
       + "}\n"
-      + "function SpecAddParam(anchorvalue) {\n"
-      + "  if (editjob.specparamname.value == \"\")\n"
+      + "function "+seqPrefix+"SpecAddParam(anchorvalue) {\n"
+      + "  if (editjob."+seqPrefix+"specparamname.value == \"\")\n"
       + "  {\n"
       + "    alert(\"" + Messages.getBodyJavascriptString(locale, "generic.TypeInParamName") + "\");\n"
-      + "    editjob.specparamname.focus();\n"
+      + "    editjob."+seqPrefix+"specparamname.focus();\n"
       + "    return;\n"
       + "  }\n"
-      + "  SpecOp(\"paramop\",\"Add\",anchorvalue);\n"
+      + "  "+seqPrefix+"SpecOp(\""+seqPrefix+"paramop\",\"Add\",anchorvalue);\n"
       + "}\n"
       + "//-->\n"
       + "</script>\n");
@@ -652,9 +650,11 @@ public class GenericConnector extends Ba
     int connectionSequenceNumber, int actualSequenceNumber, String tabName)
     throws ManifoldCFException, IOException {
 
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+
     int k, i;
 
-    if (tabName.equals(Messages.getString(locale, "generic.Parameters"))) {
+    if (tabName.equals(Messages.getString(locale, "generic.Parameters")) && connectionSequenceNumber == actualSequenceNumber) {
 
       out.print("<table class=\"displaytable\">"
         + "<tr><td class=\"description\"><nobr>" + Messages.getBodyString(locale, "generic.ParametersColon") + "</nobr></td>"
@@ -673,22 +673,22 @@ public class GenericConnector extends Ba
         SpecificationNode sn = ds.getChild(i++);
         if (sn.getType().equals("param")) {
           String paramDescription = "_" + Integer.toString(k);
-          String paramOpName = "paramop" + paramDescription;
+          String paramOpName = seqPrefix + "paramop" + paramDescription;
           String paramName = sn.getAttributeValue("name");
           String paramValue = sn.getValue();
           out.print(
             "  <tr class=\"evenformrow\">\n"
             + "    <td class=\"formcolumncell\">\n"
             + "      <input type=\"hidden\" name=\"" + paramOpName + "\" value=\"\"/>\n"
-            + "      <a name=\"" + "param_" + Integer.toString(k) + "\">\n"
+            + "      <a name=\"" + seqPrefix + "param_" + Integer.toString(k) + "\">\n"
             + "        <input type=\"button\" value=\"" + Messages.getAttributeString(locale, "generic.Delete") + "\" onClick='Javascript:SpecOp(\"" + paramOpName + "\",\"Delete\",\"param" + paramDescription + "\")' alt=\"" + Messages.getAttributeString(locale, "generic.DeleteParameter") + Integer.toString(k) + "\"/>\n"
             + "      </a>&nbsp;\n"
             + "    </td>\n"
             + "    <td class=\"formcolumncell\">\n"
-            + "      <input type=\"text\" name=\"specparamname" + paramDescription + "\" value=\"" + Encoder.attributeEscape(paramName) + "\"/>\n"
+            + "      <input type=\"text\" name=\""+seqPrefix+"specparamname" + paramDescription + "\" value=\"" + Encoder.attributeEscape(paramName) + "\"/>\n"
             + "    </td>\n"
             + "    <td class=\"formcolumncell\">\n"
-            + "      <input type=\"text\" name=\"specparamvalue" + paramDescription + "\" value=\"" + Encoder.attributeEscape(paramValue) + "\"/>\n"
+            + "      <input type=\"text\" name=\""+seqPrefix+"specparamvalue" + paramDescription + "\" value=\"" + Encoder.attributeEscape(paramValue) + "\"/>\n"
             + "    </td>\n"
             + "  </tr>\n");
           k++;
@@ -704,17 +704,17 @@ public class GenericConnector extends Ba
         "  <tr><td class=\"lightseparator\" colspan=\"3\"><hr/></td></tr>\n"
         + "  <tr class=\"evenformrow\">\n"
         + "    <td class=\"formcolumncell\">\n"
-        + "      <input type=\"hidden\" name=\"paramcount\" value=\"" + Integer.toString(k) + "\"/>\n"
-        + "      <input type=\"hidden\" name=\"paramop\" value=\"\"/>\n"
-        + "      <a name=\"param_" + Integer.toString(k) + "\">\n"
-        + "        <input type=\"button\" value=\"" + Messages.getAttributeString(locale, "generic.Add") + "\" onClick='Javascript:SpecAddParam(\"param_" + Integer.toString(k + 1) + "\")' alt=\"" + Messages.getAttributeString(locale, "generic.AddParameter") + "\"/>\n"
+        + "      <input type=\"hidden\" name=\""+seqPrefix+"paramcount\" value=\"" + Integer.toString(k) + "\"/>\n"
+        + "      <input type=\"hidden\" name=\""+seqPrefix+"paramop\" value=\"\"/>\n"
+        + "      <a name=\""+seqPrefix+"param_" + Integer.toString(k) + "\">\n"
+        + "        <input type=\"button\" value=\"" + Messages.getAttributeString(locale, "generic.Add") + "\" onClick='Javascript:"+seqPrefix+"SpecAddParam(\""+seqPrefix+"param_" + Integer.toString(k + 1) + "\")' alt=\"" + Messages.getAttributeString(locale, "generic.AddParameter") + "\"/>\n"
         + "      </a>&nbsp;\n"
         + "    </td>\n"
         + "    <td class=\"formcolumncell\">\n"
-        + "      <input type=\"text\" size=\"30\" name=\"specparamname\" value=\"\"/>\n"
+        + "      <input type=\"text\" size=\"30\" name=\""+seqPrefix+"specparamname\" value=\"\"/>\n"
         + "    </td>\n"
         + "    <td class=\"formcolumncell\">\n"
-        + "      <input type=\"text\" size=\"30\" name=\"specparamvalue\" value=\"\"/>\n"
+        + "      <input type=\"text\" size=\"30\" name=\""+seqPrefix+"specparamvalue\" value=\"\"/>\n"
         + "    </td>\n"
         + "  </tr>\n"
         + "</table>\n");
@@ -729,12 +729,12 @@ public class GenericConnector extends Ba
           String paramName = sn.getAttributeValue("name");
           String paramValue = sn.getValue();
           out.print(
-            "<input type=\"hidden\" name=\"" + "specparamname" + accessDescription + "\" value=\"" + Encoder.attributeEscape(paramName) + "\"/>\n"
-            + "<input type=\"hidden\" name=\"" + "specparamvalue" + accessDescription + "\" value=\"" + Encoder.attributeEscape(paramValue) + "\"/>\n");
+            "<input type=\"hidden\" name=\"" + seqPrefix + "specparamname" + accessDescription + "\" value=\"" + Encoder.attributeEscape(paramName) + "\"/>\n"
+            + "<input type=\"hidden\" name=\"" + seqPrefix + "specparamvalue" + accessDescription + "\" value=\"" + Encoder.attributeEscape(paramValue) + "\"/>\n");
           k++;
         }
       }
-      out.print("<input type=\"hidden\" name=\"paramcount\" value=\"" + Integer.toString(k) + "\"/>\n");
+      out.print("<input type=\"hidden\" name=\""+seqPrefix+"paramcount\" value=\"" + Integer.toString(k) + "\"/>\n");
     }
 
     // Security tab
@@ -745,7 +745,7 @@ public class GenericConnector extends Ba
         genericAuthMode = sn.getValue();
       }
     }
-    if (tabName.equals(Messages.getString(locale, "generic.Security"))) {
+    if (tabName.equals(Messages.getString(locale, "generic.Security")) && connectionSequenceNumber == actualSequenceNumber) {
       out.print(
         "<table class=\"displaytable\">\n"
         + "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n");
@@ -753,8 +753,8 @@ public class GenericConnector extends Ba
       out.print("  <tr>\n"
         + "    <td class=\"description\">" + Messages.getBodyString(locale, "generic.AuthMode") + "</td>\n"
         + "    <td class=\"value\" >\n"
-        + "      <input type=\"radio\" name=\"genericAuthMode\" value=\"provided\" " + ("provided".equals(genericAuthMode) ? "checked=\"checked\"" : "") + "/>" + Messages.getBodyString(locale, "generic.AuthModeProvided") + "<br/>\n"
-        + "      <input type=\"radio\" name=\"genericAuthMode\" value=\"forced\" " + ("forced".equals(genericAuthMode) ? "checked=\"checked\"" : "") + "/>" + Messages.getBodyString(locale, "generic.AuthModeForced") + "<br/>\n"
+        + "      <input type=\"radio\" name=\""+seqPrefix+"genericAuthMode\" value=\"provided\" " + ("provided".equals(genericAuthMode) ? "checked=\"checked\"" : "") + "/>" + Messages.getBodyString(locale, "generic.AuthModeProvided") + "<br/>\n"
+        + "      <input type=\"radio\" name=\""+seqPrefix+"genericAuthMode\" value=\"forced\" " + ("forced".equals(genericAuthMode) ? "checked=\"checked\"" : "") + "/>" + Messages.getBodyString(locale, "generic.AuthModeForced") + "<br/>\n"
         + "    </td>\n"
         + "  </tr>\n");
       // Go through forced ACL
@@ -771,15 +771,15 @@ public class GenericConnector extends Ba
         SpecificationNode sn = ds.getChild(i++);
         if (sn.getType().equals("access")) {
           String accessDescription = "_" + Integer.toString(k);
-          String accessOpName = "accessop" + accessDescription;
+          String accessOpName = seqPrefix + "accessop" + accessDescription;
           String token = sn.getAttributeValue("token");
           out.print(
             "  <tr class=\"evenformrow\">\n"
             + "    <td class=\"formcolumncell\">\n"
             + "      <input type=\"hidden\" name=\"" + accessOpName + "\" value=\"\"/>\n"
-            + "      <input type=\"hidden\" name=\"" + "spectoken" + accessDescription + "\" value=\"" + Encoder.attributeEscape(token) + "\"/>\n"
-            + "      <a name=\"" + "token_" + Integer.toString(k) + "\">\n"
-            + "        <input type=\"button\" value=\"" + Messages.getAttributeString(locale, "generic.Delete") + "\" onClick='Javascript:SpecOp(\"" + accessOpName + "\",\"Delete\",\"token_" + Integer.toString(k) + "\")' alt=\"" + Messages.getAttributeString(locale, "generic.DeleteToken") + Integer.toString(k) + "\"/>\n"
+            + "      <input type=\"hidden\" name=\"" + seqPrefix + "spectoken" + accessDescription + "\" value=\"" + Encoder.attributeEscape(token) + "\"/>\n"
+            + "      <a name=\"" + seqPrefix + "token_" + Integer.toString(k) + "\">\n"
+            + "        <input type=\"button\" value=\"" + Messages.getAttributeString(locale, "generic.Delete") + "\" onClick='Javascript:"+seqPrefix+"SpecOp(\"" + accessOpName + "\",\"Delete\",\""+seqPrefix+"token_" + Integer.toString(k) + "\")' alt=\"" + Messages.getAttributeString(locale, "generic.DeleteToken") + Integer.toString(k) + "\"/>\n"
             + "      </a>&nbsp;\n"
             + "    </td>\n"
             + "    <td class=\"formcolumncell\">\n"
@@ -799,14 +799,14 @@ public class GenericConnector extends Ba
         "  <tr><td class=\"lightseparator\" colspan=\"2\"><hr/></td></tr>\n"
         + "  <tr class=\"evenformrow\">\n"
         + "    <td class=\"formcolumncell\">\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=\"" + Messages.getAttributeString(locale, "generic.Add") + "\" onClick='Javascript:SpecAddToken(\"token_" + Integer.toString(k + 1) + "\")' alt=\"" + Messages.getAttributeString(locale, "generic.AddAccessToken") + "\"/>\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=\"" + Messages.getAttributeString(locale, "generic.Add") + "\" onClick='Javascript:"+seqPrefix+"SpecAddToken(\""+seqPrefix+"token_" + Integer.toString(k + 1) + "\")' alt=\"" + Messages.getAttributeString(locale, "generic.AddAccessToken") + "\"/>\n"
         + "      </a>&nbsp;\n"
         + "    </td>\n"
         + "    <td class=\"formcolumncell\">\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");
@@ -819,14 +819,14 @@ public class GenericConnector extends Ba
         SpecificationNode sn = ds.getChild(i++);
         if (sn.getType().equals("access")) {
           String accessDescription = "_" + Integer.toString(k);
-          String token = "" + sn.getAttributeValue("token");
+          String token = sn.getAttributeValue("token");
           out.print(
-            "<input type=\"hidden\" name=\"" + "spectoken" + accessDescription + "\" value=\"" + Encoder.attributeEscape(token) + "\"/>\n");
+            "<input type=\"hidden\" name=\"" + seqPrefix + "spectoken" + accessDescription + "\" value=\"" + Encoder.attributeEscape(token) + "\"/>\n");
           k++;
         }
       }
-      out.print("<input type=\"hidden\" name=\"tokencount\" value=\"" + Integer.toString(k) + "\"/>\n");
-      out.print("<input type=\"hidden\" name=\"genericAuthMode\" value=\"" + Encoder.attributeEscape(genericAuthMode) + "\"/>\n");
+      out.print("<input type=\"hidden\" name=\""+seqPrefix+"tokencount\" value=\"" + Integer.toString(k) + "\"/>\n");
+      out.print("<input type=\"hidden\" name=\""+seqPrefix+"genericAuthMode\" value=\"" + Encoder.attributeEscape(genericAuthMode) + "\"/>\n");
     }
   }
 
@@ -834,8 +834,9 @@ public class GenericConnector extends Ba
   public String processSpecificationPost(IPostParameters variableContext, Locale locale, Specification ds,
     int connectionSequenceNumber)
     throws ManifoldCFException {
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
 
-    String xc = variableContext.getParameter("paramcount");
+    String xc = variableContext.getParameter(seqPrefix+"paramcount");
     if (xc != null) {
       // Delete all tokens first
       int i = 0;
@@ -852,7 +853,7 @@ public class GenericConnector extends Ba
       i = 0;
       while (i < accessCount) {
         String paramDescription = "_" + Integer.toString(i);
-        String paramOpName = "paramop" + paramDescription;
+        String paramOpName = seqPrefix + "paramop" + paramDescription;
         xc = variableContext.getParameter(paramOpName);
         if (xc != null && xc.equals("Delete")) {
           // Next row
@@ -860,8 +861,8 @@ public class GenericConnector extends Ba
           continue;
         }
         // Get the stuff we need
-        String paramName = variableContext.getParameter("specparamname" + paramDescription);
-        String paramValue = variableContext.getParameter("specparamvalue" + paramDescription);
+        String paramName = variableContext.getParameter(seqPrefix + "specparamname" + paramDescription);
+        String paramValue = variableContext.getParameter(seqPrefix + "specparamvalue" + paramDescription);
         SpecificationNode node = new SpecificationNode("param");
         node.setAttribute("name", paramName);
         node.setValue(paramValue);
@@ -869,10 +870,10 @@ public class GenericConnector extends Ba
         i++;
       }
 
-      String op = variableContext.getParameter("paramop");
+      String op = variableContext.getParameter(seqPrefix+"paramop");
       if (op != null && op.equals("Add")) {
-        String paramName = variableContext.getParameter("specparamname");
-        String paramValue = variableContext.getParameter("specparamvalue");
+        String paramName = variableContext.getParameter(seqPrefix+"specparamname");
+        String paramValue = variableContext.getParameter(seqPrefix+"specparamvalue");
         SpecificationNode node = new SpecificationNode("param");
         node.setAttribute("name", paramName);
         node.setValue(paramValue);
@@ -880,7 +881,7 @@ public class GenericConnector extends Ba
       }
     }
 
-    String redmineAuthMode = variableContext.getParameter("genericAuthMode");
+    String redmineAuthMode = variableContext.getParameter(seqPrefix+"genericAuthMode");
     if (redmineAuthMode != null) {
       // Delete existing seeds record first
       int i = 0;
@@ -897,7 +898,7 @@ public class GenericConnector extends Ba
       ds.addChild(ds.getChildCount(), cn);
     }
 
-    xc = variableContext.getParameter("tokencount");
+    xc = variableContext.getParameter(seqPrefix+"tokencount");
     if (xc != null) {
       // Delete all tokens first
       int i = 0;
@@ -914,7 +915,7 @@ public class GenericConnector extends Ba
       i = 0;
       while (i < accessCount) {
         String accessDescription = "_" + Integer.toString(i);
-        String accessOpName = "accessop" + accessDescription;
+        String accessOpName = seqPrefix + "accessop" + accessDescription;
         xc = variableContext.getParameter(accessOpName);
         if (xc != null && xc.equals("Delete")) {
           // Next row
@@ -922,16 +923,16 @@ public class GenericConnector extends Ba
           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);



Mime
View raw message