manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1224641 [3/8] - in /incubator/lcf/branches/CONNECTORS-335: ./ connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ connectors/alfresco/ connectors/alfresco/connector/src/main/jav...
Date Sun, 25 Dec 2011 20:11:01 GMT
Modified: incubator/lcf/branches/CONNECTORS-335/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java Sun Dec 25 20:10:58 2011
@@ -1451,13 +1451,14 @@ public class FilenetConnector extends or
   *@param tabsArray is an array of tab names.  Add to this array any tab names that are specific to the connector.
   */
   @Override
-  public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, List<String> tabsArray)
+  public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out,
+    Locale locale, ConfigParams parameters, List<String> tabsArray)
     throws ManifoldCFException, IOException
   {
-    tabsArray.add(Messages.getString("FilenetConnector.Server"));
-    tabsArray.add(Messages.getString("FilenetConnector.ObjectStore"));
-    tabsArray.add(Messages.getString("FilenetConnector.DocumentURL"));
-    tabsArray.add(Messages.getString("FilenetConnector.Credentials"));
+    tabsArray.add(Messages.getString(locale,"FilenetConnector.Server"));
+    tabsArray.add(Messages.getString(locale,"FilenetConnector.ObjectStore"));
+    tabsArray.add(Messages.getString(locale,"FilenetConnector.DocumentURL"));
+    tabsArray.add(Messages.getString(locale,"FilenetConnector.Credentials"));
     out.print(
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
@@ -1484,28 +1485,28 @@ public class FilenetConnector extends or
 "  if (editconnection.serverhostname.value == \"\")\n"+
 "  {\n"+
 "    alert(\"The connection requires a FileNet host name\");\n"+
-"    SelectTab(\"" + Messages.getString("FilenetConnector.Server") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.Server") + "\");\n"+
 "    editconnection.serverhostname.focus();\n"+
 "    return false;\n"+
 "  }\n"+
 "  if (editconnection.serverport.value != \"\" && !isInteger(editconnection.serverport.value))\n"+
 "  {\n"+
 "    alert(\"The server port must be an integer\");\n"+
-"    SelectTab(\"" + Messages.getString("FilenetConnector.Server") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.Server") + "\");\n"+
 "    editconnection.serverport.focus();\n"+
 "    return false;\n"+
 "  }\n"+
 "  if (editconnection.urlhostname.value == \"\")\n"+
 "  {\n"+
 "    alert(\"The Document URL requires a host name\");\n"+
-"    SelectTab(\"" + Messages.getString("FilenetConnector.DocumentURL") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.DocumentURL") + "\");\n"+
 "    editconnection.urlhostname.focus();\n"+
 "    return false;\n"+
 "  }\n"+
 "  if (editconnection.urlport.value != \"\" && !isInteger(editconnection.urlport.value))\n"+
 "  {\n"+
 "    alert(\"The Document URL port must be an integer\");\n"+
-"    SelectTab(\"" + Messages.getString("FilenetConnector.DocumentURL") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.DocumentURL") + "\");\n"+
 "    editconnection.urlport.focus();\n"+
 "    return false;\n"+
 "  }\n"+
@@ -1513,28 +1514,28 @@ public class FilenetConnector extends or
 "  if (editconnection.filenetdomain.value == \"\")\n"+
 "  {\n"+
 "    alert(\"The file net domain name cannot be null\");\n"+
-"    SelectTab(\"" + Messages.getString("FilenetConnector.ObjectStore") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.ObjectStore") + "\");\n"+
 "    editconnection.filenetdomain.focus();\n"+
 "    return false;\n"+
 "  }\n"+
 "  if (editconnection.objectstore.value == \"\")\n"+
 "  {\n"+
 "    alert(\"The object store name cannot be null\");\n"+
-"    SelectTab(\"" + Messages.getString("FilenetConnector.ObjectStore") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.ObjectStore") + "\");\n"+
 "    editconnection.objectstore.focus();\n"+
 "    return false;\n"+
 "  }\n"+
 "  if (editconnection.userid.value == \"\")\n"+
 "  {\n"+
 "    alert(\"The connection requires a valid FileNet user ID\");\n"+
-"    SelectTab(\"" + Messages.getString("FilenetConnector.Credentials") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.Credentials") + "\");\n"+
 "    editconnection.userid.focus();\n"+
 "    return false;\n"+
 "  }\n"+
 "  if (editconnection.password.value == \"\")\n"+
 "  {\n"+
 "    alert(\"The connection requires the FileNet user's password\");\n"+
-"    SelectTab(\"" + Messages.getString("FilenetConnector.Credentials") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"FilenetConnector.Credentials") + "\");\n"+
 "    editconnection.password.focus();\n"+
 "    return false;\n"+
 "  }\n"+
@@ -1556,7 +1557,8 @@ public class FilenetConnector extends or
   *@param tabName is the current tab name.
   */
   @Override
-  public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, String tabName)
+  public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out,
+    Locale locale, ConfigParams parameters, String tabName)
     throws ManifoldCFException, IOException
   {
     String userID = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_USERID);
@@ -1601,13 +1603,13 @@ public class FilenetConnector extends or
       urllocation = "Workplace/Browse.jsp";
 
     // "Server" tab
-    if (tabName.equals(Messages.getString("FilenetConnector.Server")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.Server")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.ServerProtocol") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.ServerProtocol") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <select name=\"serverprotocol\" size=\"2\">\n"+
 "        <option value=\"http\" "+(serverprotocol.equals("http")?"selected=\"true\"":"")+">http</option>\n"+
@@ -1616,13 +1618,13 @@ public class FilenetConnector extends or
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.ServerHostName") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"serverhostname\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(serverhostname)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.ServerHostName") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"serverhostname\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(serverhostname)+"\"/></td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.ServerPort") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"5\" name=\"serverport\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(serverport)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.ServerPort") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"5\" name=\"serverport\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(serverport)+"\"/></td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.ServerWebServiceLocation") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"serverwsilocation\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(serverwsilocation)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.ServerWebServiceLocation") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"serverwsilocation\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(serverwsilocation)+"\"/></td>\n"+
 "  </tr>\n"+
 "</table>\n"
       );
@@ -1639,13 +1641,13 @@ public class FilenetConnector extends or
     }
 
     // "Document URL" tab
-    if (tabName.equals(Messages.getString("FilenetConnector.DocumentURL")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.DocumentURL")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.DocumentURLProtocol") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.DocumentURLProtocol") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <select name=\"urlprotocol\" size=\"2\">\n"+
 "        <option value=\"http\" "+(serverprotocol.equals("http")?"selected=\"true\"":"")+">http</option>\n"+
@@ -1654,13 +1656,13 @@ public class FilenetConnector extends or
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.DocumentURLHostName") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"urlhostname\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(urlhostname)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.DocumentURLHostName") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"urlhostname\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(urlhostname)+"\"/></td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.DocumentURLPort") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"5\" name=\"urlport\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(urlport)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.DocumentURLPort") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"5\" name=\"urlport\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(urlport)+"\"/></td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + DocumentURLLocation + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"urllocation\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(urllocation)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.DocumentURLLocation") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"urllocation\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(urllocation)+"\"/></td>\n"+
 "  </tr>\n"+
 "</table>\n"
       );
