incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1296015 - in /incubator/lcf/trunk/connectors/cmis/connector/src/main: java/org/apache/manifoldcf/crawler/connectors/cmis/ native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/ resources/org/apache/manifoldcf/crawler/connectors/cmis/
Date Fri, 02 Mar 2012 01:18:58 GMT
Author: kwright
Date: Fri Mar  2 01:18:57 2012
New Revision: 1296015

URL: http://svn.apache.org/viewvc?rev=1296015&view=rev
Log:
Internationalize the editConnection.js template.  Also fixed some problems with the connector
code itself; some i18n work was lost, and in some cases 'null' checks had been replaced with
StringUtils.empty(), which were incorrect and broke the UI.

Added:
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js
      - copied, changed from r1295923, incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration_en_US.js
Removed:
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration_en_US.js
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration_ja_JP.js
Modified:
    incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
    incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_en_US.properties
    incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_ja_JP.properties

Modified: incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1296015&r1=1296014&r2=1296015&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
(original)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
Fri Mar  2 01:18:57 2012
@@ -105,8 +105,9 @@ public class CmisRepositoryConnector ext
   /** Forward to the HTML template for rendering hidden fields when the CMIS Query tab is
not selected */
   private static final String HIDDEN_SPEC_FORWARD = "hiddenSpecification.html";
   
-  private static final String CMIS_SERVER_TAB_NAME = "Server";
-
+  private static final String CMIS_SERVER_TAB_PROPERTY = "CmisRepositoryConnector.Server";
+  private static final String CMIS_QUERY_TAB_PROPERTY = "CmisRepositoryConnector.CMISQuery";
+  
   /**
    * CMIS Session handle
    */
@@ -745,7 +746,7 @@ public class CmisRepositoryConnector ext
   public void outputConfigurationHeader(IThreadContext threadContext,
       IHTTPOutput out, Locale locale, ConfigParams parameters, List<String> tabsArray)
       throws ManifoldCFException, IOException {
-    tabsArray.add(CMIS_SERVER_TAB_NAME);
+    tabsArray.add(Messages.getString(locale,CMIS_SERVER_TAB_PROPERTY));
     outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, parameters);
   }
 
