incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1224641 [7/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/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java Sun Dec 25 20:10:58 2011
@@ -1369,14 +1369,15 @@ public class WebcrawlerConnector extends
   *@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("WebcrawlerConnector.Email"));
-    tabsArray.add(Messages.getString("WebcrawlerConnector.Robots"));
-    tabsArray.add(Messages.getString("WebcrawlerConnector.Bandwidth"));
-    tabsArray.add(Messages.getString("WebcrawlerConnector.AccessCredentials"));
-    tabsArray.add(Messages.getString("WebcrawlerConnector.Certificates"));
+    tabsArray.add(Messages.getString(locale,"WebcrawlerConnector.Email"));
+    tabsArray.add(Messages.getString(locale,"WebcrawlerConnector.Robots"));
+    tabsArray.add(Messages.getString(locale,"WebcrawlerConnector.Bandwidth"));
+    tabsArray.add(Messages.getString(locale,"WebcrawlerConnector.AccessCredentials"));
+    tabsArray.add(Messages.getString(locale,"WebcrawlerConnector.Certificates"));
     out.print(
 "<script type=\"text/javascript\">\n"+
 "<!--\n"+
@@ -1485,8 +1486,8 @@ public class WebcrawlerConnector extends
 "{\n"+
 "  if (editconnection.email.value == \"\")\n"+
 "  {\n"+
-"    alert(\"" + Messages.getString("WebcrawlerConnector.EmailAaddressRequired") + "\");\n"+
-"    SelectTab(\"" + Messages.getString("WebcrawlerConnector.Email") + "\");\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"WebcrawlerConnector.EmailAaddressRequired") + "\");\n"+
+"    SelectTab(\"" + Messages.getBodyJavascriptString(locale,"WebcrawlerConnector.Email") + "\");\n"+
 "    editconnection.email.focus();\n"+
 "    return false;\n"+
 "  }\n"+
@@ -1510,7 +1511,7 @@ public class WebcrawlerConnector extends
 "{\n"+
 "  if (editconnection.connections_bandwidth.value != \"\" && !isInteger(editconnection.connections_bandwidth.value))\n"+
 "  {\n"+
-"    alert(\"" + Messages.getString("WebcrawlerConnector.MaximumConnectionsMustBeAnInteger") + "\");\n"+
+"    alert(\"" + Messages.getBodyJavascriptString(locale,"WebcrawlerConnector.MaximumConnectionsMustBeAnInteger") + "\");\n"+
 "    editconnection.connections_bandwidth.focus();\n"+
 "    return;\n"+
 "  }\n"+
@@ -1701,7 +1702,8 @@ public class WebcrawlerConnector extends
   *@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
   {
     
@@ -1713,13 +1715,13 @@ public class WebcrawlerConnector extends
       robotsUsage = "all";
 
     // Email tab
-    if (tabName.equals(Messages.getString("WebcrawlerConnector.Email")))
+    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Email")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.EmailAddressToContact") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.EmailAddressToContact") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input type=\"text\" size=\"32\" name=\"email\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(email)+"\"/>\n"+
 "    </td>\n"+
@@ -1735,18 +1737,18 @@ public class WebcrawlerConnector extends
     }
 
     // Robots tab
-    if (tabName.equals(Messages.getString("WebcrawlerConnector.Robots")))
+    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Robots")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.RobotsTxtUsage") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RobotsTxtUsage") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <select name=\"robotsusage\" size=\"3\">\n"+
-"        <option value=\"none\" "+(robotsUsage.equals("none")?"selected=\"selected\"":"")+">" + Messages.getString("WebcrawlerConnector.DontLookAtRobotsTxt") + "</option>\n"+
-"        <option value=\"data\" "+(robotsUsage.equals("data")?"selected=\"selected\"":"")+">" + Messages.getString("WebcrawlerConnector.ObeyRobotsTxtForDataFetchesOnly") + "</option>\n"+
-"        <option value=\"all\" "+(robotsUsage.equals("all")?"selected=\"selected\"":"")+">" + Messages.getString("WebcrawlerConnector.ObeyRobotsTxtForAllFetches") + "</option>\n"+
+"        <option value=\"none\" "+(robotsUsage.equals("none")?"selected=\"selected\"":"")+">" + Messages.getBodyString(locale,"WebcrawlerConnector.DontLookAtRobotsTxt") + "</option>\n"+
+"        <option value=\"data\" "+(robotsUsage.equals("data")?"selected=\"selected\"":"")+">" + Messages.getBodyString(locale,"WebcrawlerConnector.ObeyRobotsTxtForDataFetchesOnly") + "</option>\n"+
+"        <option value=\"all\" "+(robotsUsage.equals("all")?"selected=\"selected\"":"")+">" + Messages.getBodyString(locale,"WebcrawlerConnector.ObeyRobotsTxtForAllFetches") + "</option>\n"+
 "      </select>\n"+
 "    </td>\n"+
 "  </tr>\n"+
@@ -1761,22 +1763,22 @@ public class WebcrawlerConnector extends
     }
 
     // Bandwidth tab
-    if (tabName.equals(Messages.getString("WebcrawlerConnector.Bandwidth")))
+    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Bandwidth")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.Throttles") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Throttles") + "</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("WebcrawlerConnector.BinRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.CaseInsensitive") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.MaxConnections") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.MaxKbytesSec") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.MaxFetchesMin") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.BinRegularExpression") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.CaseInsensitive") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.MaxConnections") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.MaxKbytesSec") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.MaxFetchesMin") + "</nobr></td>\n"+
 "        </tr>\n"
       );
       int i = 0;
