Search in sources :

Example 1 with SelectRealmModel

use of com.sun.identity.console.policy.model.SelectRealmModel in project OpenAM by OpenRock.

the class SelectRealmViewBean method setSchemes.

private void setSchemes(String realm) {
    if ((realm == null) || (realm.length() == 0)) {
        realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    }
    SelectRealmModel model = (SelectRealmModel) getModel();
    try {
        Set schemes = model.getAuthenticationInstances(realm);
        CCSelect sl = (CCSelect) getChild(ATTR_SCHEMES);
        sl.setOptions(createOptionList(schemes));
    } catch (AMConsoleException e) {
        if (!isInlineAlertMessageSet()) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
    }
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) CCSelect(com.sun.web.ui.view.html.CCSelect) SelectRealmModel(com.sun.identity.console.policy.model.SelectRealmModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 2 with SelectRealmModel

use of com.sun.identity.console.policy.model.SelectRealmModel in project OpenAM by OpenRock.

the class SelectRealmViewBean method getRealmNames.

private Set getRealmNames(String filter) {
    Set realmNames = null;
    SelectRealmModel model = (SelectRealmModel) getModel();
    try {
        realmNames = model.getRealmNames("/", filter);
        if (realmNames.isEmpty()) {
            if (!isInlineAlertMessageSet()) {
                setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "policy.condition.selectrealm.no.search.result.message");
            }
        } else {
            disableButton("button1", false);
        }
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
    if ((realmNames == null) || realmNames.isEmpty()) {
        realmNames = new HashSet(1);
    }
    realmNames.add("");
    return realmNames;
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) SelectRealmModel(com.sun.identity.console.policy.model.SelectRealmModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashSet(java.util.HashSet)

Aggregations

AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 SelectRealmModel (com.sun.identity.console.policy.model.SelectRealmModel)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 CCSelect (com.sun.web.ui.view.html.CCSelect)1