use of com.iplanet.jato.view.html.HiddenField in project OpenAM by OpenRock.
the class PWResetUserValidationViewBean method beginDisplay.
/**
* Set the required information to display the page.
*
* @param event display event.
* @throws ModelControlException if problem access value of component.
*/
public void beginDisplay(DisplayEvent event) throws ModelControlException {
super.beginDisplay(event);
PWResetUserValidationModel model = (PWResetUserValidationModel) getModel();
if (model.isValidRealm()) {
String orgDN = (String) getPageSessionAttribute(ORG_DN);
String userAttr = model.getUserAttr(orgDN);
HiddenField hf = (HiddenField) getChild(FLD_USER_ATTR);
hf.setValue(userAttr);
setDisplayFieldValue(USER_VALIDATION_TITLE, model.getUserValidateTitleString());
setDisplayFieldValue(LBL_USER_ATTR, model.getLocalizedStrForAttr(userAttr));
setDisplayFieldValue(NEXT_BUTTON, model.getNextBtnLabel());
String userAttrValue = (String) getPageSessionAttribute(USER_ATTR_VALUE);
if (userAttrValue != null && userAttrValue.length() > 0) {
setDisplayFieldValue(TF_USER_ATTR, userAttrValue);
removePageSessionAttribute(USER_ATTR_VALUE);
}
}
}
use of com.iplanet.jato.view.html.HiddenField 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.view.html.HiddenField in project OpenAM by OpenRock.
the class PWResetQuestionTiledView method nextTile.
/**
* Moves the current tile position to the next available tile.
*
* @return true if another tile was available, false if the position
* remained unchanged because no next tile was available.
*
* @throws ModelControlException if manipulation of model fails.
*/
public boolean nextTile() throws ModelControlException {
boolean movedToRow = super.nextTile();
PWResetQuestionModel model = getModel();
if (movedToRow) {
String question = (String) list.get(getTileIndex());
String localizedStr = model.getLocalizedStrForQuestion(question);
HiddenField hf = (HiddenField) getChild(FLD_ATTR_NAME);
hf.setValue(question);
setDisplayFieldValue(LBL_QUESTION, localizedStr);
}
return movedToRow;
}
use of com.iplanet.jato.view.html.HiddenField in project OpenAM by OpenRock.
the class PWResetQuestionTiledView method getAnswers.
/**
* Gets the answer to the secret question
*
* @return answer to the secret question
*/
public Map getAnswers() {
Map map = Collections.EMPTY_MAP;
PWResetQuestionModel model = getModel();
try {
DatasetModel dataModel = getPrimaryModel();
int size = dataModel.getSize();
if (size > 0) {
dataModel.first();
map = new HashMap(size);
}
for (int i = 0; i < size; i++) {
HiddenField hf = (HiddenField) getChild(FLD_ATTR_NAME);
String attrName = (String) hf.getValue();
String answer = (String) getDisplayFieldValue(TF_ANSWER);
if (answer != null) {
answer = answer.trim();
}
if (answer == null || answer.length() == 0) {
missingData = true;
}
map.put(attrName, answer);
dataModel.next();
}
} catch (ModelControlException mce) {
model.debugError("PWResetQuestionTiledView.getAnswers", mce);
}
return map;
}
Aggregations