@@ -1819,7 +1821,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\""+(((binCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\""+prefix+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getString("WebcrawlerConnector.DeleteBinRegularExpression")+Integer.toString(binCounter+1)+"\" onclick='javascript:deleteRegexp("+Integer.toString(binCounter)+");'/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.DeleteBinRegularExpression")+Integer.toString(binCounter+1)+"\" onclick='javascript:deleteRegexp("+Integer.toString(binCounter)+");'/>\n"+
 "              <input type=\"hidden\" name=\""+"op_"+prefix+"\" value=\"Continue\"/>\n"+
 "              <input type=\"hidden\" name=\""+"regexp_"+prefix+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(regexp)+"\"/>\n"+
 "            </a>\n"+
@@ -1855,7 +1857,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\""+(((binCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\""+prefix+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Delete") + "\" alt=\""+ Messages.getString("WebcrawlerConnector.DeleteBinRegularExpression") +Integer.toString(binCounter+1)+"\" onclick='javascript:deleteRegexp("+Integer.toString(binCounter)+");'/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Delete") + "\" alt=\""+ Messages.getAttributeString(locale,"WebcrawlerConnector.DeleteBinRegularExpression") +Integer.toString(binCounter+1)+"\" onclick='javascript:deleteRegexp("+Integer.toString(binCounter)+");'/>\n"+
 "              <input type=\"hidden\" name=\""+"op_"+prefix+"\" value=\"Continue\"/>\n"+
 "              <input type=\"hidden\" name=\""+"regexp_"+prefix+"\" value=\"\"/>\n"+
 "            </a>\n"+
@@ -1891,7 +1893,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\"formrow\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\"bandwidth\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getString("WebcrawlerConnector.AddBinRegularExpression") + "\" onclick=\"javascript:addRegexp();\"/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.AddBinRegularExpression") + "\" onclick=\"javascript:addRegexp();\"/>\n"+
 "            </a>\n"+
 "            <input type=\"hidden\" name=\"bandwidth_count\" value=\""+binCounter+"\"/>\n"+
 "            <input type=\"hidden\" name=\"bandwidth_op\" value=\"Continue\"/>\n"+
@@ -1989,22 +1991,22 @@ public class WebcrawlerConnector extends
     }
 
     // Access Credentials tab
-    if (tabName.equals(Messages.getString("WebcrawlerConnector.AccessCredentials")))
+    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.AccessCredentials")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.PageAccessCredentials") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.PageAccessCredentials") + "</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("WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.AuthenticationType") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.Domain") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.UserName") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.Password") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.AuthenticationType") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Domain") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.UserName") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Password") + "</nobr></td>\n"+
 "        </tr>\n"
       );
       int i = 0;
@@ -2031,7 +2033,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\""+(((accessCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\""+prefix+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getString("WebcrawlerConnector.DeletePageAuthenticationUrlRegularExpression")+Integer.toString(accessCounter+1)+"\" onclick='javascript:deleteARegexp("+Integer.toString(accessCounter)+");'/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.DeletePageAuthenticationUrlRegularExpression")+Integer.toString(accessCounter+1)+"\" onclick='javascript:deleteARegexp("+Integer.toString(accessCounter)+");'/>\n"+
 "              <input type=\"hidden\" name=\"op_"+prefix+"\" value=\"Continue\"/>\n"+
 "              <input type=\"hidden\" name=\"regexp_"+prefix+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(regexp)+"\"/>\n"+
 "            </a>\n"+
@@ -2040,8 +2042,8 @@ public class WebcrawlerConnector extends
 "            <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(regexp)+"</nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
-"            <nobr><input type=\"radio\" name=\"type_"+prefix+"\" value=\"basic\" "+(type.equals("basic")?"checked=\"\"":"")+" />&nbsp;" + Messages.getString("WebcrawlerConnector.BasicAuthentication") + "</nobr><br/>\n"+
-"            <nobr><input type=\"radio\" name=\"type_"+prefix+"\" value=\"ntlm\" "+(type.equals("ntlm")?"checked=\"\"":"")+" />&nbsp;" + Messages.getString("WebcrawlerConnector.NTLMAuthentication") + "</nobr>\n"+
+"            <nobr><input type=\"radio\" name=\"type_"+prefix+"\" value=\"basic\" "+(type.equals("basic")?"checked=\"\"":"")+" />&nbsp;" + Messages.getBodyString(locale,"WebcrawlerConnector.BasicAuthentication") + "</nobr><br/>\n"+
+"            <nobr><input type=\"radio\" name=\"type_"+prefix+"\" value=\"ntlm\" "+(type.equals("ntlm")?"checked=\"\"":"")+" />&nbsp;" + Messages.getBodyString(locale,"WebcrawlerConnector.NTLMAuthentication") + "</nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <nobr><input type=\"text\" size=\"16\" name=\""+"domain_"+prefix+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(domain)+"\"/></nobr>\n"+
@@ -2062,7 +2064,7 @@ public class WebcrawlerConnector extends
       if (accessCounter == 0)
       {
         out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"6\">" + Messages.getString("WebcrawlerConnector.NoPageAccessCredentialsSpecified") + "</td></tr>\n"
+"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"6\">" + Messages.getBodyString(locale,"WebcrawlerConnector.NoPageAccessCredentialsSpecified") + "</td></tr>\n"
         );
       }
       out.print(
@@ -2070,7 +2072,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\"formrow\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\"acredential\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getString("WebcrawlerConnector.AddPageAuthenticationUrlRegularExpression") + "\" onclick=\"javascript:addARegexp();\"/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.AddPageAuthenticationUrlRegularExpression") + "\" onclick=\"javascript:addARegexp();\"/>\n"+
 "            </a>\n"+
 "            <input type=\"hidden\" name=\"acredential_count\" value=\""+accessCounter+"\"/>\n"+
 "            <input type=\"hidden\" name=\"acredential_op\" value=\"Continue\"/>\n"+
@@ -2079,8 +2081,8 @@ public class WebcrawlerConnector extends
 "            <nobr><input type=\"text\" size=\"30\" name=\"regexp_acredential\" value=\"\"/></nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
-"            <nobr><input type=\"radio\" name=\"type_acredential\" value=\"basic\" checked=\"\" />&nbsp;" + Messages.getString("WebcrawlerConnector.BasicAuthentication") + "</nobr><br/>\n"+
-"            <nobr><input type=\"radio\" name=\"type_acredential\" value=\"ntlm\" />&nbsp;" + Messages.getString("WebcrawlerConnector.NTLMAuthentication") + "</nobr>\n"+
+"            <nobr><input type=\"radio\" name=\"type_acredential\" value=\"basic\" checked=\"\" />&nbsp;" + Messages.getBodyString(locale,"WebcrawlerConnector.BasicAuthentication") + "</nobr><br/>\n"+
+"            <nobr><input type=\"radio\" name=\"type_acredential\" value=\"ntlm\" />&nbsp;" + Messages.getBodyString(locale,"WebcrawlerConnector.NTLMAuthentication") + "</nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <nobr><input type=\"text\" size=\"16\" name=\"domain_acredential\" value=\"\"/></nobr>\n"+
@@ -2099,13 +2101,13 @@ public class WebcrawlerConnector extends
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.SessionBasedAccessCredentials") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.SessionBasedAccessCredentials") + "</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("WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.LoginPages") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.LoginPages") + "</nobr></td>\n"+
 "        </tr>\n"
       );
       i = 0;
