Skip to content

Commit

Permalink
Move texts from java into oxtrust_en.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
shekhar16 committed May 20, 2018
1 parent 21af32f commit b1496d5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
Expand Up @@ -85,7 +85,7 @@ public String start() {
} catch (BaseMappingException ex) {
log.error("Failed to load attributes", ex);

facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to load attributes");
facesMessages.add(FacesMessage.SEVERITY_ERROR, "#{msg['AttributeInventoryAction.loadfail']}");
conversationService.endConversation();

return OxTrustConstants.RESULT_FAILURE;
Expand Down
10 changes: 5 additions & 5 deletions server/src/main/java/org/gluu/oxtrust/action/Authenticator.java
Expand Up @@ -348,7 +348,7 @@ public String oAuthGetAccessToken() throws JSONException {
String oxAuthHost = getOxAuthHost(oxAuthAuthorizeUrl);
if (StringHelper.isEmpty(oxAuthHost)) {
log.info("Failed to determine oxAuth host using oxAuthAuthorizeUrl: '{}'", oxAuthAuthorizeUrl);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Login failed, oxTrust wasn't allow to access user data");
facesMessages.add(FacesMessage.SEVERITY_ERROR, "#{msg['Authenticator.loginFailedNoPermission']}");
return OxTrustConstants.RESULT_NO_PERMISSIONS;
}

Expand All @@ -366,7 +366,7 @@ public String oAuthGetAccessToken() throws JSONException {
String error = requestParameterMap.get(OxTrustConstants.OXAUTH_ERROR);
String errorDescription = requestParameterMap.get(OxTrustConstants.OXAUTH_ERROR_DESCRIPTION);
log.error("No state sent. Error: " + error + ". Error description: " + errorDescription);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Login failed, oxTrust wasn't allow to access user data");
facesMessages.add(FacesMessage.SEVERITY_ERROR, "#{msg['Authenticator.loginFailedNoPermission']}");

return OxTrustConstants.RESULT_NO_PERMISSIONS;
}
Expand All @@ -382,7 +382,7 @@ public String oAuthGetAccessToken() throws JSONException {
String errorDescription = requestParameterMap.get(OxTrustConstants.OXAUTH_ERROR_DESCRIPTION);

log.error("No authorization code sent. Error: " + error + ". Error description: " + errorDescription);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Login failed, oxTrust wasn't allow to access user data");
facesMessages.add(FacesMessage.SEVERITY_ERROR, "#{msg['Authenticator.loginFailedNoPermission']}");

return OxTrustConstants.RESULT_NO_PERMISSIONS;
}
Expand Down Expand Up @@ -416,9 +416,9 @@ public String oAuthGetAccessToken() throws JSONException {
clientPassword);

if (OxTrustConstants.RESULT_NO_PERMISSIONS.equals(result)) {
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Login failed, oxTrust wasn't allow to access user data");
facesMessages.add(FacesMessage.SEVERITY_ERROR, "#{msg['Authenticator.loginFailedNoPermission']}");
} else if (OxTrustConstants.RESULT_FAILURE.equals(result)) {
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Login failed");
facesMessages.add(FacesMessage.SEVERITY_ERROR, "#{msg['Authenticator.loginFailed']}");
}

return result;
Expand Down
Expand Up @@ -7,6 +7,7 @@
package org.gluu.oxtrust.action;

import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
Expand Down Expand Up @@ -183,9 +184,9 @@ public String update() {
String outcome = updateImpl();

if (OxTrustConstants.RESULT_SUCCESS.equals(outcome)) {
facesMessages.add(FacesMessage.SEVERITY_INFO, "Cache configuration updated");
facesMessages.add(FacesMessage.SEVERITY_INFO, "#{msg['ConfigureCacheRefreshAction.configUpdate']}");
} else if (OxTrustConstants.RESULT_FAILURE.equals(outcome)) {
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to update cache refresh configuration");
facesMessages.add(FacesMessage.SEVERITY_ERROR, "#{msg['ConfigureCacheRefreshAction.configUpdateFailed']}");
}

return outcome;
Expand Down Expand Up @@ -251,7 +252,7 @@ private boolean vdsCacheRefreshPollingInterval() {

if ((interval == null) || (interval < 0)) {
log.error("Invalid cache refresh pooling interval specified: {}", intervalString);
facesMessages.add("vdsCacheRefreshPollingIntervalId", FacesMessage.SEVERITY_ERROR, "Invalid cache refresh pooling interval specified");
facesMessages.add("vdsCacheRefreshPollingIntervalId", FacesMessage.SEVERITY_ERROR, "#{msg['ConfigureCacheRefreshAction.invalidPoolingInterval']}");
return false;
}

Expand Down
15 changes: 14 additions & 1 deletion server/src/main/resources/oxtrust.properties
Expand Up @@ -347,6 +347,7 @@ configuration.trustStoreCertificates = TrustStore Certificates
configuration.withObsoleteWarningOnly = With 'obsolete' warning only

group.users = Users

group.manageGroups = Manage Groups
group.addGroup = Add Group
group.search = Search
Expand Down Expand Up @@ -876,4 +877,16 @@ layout.logout = Logout

testOperationForm.userName = User Name
testOperationForm.password = Password
testOperationForm.baseURL = Base URL
testOperationForm.baseURL = Base URL


AttributeInventoryAction.loadfail = Failed to load attributes

Authenticator.loginFailedNoPermission = Login failed, oxTrust wasn't allow to access user data.
Authenticator.loginFailed = Login Failed.
ConfigureCacheRefreshAction.configUpdate = Cache configuration updated.
ConfigureCacheRefreshAction.configUpdateFailed = Failed to update cache refresh configuration.
ConfigureCacheRefreshAction.invalidPoolingInterval = Invalid cache refresh pooling interval specified.
ConfigureCacheRefreshAction.missingServerDetail = %s LDAP configuration '%s' should contains at least one server.
ConfigureCacheRefreshAction.missingBaseDN = %s LDAP configuration '%s' should contains at least one Base DN.

0 comments on commit b1496d5

Please sign in to comment.