Search in sources :

Example 1 with CCSelectableList

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

the class SMDiscoveryBootstrapRefOffViewBeanBase method setDirectiveMechIDMapping.

private void setDirectiveMechIDMapping(SMDiscoEntryData smDisco) {
    populateDirectiveMechIDRefs(smDisco);
    Map directives = smDisco.directives;
    Set directiveNames = directives.keySet();
    for (Iterator iter = DIRECTIVES_MECHID.iterator(); iter.hasNext(); ) {
        String directiveName = (String) iter.next();
        String childName = (String) MAP_DIRECTIVES_MECHID.get(directiveName);
        CCCheckBox cb = null;
        CCStaticTextField staticText = null;
        if (canModify) {
            cb = (CCCheckBox) getChild(childName.substring(0, childName.length() - 4));
        } else {
            staticText = (CCStaticTextField) getChild(childName.substring(0, childName.length() - 4));
        }
        if (directiveNames.contains(directiveName)) {
            List refIds = (List) directives.get(directiveName);
            if (canModify) {
                cb.setChecked(true);
                CCSelectableList child = (CCSelectableList) getChild(childName);
                if ((refIds != null) && !refIds.isEmpty()) {
                    child.setValues(refIds.toArray());
                } else {
                    child.setValues(null);
                }
            } else {
                staticText.setValue("true");
                CCStaticTextField child = (CCStaticTextField) getChild(childName);
                if ((refIds != null) && !refIds.isEmpty()) {
                    child.setValue(AMAdminUtils.getString(refIds, ",", false));
                } else {
                    child.setValue("");
                }
            }
        } else {
            if (canModify) {
                cb.setChecked(false);
            } else {
                staticText.setValue("false");
            }
        }
    }
}
Also used : Set(java.util.Set) CCCheckBox(com.sun.web.ui.view.html.CCCheckBox) Iterator(java.util.Iterator) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) ArrayList(java.util.ArrayList) CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Example 2 with CCSelectableList

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

the class EntityMembersFilteredIdentityViewBean method getMemberNames.

private void getMemberNames() {
    EntitiesModel model = (EntitiesModel) getModel();
    try {
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        String type = (String) getPageSessionAttribute(PG_SESSION_MEMBER_TYPE);
        String universalId = (String) getPageSessionAttribute(UNIVERSAL_ID);
        Set entities = model.getMembers(curRealm, universalId, type);
        CCSelectableList list = (CCSelectableList) getChild(MEMBERS);
        list.setOptions(getOptionListForEntities(entities));
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
Also used : Set(java.util.Set) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 3 with CCSelectableList

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

the class ActionTiledView method displayMultipleChoiceAction.

private boolean displayMultipleChoiceAction(ActionSchema actionSchema, String childName, int type, int syntax) {
    boolean display = false;
    RuleOpViewBeanBase parentVB = (RuleOpViewBeanBase) getParentViewBean();
    String serviceType = (String) parentVB.propertySheetModel.getValue(RuleOpViewBeanBase.SERVICE_TYPE);
    if (type == AMDisplayType.TYPE_MULTIPLE_CHOICE) {
        CCSelectableList child = (CCSelectableList) getChild(childName);
        child.resetStateData();
        CCAddRemoveModel addRemoveModel = (CCAddRemoveModel) model.getModel(childName);
        Set defaultValues = parentVB.getValues(addRemoveModel.getSelectedOptionList());
        if ((defaultValues == null) || defaultValues.isEmpty()) {
            defaultValues = parentVB.getDefaultActionValues(actionSchema);
        }
        OptionList optList = parentVB.getChoiceValues(serviceType, actionSchema);
        int sz = optList.size();
        OptionList availList = new OptionList();
        for (int i = 0; i < sz; i++) {
            Option opt = (Option) optList.get(i);
            if (!defaultValues.contains(opt.getValue())) {
                availList.add(opt);
            }
        }
        addRemoveModel.setAvailableOptionList(availList);
        addRemoveModel.setSelectedOptionList(parentVB.createOptionList(defaultValues));
        display = true;
    }
    return display;
}
Also used : CCAddRemoveModel(com.sun.web.ui.model.CCAddRemoveModel) Set(java.util.Set) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) Option(com.iplanet.jato.view.html.Option) OptionList(com.iplanet.jato.view.html.OptionList)

Example 4 with CCSelectableList

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

the class RuleOpViewBeanBase method getManagedResources.

protected void getManagedResources() {
    if (canModify) {
        PolicyModel model = (PolicyModel) getModel();
        String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        String serviceType = (String) propertySheetModel.getValue(SERVICE_TYPE);
        CCSelectableList cb = (CCSelectableList) getChild(MANAGED_RESOURCES);
        cb.setOptions(createOptionList(model.getManagedResources(realmName, serviceType)));
    }
}
Also used : CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) PolicyModel(com.sun.identity.console.policy.model.PolicyModel)

Example 5 with CCSelectableList

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

the class RMRealmAddViewBean method populateRealmParentList.

private void populateRealmParentList() {
    RMRealmModel model = (RMRealmModel) getModel();
    Set realms = new HashSet();
    try {
        realms = model.getRealmNames(model.getStartDN(), "*");
    } catch (AMConsoleException a) {
    // do something here
    }
    Map display = new HashMap(realms.size() * 2);
    for (Iterator i = realms.iterator(); i.hasNext(); ) {
        String tmp = (String) i.next();
        String path = getPath(tmp);
        display.put(tmp, path);
    }
    OptionList optionList = createOptionList(display);
    CCSelectableList parentList = (CCSelectableList) getChild(RMRealmModel.TF_PARENT);
    parentList.setOptions(optionList);
    String value = (String) parentList.getValue();
    if ((value == null) || (value.length() == 0)) {
        Option opt = optionList.get(0);
        parentList.setValue(opt.getValue());
    }
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) HashMap(java.util.HashMap) Iterator(java.util.Iterator) CCSelectableList(com.sun.web.ui.view.html.CCSelectableList) Option(com.iplanet.jato.view.html.Option) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) HashMap(java.util.HashMap) Map(java.util.Map) RMRealmModel(com.sun.identity.console.realm.model.RMRealmModel) OptionList(com.iplanet.jato.view.html.OptionList) HashSet(java.util.HashSet)

Aggregations

CCSelectableList (com.sun.web.ui.view.html.CCSelectableList)6 OptionList (com.iplanet.jato.view.html.OptionList)4 Set (java.util.Set)4 Iterator (java.util.Iterator)3 Option (com.iplanet.jato.view.html.Option)2 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)2 CCEditableList (com.sun.web.ui.view.editablelist.CCEditableList)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)1 PolicyModel (com.sun.identity.console.policy.model.PolicyModel)1 RMRealmModel (com.sun.identity.console.realm.model.RMRealmModel)1 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)1 CCCheckBox (com.sun.web.ui.view.html.CCCheckBox)1 CCStaticTextField (com.sun.web.ui.view.html.CCStaticTextField)1 HashSet (java.util.HashSet)1