@@ -2127,7 +2129,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\""+(((accessCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\""+prefix+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getString("WebcrawlerConnector.DeleteSessionAuthenticationUrlRegularExpression")+Integer.toString(accessCounter+1)+"\" onclick='javascript:deleteSRegexp("+Integer.toString(accessCounter)+");'/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.DeleteSessionAuthenticationUrlRegularExpression")+Integer.toString(accessCounter+1)+"\" onclick='javascript:deleteSRegexp("+Integer.toString(accessCounter)+");'/>\n"+
 "              <input type=\"hidden\" name=\""+prefix+"_op"+"\" value=\"Continue\"/>\n"+
 "              <input type=\"hidden\" name=\""+prefix+"_regexp"+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(regexp)+"\"/>\n"+
 "            </a>\n"+
@@ -2139,10 +2141,10 @@ public class WebcrawlerConnector extends
 "            <table class=\"formtable\">\n"+
 "              <tr class=\"formheaderrow\">\n"+
 "                <td class=\"formcolumnheader\"></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.LoginURLRegularExpression") + "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.PageType") + "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.FormNamelinkTargetRegularExpression") + "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.OverrideFormParameters") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.LoginURLRegularExpression") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.PageType") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.FormNamelinkTargetRegularExpression") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.OverrideFormParameters") + "</nobr></td>\n"+
 "              </tr>\n"
             );
             int q = 0;
@@ -2297,7 +2299,7 @@ public class WebcrawlerConnector extends
       if (accessCounter == 0)
       {
         out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">" + Messages.getString("WebcrawlerConnector.NoSessionBasedAccessCredentialsSpecified") + "</td></tr>\n"
+"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">" + Messages.getBodyString(locale,"WebcrawlerConnector.NoSessionBasedAccessCredentialsSpecified") + "</td></tr>\n"
         );
       }
       out.print(
@@ -2305,7 +2307,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\"formrow\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\"scredential\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Add") + "\" alt=\"Add session authentication url regular expression\" onclick=\"javascript:addSRegexp();\"/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Add") + "\" alt=\"Add session authentication url regular expression\" onclick=\"javascript:addSRegexp();\"/>\n"+
 "            </a>\n"+
 "            <input type=\"hidden\" name=\"scredential_count\" value=\""+accessCounter+"\"/>\n"+
 "            <input type=\"hidden\" name=\"scredential_op\" value=\"Continue\"/>\n"+
@@ -2447,19 +2449,19 @@ public class WebcrawlerConnector extends
     }
 
     // "Certificates" tab
-    if (tabName.equals(Messages.getString("WebcrawlerConnector.Certificates")))
+    if (tabName.equals(Messages.getString(locale,"WebcrawlerConnector.Certificates")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.TrustCertificates") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.TrustCertificates") + "</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("WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.Certificate") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Certificate") + "</nobr></td>\n"+
 "        </tr>\n"
       );
       int i = 0;
@@ -2542,14 +2544,14 @@ public class WebcrawlerConnector extends
       if (trustsCounter == 0)
       {
         out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">" + Messages.getString("WebcrawlerConnector.NoTrustCertificatesSpecified") + "</td></tr>\n"
+"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">" + Messages.getBodyString(locale,"WebcrawlerConnector.NoTrustCertificatesSpecified") + "</td></tr>\n"
         );
       }
       out.print(
 "        <tr class=\"formrow\"><td class=\"formseparator\" colspan=\"3\"><hr/></td></tr>\n"+
 "        <tr class=\"formrow\">\n"+
 "          <td class=\"formcolumncell\">\n"+
-"            <a name=\"trust\"><input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getString("WebcrawlerConnector.AddUrlRegularExpressionForTruststore") + "\" onclick=\"javascript:addTRegexp();\"/></a>\n"+
+"            <a name=\"trust\"><input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.AddUrlRegularExpressionForTruststore") + "\" onclick=\"javascript:addTRegexp();\"/></a>\n"+
 "            <input type=\"hidden\" name=\"trust_count\" value=\""+trustsCounter+"\"/>\n"+
 "            <input type=\"hidden\" name=\"trust_op\" value=\"Continue\"/>\n"+
 "          </td>\n"+
@@ -2557,7 +2559,7 @@ public class WebcrawlerConnector extends
 "            <nobr><input type=\"text\" size=\"30\" name=\"regexp_trust\" value=\"\"/></nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
-"            <nobr>" + Messages.getString("WebcrawlerConnector.UploadCertificate") + " <input name=\"certificate_trust\" size=\"50\" type=\"file\"/>&nbsp;<input name=\"all_trust\" type=\"checkbox\" value=\"true\">" + Messages.getString("WebcrawlerConnector.TrustEverything") + "</input></nobr>\n"+
+"            <nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.UploadCertificate") + " <input name=\"certificate_trust\" size=\"50\" type=\"file\"/>&nbsp;<input name=\"all_trust\" type=\"checkbox\" value=\"true\">" + Messages.getBodyString(locale,"WebcrawlerConnector.TrustEverything") + "</input></nobr>\n"+
 "          </td>\n"+
 "        </tr>\n"+
 "      </table>\n"+
@@ -2621,7 +2623,8 @@ public class WebcrawlerConnector extends
   *@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 email = variableContext.getParameter("email");
@@ -2997,7 +3000,8 @@ public class WebcrawlerConnector extends
   *@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
   {
     String email = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.webcrawler.WebcrawlerConfig.PARAMETER_EMAIL);
@@ -3084,14 +3088,14 @@ public class WebcrawlerConnector extends
 "  </tr>\n"+
 "  \n"+
 "  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getString("WebcrawlerConnector.PageAccessCredentials") + "</nobr></td>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.PageAccessCredentials") + "</nobr></td>\n"+
 "    <td class=\"boxcell\" colspan=\"3\">\n"+
 "      <table class=\"formtable\">\n"+
 "        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.CredentialType") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.CredentialDomain") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.UserName") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.CredentialType") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.CredentialDomain") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.UserName") + "</nobr></td>\n"+
 "        </tr>\n"
     );
     i = 0;