@@ -789,7 +790,7 @@ public class CmisRepositoryConnector ext
     newMap.setParameter(CmisConfig.PATH_PARAM, path);
     newMap.setParameter(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
     newMap.setParameter(CmisConfig.BINDING_PARAM, binding);
-    if(CMIS_SERVER_TAB_NAME.equals(tabName)){
+    if(Messages.getString(locale,CMIS_SERVER_TAB_PROPERTY).equals(tabName)){
       outputResource(EDIT_CONFIG_FORWARD, out, locale, newMap);
     } else {
       outputResource(HIDDEN_CONFIG_FORWARD, out, locale, newMap);
@@ -821,29 +822,29 @@ public class CmisRepositoryConnector ext
       throws ManifoldCFException {
     
     String binding = variableContext.getParameter(CmisConfig.BINDING_PARAM);
-    if (StringUtils.isNotEmpty(binding))
+    if (binding != null)
       parameters.setParameter(CmisConfig.BINDING_PARAM, binding);
     
     String username = variableContext.getParameter(CmisConfig.USERNAME_PARAM);
-    if (StringUtils.isNotEmpty(username))
+    if (username != null)
       parameters.setParameter(CmisConfig.USERNAME_PARAM, username);
 
     String password = variableContext.getParameter(CmisConfig.PASSWORD_PARAM);
-    if (StringUtils.isNotEmpty(password))
+    if (password != null)
       parameters.setParameter(CmisConfig.PASSWORD_PARAM, password);
 
     String protocol = variableContext.getParameter(CmisConfig.PROTOCOL_PARAM);
-    if (StringUtils.isNotEmpty(protocol)) {
+    if (protocol != null) {
       parameters.setParameter(CmisConfig.PROTOCOL_PARAM, protocol);
     }
     
     String server = variableContext.getParameter(CmisConfig.SERVER_PARAM);
-    if (StringUtils.isNotEmpty(server) && !StringUtils.contains(server, '/')) {
+    if (server != null && !StringUtils.contains(server, '/')) {
       parameters.setParameter(CmisConfig.SERVER_PARAM, server);
     }
     
     String port = variableContext.getParameter(CmisConfig.PORT_PARAM);
-    if (StringUtils.isNotEmpty(port)){
+    if (port != null){
       try {
         Integer.parseInt(port);
         parameters.setParameter(CmisConfig.PORT_PARAM, port);
@@ -853,12 +854,14 @@ public class CmisRepositoryConnector ext
     }
     
     String path = variableContext.getParameter(CmisConfig.PATH_PARAM);
-    if (StringUtils.isNotEmpty(path)) {
+    if (path != null) {
       parameters.setParameter(CmisConfig.PATH_PARAM, path);
     }
 
     String repositoryId = variableContext.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
-    parameters.setParameter(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
+    if (repositoryId != null) {
+      parameters.setParameter(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
+    }
 
     return null;
   }
@@ -974,7 +977,7 @@ public class CmisRepositoryConnector ext
 
     ConfigParams params = new ConfigParams();
     params.setParameter(CmisConfig.CMIS_QUERY_PARAM, cmisQuery);
-    if (tabName.equals(Messages.getString(locale,"CmisRepositoryConnector.CMISQuery"))) {
+    if (tabName.equals(Messages.getString(locale,CMIS_QUERY_TAB_PROPERTY))) {
       outputResource(EDIT_SPEC_FORWARD, out, locale, params);
     } else {
       outputResource(HIDDEN_SPEC_FORWARD, out, locale, params);
@@ -999,7 +1002,7 @@ public class CmisRepositoryConnector ext
   public void outputSpecificationHeader(IHTTPOutput out,
       Locale locale, DocumentSpecification ds, List<String> tabsArray)
       throws ManifoldCFException, IOException {
-    tabsArray.add(Messages.getString(locale,"CmisRepositoryConnector.CMISQuery"));
+    tabsArray.add(Messages.getString(locale,CMIS_QUERY_TAB_PROPERTY));
     outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, params);
   }
 

Modified: incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_en_US.properties
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_en_US.properties?rev=1296015&r1=1296014&r2=1296015&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_en_US.properties
(original)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_en_US.properties
Fri Mar  2 01:18:57 2012
@@ -19,6 +19,8 @@ CmisAuthorityConnector.UserMapping=User 
 CmisAuthorityConnector.TheEndpointMustBeNotNull=The endpoint must be not null
 CmisAuthorityConnector.Parameters=Parameters:
 
+CmisRepositoryConnector.Server=Server
+
 CmisRepositoryConnector.BindingColon=Binding:
 CmisRepositoryConnector.UsernameColon=Username:
 CmisRepositoryConnector.PasswordColon=Password:
@@ -29,6 +31,15 @@ CmisRepositoryConnector.PortColon=Path:
 CmisRepositoryConnector.RepositoryIDColon=Repository ID:
 CmisRepositoryConnector.Optional=(optional)
 
+CmisRepositoryConnector.TheUsernameMustNotBeNull=The username must not be null
+CmisRepositoryConnector.ThePasswordMustNotBeNull=The password must not be null
+CmisRepositoryConnector.TheBindingMustNotBeNull=The binding must not be null
+CmisRepositoryConnector.ServerNameMustNotBeNull=Server name must be not null
+CmisRepositoryConnector.ServerNameCantContainSlash=Server name can't contain the character
'/'
+CmisRepositoryConnector.ThePortMustNotBeNull=The port must be not null
+CmisRepositoryConnector.TheServerPortMustBeValidInteger=The server port must be a valid integer
+CmisRepositoryConnector.PathMustNotBeNull=Path must be not null
+
 CmisRepositoryConnector.CMISQuery=CMIS Query
 
 CmisAuthorityConnector.Repository=Repository

Modified: incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_ja_JP.properties?rev=1296015&r1=1296014&r2=1296015&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_ja_JP.properties
(original)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/cmis/common_ja_JP.properties
Fri Mar  2 01:18:57 2012
@@ -19,6 +19,8 @@ CmisAuthorityConnector.UserMapping=�
 CmisAuthorityConnector.TheEndpointMustBeNotNull=エンドポイントがnullです
 CmisAuthorityConnector.Parameters=引数:
 
+CmisRepositoryConnector.Server=サーバ
+
 CmisRepositoryConnector.BindingColon=バイディング:
 CmisRepositoryConnector.UsernameColon=ユーザ名:
 CmisRepositoryConnector.PasswordColon=パスワード:
@@ -29,6 +31,15 @@ CmisRepositoryConnector.PortColon=パ
 CmisRepositoryConnector.RepositoryIDColon=リポジトリID:
 CmisRepositoryConnector.Optional=(任意)
 
+CmisRepositoryConnector.TheUsernameMustNotBeNull=ユーザ名を入力してください
+CmisRepositoryConnector.ThePasswordMustNotBeNull=パスワードを入力してください
+CmisRepositoryConnector.TheBindingMustNotBeNull=バイディングを入力してください
+CmisRepositoryConnector.ServerNameMustNotBeNull=サーバ名を入力してください
+CmisRepositoryConnector.ServerNameCantContainSlash=サーバ名には文字「/」を含めないでください
+CmisRepositoryConnector.ThePortMustNotBeNull=ポート番号を入力してください
+CmisRepositoryConnector.TheServerPortMustBeValidInteger=サーバポートには整数を入力してください
+CmisRepositoryConnector.PathMustNotBeNull=パスを入力してください
+
 CmisRepositoryConnector.CMISQuery=CMISクエリー
 
 CmisAuthorityConnector.Repository=リポジトリ

Copied: incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js
(from r1295923, incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration_en_US.js)
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js?p2=incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js&p1=incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration_en_US.js&r1=1295923&r2=1296015&rev=1296015&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration_en_US.js
(original)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js
Fri Mar  2 01:18:57 2012
@@ -26,53 +26,53 @@ function checkConfigForSave()
 {
   if (editconnection.username.value == "")
   {
-    alert("The username must be not null");
-    SelectTab("Server");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.TheUsernameMustNotBeNull'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.Server'))");
     editconnection.username.focus();
     return false;
   }
   if (editconnection.password.value == "")
   {
-    alert("The password must be not null");
-    SelectTab("Server");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.ThePasswordMustNotBeNull'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.Server'))");
     editconnection.password.focus();
     return false;
   }
   if (editconnection.binding.value == "")
   {
-    alert("The binding must be not null");
-    SelectTab("Server");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.TheBindingMustNotBeNull'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.Server'))");
     editconnection.binding.focus();
     return false;
   }
   if (editconnection.server.value ==""){
-    alert("Server name must be not null");
-    SelectTab("Server");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.ServerNameMustNotBeNull'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.Server'))");
     editconnection.server.focus();
     return false;
   }
   if(!editconnection.server.value.indexOf('/')==-1) {
-    alert("Server name can't contain the character '/'");
-    SelectTab("Server");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.ServerNameCantContainSlash'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.Server'))");
     editconnection.server.focus();
     return false;
   }
   if (editconnection.port.value == "")
   {
-    alert("The port must be not null");
-    SelectTab("Server");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.ThePortMustNotBeNull'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.Server'))");
     editconnection.port.focus();
     return false;
   }
   if (!isInteger(editconnection.port.value)){
-    alert("The server port must be a valid integer");
-    SelectTab("Server");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.TheServerPortMustBeValidInteger'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.Server'))");
     editconnection.port.focus();
     return false;
   }
   if(editconnection.path.value == ""){
-    alert("Path must be not null");
-    SelectTab("Server");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.PathMustNotBeNull'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('CmisRepositoryConnector.Server'))");
     editconnection.path.focus();
     return false;
   }



Mime
View raw message