Search in sources :

Example 1 with CCDropDownMenu

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

the class ServerEditGeneralViewBean method getParentSites.

private void getParentSites(String serverName, ServerSiteModel model) throws AMConsoleException {
    Set sites = model.getSiteNames();
    OptionList choices = createOptionList(sites);
    choices.add(0, new Option(model.getLocalizedString("none.site"), ""));
    String parentSite = model.getServerSite(serverName);
    if (parentSite == null) {
        parentSite = "";
    }
    CCDropDownMenu cb = (CCDropDownMenu) getChild(PARENT_SITE);
    cb.resetStateData();
    cb.setValue(parentSite);
    cb.setOptions(choices);
}
Also used : Set(java.util.Set) Option(com.iplanet.jato.view.html.Option) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 2 with CCDropDownMenu

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

the class SAMLv2Base method populateAuthenticationContext.

/**
     * For the given set of authContexts read from the extended metadata, populate the table and dropdown menu
     * @param authContexts The set of SAMLv2AuthContexts read from the extended metadata
     * @param tblAuthContextsModel The table model to populate
     * @param dropdownContextRef The name of the context dropdown menu component to populate
     */
protected void populateAuthenticationContext(SAMLv2AuthContexts authContexts, CCActionTableModel tblAuthContextsModel, String dropdownContextRef) {
    // Create lists from defaults that can be updated as there maybe custom entries from the extended metadata.
    Set<String> contextNames = new LinkedHashSet<String>(DEFAULT_AUTH_CONTEXT_REF_NAMES);
    OptionList options = new OptionList();
    // Used to indicate no default context
    options.add(getLabel("none"), "none");
    for (String name : contextNames) {
        options.add(getLabel(name), name);
    }
    // Need to compare the list from the metadata to the default list and any that are missing should be added
    // to the set being shown in the console as they will be custom entries
    Map<String, SAMLv2AuthContexts.SAMLv2AuthContext> contexts = authContexts.getCollections();
    for (SAMLv2AuthContexts.SAMLv2AuthContext value : contexts.values()) {
        if (contextNames.add(value.name)) {
            options.add(getLabel(value.name), value.name);
        }
    }
    CCDropDownMenu ac = (CCDropDownMenu) getChild(dropdownContextRef);
    ac.setOptions(options);
    tblAuthContextsModel.clear();
    int i = 0;
    for (String name : contextNames) {
        populateAuthenticationContext(name, authContexts, i++, tblAuthContextsModel, dropdownContextRef);
    }
}
Also used : LinkedHashSet(java.util.LinkedHashSet) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 3 with CCDropDownMenu

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

the class FSSAMLTrustedPartnersViewBeanBase method beginDisplay.

public void beginDisplay(DisplayEvent event) throws ModelControlException {
    super.beginDisplay(event);
    if (populateValues) {
        int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
        List list = (List) getPageSessionAttribute("samlPropertyAttributes");
        setValues(AMPipeDelimitAttrTokenizer.getInstance().tokenizes((String) list.get(index)));
    }
    Set attributeNames = getAttributeNames();
    if (attributeNames.contains(SAMLConstants.VERSION)) {
        CCDropDownMenu menu = (CCDropDownMenu) getChild(SAMLConstants.VERSION);
        String version = (String) menu.getValue();
        if ((version == null) || (version.length() == 0)) {
            menu.setValue("1.1");
        }
    }
}
Also used : HashSet(java.util.HashSet) Set(java.util.Set) OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) List(java.util.List) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu)

Example 4 with CCDropDownMenu

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

the class MAPDeviceProfileViewBean method initializedClassificationDropDownList.

private void initializedClassificationDropDownList() {
    MAPDeviceProfileModel model = (MAPDeviceProfileModel) getModel();
    String[] classification = model.getAttributeClassification(deviceName);
    if (classification != null) {
        Map localizedLabels = model.getLocalizedClassificationLabels(classification);
        OptionList optList = new OptionList();
        for (int i = 0; i < classification.length; i++) {
            String c = classification[i];
            String label = (String) localizedLabels.get(c);
            if ((label == null) || (label.trim().length() == 0)) {
                label = c;
            }
            optList.add(label, c);
        }
        CCDropDownMenu cb = (CCDropDownMenu) getChild(SINGLECHOICE_CLASSIFICATION);
        cb.setOptions(optList);
        String value = (String) cb.getValue();
        if ((value == null) || (value.length() == 0)) {
            cb.setValue(classification[0]);
            setDisplayFieldValue(TF_CLASSIFICATION, classification[0]);
        } else {
            setDisplayFieldValue(TF_CLASSIFICATION, value);
        }
    }
}
Also used : Map(java.util.Map) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) MAPDeviceProfileModel(com.sun.identity.console.service.model.MAPDeviceProfileModel) OptionList(com.iplanet.jato.view.html.OptionList)

Example 5 with CCDropDownMenu

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

the class MAPClientManagerViewBean method setStyles.

private void setStyles() {
    MAPServiceModel model = (MAPServiceModel) getModel();
    Set styles = model.getStyleNames(getProfileName());
    if ((styles != null) && !styles.isEmpty()) {
        OptionList styleList = new OptionList();
        for (Iterator iter = styles.iterator(); iter.hasNext(); ) {
            String name = (String) iter.next();
            styleList.add(name, name);
        }
        CCDropDownMenu menu = (CCDropDownMenu) getChild(SINGLECHOICE_STYLE);
        menu.setOptions(styleList);
    }
}
Also used : MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) Set(java.util.Set) Iterator(java.util.Iterator) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) 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