@@ -3126,7 +3130,7 @@ public class WebcrawlerConnector extends
     if (instanceNumber == 0)
     {
       out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"4\"><nobr>" + Messages.getString("WebcrawlerConnector.NoPageAccessCredentials") + "</nobr></td></tr>\n"
+"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"4\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoPageAccessCredentials") + "</nobr></td></tr>\n"
       );
     }
     out.print(
@@ -3135,12 +3139,12 @@ public class WebcrawlerConnector extends
 "  </tr>\n"+
 "\n"+
 "  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getString("WebcrawlerConnector.SessionBasedAccessCredentials") + "</nobr></td>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.SessionBasedAccessCredentials") + "</nobr></td>\n"+
 "    <td class=\"boxcell\" colspan=\"3\">\n"+
 "      <table class=\"formtable\">\n"+
 "        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.LoginPages") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.LoginPages") + "</nobr></td>\n"+
 "        </tr>\n"
     );
     i = 0;
@@ -3178,10 +3182,10 @@ public class WebcrawlerConnector extends
                 out.print(
 "            <table class=\"formtable\">\n"+
 "              <tr class=\"formheaderrow\">\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.LoginURLRegularExpression") + "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.PageType") + "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.FormNamelinkTargetRegularExpression") + "</nobr></td>\n"+
-"                <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.OverrideFormParameters") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.LoginURLRegularExpression") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.PageType") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.FormNamelinkTargetRegularExpression") + "</nobr></td>\n"+
+"                <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.OverrideFormParameters") + "</nobr></td>\n"+
 "              </tr>\n"
                 );
               }
@@ -3225,7 +3229,7 @@ public class WebcrawlerConnector extends
           if (authPageInstanceNumber == 0)
           {
             out.print(
-"            <nobr>" + Messages.getString("WebcrawlerConnector.NoLoginPagesSpecified") + "</nobr>\n"
+"            <nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoLoginPagesSpecified") + "</nobr>\n"
             );
           }
           else
@@ -3245,7 +3249,7 @@ public class WebcrawlerConnector extends
     if (instanceNumber == 0)
     {
       out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"2\"><nobr>" + Messages.getString("WebcrawlerConnector.NoSessionBasedAccessCredentials") + "</nobr></td></tr>\n"
+"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"2\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoSessionBasedAccessCredentials") + "</nobr></td></tr>\n"
       );
     }
     out.print(
@@ -3254,12 +3258,12 @@ public class WebcrawlerConnector extends
 "  </tr>\n"+
 "  \n"+
 "  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getString("WebcrawlerConnector.TrustCertificates") + "</nobr></td>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.TrustCertificates") + "</nobr></td>\n"+
 "    <td class=\"boxcell\" colspan=\"3\">\n"+
 "      <table class=\"formtable\">\n"+
 "        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.Certificate") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Certificate") + "</nobr></td>\n"+
 "        </tr>\n"
     );
     i = 0;
@@ -3278,7 +3282,7 @@ public class WebcrawlerConnector extends
           out.print(
 "        <tr class=\""+(((instanceNumber % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
 "          <td class=\"formcolumncell\"><nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(regexp)+"</nobr></td>\n"+
-"          <td class=\"formcolumncell\"><i>" + Messages.getString("WebcrawlerConnector.TrustEverything") + "</i></td>\n"+
+"          <td class=\"formcolumncell\"><i>" + Messages.getBodyString(locale,"WebcrawlerConnector.TrustEverything") + "</i></td>\n"+
 "        </tr>\n"
           );
           instanceNumber++;
@@ -3313,7 +3317,7 @@ public class WebcrawlerConnector extends
     if (instanceNumber == 0)
     {
       out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"2\">" + Messages.getString("WebcrawlerConnector.NoTrustCertificates") + "</td></tr>\n"
+"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"2\">" + Messages.getBodyString(locale,"WebcrawlerConnector.NoTrustCertificates") + "</td></tr>\n"
       );
     }
     out.print(
@@ -3332,7 +3336,7 @@ public class WebcrawlerConnector extends
   *@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("Seeds");
@@ -3446,7 +3450,7 @@ public class WebcrawlerConnector extends
   *@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;
@@ -3541,13 +3545,13 @@ public class WebcrawlerConnector extends
 "      <table class=\"formtable\">\n"+
 "        <tr class=\"formheaderrow\">\n"+
 "          <td class=\"formcolumnheader\"></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.Description") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.Reorder") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.RemoveJSPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.RemoveASPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.RemovePHPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.RemoveBVSessions") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegularExpression") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Description") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Reorder") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveJSPSessions") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveASPSessions") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemovePHPSessions") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveBVSessions") + "</nobr></td>\n"+
 "        </tr>\n"
       );
       int q = 0;
@@ -3581,7 +3585,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\""+(((l % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\""+"urlregexp_"+Integer.toString(l)+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getString("WebcrawlerConnector.DeleteUrlRegexp")+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(regexpString)+"\" onclick='javascript:URLRegexpDelete("+Integer.toString(l)+",\"urlregexp_"+Integer.toString(l)+"\");'/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Delete") + "\" alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.DeleteUrlRegexp")+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(regexpString)+"\" onclick='javascript:URLRegexpDelete("+Integer.toString(l)+",\"urlregexp_"+Integer.toString(l)+"\");'/>\n"+
 "            </a>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
@@ -3609,7 +3613,7 @@ public class WebcrawlerConnector extends
       if (l == 0)
       {
         out.print(
-"        <tr class=\"formrow\"><td colspan=\"8\" class=\"formcolumnmessage\"><nobr>" + Messages.getString("WebcrawlerConnector.NoCanonicalizationSpecified") + "</nobr></td></tr>\n"
+"        <tr class=\"formrow\"><td colspan=\"8\" class=\"formcolumnmessage\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoCanonicalizationSpecified") + "</nobr></td></tr>\n"
         );
       }
       out.print(
@@ -3617,7 +3621,7 @@ public class WebcrawlerConnector extends
 "        <tr class=\"formrow\">\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <a name=\""+"urlregexp_"+Integer.toString(l)+"\">\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getString("WebcrawlerConnector.AddUrlRegexp") + "\" onclick='javascript:URLRegexpAdd(\"urlregexp_"+Integer.toString(l+1)+"\");'/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Add") + "\" alt=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.AddUrlRegexp") + "\" onclick='javascript:URLRegexpAdd(\"urlregexp_"+Integer.toString(l+1)+"\");'/>\n"+
 "              <input type=\"hidden\" name=\"urlregexpcount\" value=\""+Integer.toString(l)+"\"/>\n"+
 "            </a>\n"+
 "          </td>\n"+
