use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class RedirectToRealmHomeViewBean method redirectToHome.
protected void redirectToHome() {
if (XuiRedirectHelper.isXuiAdminConsoleEnabled()) {
RequestContext rc = RequestManager.getRequestContext();
try {
String realm = URLEncoder.encode(rc.getRequest().getParameter("realm"), "UTF-8");
rc.getResponse().sendRedirect("../XUI#realms/" + realm + "/dashboard");
} catch (UnsupportedEncodingException e) {
throw new IllegalStateException("UTF-8 not supported", e);
} catch (IOException e) {
debug.message("Unexpected IOException during redirect", e);
}
} else {
HomeViewBean vb = (HomeViewBean) getViewBean(HomeViewBean.class);
backTrail();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
}
use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class PWResetQuestionViewBean method handleBtnOKRequest.
/**
* Handles form submission request for next button. It will
* forward to <code>PWResetSuccessViewBean</code> if the answers
* are correct for the questions.
*
* @param event request invocation event
*/
public void handleBtnOKRequest(RequestInvocationEvent event) {
PWResetQuestionModel model = (PWResetQuestionModel) getModel();
String orgDN = (String) getPageSessionAttribute(ORG_DN);
String userDN = (String) getPageSessionAttribute(USER_DN);
RequestContext reqContext = event.getRequestContext();
ISLocaleContext localeContext = new ISLocaleContext();
localeContext.setLocale(reqContext.getRequest());
java.util.Locale localeObj = localeContext.getLocale();
String locale = localeObj.toString();
model.setUserLocale(locale);
PWResetQuestionTiledView tView = (PWResetQuestionTiledView) getChild(PASSWORD_RESET_TILEDVIEW);
Map map = tView.getAnswers();
if (tView.isAnswerBlank()) {
setErrorMessage(model.getErrorTitle(), model.getMissingAnswerMessage());
forwardTo();
} else {
try {
model.resetPassword(userDN, orgDN, map);
PWResetSuccessViewBean vb = (PWResetSuccessViewBean) getViewBean(PWResetSuccessViewBean.class);
vb.setResetMessage(model.getPasswordResetMessage());
vb.setPageSessionAttribute(URL_LOCALE, locale);
vb.forwardTo(getRequestContext());
} catch (PWResetException pwe) {
if (!model.isUserLockout(userDN, orgDN)) {
setErrorMessage(model.getErrorTitle(), pwe.getMessage());
}
forwardTo();
}
}
}
use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class PWResetUserValidationViewBean method handleBtnNextRequest.
/**
* Handles form submission request
*
* @param event request invocation event
*/
public void handleBtnNextRequest(RequestInvocationEvent event) {
PWResetUserValidationModel model = (PWResetUserValidationModel) getModel();
String userAttrValue = (String) getDisplayFieldValue(TF_USER_ATTR);
if (userAttrValue != null) {
userAttrValue = userAttrValue.trim();
}
HiddenField hf = (HiddenField) getChild(FLD_USER_ATTR);
String userAttrName = (String) hf.getValue();
String orgDN = (String) getPageSessionAttribute(ORG_DN);
String orgDNFlag = (String) getPageSessionAttribute(ORG_DN_FLAG);
RequestContext reqContext = event.getRequestContext();
ISLocaleContext localeContext = new ISLocaleContext();
localeContext.setLocale(reqContext.getRequest());
java.util.Locale localeObj = localeContext.getLocale();
String locale = localeObj.toString();
model.setUserLocale(locale);
if (orgDNFlag != null && orgDNFlag.equals(STRING_TRUE)) {
model.setRealmFlag(true);
}
if (userAttrValue == null || userAttrValue.length() == 0) {
setErrorMessage(model.getErrorTitle(), model.getMissingUserAttrMessage(userAttrName));
forwardTo();
} else {
if (model.isUserAttrValueValid(orgDN, userAttrValue) && model.isUserExists(userAttrValue, userAttrName, orgDN) && model.isUserActive(model.getUserRealm())) {
forwardToPWResetQuestionVB(orgDN, userAttrValue, orgDNFlag, locale);
} else {
setErrorMessage(model.getErrorTitle(), model.getErrorMessage());
forwardTo();
}
}
}
use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class AMAdminFrameViewBean method beginDisplay.
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
AMViewConfig config = AMViewConfig.getInstance();
RequestContext rc = getRequestContext();
String startDN = AMModelBase.getStartDN(rc.getRequest());
String url = config.getDefaultViewBeanURL(startDN, rc.getRequest());
if ((url != null) && (url.length() > 0)) {
setDisplayFieldValue(VIEWBEAN_URL, url);
} else {
/*
* We couldn't retrieve the default view to display.
* This may be due to permission problems, or a configuration
* issue. If the users profile is set to ignore, display
* the "Authenticated View".
*/
AMModel model = getModel();
if (model.ignoreUserProfile()) {
AuthenticatedViewBean vb = (AuthenticatedViewBean) getViewBean(AuthenticatedViewBean.class);
passPgSessionMap(vb);
vb.forwardTo(rc);
}
//set the non admin end user view
setDisplayFieldValue(VIEWBEAN_URL, "../idm/EndUser");
}
}
use of com.iplanet.jato.RequestContext in project OpenAM by OpenRock.
the class EditAuthTypeViewBean method getAuthModel.
private AuthPropertiesModel getAuthModel() {
if (authModel == null) {
RequestContext rc = RequestManager.getRequestContext();
authModel = new AuthPropertiesModelImpl(rc.getRequest(), getPageSessionAttributes());
}
return authModel;
}
Aggregations