svn commit: r1840926 - in /ofbiz/ofbiz-plugins/trunk/passport: config/PassportUiLabels.xml src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1840926 - in /ofbiz/ofbiz-plugins/trunk/passport: config/PassportUiLabels.xml src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java

surajk
Author: surajk
Date: Fri Sep 14 13:45:26 2018
New Revision: 1840926

URL: http://svn.apache.org/viewvc?rev=1840926&view=rev
Log:
Improved: Arranged passport UI labels in alphabetic order.
(OFBIZ-7285)

Modified:
    ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml
    ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java
    ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java

Modified: ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml?rev=1840926&r1=1840925&r2=1840926&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml (original)
+++ ofbiz/ofbiz-plugins/trunk/passport/config/PassportUiLabels.xml Fri Sep 14 13:45:26 2018
@@ -18,77 +18,75 @@ specific language governing permissions
 under the License.
 -->
 
-<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <property key="PassportApplication">
-        <value xml:lang="en">Passport Third Party Auth Application</value>
-        <value xml:lang="zh">第三方认证应用程序</value>
+<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-properties.xsd">
+    <!-- GitHub labels -->
+    <property key="GitHubFailedToMatchState">
+        <value xml:lang="en">Failed to match the state parameter in GitHub response. Just try to login again.</value>
+        <value xml:lang="zh">GitHub响应中的state参数不一致。重试登录即可。</value>
     </property>
-    <property key="ThirdPartyLogin">
-        <value xml:lang="en">Third Party Login</value>
-        <value xml:lang="zh">第三方登录</value>
+    <property key="GitHubGetAuthorizationCodeError">
+        <value xml:lang="en">Failed to get GitHub authorization code.</value>
+        <value xml:lang="zh">获取GitHub授权码时出错。</value>
     </property>
-
-    <!-- LinkedIn labels -->
-    <property key="LinkedInFailedToMatchState">
-        <value xml:lang="en">Failed to match the state parameter in LinkedIn response. Just try to login again.</value>
-        <value xml:lang="zh">领英响应中的state参数不一致。重试登录即可。</value>
+    <property key="GitHubGetOAuth2AccessTokenError">
+        <value xml:lang="en">Failed to get GitHub access token: ${error}</value>
+        <value xml:lang="zh">获取GitHub访问令牌时出错:${error}</value>
     </property>
-    <property key="RedirectToLinkedInOAuth2NullException">
-        <value xml:lang="en">Error while redirecting to LinkedIn authorization URL. Please use other login method for now.</value>
-        <value xml:lang="zh">转到领英认证网址时出错。请先使用其它登录方式。</value>
+    <property key="GitHubGetOAuth2ConfigError">
+        <value xml:lang="en">Failed to get GitHub configuration. Please check whether OAuth2GitHub entity has your productStoreId configured.</value>
+        <value xml:lang="zh">获取GitHub配置时出错。请检查OAuth2GitHub实体中是否配置了你的店铺标识(productStoreId)。</value>
     </property>
-    <property key="RedirectToLinkedInOAuth2Error">
-        <value xml:lang="en">Error while redirecting to LinkedIn authorization URL: ${errorMessage}</value>
-        <value xml:lang="zh">转到领英认证网址时出错:${errorMessage}。</value>
+    <property key="GitHubGetOAuth2Error">
+        <value xml:lang="en">Failed to get OAuth2GitHub entity: ${errorMessage}</value>
+        <value xml:lang="zh">获取OAuth2GitHub实体时出错:${errorMessage}</value>
+    </property>
+    <property key="GitHubRedirectToOAuth2Error">
+        <value xml:lang="en">Error while redirecting to GitHub authorization URL: ${errorMessage}</value>
+        <value xml:lang="zh">转到GitHub认证网址时出错:${errorMessage}。</value>
+    </property>
+    <property key="GitHubRedirectToOAuth2NullException">
+        <value xml:lang="en">Error while redirecting to GitHub authorization URL. Please use other login method for now.</value>
+        <value xml:lang="zh">转到GitHub认证网址时出错。请先使用其它登录方式。</value>
     </property>