@@ -3689,19 +3693,19 @@ public class WebcrawlerConnector extends
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getString("WebcrawlerConnector.IncludeInCrawl") + "</nobr></td>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeInCrawl") + "</nobr></td>\n"+
 "    <td class=\"value\" colspan=\"1\">\n"+
 "      <textarea rows=\"25\" cols=\"60\" name=\"inclusions\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(inclusions)+"</textarea>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getString("WebcrawlerConnector.IncludeInIndex") + "</nobr></td>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeInIndex") + "</nobr></td>\n"+
 "    <td class=\"value\" colspan=\"1\">\n"+
 "      <textarea rows=\"10\" cols=\"60\" name=\"inclusionsindex\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(inclusionsIndex)+"</textarea>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.IncludeOnlyHostsMatchingSeeds") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeOnlyHostsMatchingSeeds") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input type=\"checkbox\" name=\"matchinghosts\" value=\"true\""+(includeMatching?" checked=\"yes\"":"")+"/>\n"+
 "      <input type=\"hidden\" name=\"matchinghosts_present\" value=\"true\"/>\n"+
@@ -3727,13 +3731,13 @@ public class WebcrawlerConnector extends
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getString("WebcrawlerConnector.ExcludeFromCrawl") + "</nobr></td>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ExcludeFromCrawl") + "</nobr></td>\n"+
 "    <td class=\"value\" colspan=\"1\">\n"+
 "      <textarea rows=\"25\" cols=\"60\" name=\"exclusions\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(exclusions)+"</textarea>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getString("WebcrawlerConnector.ExcludeFromIndex") + "</nobr></td>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ExcludeFromIndex") + "</nobr></td>\n"+
 "    <td class=\"value\" colspan=\"1\">\n"+
 "      <textarea rows=\"10\" cols=\"60\" name=\"exclusionsindex\">"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(exclusionsIndex)+"</textarea>\n"+
 "    </td>\n"+
@@ -3776,7 +3780,7 @@ public class WebcrawlerConnector extends
 "      <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("WebcrawlerConnector.Delete") + "\" onClick='Javascript:SpecOp(\""+accessOpName+"\",\"Delete\",\"token_"+Integer.toString(k)+"\")' alt=\""+Messages.getString("WebcrawlerConnector.DeleteToken")+Integer.toString(k)+"\"/>\n"+
+"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Delete") + "\" onClick='Javascript:SpecOp(\""+accessOpName+"\",\"Delete\",\"token_"+Integer.toString(k)+"\")' alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.DeleteToken")+Integer.toString(k)+"\"/>\n"+
 "      </a>&nbsp;\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -3791,7 +3795,7 @@ public class WebcrawlerConnector extends
       {
         out.print(
 "  <tr>\n"+
-"    <td class=\"message\" colspan=\"2\">" + Messages.getString("WebcrawlerConnector.NoAccessTokensPresent") + "</td>\n"+
+"    <td class=\"message\" colspan=\"2\">" + Messages.getBodyString(locale,"WebcrawlerConnector.NoAccessTokensPresent") + "</td>\n"+
 "  </tr>\n"
         );
       }
@@ -3802,7 +3806,7 @@ public class WebcrawlerConnector extends
 "      <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("WebcrawlerConnector.Add") + "\" onClick='Javascript:SpecAddToken(\"token_"+Integer.toString(k+1)+"\")' alt=\"" + Messages.getString("WebcrawlerConnector.AddAccessToken") + "\"/>\n"+
+"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Add") + "\" onClick='Javascript:SpecAddToken(\"token_"+Integer.toString(k+1)+"\")' alt=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.AddAccessToken") + "\"/>\n"+
 "      </a>&nbsp;\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -3861,7 +3865,7 @@ public class WebcrawlerConnector extends
 "      <input type=\"hidden\" name=\""+"specmetaname"+metadataDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(name)+"\"/>\n"+
 "      <input type=\"hidden\" name=\""+"specmetavalue"+metadataDescription+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(value)+"\"/>\n"+
 "      <a name=\""+"metadata_"+Integer.toString(k)+"\">\n"+
-"        <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Delete") + "\" onClick='Javascript:SpecOp(\""+metadataOpName+"\",\"Delete\",\"metadata_"+Integer.toString(k)+"\")' alt=\""+Messages.getString("WebcrawlerConnector.DeleteMetadata")+Integer.toString(k)+"\"/>\n"+
+"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Delete") + "\" onClick='Javascript:SpecOp(\""+metadataOpName+"\",\"Delete\",\"metadata_"+Integer.toString(k)+"\")' alt=\""+Messages.getAttributeString(locale,"WebcrawlerConnector.DeleteMetadata")+Integer.toString(k)+"\"/>\n"+
 "      </a>&nbsp;\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -3881,7 +3885,7 @@ public class WebcrawlerConnector extends
       {
         out.print(
 "  <tr>\n"+
-"    <td class=\"message\" colspan=\"4\">" + Messages.getString("WebcrawlerConnector.NoMetadataPresent") + "</td>\n"+
+"    <td class=\"message\" colspan=\"4\">" + Messages.getBodyString(locale,"WebcrawlerConnector.NoMetadataPresent") + "</td>\n"+
 "  </tr>\n"
         );
       }
@@ -3892,7 +3896,7 @@ public class WebcrawlerConnector extends
 "      <input type=\"hidden\" name=\"metadatacount\" value=\""+Integer.toString(k)+"\"/>\n"+
 "      <input type=\"hidden\" name=\"metadataop\" value=\"\"/>\n"+
 "      <a name=\""+"metadata_"+Integer.toString(k)+"\">\n"+
-"        <input type=\"button\" value=\"" + Messages.getString("WebcrawlerConnector.Add") + "\" onClick='Javascript:SpecAddMetadata(\"metadata_"+Integer.toString(k+1)+"\")' alt=\"" + Messages.getString("WebcrawlerConnector.AddMetadata") + "\"/>\n"+
+"        <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.Add") + "\" onClick='Javascript:SpecAddMetadata(\"metadata_"+Integer.toString(k+1)+"\")' alt=\"" + Messages.getAttributeString(locale,"WebcrawlerConnector.AddMetadata") + "\"/>\n"+
 "      </a>&nbsp;\n"+
 "    </td>\n"+
 "    <td class=\"value\">\n"+
@@ -3943,7 +3947,7 @@ public class WebcrawlerConnector extends
   *@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
   {
     // Get the seeds
@@ -4257,7 +4261,7 @@ public class WebcrawlerConnector extends
   *@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 j;
@@ -4316,7 +4320,7 @@ public class WebcrawlerConnector extends
     out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.Seeds") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Seeds") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
     );
     try
