Search in sources :

Example 21 with CCDropDownMenu

use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.

the class AuthActionTiledView method displayModuleNameMenu.

private boolean displayModuleNameMenu(String childName, int index) {
    boolean display = false;
    AuthConfigViewBean parentVB = (AuthConfigViewBean) getParentViewBean();
    String value = parentVB.getModuleName(index);
    CCDropDownMenu list = (CCDropDownMenu) getChild(childName);
    OptionList optList = parentVB.getModuleNameChoiceValues();
    if ((optList != null) && (optList.size() > 0)) {
        if ((value != null) && (value.length() != 0)) {
            if (!containsOption(optList, value)) {
                optList.add(0, value, value);
            }
            list.setOptions(optList);
            list.setValue(value);
            display = true;
        }
    }
    return display;
}
Also used : CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 22 with CCDropDownMenu

use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.

the class AuthActionTiledView method displayCriteriaMenu.

private boolean displayCriteriaMenu(String childName, int index) {
    boolean display = false;
    AuthConfigViewBean parentVB = (AuthConfigViewBean) getParentViewBean();
    CCDropDownMenu list = (CCDropDownMenu) getChild(childName);
    OptionList optList = parentVB.getCriteriaNameChoiceValues();
    list.setOptions(optList);
    if ((optList != null) && (optList.size() > 0)) {
        String value = parentVB.getModuleFlag(index);
        if ((value != null) && (value.length() != 0)) {
            list.setValue(value);
            display = true;
        }
    }
    return display;
}
Also used : CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 23 with CCDropDownMenu

use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.

the class IdentityMembershipConditionAddViewBean method beginDisplay.

/**
     * Sets the values to UI model.
     *
     * @param event Display Event.
     * @throws ModelControlException if the default UI model is not accessible.
     */
public void beginDisplay(DisplayEvent event) throws ModelControlException {
    IdentitySubjectModel subjectModel = getSubjectModel();
    PolicyModel model = (PolicyModel) getModel();
    super.beginDisplay(event);
    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 = helper.createOptionList(model.getUserSSOToken(), model.getUserLocale(), this, getPossibleValues(subjectModel, realmName));
    child.resetStateData();
    addRemoveModel.setAvailableOptionList(possible);
}
Also used : IdentitySubjectModel(com.sun.identity.console.policy.model.IdentitySubjectModel) PolicyModel(com.sun.identity.console.policy.model.PolicyModel) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) Map(java.util.Map) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) OptionList(com.iplanet.jato.view.html.OptionList)

Example 24 with CCDropDownMenu

use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.

the class IdentityMembershipConditionAddViewBean method handleBtnFilterRequest.

/**
     * Handles filter results request.
     *
     * @param event Request invocation event.
     */
public void handleBtnFilterRequest(RequestInvocationEvent event) {
    CCDropDownMenu menu = (CCDropDownMenu) getChild(FILTER_TYPE);
    setPageSessionAttribute(ENTITY_TYPE, (String) menu.getValue());
    bFilter = true;
    submitCycle = true;
    forwardTo();
}
Also used : CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu)

Example 25 with CCDropDownMenu

use of com.sun.web.ui.view.html.CCDropDownMenu in project OpenAM by OpenRock.

the class IdentityMembershipConditionEditViewBean method beginDisplay.

/**
     * Sets the values to UI model.
     *
     * @param event Display Event.
     */
public void beginDisplay(DisplayEvent event) throws ModelControlException {
    IdentitySubjectModel subjectModel = getSubjectModel();
    PolicyModel model = (PolicyModel) getModel();
    super.beginDisplay(event);
    if (!canModify) {
        Map mapValues = getDefaultValues();
        if ((mapValues != null) && !mapValues.isEmpty()) {
            Set values = (Set) mapValues.get(AMIdentityMembershipCondition.AM_IDENTITY_NAME);
            Set identityNames = helper.getAMIdentityNames(model.getUserSSOToken(), values);
            propertySheetModel.setValue(VALUES_MULTIPLE_CHOICE_VALUE, AMAdminUtils.getString(identityNames, ",", false));
        }
    } else {
        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("");
        CCAddRemove child = (CCAddRemove) getChild(VALUES_MULTIPLE_CHOICE_VALUE);
        child.restoreStateData();
        if (!submitCycle) {
            helper.setSelectedIdentities(child, model.getUserSSOToken(), model.getUserLocale(), this, getDefaultValues());
        } else {
            // initialize the available/selected component
            OptionList possible = helper.createOptionList(model.getUserSSOToken(), model.getUserLocale(), this, getPossibleValues(subjectModel, realmName));
            OptionList selected = addRemoveModel.getSelectedOptionList();
            List selectedIds = AMAdminUtils.toList(selected);
            child.resetStateData();
            addRemoveModel.setAvailableOptionList(possible);
            addRemoveModel.setSelectedOptionList(helper.createOptionList(model.getUserSSOToken(), model.getUserLocale(), this, selectedIds));
        }
    }
}
Also used : IdentitySubjectModel(com.sun.identity.console.policy.model.IdentitySubjectModel) Set(java.util.Set) PolicyModel(com.sun.identity.console.policy.model.PolicyModel) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) Map(java.util.Map) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) CCAddRemove(com.sun.web.ui.view.addremove.CCAddRemove) OptionList(com.iplanet.jato.view.html.OptionList)

Aggregations

CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)37 OptionList (com.iplanet.jato.view.html.OptionList)25 Set (java.util.Set)23 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)16 Map (java.util.Map)10 TaskModel (com.sun.identity.console.task.model.TaskModel)9 Iterator (java.util.Iterator)8 TreeSet (java.util.TreeSet)7 HashSet (java.util.HashSet)6 HttpServletRequest (javax.servlet.http.HttpServletRequest)6 IdentitySubjectModel (com.sun.identity.console.policy.model.IdentitySubjectModel)4 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)4 List (java.util.List)4 PolicyModel (com.sun.identity.console.policy.model.PolicyModel)2 OrderedSet (com.sun.identity.shared.datastruct.OrderedSet)2 HashMap (java.util.HashMap)2 View (com.iplanet.jato.view.View)1 Option (com.iplanet.jato.view.html.Option)1 AuthPropertiesModel (com.sun.identity.console.authentication.model.AuthPropertiesModel)1 AMPropertySheet (com.sun.identity.console.base.AMPropertySheet)1