@@ -1677,16 +1679,16 @@ public class FilenetConnector extends or
     }
 
     // "Object Store" tab
-    if (tabName.equals(Messages.getString("FilenetConnector.ObjectStore")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.ObjectStore")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.FileNetDomainName") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"filenetdomain\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(filenetdomain)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.FileNetDomainName") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"filenetdomain\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(filenetdomain)+"\"/></td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.ObjectStoreName") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"objectstore\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(objectstore)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.ObjectStoreName") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"objectstore\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(objectstore)+"\"/></td>\n"+
 "  </tr>\n"+
 "</table>\n"
       );
@@ -1702,16 +1704,16 @@ public class FilenetConnector extends or
 
 
     // "Credentials" tab
-    if (tabName.equals(Messages.getString("FilenetConnector.Credentials")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.Credentials")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.UserID") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"userid\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(userID)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.UserID") + "</nobr></td><td class=\"value\"><input type=\"text\" size=\"32\" name=\"userid\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(userID)+"\"/></td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.Password") + "</nobr></td><td class=\"value\"><input type=\"password\" size=\"32\" name=\"password\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.Password") + "</nobr></td><td class=\"value\"><input type=\"password\" size=\"32\" name=\"password\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/></td>\n"+
 "  </tr>\n"+
 "</table>\n"
       );
@@ -1737,7 +1739,8 @@ public class FilenetConnector extends or
   *@return null if all is well, or a string error message if there is an error that should prevent saving of the connection (and cause a redirection to an error page).
   */
   @Override
-  public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, ConfigParams parameters)
+  public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext,
+    Locale locale, ConfigParams parameters)
     throws ManifoldCFException
   {
     String serverprotocol = variableContext.getParameter("serverprotocol");
@@ -1798,13 +1801,14 @@ public class FilenetConnector extends or
   *@param parameters are the configuration parameters, as they currently exist, for this connection being configured.
   */
   @Override
-  public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters)
+  public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out,
+    Locale locale, ConfigParams parameters)
     throws ManifoldCFException, IOException
   {
     out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getString("FilenetConnector.Parameters") + "</nobr></td>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.Parameters") + "</nobr></td>\n"+
 "    <td class=\"value\" colspan=\"3\">\n"
     );
 
@@ -1848,13 +1852,13 @@ public class FilenetConnector extends or
   *@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, DocumentSpecification ds, List<String> tabsArray)