@@ -4370,17 +4374,17 @@ public class WebcrawlerConnector extends
         {
           out.print(
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.URLCanonicalization") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLCanonicalization") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <table class=\"formtable\">\n"+
 "        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.URLRegexp") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.Description") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.Reorder") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.RemoveJSPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.RemoveASPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.RemovePHPSessions") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WebcrawlerConnector.RemoveBVSessions") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.URLRegexp") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Description") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Reorder") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveJSPSessions") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveASPSessions") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemovePHPSessions") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.RemoveBVSessions") + "</nobr></td>\n"+
 "        </tr>\n"
           );
         }
@@ -4428,13 +4432,13 @@ public class WebcrawlerConnector extends
     else
     {
       out.print(
-"  <tr><td class=\"message\" colspan=\"2\"><nobr>" + Messages.getString("WebcrawlerConnector.NoCanonicalizationSpecified") + "</nobr></td></tr>\n"
+"  <tr><td class=\"message\" colspan=\"2\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoCanonicalizationSpecified") + "</nobr></td></tr>\n"
       );
     }
     out.print(
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.IncludeOnlyHostsMatchingSeeds") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeOnlyHostsMatchingSeeds") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "    "+(includeMatching?"yes":"no")+"\n"+
 "    </td>\n"+
@@ -4444,7 +4448,7 @@ public class WebcrawlerConnector extends
     out.print(
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.IncludeInCrawl") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeInCrawl") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
     );
     try
@@ -4486,7 +4490,7 @@ public class WebcrawlerConnector extends
 "  </tr>\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.IncludeInIndex") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.IncludeInIndex") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
     );
     try
@@ -4528,7 +4532,7 @@ public class WebcrawlerConnector extends
 "  </tr>\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.ExcludeFromCrawl") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ExcludeFromCrawl") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
     );
     try
@@ -4570,7 +4574,7 @@ public class WebcrawlerConnector extends
 "  </tr>\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.ExcludeFromIndex") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.ExcludeFromIndex") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
     );
     try
@@ -4625,7 +4629,7 @@ public class WebcrawlerConnector extends
         {
           out.print(
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.AccessTokens") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.AccessTokens") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
           );
           seenAny = true;
@@ -4647,7 +4651,7 @@ public class WebcrawlerConnector extends
     else
     {
       out.print(
-"  <tr><td class=\"message\" colspan=\"2\"><nobr>" + Messages.getString("WebcrawlerConnector.NoAccessTokensSpecified") + "</nobr></td></tr>\n"
+"  <tr><td class=\"message\" colspan=\"2\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoAccessTokensSpecified") + "</nobr></td></tr>\n"
       );
     }
     out.print(
@@ -4665,7 +4669,7 @@ public class WebcrawlerConnector extends
         {
           out.print(
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WebcrawlerConnector.Metadata") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.Metadata") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"
           );
           seenAny = true;
@@ -4688,7 +4692,7 @@ public class WebcrawlerConnector extends
     else
     {
       out.print(
-"  <tr><td class=\"message\" colspan=\"2\"><nobr>" + Messages.getString("WebcrawlerConnector.NoMetadataSpecified") + "</nobr></td></tr>\n"
+"  <tr><td class=\"message\" colspan=\"2\"><nobr>" + Messages.getBodyString(locale,"WebcrawlerConnector.NoMetadataSpecified") + "</nobr></td></tr>\n"
       );
     }
     out.print(

Modified: incubator/lcf/branches/CONNECTORS-335/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/Messages.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/Messages.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/Messages.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/Messages.java Sun Dec 25 20:10:58 2011
@@ -19,75 +19,106 @@
 package org.apache.manifoldcf.crawler.connectors.wiki;
 
 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.wiki.common";
-
+  public static final String DEFAULT_PATH_NAME="org.apache.manifoldcf.crawler.connectors.wiki";
+  
   /** 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/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java Sun Dec 25 20:10:58 2011
@@ -317,10 +317,11 @@ public class WikiConnector 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 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("WikiConnector.Server"));
+    tabsArray.add(Messages.getString(locale,"WikiConnector.Server"));
 
     out.print(
 "<script type=\"text/javascript\">\n"+
@@ -382,7 +383,8 @@ public class WikiConnector extends org.a
   *@param parameters are the configuration parameters, as they currently exist, for this connection being configured.
   *@param tabName is the current tab name.
   */
-  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 protocol = parameters.getParameter(WikiConfig.PARAM_PROTOCOL);
@@ -401,12 +403,12 @@ public class WikiConnector extends org.a
     if (path == null)
       path = "/w";
 
-    if (tabName.equals(Messages.getString("WikiConnector.Server")))
+    if (tabName.equals(Messages.getString(locale,"WikiConnector.Server")))
     {
       out.print(
 "<table class=\"displaytable\">\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WikiConnector.Protocol") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.Protocol") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <select name=\"serverprotocol\">\n"+
 "        <option value=\"http\""+(protocol.equals("http")?" selected=\"true\"":"")+">http</option>\n"+
@@ -415,19 +417,19 @@ public class WikiConnector extends org.a
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WikiConnector.ServerName") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.ServerName") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input name=\"servername\" type=\"text\" size=\"32\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(server)+"\"/>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WikiConnector.Port") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.Port") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input name=\"serverport\" type=\"text\" size=\"5\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(port)+"\"/>\n"+
 "    </td>\n"+
 "  </tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WikiConnector.PathName") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.PathName") + "</nobr></td>\n"+
 "    <td class=\"value\">\n"+
 "      <input name=\"serverpath\" type=\"text\" size=\"16\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(path)+"\"/>\n"+
 "    </td>\n"+
