Search in sources :

Example 1 with UMUserPasswordResetOptionsModel

use of com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel in project OpenAM by OpenRock.

the class UMUserPasswordResetOptionsViewBean method getQuestions.

private void getQuestions() {
    UMUserPasswordResetOptionsModel model = (UMUserPasswordResetOptionsModel) getModel();
    String userId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
    try {
        List questionAnswers = model.getUserAnswers(userId);
        populateTableModel(questionAnswers);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) UMUserPasswordResetOptionsModel(com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel)

Example 2 with UMUserPasswordResetOptionsModel

use of com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel in project OpenAM by OpenRock.

the class UMUserPasswordResetOptionsViewBean method handleButton1Request.

/**
     * Handles save password options request.
     *
     * @param event Request invocation event.
     * @throws ModelControlException if action table model state cannot be 
     *               restored.
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    List optionData = restoreOptionsData();
    CCCheckBox cbForceResetPwd = (CCCheckBox) getChild(CB_FORCE_RESET_PWD);
    boolean forceResetPwd = cbForceResetPwd.isChecked();
    UMUserPasswordResetOptionsModel model = (UMUserPasswordResetOptionsModel) getModel();
    String userId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
    try {
        model.modifyUserOption(optionData, userId, forceResetPwd);
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", model.getLocalizedString("profile.updated"));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    forwardTo();
}
Also used : CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) List(java.util.List) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) UMUserPasswordResetOptionsModel(com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel)

Example 3 with UMUserPasswordResetOptionsModel

use of com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel in project OpenAM by OpenRock.

the class UMUserPasswordResetOptionsViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (!tblModelPopulated) {
        getQuestions();
        CCCheckBox cbForceResetPwd = (CCCheckBox) getChild(CB_FORCE_RESET_PWD);
        UMUserPasswordResetOptionsModel model = (UMUserPasswordResetOptionsModel) getModel();
        String userId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
        cbForceResetPwd.setChecked(model.isForceReset(userId));
    }
}
Also used : CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) UMUserPasswordResetOptionsModel(com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel)

Example 4 with UMUserPasswordResetOptionsModel

use of com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel in project OpenAM by OpenRock.

the class UMUserPasswordResetOptionsViewBean method beginQuestionsDisplay.

public boolean beginQuestionsDisplay(ChildDisplayEvent event) {
    boolean display = false;
    UMUserPasswordResetOptionsModel model = (UMUserPasswordResetOptionsModel) getModel();
    String userId = (String) getPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID);
    if (model.isLoggedInUser(userId)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
        List data = (List) szCache.getSerializedObj();
        display = (data != null) && !data.isEmpty();
    }
    return display;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) List(java.util.List) UMUserPasswordResetOptionsModel(com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel)

Aggregations

UMUserPasswordResetOptionsModel (com.sun.identity.console.user.model.UMUserPasswordResetOptionsModel)4 List (java.util.List)3 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)2 SerializedField (com.sun.identity.console.components.view.html.SerializedField)1