+  public void outputSpecificationHeader(IHTTPOutput out, Locale locale, DocumentSpecification ds, List<String> tabsArray)
     throws ManifoldCFException, IOException
   {
-    tabsArray.add(Messages.getString("FilenetConnector.DocumentClasses"));
-    tabsArray.add(Messages.getString("FilenetConnector.MimeTypes"));
-    tabsArray.add(Messages.getString("FilenetConnector.Folders"));
-    tabsArray.add(Messages.getString("FilenetConnector.Security"));
+    tabsArray.add(Messages.getString(locale,"FilenetConnector.DocumentClasses"));
+    tabsArray.add(Messages.getString(locale,"FilenetConnector.MimeTypes"));
+    tabsArray.add(Messages.getString(locale,"FilenetConnector.Folders"));
+    tabsArray.add(Messages.getString(locale,"FilenetConnector.Security"));
     out.print(
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
@@ -1925,7 +1929,7 @@ public class FilenetConnector extends or
   *@param tabName is the current tab name.
   */
   @Override
-  public void outputSpecificationBody(IHTTPOutput out, DocumentSpecification ds, String tabName)
+  public void outputSpecificationBody(IHTTPOutput out, Locale locale, DocumentSpecification ds, String tabName)
     throws ManifoldCFException, IOException
   {
     int i;
@@ -1949,7 +1953,7 @@ public class FilenetConnector extends or
     }
 
     // Folders tab
-    if (tabName.equals(Messages.getString("FilenetConnector.Folders")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.Folders")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -1972,7 +1976,7 @@ public class FilenetConnector extends or
 "  <tr>\n"+
 "    <td class=\"value\">\n"+
 "      <a name=\""+"path_"+Integer.toString(k)+"\">\n"+
-"        <input type=\"button\" value=\"" + Messages.getString("FilenetConnector.Delete") + "\" alt=\""+Messages.getString("FilenetConnector.DeletePath")+Integer.toString(k)+"\" onClick='Javascript:SpecOp(\""+pathOpName+"\",\"Delete\",\"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>&nbsp;\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -1989,7 +1993,7 @@ public class FilenetConnector extends or
       {
         out.print(
 "  <tr>\n"+
-"    <td class=\"message\" colspan=\"2\">" + Messages.getString("FilenetConnector.NoFoldersChosen") + "</td>\n"+
+"    <td class=\"message\" colspan=\"2\">" + Messages.getBodyString(locale,"FilenetConnector.NoFoldersChosen") + "</td>\n"+
 "  </tr>\n"
         );
       }
@@ -2022,22 +2026,22 @@ public class FilenetConnector extends or
         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.getString("FilenetConnector.Add") + "\" alt=\"" + Messages.getString("FilenetConnector.AddPath") + "\" onClick='Javascript:SpecOp(\"pathop\",\"Add\",\"path_"+Integer.toString(k+1)+"\")'/>\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"+
 "          &nbsp;"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(pathSoFar)+"\n"
         );
         if (pathSoFar.length() > 0)
         {
           out.print(
-"          <input type=\"button\" value=\"-\" alt=\"" + Messages.getString("FilenetConnector.RemoveFromPath") + "\" onClick='Javascript:SpecOp(\"pathop\",\"Up\",\"path_"+Integer.toString(k)+"\")'/>\n"
+"          <input type=\"button\" value=\"-\" alt=\"" + Messages.getAttributeString(locale,"FilenetConnector.RemoveFromPath") + "\" onClick='Javascript:SpecOp(\"pathop\",\"Up\",\"path_"+Integer.toString(k)+"\")'/>\n"
           );
         }
         if (childList.length > 0)
         {
           out.print(
 "          <nobr>\n"+
-"            <input type=\"button\" value=\"+\" alt=\"" + Messages.getString("FilenetConnector.AddToPath") + "\" onClick='Javascript:SpecAddToPath(\"path_"+Integer.toString(k)+"\")'/>&nbsp;\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"+
-"              <option value=\"\" selected=\"selected\">-- " + Messages.getString("FilenetConnector.PickAFolder") + " --</option>\n"
+"              <option value=\"\" selected=\"selected\">-- " + Messages.getBodyString(locale,"FilenetConnector.PickAFolder") + " --</option>\n"
           );
           int j = 0;
           while (j < childList.length)
@@ -2096,7 +2100,7 @@ public class FilenetConnector extends or
     }
     
     // Document classes tab
-    if (tabName.equals(Messages.getString("FilenetConnector.DocumentClasses")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.DocumentClasses")))
     {
       out.print(
 "<input type=\"hidden\" name=\"hasdocumentclasses\" value=\"true\"/>\n"+
@@ -2151,7 +2155,7 @@ public class FilenetConnector extends or
 "      <table class=\"displaytable\">\n"+
 "        <tr>\n"+
 "          <td class=\"description\">\n"+
-"            <nobr>" + Messages.getString("FilenetConnector.Include") + "</nobr>\n"+
+"            <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"+
@@ -2159,7 +2163,7 @@ public class FilenetConnector extends or
 "        </tr>\n"+
 "        <tr>\n"+
 "          <td class=\"description\">\n"+
-"            <nobr>" + Messages.getString("FilenetConnector.DocumentCriteria") + "</nobr>\n"+
+"            <nobr>" + Messages.getBodyString(locale,"FilenetConnector.DocumentCriteria") + "</nobr>\n"+
 "          </td>\n"+
 "          <td class=\"boxcell\">\n"+
 "            <table class=\"displaytable\">\n"
@@ -2190,7 +2194,7 @@ public class FilenetConnector extends or
 "                <td class=\"description\">\n"+
 "                  <input type=\"hidden\" name=\""+opName+"\" value=\"\"/>\n"+
 "                  <a name=\""+labelName+"\">\n"+
-"                    <input type=\"button\" value=\"" + Messages.getString("FilenetConnector.Delete") + "\" alt=\"" + Messages.getString("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:SpecOp(\""+opName+"\",\"Delete\",\""+labelName+"\")'/>\n"+
 "                  </a>\n"+
 "                </td>\n"+
 "                <td class=\"value\">\n"+
@@ -2212,7 +2216,7 @@ public class FilenetConnector extends or
           if (q == 0)
           {
             out.print(
-"              <tr><td class=\"message\" colspan=\"4\"><nobr>" + Messages.getString("FilenetConnector.NoCriteriaSpecified") + "</nobr></td></tr>\n"
+"              <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);
@@ -2224,7 +2228,7 @@ public class FilenetConnector extends or
 "                  <input type=\"hidden\" name=\""+"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.getString("FilenetConnector.Add") + "\" alt=\"Add match for "+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=\"Add match for "+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"+
 "                  </a>\n"+
 "                </td>\n"+
 "                <td class=\"value\">\n"+
@@ -2259,7 +2263,7 @@ public class FilenetConnector extends or
 "        </tr>\n"+
 "        <tr>\n"+
 "          <td class=\"description\">\n"+
-"            <nobr>" + Messages.getString("FilenetConnector.IngestAllMetadataFields") + "</nobr>\n"+
+"            <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"+
@@ -2267,7 +2271,7 @@ public class FilenetConnector extends or
 "        </tr>\n"+
 "        <tr>\n"+
 "          <td class=\"description\">\n"+
-"            <nobr>" + Messages.getString("FilenetConnector.MetadataFields") + "</nobr>\n"+
+"            <nobr>" + Messages.getBodyString(locale,"FilenetConnector.MetadataFields") + "</nobr>\n"+
 "          </td>\n"+
 "          <td class=\"value\">\n"+
 "            <nobr>\n"+
@@ -2364,7 +2368,7 @@ public class FilenetConnector extends or
       }
     }
 
-    if (tabName.equals(Messages.getString("FilenetConnector.MimeTypes")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.MimeTypes")))
     {
       out.print(
 "<input type=\"hidden\" name=\"hasmimetypes\" value=\"true\"/>\n"+
@@ -2398,7 +2402,7 @@ public class FilenetConnector extends or
       else
       {
         out.print(
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.MimeTypesToInclude") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.MimeTypesToInclude") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <select name=\"mimetypes\" size=\"10\" multiple=\"true\">\n"
         );
@@ -2468,13 +2472,13 @@ public class FilenetConnector extends or
       }
     }
 
-    if (tabName.equals(Messages.getString("FilenetConnector.Security")))
+    if (tabName.equals(Messages.getString(locale,"FilenetConnector.Security")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.Security2") + "</nobr></td>\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\"":"")+" />Enabled&nbsp;\n"+
 "      <input type=\"radio\" name=\"specsecurity\" value=\"off\" "+((securityOn==false)?"checked=\"true\"":"")+" />Disabled\n"+
@@ -2499,7 +2503,7 @@ public class FilenetConnector extends or
 "      <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.getString("FilenetConnector.Delete") + "\" alt=\""+"Delete access token #"+Integer.toString(k)+"\" onClick='Javascript:SpecOp(\""+accessOpName+"\",\"Delete\",\"token_"+Integer.toString(k)+"\")'/>\n"+
+"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Delete") + "\" alt=\""+"Delete access token #"+Integer.toString(k)+"\" onClick='Javascript:SpecOp(\""+accessOpName+"\",\"Delete\",\"token_"+Integer.toString(k)+"\")'/>\n"+
 "      </a>\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -2514,7 +2518,7 @@ public class FilenetConnector extends or
       {
         out.print(
 "  <tr>\n"+
-"    <td class=\"message\" colspan=\"2\">" + Messages.getString("FilenetConnector.NoAccessTokensPresent") + "</td>\n"+
+"    <td class=\"message\" colspan=\"2\">" + Messages.getBodyString(locale,"FilenetConnector.NoAccessTokensPresent") + "</td>\n"+
 "  </tr>\n"
         );
       }
@@ -2525,7 +2529,7 @@ public class FilenetConnector extends or
 "      <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.getString("FilenetConnector.Add") + "\" alt=\"Add access token\" onClick='Javascript:SpecAddToken(\"token_"+Integer.toString(k+1)+"\")'/>\n"+
+"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FilenetConnector.Add") + "\" alt=\"Add access token\" onClick='Javascript:SpecAddToken(\"token_"+Integer.toString(k+1)+"\")'/>\n"+
 "      </a>\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -2571,7 +2575,7 @@ public class FilenetConnector extends or
   *@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)
+  public String processSpecificationPost(IPostParameters variableContext, Locale locale, DocumentSpecification ds)
     throws ManifoldCFException
   {
     String[] x;
@@ -2835,7 +2839,7 @@ public class FilenetConnector extends or
   *@param ds is the current document specification for this job.
   */
   @Override
-  public void viewSpecification(IHTTPOutput out, DocumentSpecification ds)
+  public void viewSpecification(IHTTPOutput out, Locale locale, DocumentSpecification ds)
     throws ManifoldCFException, IOException
   {
     int i;
@@ -2869,13 +2873,13 @@ public class FilenetConnector extends or
     if (sortedDocumentClasses.length == 0)
     {
       out.print(
-"    <td class=\"message\" colspan=\"2\"><nobr>" + Messages.getString("FilenetConnector.NoIncludedDocumentClasses") + "</nobr></td>\n"
+"    <td class=\"message\" colspan=\"2\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.NoIncludedDocumentClasses") + "</nobr></td>\n"
       );
     }
     else
     {
       out.print(
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.IncludedDocumentClasses") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.IncludedDocumentClasses") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <table class=\"displaytable\">\n"
       );
@@ -2889,7 +2893,7 @@ public class FilenetConnector extends or
 "          <td class=\"boxcell\">\n"+
 "            <table class=\"displaytable\">\n"+
 "              <tr>\n"+
-"                <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.Metadata") + "</nobr></td>\n"+
+"                <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.Metadata") + "</nobr></td>\n"+
 "                <td class=\"value\">\n"
         );
         org.apache.manifoldcf.crawler.connectors.filenet.DocClassSpec fieldValues = (org.apache.manifoldcf.crawler.connectors.filenet.DocClassSpec)documentClasses.get(docclass);
@@ -2916,7 +2920,7 @@ public class FilenetConnector extends or
 "                </td>\n"+
 "              </tr>\n"+
 "              <tr>\n"+
-"                <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.DocumentsMatching") + "</nobr></td>\n"+
+"                <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.DocumentsMatching") + "</nobr></td>\n"+
 "                <td class=\"value\">\n"
         );
         int matchCount = fieldValues.getMatchCount();
@@ -2982,7 +2986,7 @@ public class FilenetConnector extends or
       }
       java.util.Arrays.sort(sortedMimeTypes);
       out.print(
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.IncludedMimeTypes") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.IncludedMimeTypes") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
       );
       i = 0;
@@ -3000,7 +3004,7 @@ public class FilenetConnector extends or
     else
     {
       out.print(
-"    <td class=\"message\" colspan=\"2\"><nobr>" + Messages.getString("FilenetConnector.NoIncludedMimeTypes") + "</nobr></td>\n"
+"    <td class=\"message\" colspan=\"2\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.NoIncludedMimeTypes") + "</nobr></td>\n"
       );
     }
     out.print(
@@ -3022,7 +3026,7 @@ public class FilenetConnector extends or
         }
         out.print(
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.Folders2") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.Folders2") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(spn.getAttributeValue(SPEC_ATTRIBUTE_VALUE))+"</nobr>\n"+
 "    </td>\n"+