@@ -458,7 +460,8 @@ public class WikiConnector 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 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 protocol = variableContext.getParameter("serverprotocol");
@@ -488,7 +491,8 @@ public class WikiConnector extends org.a
   *@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(
@@ -539,10 +543,10 @@ public class WikiConnector 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("WikiConnector.NamespaceAndTitles"));
+    tabsArray.add(Messages.getString(locale,"WikiConnector.NamespaceAndTitles"));
     
     out.print(
 "<script type=\"text/javascript\">\n"+
@@ -584,10 +588,10 @@ public class WikiConnector extends org.a
   */
   @Override
 
-  public void outputSpecificationBody(IHTTPOutput out, DocumentSpecification ds, String tabName)
+  public void outputSpecificationBody(IHTTPOutput out, Locale locale, DocumentSpecification ds, String tabName)
     throws ManifoldCFException, IOException
   {
-    if (tabName.equals(Messages.getString("WikiConnector.NamespaceAndTitles")))
+    if (tabName.equals(Messages.getString(locale,"WikiConnector.NamespaceAndTitles")))
     {
       boolean seenAny = false;
       // Output table column headers
@@ -595,13 +599,13 @@ public class WikiConnector extends org.a
 "<table class=\"displaytable\">\n"+
 "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
 "  <tr>\n"+
-"    <td class=\"description\"><nobr>" + Messages.getString("WikiConnector.NamespaceAndTitles2") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.NamespaceAndTitles2") + "</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("WikiConnector.Namespace") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WikiConnector.TitlePrefix") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.Namespace") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.TitlePrefix") + "</nobr></td>\n"+
 "        </tr>\n"
       );
 
@@ -625,7 +629,7 @@ public class WikiConnector extends org.a
 "              <input type=\"hidden\" name=\""+nsOpName+"\" value=\"\"/>\n"+
 "              <input type=\"hidden\" name=\""+nsNsName+"\" value=\""+((namespace==null)?"":org.apache.manifoldcf.ui.util.Encoder.attributeEscape(namespace))+"\"/>\n"+
 "              <input type=\"hidden\" name=\""+nsTitlePrefix+"\" value=\""+((titlePrefix==null)?"":org.apache.manifoldcf.ui.util.Encoder.attributeEscape(titlePrefix))+"\"/>\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WikiConnector.Delete") + "\" onClick='Javascript:NsDelete("+Integer.toString(k)+")' alt=\""+"Delete namespace/title #"+Integer.toString(k)+"\"/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WikiConnector.Delete") + "\" onClick='Javascript:NsDelete("+Integer.toString(k)+")' alt=\""+"Delete namespace/title #"+Integer.toString(k)+"\"/>\n"+
 "            </nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
@@ -647,7 +651,7 @@ public class WikiConnector extends org.a
       if (k == 0)
       {
         out.print(
-"        <tr class=\"formrow\"><td colspan=\"3\" class=\"formmessage\">" + Messages.getString("WikiConnector.NoSpecification") + "</td></tr>\n"
+"        <tr class=\"formrow\"><td colspan=\"3\" class=\"formmessage\">" + Messages.getBodyString(locale,"WikiConnector.NoSpecification") + "</td></tr>\n"
         );
       }
 
@@ -678,13 +682,13 @@ public class WikiConnector extends org.a
 "              <a name=\""+"ns_"+Integer.toString(k)+"\"/>\n"+
 "              <input type=\"hidden\" name=\"nsop\" value=\"\"/>\n"+
 "              <input type=\"hidden\" name=\"nscount\" value=\""+Integer.toString(k)+"\"/>\n"+
-"              <input type=\"button\" value=\"" + Messages.getString("WikiConnector.Add") + "\" onClick='Javascript:NsAdd("+Integer.toString(k)+")' alt=\"" + Messages.getString("WikiConnector.AddNamespacePrefix") + "\"/>\n"+
+"              <input type=\"button\" value=\"" + Messages.getAttributeString(locale,"WikiConnector.Add") + "\" onClick='Javascript:NsAdd("+Integer.toString(k)+")' alt=\"" + Messages.getAttributeString(locale,"WikiConnector.AddNamespacePrefix") + "\"/>\n"+
 "            </nobr>\n"+
 "          </td>\n"+
 "          <td class=\"formcolumncell\">\n"+
 "            <nobr>\n"+
 "              <select name=\"nsnsname\">\n"+
-"                <option value=\"\" selected=\"true\">-- " + Messages.getString("WikiConnector.UseDefault") + " --</option>\n"
+"                <option value=\"\" selected=\"true\">-- " + Messages.getBodyString(locale,"WikiConnector.UseDefault") + " --</option>\n"
         );
         for (int l = 0 ; l < nameSpaceNames.length ; l++)
         {
@@ -710,7 +714,7 @@ public class WikiConnector extends org.a
       catch (ServiceInterruption e)
       {
         out.print(
-"        <tr class=\"formrow\"><td colspan=\"3\" class=\"formmessage\">" + Messages.getString("WikiConnector.TransientError") + org.apache.manifoldcf.ui.util.Encoder.bodyEscape(e.getMessage())+"</td></tr>\n"
+"        <tr class=\"formrow\"><td colspan=\"3\" class=\"formmessage\">" + Messages.getBodyString(locale,"WikiConnector.TransientError") + org.apache.manifoldcf.ui.util.Encoder.bodyEscape(e.getMessage())+"</td></tr>\n"
         );
       }
 
@@ -759,7 +763,7 @@ public class WikiConnector 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 countString = variableContext.getParameter("nscount");
@@ -827,7 +831,7 @@ public class WikiConnector 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(
@@ -835,12 +839,12 @@ public class WikiConnector extends org.a
 "  <tr>\n"
     );
     out.print(
-"    <td class=\"description\"><nobr>" + Messages.getString("WikiConnector.NamespaceAndTitles2") + "</nobr></td>\n"+
+"    <td class=\"description\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.NamespaceAndTitles2") + "</nobr></td>\n"+
 "    <td class=\"boxcell\">\n"+
 "      <table class=\"formtable\">\n"+
 "        <tr class=\"formheaderrow\">\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WikiConnector.Namespace") + "</nobr></td>\n"+
-"          <td class=\"formcolumnheader\"><nobr>" + Messages.getString("WikiConnector.TitlePrefix") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.Namespace") + "</nobr></td>\n"+
+"          <td class=\"formcolumnheader\"><nobr>" + Messages.getBodyString(locale,"WikiConnector.TitlePrefix") + "</nobr></td>\n"+
 "        </tr>\n"
     );
 