-    <property key="FailedToGetLinkedInAuthorizationCode">
+    <!-- LinkedIn labels -->
+    <property key="LinkedInFailedToGetAuthorizationCode">
         <value xml:lang="en">Failed to get LinkedIn authorization code.&lt;br&gt;Error: ${error}&lt;br&gt;Error description: ${error_description}</value>
         <value xml:lang="zh">获取领英授权码时出错。&lt;br&gt;错误: ${error}&lt;br&gt;错误描述: ${error_description}</value>
     </property>
-    <property key="GetLinkedInAuthorizationCodeError">
+    <property key="LinkedInFailedToMatchState">
+        <value xml:lang="en">Failed to match the state parameter in LinkedIn response. Just try to login again.</value>
+        <value xml:lang="zh">领英响应中的state参数不一致。重试登录即可。</value>
+    </property>
+    <property key="LinkedInGetAuthorizationCodeError">
         <value xml:lang="en">Failed to get LinkedIn authorization code.</value>
         <value xml:lang="zh">获取领英授权码时出错。</value>
     </property>
-    <property key="GetOAuth2LinkedInConfigError">
-        <value xml:lang="en">Failed to get LinkedIn configuration. Please check whether OAuth2LinkedIn entity has your productStoreId configured.</value>
-        <value xml:lang="zh">获取领英配置时出错。请检查OAuth2LinkedIn实体中是否配置了你的店铺标识(productStoreId)。</value>
-    </property>
-    <property key="GetOAuth2LinkedInAccessTokenError">
+    <property key="LinkedInGetOAuth2AccessTokenError">
         <value xml:lang="en">Failed to get LinkedIn access token.</value>
         <value xml:lang="zh">获取领英访问令牌时出错。</value>
     </property>
-    <property key="GetOAuth2LinkedInError">
+    <property key="LinkedInGetOAuth2ConfigError">
+        <value xml:lang="en">Failed to get LinkedIn configuration. Please check whether OAuth2LinkedIn entity has your productStoreId configured.</value>
+        <value xml:lang="zh">获取领英配置时出错。请检查OAuth2LinkedIn实体中是否配置了你的店铺标识(productStoreId)。</value>
+    </property>
+    <property key="LinkedInGetOAuth2Error">
         <value xml:lang="en">Failed to get OAuth2LinkedIn entity: ${errorMessage}</value>
         <value xml:lang="zh">获取OAuth2LinkedIn实体时出错:${errorMessage}</value>
     </property>
-    
-    <!-- GitHub labels -->
-    <property key="RedirectToGitHubOAuth2NullException">
-        <value xml:lang="en">Error while redirecting to GitHub authorization URL. Please use other login method for now.</value>
-        <value xml:lang="zh">转到GitHub认证网址时出错。请先使用其它登录方式。</value>
-    </property>
-    <property key="RedirectToGitHubOAuth2Error">
-        <value xml:lang="en">Error while redirecting to GitHub authorization URL: ${errorMessage}</value>
-        <value xml:lang="zh">转到GitHub认证网址时出错:${errorMessage}。</value>
-    </property>
-    <property key="GitHubFailedToMatchState">
-        <value xml:lang="en">Failed to match the state parameter in GitHub response. Just try to login again.</value>
-        <value xml:lang="zh">GitHub响应中的state参数不一致。重试登录即可。</value>
-    </property>
-    <property key="GetGitHubAuthorizationCodeError">
-        <value xml:lang="en">Failed to get GitHub authorization code.</value>
-        <value xml:lang="zh">获取GitHub授权码时出错。</value>
+    <property key="LinkedInRedirectToOAuth2Error">
+        <value xml:lang="en">Error while redirecting to LinkedIn authorization URL: ${errorMessage}</value>
+        <value xml:lang="zh">转到领英认证网址时出错:${errorMessage}。</value>
     </property>
-    <property key="GetOAuth2GitHubConfigError">
-        <value xml:lang="en">Failed to get GitHub configuration. Please check whether OAuth2GitHub entity has your productStoreId configured.</value>
-        <value xml:lang="zh">获取GitHub配置时出错。请检查OAuth2GitHub实体中是否配置了你的店铺标识(productStoreId)。</value>
+    <property key="LinkedInRedirectToOAuth2NullException">
+        <value xml:lang="en">Error while redirecting to LinkedIn authorization URL. Please use other login method for now.</value>
+        <value xml:lang="zh">转到领英认证网址时出错。请先使用其它登录方式。</value>
     </property>