@@ -3033,7 +3037,7 @@ public class FilenetConnector extends or
     if (seenAny == false)
     {
       out.print(
-"  <tr><td class=\"message\" colspan=\"2\">" + Messages.getString("FilenetConnector.AllFoldersSpecified") + "</td></tr>\n"
+"  <tr><td class=\"message\" colspan=\"2\">" + Messages.getBodyString(locale,"FilenetConnector.AllFoldersSpecified") + "</td></tr>\n"
       );
     }
     out.print(
@@ -3058,7 +3062,7 @@ public class FilenetConnector extends or
     }
     out.print(
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.Security2") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.Security2") + "</nobr></td>\n"+
 "    <td class=\"value\">"+(securityOn?"Enabled":"Disabled")+"</td>\n"+
 "  </tr>\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"
@@ -3075,7 +3079,7 @@ public class FilenetConnector extends or
         {
           out.print(
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FilenetConnector.AccessTokens") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FilenetConnector.AccessTokens") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
           );
           seenAny = true;
@@ -3097,7 +3101,7 @@ public class FilenetConnector extends or
     else
     {
       out.print(
-"  <tr><td class=\"message\" colspan=\"2\">" + Messages.getString("FilenetConnector.NoAccessTokensSpecified") + "</td></tr>\n"
+"  <tr><td class=\"message\" colspan=\"2\">" + Messages.getBodyString(locale,"FilenetConnector.NoAccessTokensSpecified") + "</td></tr>\n"
       );
     }
     out.print(

Modified: incubator/lcf/branches/CONNECTORS-335/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/Messages.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/Messages.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/Messages.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/Messages.java Sun Dec 25 20:10:58 2011
@@ -19,75 +19,106 @@
 package org.apache.manifoldcf.crawler.connectors.filenet;
 
 import java.util.Locale;
+import java.util.Map;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
 
-public class Messages extends org.apache.manifoldcf.core.i18n.Messages
+public class Messages extends org.apache.manifoldcf.ui.i18n.Messages
 {
   public static final String DEFAULT_BUNDLE_NAME="org.apache.manifoldcf.crawler.connectors.filenet.common";
-
+  public static final String DEFAULT_PATH_NAME="org.apache.manifoldcf.crawler.connectors.filenet";
+  
   /** Constructor - do no instantiate
   */
-  private Messages()
+  protected Messages()
   {
   }
   
-  // These four have limited applicability since they are all local to the core jar, which generally does not render
-  // text.
-  
-  public static String getString(String messageKey)
+  public static String getString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, Locale.getDefault(), messageKey, null);
+    return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
-  public static String getString(String messageKey, Object[] args)
+
+  public static String getAttributeString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, Locale.getDefault(), messageKey, args);
+    return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
-  public static String getString(Locale locale, String messageKey)
+
+  public static String getBodyString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+    return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
+
+  public static String getAttributeJavascriptString(Locale locale, String messageKey)
+  {
+    return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+  }
+
+  public static String getBodyJavascriptString(Locale locale, String messageKey)
+  {
+    return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+  }
+
   public static String getString(Locale locale, String messageKey, Object[] args)
   {
     return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
+
+  public static String getAttributeString(Locale locale, String messageKey, Object[] args)
+  {
+    return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
+  }
   
-  // More general methods which allow bundlenames and class loaders to be specified.
-  
-  public static String getString(String bundleName, String messageKey)
+  public static String getBodyString(Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, Locale.getDefault(), messageKey, null);
+    return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, String messageKey)
+  public static String getAttributeJavascriptString(Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, Locale.getDefault(), messageKey, null);
+    return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
+
+  public static String getBodyJavascriptString(Locale locale, String messageKey, Object[] args)
+  {
+    return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
+  }
+
+  // More general methods which allow bundlenames and class loaders to be specified.
   
-  public static String getString(String bundleName, String messageKey, Object[] args)
+  public static String getString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, Locale.getDefault(), messageKey, args);
+    return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, String messageKey, Object[] args)
+  public static String getAttributeString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, Locale.getDefault(), messageKey, args);
+    return getAttributeString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
+  }
+
+  public static String getBodyString(String bundleName, Locale locale, String messageKey, Object[] args)
+  {
+    return getBodyString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
   
-  public static String getString(String bundleName, Locale locale, String messageKey)
+  public static String getAttributeJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, locale, messageKey, null);
+    return getAttributeJavascriptString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, Locale locale, String messageKey)
+  public static String getBodyJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, locale, messageKey, null);
+    return getBodyJavascriptString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
+
+  // Resource output
   
-  public static String getString(String bundleName, Locale locale, String messageKey, Object[] args)
+  public static void outputResource(IHTTPOutput output, Locale locale, String resourceKey,
+    Map<String,String> substitutionParameters, boolean mapToUpperCase)
+    throws ManifoldCFException
   {
-    return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
+    outputResource(output,Messages.class,DEFAULT_PATH_NAME,locale,resourceKey,
+      substitutionParameters,mapToUpperCase);
   }
   
 }