@@ -872,7 +876,7 @@ public class WikiConnector extends org.a
     
     if (k == 0)
       out.print(
-"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"2\">" + Messages.getString("WikiConnector.AllDefaultNamespaceDocumentsIncluded") + "</td></tr>\n"
+"        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"2\">" + Messages.getBodyString(locale,"WikiConnector.AllDefaultNamespaceDocumentsIncluded") + "</td></tr>\n"
       );
     
     out.print(

Modified: incubator/lcf/branches/CONNECTORS-335/framework/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/framework/build.xml?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/framework/build.xml (original)
+++ incubator/lcf/branches/CONNECTORS-335/framework/build.xml Sun Dec 25 20:10:58 2011
@@ -249,6 +249,7 @@
                 <include name="commons-fileupload*.jar"/>
                 <include name="commons-httpclient-mcf.jar"/>
                 <include name="commons-io*.jar"/>
+                <include name="commons-lang*.jar"/>
                 <include name="commons-logging*.jar"/>
                 <include name="jdbcpool-0.99.jar"/>
                 <include name="json.jar"/>
@@ -285,6 +286,7 @@
                 <include name="commons-fileupload*.jar"/>
                 <include name="commons-httpclient-mcf.jar"/>
                 <include name="commons-io*.jar"/>
+                <include name="commons-lang*.jar"/>
                 <include name="commons-logging*.jar"/>
                 <include name="jdbcpool-0.99.jar"/>
                 <include name="json.jar"/>
@@ -327,6 +329,7 @@
                 <include name="commons-fileupload*.jar"/>
                 <include name="commons-httpclient-mcf.jar"/>
                 <include name="commons-io*.jar"/>
+                <include name="commons-lang*.jar"/>
                 <include name="commons-logging*.jar"/>
                 <include name="jdbcpool-0.99.jar"/>
                 <include name="json.jar"/>
@@ -408,6 +411,7 @@
                 <include name="commons-fileupload*.jar"/>
                 <include name="commons-httpclient-mcf.jar"/>
                 <include name="commons-io*.jar"/>
+                <include name="commons-lang*.jar"/>
                 <include name="commons-logging*.jar"/>
                 <include name="jdbcpool-0.99.jar"/>
                 <include name="json.jar"/>
@@ -467,6 +471,7 @@
                 <include name="commons-collections*.jar"/>
                 <include name="commons-httpclient-mcf.jar"/>
                 <include name="commons-io*.jar"/>
+                <include name="commons-lang*.jar"/>
                 <include name="commons-logging*.jar"/>
                 <include name="json.jar"/>
             </fileset>
@@ -493,6 +498,7 @@
                 <include name="commons-fileupload*.jar"/>
                 <include name="commons-httpclient-mcf.jar"/>
                 <include name="commons-io*.jar"/>
+                <include name="commons-lang*.jar"/>
                 <include name="commons-logging*.jar"/>
                 <include name="eclipse*.jar"/>
                 <include name="jasper*.jar"/>

Modified: incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java?rev=1224641&r1=1224640&r2=1224641&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java (original)
+++ incubator/lcf/branches/CONNECTORS-335/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java Sun Dec 25 20:10:58 2011
@@ -25,7 +25,10 @@ import java.util.ResourceBundle;
 import java.util.Set;
 import java.util.HashSet;
 
+import java.io.InputStream;
+
 import org.apache.manifoldcf.core.system.Logging;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 
 public class Messages
 {
@@ -35,10 +38,11 @@ public class Messages
   
   protected static Set<BundleKey> bundleSet = new HashSet<BundleKey>();
   protected static Set<MessageKey> messageSet = new HashSet<MessageKey>();
+  protected static Set<ResourceKey> resourceSet = new HashSet<ResourceKey>();
   
   /** Constructor - do no instantiate
   */
-  public Messages()
+  protected Messages()
   {
   }
   
@@ -102,6 +106,36 @@ public class Messages
     return getString(Messages.class.getClassLoader(), bundleName, locale, messageKey, args);
   }
   
+  /** Read a resource as an input stream, given a classloader, path, locale, and resource key.
+  */
+  public static InputStream getResourceAsStream(Class classInstance, String pathName,
+    Locale locale, String resourceKey)
+    throws ManifoldCFException
+  {
+    InputStream is = classInstance.getResourceAsStream(localizeResourceName(pathName,resourceKey,locale));
+    if (is == null)
+    {
+      complainMissingResource("No resource in path '"+pathName+"' named '"+resourceKey+"' found for locale '"+locale.toString()+"'",
+        new Exception("Resource not found"),pathName,locale,resourceKey);
+      is = classInstance.getResourceAsStream(localizeResourceName(pathName,resourceKey,Locale.US));
+      if (is == null)
+        throw new ManifoldCFException("No backup resource in path '"+pathName+"' named '"+resourceKey+"' found for US locale!");
+    }
+    return is;
+  }
+  
+  private static String localizeResourceName(String pathName, String resourceName, Locale locale)
+  {
+    // Path names temporarily disabled, since they don't work.
+    // MHL
+    int dotIndex = resourceName.lastIndexOf(".");
+    if (dotIndex == -1)
+      return /*pathName + "." + */resourceName + "_" + locale.toString();
+    return /*pathName + "." + */resourceName.substring(0,dotIndex) + "_" + locale.toString() + resourceName.substring(dotIndex);
+  }
+  
+  /** Obtain a string given a classloader, bundle, locale, message key, and arguments.
+  */
   public static String getString(ClassLoader classLoader, String bundleName, Locale locale,
     String messageKey, Object[] args)
   {
@@ -177,6 +211,19 @@ public class Messages
     logError(errorMessage,exception);
   }
 
+  protected static void complainMissingResource(String errorMessage, Throwable exception, String pathName, Locale locale, String resourceKey)
+  {
+    String localeName = locale.toString();
+    ResourceKey bk = new ResourceKey(pathName,localeName,resourceKey);
+    synchronized (resourceSet)
+    {
+      if (resourceSet.contains(bk))
+        return;
+      resourceSet.add(bk);
+    }
+    logError(errorMessage,exception);
+  }
+
   protected static void logError(String errorMessage, Throwable exception)
   {
     if (Logging.misc == null)
@@ -244,5 +291,34 @@ public class Messages
     }
   }
 
+  /** Class to help keep track of the missing resources we've already complained about,
+  * so we don't fill up the standard out log with repetitive stuff. */
+  protected static class ResourceKey
+  {
+    protected String pathName;
+    protected String localeName;
+    protected String resourceKey;
+    
+    public ResourceKey(String pathName, String localeName, String resourceKey)
+    {
+      this.pathName = pathName;
+      this.localeName = localeName;
+      this.resourceKey = resourceKey;
+    }
+    
+    public int hashCode()
+    {
+      return pathName.hashCode() + localeName.hashCode() + resourceKey.hashCode();
+    }
+    
+    public boolean equals(Object o)
+    {
+      if (!(o instanceof ResourceKey))
+        return false;
+      ResourceKey b = (ResourceKey)o;
+      return b.pathName.equals(pathName) && b.localeName.equals(localeName) && b.resourceKey.equals(resourceKey);
+    }
+  }
+
 }
 



Mime
View raw message