-    <property key="GetOAuth2GitHubAccessTokenError">
-        <value xml:lang="en">Failed to get GitHub access token: ${error}</value>
-        <value xml:lang="zh">获取GitHub访问令牌时出错:${error}</value>
+    <property key="PassportApplication">
+        <value xml:lang="en">Passport Third Party Auth Application</value>
+        <value xml:lang="zh">第三方认证应用程序</value>
     </property>
-    <property key="GetOAuth2GitHubError">
-        <value xml:lang="en">Failed to get OAuth2GitHub entity: ${errorMessage}</value>
-        <value xml:lang="zh">获取OAuth2GitHub实体时出错:${errorMessage}</value>
+    <property key="ThirdPartyLogin">
+        <value xml:lang="en">Third Party Login</value>
+        <value xml:lang="zh">第三方登录</value>
     </property>
 </resource>

Modified: ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java?rev=1840926&r1=1840925&r2=1840926&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java (original)
+++ ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java Fri Sep 14 13:45:26 2018
@@ -114,12 +114,12 @@ public class GitHubEvents {
             Debug.logInfo("Request to GitHub: " + redirectUrl, module);
             response.sendRedirect(redirectUrl);
         } catch (NullPointerException e) {
-            String errMsg = UtilProperties.getMessage(resource, "RedirectToGitHubOAuth2NullException", UtilHttp.getLocale(request));
+            String errMsg = UtilProperties.getMessage(resource, "GitHubRedirectToOAuth2NullException", UtilHttp.getLocale(request));
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
             return "error";
         } catch (IOException e) {
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString());
-            String errMsg = UtilProperties.getMessage(resource, "RedirectToGitHubOAuth2Error", messageMap, UtilHttp.getLocale(request));
+            String errMsg = UtilProperties.getMessage(resource, "GitHubRedirectToOAuth2Error", messageMap, UtilHttp.getLocale(request));
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
             return "error";
         }