Modified: incubator/lcf/branches/CONNECTORS-335/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/FileConnector.java Sun Dec 25 20:10:58 2011
@@ -391,10 +391,10 @@ public class FileConnector extends org.a
   *@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, DocumentSpecification ds, List<String> tabsArray)
+  public void outputSpecificationHeader(IHTTPOutput out, Locale locale, DocumentSpecification ds, List<String> tabsArray)
     throws ManifoldCFException, IOException
   {
-    tabsArray.add(Messages.getString("FileConnector.Paths"));
+    tabsArray.add(Messages.getString(locale,"FileConnector.Paths"));
 
     out.print(
 "<script type=\"text/javascript\">\n"+
@@ -424,14 +424,14 @@ public class FileConnector extends org.a
   *@param tabName is the current tab name.
   */
   @Override
-  public void outputSpecificationBody(IHTTPOutput out, DocumentSpecification ds, String tabName)
+  public void outputSpecificationBody(IHTTPOutput out, Locale locale, DocumentSpecification ds, String tabName)
     throws ManifoldCFException, IOException
   {
     int i;
     int k;
 
     // Paths tab
-    if (tabName.equals(Messages.getString("FileConnector.Paths")))
+    if (tabName.equals(Messages.getString(locale,"FileConnector.Paths")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
@@ -450,13 +450,13 @@ public class FileConnector extends org.a
           {
             out.print(
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("FileConnector.Paths2") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"FileConnector.Paths2") + "</nobr></td>\n"+
 "    <td class=\"boxcell\">\n"+
 "      <table class=\"formtable\">\n"+
 "        <tr class=\"formheaderrow\">\n"+
 "          <td class=\"formcolumnheader\"></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("FileConnector.RootPath") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("FileConnector.Rules") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"FileConnector.RootPath") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"FileConnector.Rules") + "</nobr></td>\n"+
 "        </tr>\n"
             );
           }
@@ -466,7 +466,7 @@ public class FileConnector extends org.a
 "            <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.getString("FileConnector.Delete") + "\" onClick='Javascript:SpecOp(\""+pathOpName+"\",\"Delete\",\"path_"+Integer.toString(k)+"\")' alt=\""+Messages.getString("FileConnector.DeletePath")+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"+
 "            </a>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
@@ -479,9 +479,9 @@ public class FileConnector extends org.a
 "            <table class=\"formtable\">\n"+
 "              <tr class=\"formheaderrow\">\n"+
 "                <td class=\"formcolumnheader\"></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("FileConnector.IncludeExclude") + "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("FileConnector.FileDirectory") + "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("FileConnector.Match") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"FileConnector.IncludeExclude") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"FileConnector.FileDirectory") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"FileConnector.Match") + "</nobr></td>\n"+
 "              </tr>\n"
           );
           int j = 0;
@@ -498,22 +498,22 @@ public class FileConnector extends org.a
 "              <tr class=\"evenformrow\">\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
-"                    <input type=\"button\" value=\"" + Messages.getString("FileConnector.InsertHere") + "\" onClick='Javascript:SpecOp(\"specop"+instanceDescription+"\",\"" + Messages.getString("FileConnector.InsertHere") + "\",\"match_"+Integer.toString(k)+"_"+Integer.toString(j+1)+"\")' alt=\""+"Insert new match for path #"+Integer.toString(k)+" before position #"+Integer.toString(j)+"\"/>\n"+
+"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.InsertHere") + "\" onClick='Javascript:SpecOp(\"specop"+instanceDescription+"\",\"InsertHere\",\"match_"+Integer.toString(k)+"_"+Integer.toString(j+1)+"\")' alt=\""+"Insert new match for path #"+Integer.toString(k)+" before position #"+Integer.toString(j)+"\"/>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
 "                    <select name=\""+"specflavor"+instanceDescription+"\">\n"+
-"                      <option value=\"" + Messages.getString("FileConnector.include") + "\">" + Messages.getString("FileConnector.include") + "</option>\n"+
-"                      <option value=\"exclude\">" + Messages.getString("FileConnector.exclude") + "</option>\n"+
+"                      <option value=\"include\">" + Messages.getBodyString(locale,"FileConnector.include") + "</option>\n"+
+"                      <option value=\"exclude\">" + Messages.getBodyString(locale,"FileConnector.exclude") + "</option>\n"+
 "                    </select>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
 "                    <select name=\""+"spectype"+instanceDescription+"\">\n"+
-"                      <option value=\"" + Messages.getString("FileConnector.File") + "\">" + Messages.getString("FileConnector.File") + "</option>\n"+
-"                      <option value=\"directory\">" + Messages.getString("FileConnector.Directory") + "</option>\n"+
+"                      <option value=\"file\">" + Messages.getBodyString(locale,"FileConnector.File") + "</option>\n"+
+"                      <option value=\"directory\">" + Messages.getBodyString(locale,"FileConnector.Directory") + "</option>\n"+
 "                    </select>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
@@ -531,7 +531,7 @@ public class FileConnector extends org.a
 "                    <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.getString("FileConnector.Delete") + "\" onClick='Javascript:SpecOp(\"specop"+instanceDescription+"\",\"Delete\",\"match_"+Integer.toString(k)+"_"+Integer.toString(j)+"\")' alt=\""+"Delete path #"+Integer.toString(k)+", match spec #"+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=\""+"Delete path #"+Integer.toString(k)+", match spec #"+Integer.toString(j)+"\"/>\n"+
 "                    </a>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
@@ -557,7 +557,7 @@ public class FileConnector extends org.a
           if (j == 0)
           {
             out.print(
-"              <tr class=\"formrow\"><td class=\"message\" colspan=\"4\">" + Messages.getString("FileConnector.NoRulesDefined") + "</td></tr>\n"
+"              <tr class=\"formrow\"><td class=\"message\" colspan=\"4\">" + Messages.getBodyString(locale,"FileConnector.NoRulesDefined") + "</td></tr>\n"
             );
           }
           out.print(
@@ -565,22 +565,22 @@ public class FileConnector extends org.a
 "              <tr class=\"formrow\">\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <a name=\""+"match_"+Integer.toString(k)+"_"+Integer.toString(j)+"\">\n"+
-"                    <input type=\"button\" value=\"" + Messages.getString("FileConnector.Add") + "\" onClick='Javascript:SpecOp(\""+pathOpName+"\",\"Add\",\"match_"+Integer.toString(k)+"_"+Integer.toString(j+1)+"\")' alt=\""+"Add new match for path #"+Integer.toString(k)+"\"/>\n"+
+"                    <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Add") + "\" onClick='Javascript:SpecOp(\""+pathOpName+"\",\"Add\",\"match_"+Integer.toString(k)+"_"+Integer.toString(j+1)+"\")' alt=\""+"Add new match for path #"+Integer.toString(k)+"\"/>\n"+
 "                  </a>\n"+
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
 "                    <select name=\""+"specflavor"+pathDescription+"\">\n"+
-"                      <option value=\"include\">" + Messages.getString("FileConnector.include") + "</option>\n"+
-"                      <option value=\"exclude\">" + Messages.getString("FileConnector.exclude") + "</option>\n"+
+"                      <option value=\"include\">" + Messages.getBodyString(locale,"FileConnector.include") + "</option>\n"+
+"                      <option value=\"exclude\">" + Messages.getBodyString(locale,"FileConnector.exclude") + "</option>\n"+
 "                    </select>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
 "                <td class=\"formcolumncell\">\n"+
 "                  <nobr>\n"+
 "                    <select name=\""+"spectype"+pathDescription+"\">\n"+
-"                      <option value=\"file\">" + Messages.getString("FileConnector.File") + "</option>\n"+
-"                      <option value=\"directory\">" + Messages.getString("FileConnector.Directory") + "</option>\n"+
+"                      <option value=\"file\">" + Messages.getBodyString(locale,"FileConnector.File") + "</option>\n"+
+"                      <option value=\"directory\">" + Messages.getBodyString(locale,"FileConnector.Directory") + "</option>\n"+
 "                    </select>\n"+
 "                  </nobr>\n"+
 "                </td>\n"+
@@ -600,7 +600,7 @@ public class FileConnector extends org.a
       if (k == 0)
       {
         out.print(
-"        <tr class=\"formrow\"><td class=\"message\" colspan=\"3\">" + Messages.getString("FileConnector.NoDocumentsSpecified") + "</td></tr>\n"
+"        <tr class=\"formrow\"><td class=\"message\" colspan=\"3\">" + Messages.getBodyString(locale,"FileConnector.NoDocumentsSpecified") + "</td></tr>\n"
         );
       }
       out.print(
@@ -609,7 +609,7 @@ public class FileConnector extends org.a
 "          <td class=\"formcolumncell\">\n"+
 "            <nobr>\n"+
 "              <a name=\""+"path_"+Integer.toString(k)+"\">\n"+
-"                <input type=\"button\" value=\"" + Messages.getString("FileConnector.Add") + "\" onClick='Javascript:SpecOp(\"specop\",\"Add\",\"path_"+Integer.toString(i+1)+"\")' alt=\"Add new path\"/>\n"+
+"                <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"FileConnector.Add") + "\" onClick='Javascript:SpecOp(\"specop\",\"Add\",\"path_"+Integer.toString(i+1)+"\")' alt=\"Add new path\"/>\n"+
 "                <input type=\"hidden\" name=\"pathcount\" value=\""+Integer.toString(k)+"\"/>\n"+
 "                <input type=\"hidden\" name=\"specop\" value=\"\"/>\n"+
 "              </a>\n"+
@@ -678,7 +678,7 @@ public class FileConnector extends org.a
   *@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)
+  public String processSpecificationPost(IPostParameters variableContext, Locale locale, DocumentSpecification ds)
     throws ManifoldCFException
   {
     String x = variableContext.getParameter("pathcount");
@@ -792,7 +792,7 @@ public class FileConnector extends org.a
   *@param ds is the current document specification for this job.
   */
   @Override
-  public void viewSpecification(IHTTPOutput out, DocumentSpecification ds)
+  public void viewSpecification(IHTTPOutput out, Locale locale, DocumentSpecification ds)
     throws ManifoldCFException, IOException
   {
     out.print(
@@ -836,7 +836,7 @@ public class FileConnector extends org.a
     if (seenAny == false)
     {
       out.print(
-"  <tr><td class=\"message\">" + Messages.getString("FileConnector.NoDocumentsSpecified") + "</td></tr>\n"
+"  <tr><td class=\"message\">" + Messages.getBodyString(locale,"FileConnector.NoDocumentsSpecified") + "</td></tr>\n"
       );
     }
     out.print(

Modified: incubator/lcf/branches/CONNECTORS-335/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/Messages.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/Messages.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/Messages.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/filesystem/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filesystem/Messages.java Sun Dec 25 20:10:58 2011
@@ -19,75 +19,106 @@
 package org.apache.manifoldcf.crawler.connectors.filesystem;
 
 import java.util.Locale;
+import java.util.Map;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
 
-public class Messages extends org.apache.manifoldcf.core.i18n.Messages
+public class Messages extends org.apache.manifoldcf.ui.i18n.Messages
 {
   public static final String DEFAULT_BUNDLE_NAME="org.apache.manifoldcf.crawler.connectors.filesystem.common";
-
+  public static final String DEFAULT_PATH_NAME="org.apache.manifoldcf.crawler.connectors.filesystem";
+  
   /** Constructor - do no instantiate
   */
-  private Messages()
+  protected Messages()
   {
   }
   
-  // These four have limited applicability since they are all local to the core jar, which generally does not render
-  // text.
-  
-  public static String getString(String messageKey)
+  public static String getString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, Locale.getDefault(), messageKey, null);
+    return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
-  public static String getString(String messageKey, Object[] args)
+
+  public static String getAttributeString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, Locale.getDefault(), messageKey, args);
+    return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
-  public static String getString(Locale locale, String messageKey)
+
+  public static String getBodyString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+    return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
+
+  public static String getAttributeJavascriptString(Locale locale, String messageKey)
+  {
+    return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+  }
+
+  public static String getBodyJavascriptString(Locale locale, String messageKey)
+  {
+    return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+  }
+
   public static String getString(Locale locale, String messageKey, Object[] args)
   {
     return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
+
+  public static String getAttributeString(Locale locale, String messageKey, Object[] args)
+  {
+    return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
+  }
   
-  // More general methods which allow bundlenames and class loaders to be specified.
-  
-  public static String getString(String bundleName, String messageKey)
+  public static String getBodyString(Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, Locale.getDefault(), messageKey, null);
+    return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, String messageKey)
+  public static String getAttributeJavascriptString(Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, Locale.getDefault(), messageKey, null);
+    return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
+
+  public static String getBodyJavascriptString(Locale locale, String messageKey, Object[] args)
+  {
+    return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
+  }
+
+  // More general methods which allow bundlenames and class loaders to be specified.
   
-  public static String getString(String bundleName, String messageKey, Object[] args)
+  public static String getString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, Locale.getDefault(), messageKey, args);
+    return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, String messageKey, Object[] args)
+  public static String getAttributeString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, Locale.getDefault(), messageKey, args);
+    return getAttributeString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
+  }
+
+  public static String getBodyString(String bundleName, Locale locale, String messageKey, Object[] args)
+  {
+    return getBodyString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
   
-  public static String getString(String bundleName, Locale locale, String messageKey)
+  public static String getAttributeJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, locale, messageKey, null);
+    return getAttributeJavascriptString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, Locale locale, String messageKey)
+  public static String getBodyJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, locale, messageKey, null);
+    return getBodyJavascriptString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
+
+  // Resource output
   
