Search in sources :

Example 6 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.

the class IdentityMembershipConditionAddViewBean method setPropertiesValues.

protected void setPropertiesValues(PolicyModel model, Map values) {
    CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
    helper.setSelectedIdentities(child, model.getUserSSOToken(), model.getUserLocale(), this, values);
}
Also used : CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove)

Example 7 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.

the class IdentitySubjectAddViewBean method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    IdentitySubjectModel model = (IdentitySubjectModel) getModel();
    Set values = null;
    if (bFilter) {
        Set defaultValue = getValues();
        if (defaultValue != null) {
            values = getAMIdentity(model, defaultValue);
        }
    }
    super.beginDisplay(event);
    String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    // initialize the 'Filter' drop down menu
    // supportedEntityTypes is a map of entity name to its
    // localized value
    CCDropDownMenu menu = (CCDropDownMenu) getChild(FILTER_TYPE);
    Map supportedEntityTypes = model.getSupportedEntityTypes(realmName);
    OptionList entityTypes = createOptionList(supportedEntityTypes);
    entityTypes.add(0, "policy.subject.select.identity.type", "");
    menu.setOptions(entityTypes);
    menu.setValue("");
    // initialize the available/selected component
    CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
    child.restoreStateData();
    OptionList selected = addRemoveModel.getSelectedOptionList();
    OptionList possible = createOptionList(getPossibleValues(model, realmName));
    child.resetStateData();
    addRemoveModel.setAvailableOptionList(possible);
    List selectedIds = AMAdminUtils.toList(selected);
    addRemoveModel.setSelectedOptionList(createOptionList(getAMIdentity(model, selectedIds)));
}
Also used : IdentitySubjectModel(com.sun.identity.console.policy.model.IdentitySubjectModel) HashSet(java.util.HashSet) Set(java.util.Set) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) HashMap(java.util.HashMap) Map(java.util.Map) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) OptionList(com.iplanet.jato.view.html.OptionList)

Example 8 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.

the class IdentitySubjectEditViewBean method getValues.

protected Set getValues(String subjectType) throws ModelControlException {
    CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
    child.restoreStateData();
    Set values = getValues(addRemoveModel.getSelectedOptionList());
    if ((values == null) || values.isEmpty()) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "policy.missing.subject.value");
        values = null;
    }
    return values;
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove)

Example 9 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.

the class SubjectOpViewBeanBase method getActionSchemaValues.

private Set getActionSchemaValues(Syntax syntax) {
    Set values = null;
    int syn = AMDisplayType.getDisplaySyntax(syntax);
    switch(syn) {
        case AMDisplayType.SYNTAX_TEXT:
            values = AMAdminUtils.toSet(propertySheetModel.getValues(VALUES_TEXT_VALUE));
            break;
        case AMDisplayType.SYNTAX_SINGLE_CHOICE:
            values = AMAdminUtils.toSet(propertySheetModel.getValues(VALUES_SINGLE_CHOICE_VALUE));
            break;
        case AMDisplayType.SYNTAX_MULTIPLE_CHOICE:
            if (addRemoveModel != null) {
                CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
                child.restoreStateData();
                values = getValues(addRemoveModel.getSelectedOptionList());
                break;
            }
    }
    return (values == null) ? Collections.EMPTY_SET : values;
}
Also used : Set(java.util.Set) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove)

Example 10 with CCAddRemove

use of com.sun.web.ui.view.addremove.CCAddRemove in project OpenAM by OpenRock.

the class SubjectOpViewBeanBase method setAddRemoveModel.

protected void setAddRemoveModel() throws ModelControlException {
    if (canModify) {
        Set values = getValidValues();
        CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
        Set defaultValues = (bFilter) ? getValues() : getDefaultValues();
        child.resetStateData();
        if (values != null) {
            if (defaultValues != null) {
                values.removeAll(defaultValues);
            }
            addRemoveModel.setAvailableOptionList(createOptionList(values));
        } else {
            addRemoveModel.setAvailableOptionList(new OptionList());
        }
        addRemoveModel.setSelectedOptionList(createOptionList(defaultValues));
    }
}
Also used : Set(java.util.Set) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)24 Set (java.util.Set)13 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)11 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)10 HashSet (java.util.HashSet)10 Map (java.util.Map)8 OptionList (com.iplanet.jato.view.html.OptionList)7 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)4 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)4 IdentitySubjectModel (com.sun.identity.console.policy.model.IdentitySubjectModel)4 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)4 HashMap (java.util.HashMap)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 FSAuthDomainsModel (com.sun.identity.console.federation.model.FSAuthDomainsModel)2 PolicyModel (com.sun.identity.console.policy.model.PolicyModel)2 ContainerView (com.iplanet.jato.view.ContainerView)1 View (com.iplanet.jato.view.View)1 ViewBean (com.iplanet.jato.view.ViewBean)1 SerializedField (com.sun.identity.console.components.view.html.SerializedField)1