@@ -147,7 +147,7 @@ public class GitHubEvents {
             try {
                 errMsg = UtilProperties.getMessage(resource, "FailedToGetGitHubAuthorizationCode", UtilMisc.toMap(PassportUtil.COMMON_ERROR, error, PassportUtil.COMMON_ERROR_DESCRIPTION, URLDecoder.decode(errorDescpriton, "UTF-8")), UtilHttp.getLocale(request));
             } catch (UnsupportedEncodingException e) {
-                errMsg = UtilProperties.getMessage(resource, "GetGitHubAuthorizationCodeError", UtilHttp.getLocale(request));
+                errMsg = UtilProperties.getMessage(resource, "GitHubGetAuthorizationCodeError", UtilHttp.getLocale(request));
             }
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
             return "error";
@@ -156,7 +156,7 @@ public class GitHubEvents {
         
         GenericValue oauth2GitHub = getOAuth2GitHubConfig(request);
         if (UtilValidate.isEmpty(oauth2GitHub)) {
-            String errMsg = UtilProperties.getMessage(resource, "GetOAuth2GitHubConfigError", UtilHttp.getLocale(request));
+            String errMsg = UtilProperties.getMessage(resource, "GitHubGetOAuth2ConfigError", UtilHttp.getLocale(request));
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
             return "error";
         }
@@ -198,7 +198,7 @@ public class GitHubEvents {
                 // Debug.logInfo("Generated Access Token : " + accessToken, module);
                 // Debug.logInfo("Token Type: " + tokenType, module);
             } else {
-                String errMsg = UtilProperties.getMessage(resource, "GetOAuth2GitHubAccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request));
+                String errMsg = UtilProperties.getMessage(resource, "GitHubGetOAuth2AccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request));
                 request.setAttribute("_ERROR_MESSAGE_", errMsg);
                 return "error";
             }
@@ -310,7 +310,7 @@ public class GitHubEvents {
             return getOAuth2GitHubConfig(delegator, productStoreId);
         } catch (GenericEntityException e) {
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString());
-            String errMsg = UtilProperties.getMessage(resource, "GetOAuth2GitHubError", messageMap, UtilHttp.getLocale(request));
+            String errMsg = UtilProperties.getMessage(resource, "GitHubGetOAuth2Error", messageMap, UtilHttp.getLocale(request));
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
         }
         return null;

Modified: ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java?rev=1840926&r1=1840925&r2=1840926&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java (original)
+++ ofbiz/ofbiz-plugins/trunk/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java Fri Sep 14 13:45:26 2018
@@ -115,12 +115,12 @@ public class LinkedInEvents {
                     + "&state=" + state;
             response.sendRedirect(redirectUrl);
         } catch (NullPointerException e) {
-            String errMsg = UtilProperties.getMessage(resource, "RedirectToLinkedInOAuth2NullException", UtilHttp.getLocale(request));
+            String errMsg = UtilProperties.getMessage(resource, "LinkedInRedirectToOAuth2NullException", UtilHttp.getLocale(request));
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
             return "error";
         } catch (IOException e) {
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString());
-            String errMsg = UtilProperties.getMessage(resource, "RedirectToLinkedInOAuth2Error", messageMap, UtilHttp.getLocale(request));
+            String errMsg = UtilProperties.getMessage(resource, "LinkedInRedirectToOAuth2Error", messageMap, UtilHttp.getLocale(request));
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
             return "error";
         }
@@ -146,9 +146,9 @@ public class LinkedInEvents {
             String errorDescpriton = request.getParameter(PassportUtil.COMMON_ERROR_DESCRIPTION);
             String errMsg = null;
             try {
-                errMsg = UtilProperties.getMessage(resource, "FailedToGetLinkedInAuthorizationCode", UtilMisc.toMap(PassportUtil.COMMON_ERROR, error, PassportUtil.COMMON_ERROR_DESCRIPTION, URLDecoder.decode(errorDescpriton, "UTF-8")), UtilHttp.getLocale(request));
+                errMsg = UtilProperties.getMessage(resource, "LinkedInFailedToGetAuthorizationCode", UtilMisc.toMap(PassportUtil.COMMON_ERROR, error, PassportUtil.COMMON_ERROR_DESCRIPTION, URLDecoder.decode(errorDescpriton, "UTF-8")), UtilHttp.getLocale(request));
             } catch (UnsupportedEncodingException e) {
-                errMsg = UtilProperties.getMessage(resource, "GetLinkedInAuthorizationCodeError", UtilHttp.getLocale(request));
+                errMsg = UtilProperties.getMessage(resource, "LinkedInGetAuthorizationCodeError", UtilHttp.getLocale(request));
             }
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
             return "error";
@@ -157,7 +157,7 @@ public class LinkedInEvents {
         
         GenericValue oauth2LinkedIn = getOAuth2LinkedInConfig(request);
         if (UtilValidate.isEmpty(oauth2LinkedIn)) {
-            String errMsg = UtilProperties.getMessage(resource, "GetOAuth2LinkedInConfigError", UtilHttp.getLocale(request));
+            String errMsg = UtilProperties.getMessage(resource, "LinkedInGetOAuth2ConfigError", UtilHttp.getLocale(request));
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
             return "error";
         }
@@ -196,7 +196,7 @@ public class LinkedInEvents {
                 accessToken = (String) userMap.get("access_token");
                 // Debug.logInfo("Generated Access Token : " + accessToken, module);
             } else {
-                String errMsg = UtilProperties.getMessage(resource, "GetOAuth2LinkedInAccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request));
+                String errMsg = UtilProperties.getMessage(resource, "LinkedInGetOAuth2AccessTokenError", UtilMisc.toMap("error", responseString), UtilHttp.getLocale(request));
                 request.setAttribute("_ERROR_MESSAGE_", errMsg);
                 return "error";
             }
@@ -317,7 +317,7 @@ public class LinkedInEvents {
             return getOAuth2LinkedInConfig(delegator, productStoreId);
         } catch (GenericEntityException e) {
             Map<String, String> messageMap = UtilMisc.toMap("errorMessage", e.toString());
-            String errMsg = UtilProperties.getMessage(resource, "GetOAuth2LinkedInError", messageMap, UtilHttp.getLocale(request));
+            String errMsg = UtilProperties.getMessage(resource, "LinkedInGetOAuth2Error", messageMap, UtilHttp.getLocale(request));
             request.setAttribute("_ERROR_MESSAGE_", errMsg);
         }
         return null;