-  public static String getString(String bundleName, Locale locale, String messageKey, Object[] args)
+  public static void outputResource(IHTTPOutput output, Locale locale, String resourceKey,
+    Map<String,String> substitutionParameters, boolean mapToUpperCase)
+    throws ManifoldCFException
   {
-    return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
+    outputResource(output,Messages.class,DEFAULT_PATH_NAME,locale,resourceKey,
+      substitutionParameters,mapToUpperCase);
   }
   
 }

Modified: incubator/lcf/branches/CONNECTORS-335/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/GTSConnector.java Sun Dec 25 20:10:58 2011
@@ -361,10 +361,11 @@ public class GTSConnector extends org.ap
   *@param tabsArray is an array of tab names.  Add to this array any tab names that are specific to the connector.
   */
   @Override
-  public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, List<String> tabsArray)
+  public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out,
+    Locale locale, ConfigParams parameters, List<String> tabsArray)
     throws ManifoldCFException, IOException
   {
-    tabsArray.add(Messages.getString("GTSConnector.Appliance"));
+    tabsArray.add(Messages.getString(locale,"GTSConnector.Appliance"));
     out.print(
 "\n"+
 "<script type=\"text/javascript\">\n"+
@@ -385,7 +386,7 @@ public class GTSConnector extends org.ap
 "  if (editconnection.ingesturi.value == \"\")\n"+
 "  {\n"+
 "    alert(\"Please supply a valid ingestion URI\");\n"+
-"    SelectTab(\"" + Messages.getString("GTSConnector.Appliance") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"GTSConnector.Appliance") + "\");\n"+
 "    editconnection.ingesturi.focus();\n"+
 "    return false;\n"+
 "  }\n"+
@@ -408,7 +409,8 @@ public class GTSConnector extends org.ap
   *@param tabName is the current tab name.
   */
   @Override
-  public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters, String tabName)
+  public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out,
+    Locale locale, ConfigParams parameters, String tabName)
     throws ManifoldCFException, IOException
   {
     String ingestURI = parameters.getParameter(org.apache.manifoldcf.agents.output.gts.GTSConfig.PARAM_INGESTURI);
@@ -428,31 +430,31 @@ public class GTSConnector extends org.ap
       password = "";
 		
     // "Appliance" tab
-    if (tabName.equals(Messages.getString("GTSConnector.Appliance")))
+    if (tabName.equals(Messages.getString(locale,"GTSConnector.Appliance")))
     {
       out.print(
 "\n"+
 "<table class=\"displaytable\">\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("GTSConnector.IngestURI") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"GTSConnector.IngestURI") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input name=\"ingesturi\" type=\"text\" size=\"32\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(ingestURI)+"\"/>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("GTSConnector.Realm") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"GTSConnector.Realm") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input name=\"realm\" type=\"text\" size=\"32\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(realm)+"\"/>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("GTSConnector.UserID") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"GTSConnector.UserID") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input name=\"userid\" type=\"text\" size=\"32\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(userID)+"\"/>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("GTSConnector.Password") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"GTSConnector.Password") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input type=\"password\" size=\"32\" name=\"password\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(password)+"\"/>\n"+
 "    </td>\n"+
@@ -481,7 +483,8 @@ public class GTSConnector extends org.ap
   *@return null if all is well, or a string error message if there is an error that should prevent saving of the connection (and cause a redirection to an error page).
   */
   @Override
-  public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext, ConfigParams parameters)
+  public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext,
+    Locale locale, ConfigParams parameters)
     throws ManifoldCFException
   {
     String ingestURI = variableContext.getParameter("ingesturi");
@@ -511,7 +514,7 @@ public class GTSConnector extends org.ap
   *@param parameters are the configuration parameters, as they currently exist, for this connection being configured.
   */
   @Override
-  public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, ConfigParams parameters)
+  public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, Locale locale, ConfigParams parameters)
     throws ManifoldCFException, IOException
   {
     out.print(
@@ -562,11 +565,11 @@ public class GTSConnector extends org.ap
   *@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, OutputSpecification os, List<String> tabsArray)
+  public void outputSpecificationHeader(IHTTPOutput out, Locale locale, OutputSpecification os, List<String> tabsArray)
     throws ManifoldCFException, IOException
   {
-    tabsArray.add(Messages.getString("GTSConnector.GTSCollections"));
-    tabsArray.add(Messages.getString("GTSConnector.GTSTemplate"));
+    tabsArray.add(Messages.getString(locale,"GTSConnector.GTSCollections"));
+    tabsArray.add(Messages.getString(locale,"GTSConnector.GTSTemplate"));
     out.print(
 "\n"+
 "<script type=\"text/javascript\">\n"+
@@ -597,7 +600,7 @@ public class GTSConnector extends org.ap
   *@param tabName is the current tab name.
   */
   @Override
-  public void outputSpecificationBody(IHTTPOutput out, OutputSpecification os, String tabName)
+  public void outputSpecificationBody(IHTTPOutput out, Locale locale, OutputSpecification os, String tabName)
     throws ManifoldCFException, IOException
   {
     int i = 0;
@@ -621,13 +624,13 @@ public class GTSConnector extends org.ap
       documentTemplate = "";
 
     // Collections tab
-    if (tabName.equals(Messages.getString("GTSConnector.GTSCollections")))
+    if (tabName.equals(Messages.getString(locale,"GTSConnector.GTSCollections")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("GTSConnector.CollectionName") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"GTSConnector.CollectionName") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input name=\"gts_collectionname\" type=\"text\" size=\"32\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(collectionName)+"\"/>\n"+
 "    </td>\n"+
@@ -644,13 +647,13 @@ public class GTSConnector extends org.ap
     }
 
     // Template tab
-    if (tabName.equals(Messages.getString("GTSConnector.GTSTemplate")))
+    if (tabName.equals(Messages.getString(locale,"GTSConnector.GTSTemplate")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("GTSConnector.DocumentTemplate") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"GTSConnector.DocumentTemplate") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <textarea rows=\"10\" cols=\"96\" name=\"gts_documenttemplate\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(documentTemplate)+"</textarea>\n"+
 "    </td>\n"+
@@ -676,7 +679,7 @@ public class GTSConnector extends org.ap
   *@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, OutputSpecification os)
+  public String processSpecificationPost(IPostParameters variableContext, Locale locale, OutputSpecification os)
     throws ManifoldCFException
   {
     // Collection name
@@ -728,7 +731,7 @@ public class GTSConnector extends org.ap
   *@param os is the current output specification for this job.
   */
   @Override
-  public void viewSpecification(IHTTPOutput out, OutputSpecification os)
+  public void viewSpecification(IHTTPOutput out, Locale locale, OutputSpecification os)
     throws ManifoldCFException, IOException
   {
     int i = 0;
@@ -756,11 +759,11 @@ public class GTSConnector extends org.ap
 "\n"+
 "<table class=\"displaytable\">\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("GTSConnector.Collection") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"GTSConnector.Collection") + "</nobr></td>\n"+
 "    <td class=\"value\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(collectionName)+"</td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("GTSConnector.DocumentTemplate") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"GTSConnector.DocumentTemplate") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
     );
     if (documentTemplate == null || documentTemplate.length() == 0)

Modified: incubator/lcf/branches/CONNECTORS-335/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/Messages.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/Messages.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/Messages.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/gts/connector/src/main/java/org/apache/manifoldcf/agents/output/gts/Messages.java Sun Dec 25 20:10:58 2011
@@ -19,75 +19,106 @@
 package org.apache.manifoldcf.agents.output.gts;
 
 import java.util.Locale;
+import java.util.Map;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
 
-public class Messages extends org.apache.manifoldcf.core.i18n.Messages
+public class Messages extends org.apache.manifoldcf.ui.i18n.Messages
 {
   public static final String DEFAULT_BUNDLE_NAME="org.apache.manifoldcf.agents.output.gts.common";
-
+  public static final String DEFAULT_PATH_NAME="org.apache.manifoldcf.agents.output.gts";
+  
   /** Constructor - do no instantiate
   */
-  private Messages()
+  protected Messages()
   {
   }
   
-  // These four have limited applicability since they are all local to the core jar, which generally does not render
-  // text.
-  
-  public static String getString(String messageKey)
+  public static String getString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, Locale.getDefault(), messageKey, null);
+    return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
-  public static String getString(String messageKey, Object[] args)
+
+  public static String getAttributeString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, Locale.getDefault(), messageKey, args);
+    return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
-  public static String getString(Locale locale, String messageKey)
+
+  public static String getBodyString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+    return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
+
+  public static String getAttributeJavascriptString(Locale locale, String messageKey)
+  {
+    return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+  }
+
+  public static String getBodyJavascriptString(Locale locale, String messageKey)
+  {
+    return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+  }
+
   public static String getString(Locale locale, String messageKey, Object[] args)
   {
     return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
+
+  public static String getAttributeString(Locale locale, String messageKey, Object[] args)
+  {
+    return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
+  }
   
-  // More general methods which allow bundlenames and class loaders to be specified.
-  
-  public static String getString(String bundleName, String messageKey)
+  public static String getBodyString(Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, Locale.getDefault(), messageKey, null);
+    return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, String messageKey)
+  public static String getAttributeJavascriptString(Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, Locale.getDefault(), messageKey, null);
+    return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
+
+  public static String getBodyJavascriptString(Locale locale, String messageKey, Object[] args)
+  {
+    return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
+  }
+
+  // More general methods which allow bundlenames and class loaders to be specified.
   
-  public static String getString(String bundleName, String messageKey, Object[] args)
+  public static String getString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, Locale.getDefault(), messageKey, args);
+    return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, String messageKey, Object[] args)
+  public static String getAttributeString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, Locale.getDefault(), messageKey, args);
+    return getAttributeString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
+  }
+
+  public static String getBodyString(String bundleName, Locale locale, String messageKey, Object[] args)
+  {
+    return getBodyString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
   
-  public static String getString(String bundleName, Locale locale, String messageKey)
+  public static String getAttributeJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, locale, messageKey, null);
+    return getAttributeJavascriptString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, Locale locale, String messageKey)
+  public static String getBodyJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, locale, messageKey, null);
+    return getBodyJavascriptString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
+
+  // Resource output
   
