Search in sources :

Example 6 with AuthPropertiesModel

use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.

the class EditAuthTypeViewBean method handleButton2Request.

/**
     * Handles reset request.
     * 
     * @param event Request invocation event.
     */
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
    String instance = (String) getPageSessionAttribute(SERVICE_TYPE);
    /*                                                               
         * The service name will be null if the entry was deleted by
         * another user while the properties were being viewed.
         */
    if (getServiceName(instance) == null) {
        debug.warning("EditAuthTypeViewBean.handleButton2Request() " + "The instance " + instance + " could not be found");
        AuthPropertiesModel model = getAuthModel();
        returnToAuthProperties(model.getLocalizedString("no.module.instance"));
    } else {
        super.handleButton2Request(event);
    }
}
Also used : AuthPropertiesModel(com.sun.identity.console.authentication.model.AuthPropertiesModel)

Example 7 with AuthPropertiesModel

use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.

the class EditAuthTypeViewBean method getValues.

protected Map getValues() throws ModelControlException, AMConsoleException {
    Map values = null;
    String instance = (String) getPageSessionAttribute(SERVICE_TYPE);
    AuthPropertiesModel model = getAuthModel();
    if (model != null) {
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        values = ps.getAttributeValues(model.getInstanceValues(instance), model);
    }
    return values;
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AuthPropertiesModel(com.sun.identity.console.authentication.model.AuthPropertiesModel) Map(java.util.Map)

Example 8 with AuthPropertiesModel

use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.

the class EditAuthTypeViewBean method handleButton1Request.

/**
     * Handles save request.
     *
     * @param event Request invocation event.
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    String instance = (String) getPageSessionAttribute(SERVICE_TYPE);
    AuthPropertiesModel model = getAuthModel();
    /*
         * The service name will be null if the entry was deleted by
         * another user while the properties were being viewed.
         */
    if (getServiceName(instance) == null) {
        returnToAuthProperties(model.getLocalizedString("no.module.instance"));
    } else {
        if (model != null) {
            try {
                Map values = getValues();
                model.setInstanceValues(instance, values);
                setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
            } catch (AMConsoleException e) {
                setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
            }
        }
        forwardTo();
    }
}
Also used : AuthPropertiesModel(com.sun.identity.console.authentication.model.AuthPropertiesModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map)

Example 9 with AuthPropertiesModel

use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.

the class AuthPropertiesViewBean method populateConfigMenu.

private void populateConfigMenu() {
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    if ((realm == null) || (realm.length() == 0)) {
        realm = AMModelBase.getStartDN(getRequestContext().getRequest());
    }
    AuthPropertiesModel model = (AuthPropertiesModel) getModel();
    OrderedSet configs = new OrderedSet();
    configs.addAll(AuthConfigurationModelImpl.getNamedConfigurations(model.getUserSSOToken(), realm));
    OptionList containers = new OptionList();
    for (Iterator i = configs.iterator(); i.hasNext(); ) {
        String entry = (String) i.next();
        containers.add(entry, entry);
    }
    CCDropDownMenu ac = (CCDropDownMenu) getChild(AUTH_CONFIG);
    ac.setOptions(containers);
    CCDropDownMenu aac = (CCDropDownMenu) getChild(ADMIN_AUTH_CONFIG);
    aac.setOptions(containers);
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Iterator(java.util.Iterator) AuthPropertiesModel(com.sun.identity.console.authentication.model.AuthPropertiesModel) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 10 with AuthPropertiesModel

use of com.sun.identity.console.authentication.model.AuthPropertiesModel in project OpenAM by OpenRock.

the class AuthPropertiesViewBean method handleButton1Request.

/**
     * Handles save button request.
     *
     * @param event Request invocation event
     */
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        AuthPropertiesModel model = (AuthPropertiesModel) getModel();
        Map original = model.getValues();
        AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
        model.setValues(ps.getAttributeValues(original, true, model));
        setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "authentication.profile.updated");
    } catch (AMConsoleException a) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", a.getMessage());
    }
    forwardTo();
}
Also used : AMPropertySheet(com.sun.identity.console.base.AMPropertySheet) AuthPropertiesModel(com.sun.identity.console.authentication.model.AuthPropertiesModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

AuthPropertiesModel (com.sun.identity.console.authentication.model.AuthPropertiesModel)14 Map (java.util.Map)6 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)4 Iterator (java.util.Iterator)4 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)3 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)3 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)3 HashSet (java.util.HashSet)3 Set (java.util.Set)3 AMAuthenticationInstance (com.sun.identity.authentication.config.AMAuthenticationInstance)2 HashMap (java.util.HashMap)2 OptionList (com.iplanet.jato.view.html.OptionList)1 AMAuthenticationManager (com.sun.identity.authentication.config.AMAuthenticationManager)1 AMConfigurationException (com.sun.identity.authentication.config.AMConfigurationException)1 AuthPropertiesModelImpl (com.sun.identity.console.authentication.model.AuthPropertiesModelImpl)1 AMPropertySheetModel (com.sun.identity.console.base.model.AMPropertySheetModel)1 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)1 CCActionTable (com.sun.web.ui.view.table.CCActionTable)1