From 13fa3e0d8a95ed1725f95a48df4feef2ce095fc3 Mon Sep 17 00:00:00 2001 From: Suraj Khurana Date: Fri, 14 Sep 2018 13:45:26 +0000 Subject: [PATCH] Improved: Arranged passport UI labels in alphabetic order. (OFBIZ-7285) git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/trunk@1840926 13f79535-47bb-0310-9956-ffa450edef68 --- passport/config/PassportUiLabels.xml | 128 +++++++++--------- .../ofbiz/passport/event/GitHubEvents.java | 12 +- .../ofbiz/passport/event/LinkedInEvents.java | 14 +- 3 files changed, 76 insertions(+), 78 deletions(-) diff --git a/passport/config/PassportUiLabels.xml b/passport/config/PassportUiLabels.xml index 05f2602b7..1e0eb6828 100644 --- a/passport/config/PassportUiLabels.xml +++ b/passport/config/PassportUiLabels.xml @@ -18,7 +18,69 @@ specific language governing permissions and limitations under the License. --> - + + + + Failed to match the state parameter in GitHub response. Just try to login again. + GitHub响应中的state参数不一致。重试登录即可。 + + + Failed to get GitHub authorization code. + 获取GitHub授权码时出错。 + + + Failed to get GitHub access token: ${error} + 获取GitHub访问令牌时出错:${error} + + + Failed to get GitHub configuration. Please check whether OAuth2GitHub entity has your productStoreId configured. + 获取GitHub配置时出错。请检查OAuth2GitHub实体中是否配置了你的店铺标识(productStoreId)。 + + + Failed to get OAuth2GitHub entity: ${errorMessage} + 获取OAuth2GitHub实体时出错:${errorMessage} + + + Error while redirecting to GitHub authorization URL: ${errorMessage} + 转到GitHub认证网址时出错:${errorMessage}。 + + + Error while redirecting to GitHub authorization URL. Please use other login method for now. + 转到GitHub认证网址时出错。请先使用其它登录方式。 + + + + Failed to get LinkedIn authorization code.<br>Error: ${error}<br>Error description: ${error_description} + 获取领英授权码时出错。<br>错误: ${error}<br>错误描述: ${error_description} + + + Failed to match the state parameter in LinkedIn response. Just try to login again. + 领英响应中的state参数不一致。重试登录即可。 + + + Failed to get LinkedIn authorization code. + 获取领英授权码时出错。 + + + Failed to get LinkedIn access token. + 获取领英访问令牌时出错。 + + + Failed to get LinkedIn configuration. Please check whether OAuth2LinkedIn entity has your productStoreId configured. + 获取领英配置时出错。请检查OAuth2LinkedIn实体中是否配置了你的店铺标识(productStoreId)。 + + + Failed to get OAuth2LinkedIn entity: ${errorMessage} + 获取OAuth2LinkedIn实体时出错:${errorMessage} + + + Error while redirecting to LinkedIn authorization URL: ${errorMessage} + 转到领英认证网址时出错:${errorMessage}。 + + + Error while redirecting to LinkedIn authorization URL. Please use other login method for now. + 转到领英认证网址时出错。请先使用其它登录方式。 + Passport Third Party Auth Application 第三方认证应用程序 @@ -27,68 +89,4 @@ under the License. Third Party Login 第三方登录 - - - - Failed to match the state parameter in LinkedIn response. Just try to login again. - 领英响应中的state参数不一致。重试登录即可。 - - - Error while redirecting to LinkedIn authorization URL. Please use other login method for now. - 转到领英认证网址时出错。请先使用其它登录方式。 - - - Error while redirecting to LinkedIn authorization URL: ${errorMessage} - 转到领英认证网址时出错:${errorMessage}。 - - - Failed to get LinkedIn authorization code.<br>Error: ${error}<br>Error description: ${error_description} - 获取领英授权码时出错。<br>错误: ${error}<br>错误描述: ${error_description} - - - Failed to get LinkedIn authorization code. - 获取领英授权码时出错。 - - - Failed to get LinkedIn configuration. Please check whether OAuth2LinkedIn entity has your productStoreId configured. - 获取领英配置时出错。请检查OAuth2LinkedIn实体中是否配置了你的店铺标识(productStoreId)。 - - - Failed to get LinkedIn access token. - 获取领英访问令牌时出错。 - - - Failed to get OAuth2LinkedIn entity: ${errorMessage} - 获取OAuth2LinkedIn实体时出错:${errorMessage} - - - - - Error while redirecting to GitHub authorization URL. Please use other login method for now. - 转到GitHub认证网址时出错。请先使用其它登录方式。 - - - Error while redirecting to GitHub authorization URL: ${errorMessage} - 转到GitHub认证网址时出错:${errorMessage}。 - - - Failed to match the state parameter in GitHub response. Just try to login again. - GitHub响应中的state参数不一致。重试登录即可。 - - - Failed to get GitHub authorization code. - 获取GitHub授权码时出错。 - - - Failed to get GitHub configuration. Please check whether OAuth2GitHub entity has your productStoreId configured. - 获取GitHub配置时出错。请检查OAuth2GitHub实体中是否配置了你的店铺标识(productStoreId)。 - - - Failed to get GitHub access token: ${error} - 获取GitHub访问令牌时出错:${error} - - - Failed to get OAuth2GitHub entity: ${errorMessage} - 获取OAuth2GitHub实体时出错:${errorMessage} - diff --git a/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java b/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java index 03a718462..59ec6f543 100644 --- a/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java +++ b/passport/src/main/java/org/apache/ofbiz/passport/event/GitHubEvents.java @@ -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 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 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; diff --git a/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java b/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java index 1ce2ebe7a..406c47864 100644 --- a/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java +++ b/passport/src/main/java/org/apache/ofbiz/passport/event/LinkedInEvents.java @@ -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 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 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;