-  public static String getString(String bundleName, Locale locale, String messageKey, Object[] args)
+  public static void outputResource(IHTTPOutput output, Locale locale, String resourceKey,
+    Map<String,String> substitutionParameters, boolean mapToUpperCase)
+    throws ManifoldCFException
   {
-    return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
+    outputResource(output,Messages.class,DEFAULT_PATH_NAME,locale,resourceKey,
+      substitutionParameters,mapToUpperCase);
   }
   
 }

Modified: incubator/lcf/branches/CONNECTORS-335/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/Messages.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/Messages.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/Messages.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/Messages.java Sun Dec 25 20:10:58 2011
@@ -19,75 +19,106 @@
 package org.apache.manifoldcf.crawler.connectors.sharedrive;
 
 import java.util.Locale;
+import java.util.Map;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
 
-public class Messages extends org.apache.manifoldcf.core.i18n.Messages
+public class Messages extends org.apache.manifoldcf.ui.i18n.Messages
 {
   public static final String DEFAULT_BUNDLE_NAME="org.apache.manifoldcf.crawler.connectors.sharedrive.common";
-
+  public static final String DEFAULT_PATH_NAME="org.apache.manifoldcf.crawler.connectors.sharedrive";
+  
   /** Constructor - do no instantiate
   */
-  private Messages()
+  protected Messages()
   {
   }
   
-  // These four have limited applicability since they are all local to the core jar, which generally does not render
-  // text.
-  
-  public static String getString(String messageKey)
+  public static String getString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, Locale.getDefault(), messageKey, null);
+    return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
-  public static String getString(String messageKey, Object[] args)
+
+  public static String getAttributeString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, Locale.getDefault(), messageKey, args);
+    return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
-  public static String getString(Locale locale, String messageKey)
+
+  public static String getBodyString(Locale locale, String messageKey)
   {
-    return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+    return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
   }
-  
+
+  public static String getAttributeJavascriptString(Locale locale, String messageKey)
+  {
+    return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+  }
+
+  public static String getBodyJavascriptString(Locale locale, String messageKey)
+  {
+    return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null);
+  }
+
   public static String getString(Locale locale, String messageKey, Object[] args)
   {
     return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
+
+  public static String getAttributeString(Locale locale, String messageKey, Object[] args)
+  {
+    return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
+  }
   
-  // More general methods which allow bundlenames and class loaders to be specified.
-  
-  public static String getString(String bundleName, String messageKey)
+  public static String getBodyString(Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, Locale.getDefault(), messageKey, null);
+    return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, String messageKey)
+  public static String getAttributeJavascriptString(Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, Locale.getDefault(), messageKey, null);
+    return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
   }
+
+  public static String getBodyJavascriptString(Locale locale, String messageKey, Object[] args)
+  {
+    return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args);
+  }
+
+  // More general methods which allow bundlenames and class loaders to be specified.
   
-  public static String getString(String bundleName, String messageKey, Object[] args)
+  public static String getString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, Locale.getDefault(), messageKey, args);
+    return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, String messageKey, Object[] args)
+  public static String getAttributeString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, Locale.getDefault(), messageKey, args);
+    return getAttributeString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
+  }
+
+  public static String getBodyString(String bundleName, Locale locale, String messageKey, Object[] args)
+  {
+    return getBodyString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
   
-  public static String getString(String bundleName, Locale locale, String messageKey)
+  public static String getAttributeJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(bundleName, locale, messageKey, null);
+    return getAttributeJavascriptString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
 
-  public static String getString(ClassLoader classLoader, String bundleName, Locale locale, String messageKey)
+  public static String getBodyJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args)
   {
-    return getString(classLoader, bundleName, locale, messageKey, null);
+    return getBodyJavascriptString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
+
+  // Resource output
   
-  public static String getString(String bundleName, Locale locale, String messageKey, Object[] args)
+  public static void outputResource(IHTTPOutput output, Locale locale, String resourceKey,
+    Map<String,String> substitutionParameters, boolean mapToUpperCase)
+    throws ManifoldCFException
   {
-    return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
+    outputResource(output,Messages.class,DEFAULT_PATH_NAME,locale,resourceKey,
+      substitutionParameters,mapToUpperCase);
   }
   
 }



Mime
View raw message