Search in sources :

Example 46 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class IDRepoModelImpl method getIDRepoTypes.

/**
     * Returns an option list of ID Repo type name to its localized string.
     *
     * @return an option list of ID Repo type name to its localized string.
     */
public OptionList getIDRepoTypes() throws AMConsoleException {
    Map map = AMFormatUtils.reverseStringMap(getIDRepoTypesMap());
    OptionList optList = new OptionList();
    List sorted = AMFormatUtils.sortKeyInMap(map, getUserLocale());
    for (Iterator iter = sorted.iterator(); iter.hasNext(); ) {
        String label = (String) iter.next();
        optList.add(label, (String) map.get(label));
    }
    return optList;
}
Also used : Iterator(java.util.Iterator) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) OptionList(com.iplanet.jato.view.html.OptionList)

Example 47 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class SMDiscoveryBootstrapRefOffViewBeanBase method populateDirectiveMechIDRefs.

protected void populateDirectiveMechIDRefs(SMDiscoEntryData data) {
    List mechIDs = data.getPossibleDirectivesToMechIDs();
    if (canModify) {
        OptionList optionList = createOptionList(mechIDs);
        for (Iterator i = DIRECTIVES_MECHID_LIST.iterator(); i.hasNext(); ) {
            String childName = (String) i.next();
            CCSelectableList child = (CCSelectableList) getChild(childName);
            child.setOptions(optionList);
        }
    }
}
Also used : 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) OptionList(com.iplanet.jato.view.html.OptionList)

Example 48 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class SMDiscoveryBootstrapRefOffViewBeanBase method getValues.

protected SMDiscoEntryData getValues(boolean validated) throws AMConsoleException {
    SMDiscoEntryData smDisco = new SMDiscoEntryData();
    smDisco.abstractValue = ((String) propertySheetModel.getValue(ATTR_ABSTRACT)).trim();
    smDisco.serviceType = ((String) propertySheetModel.getValue(ATTR_SERVICE_TYPE)).trim();
    smDisco.providerId = ((String) propertySheetModel.getValue(ATTR_PROVIDER_ID)).trim();
    String optionFlag = (String) propertySheetModel.getValue(ATTR_RESOURCE_OFFERING_OPTIONS_OPTIONS);
    smDisco.noOption = optionFlag.equalsIgnoreCase("true");
    CCEditableList eList = (CCEditableList) getChild(ATTR_RESOURCE_OFFERING_OPTIONS_LIST);
    eList.restoreStateData();
    CCEditableListModel eModel = (CCEditableListModel) eList.getModel();
    OptionList options = eModel.getOptionList();
    if (options != null) {
        smDisco.options = AMAdminUtils.toList(options);
    }
    List descData = (List) removePageSessionAttribute(ATTR_SECURITY_MECH_ID);
    if (descData != null) {
        smDisco.descData = descData;
    }
    smDisco.directives = getDirectiveMechIDMapping();
    if (validated) {
        if ((descData == null) || descData.isEmpty()) {
            throw new AMConsoleException("discovery.service.bootstrapResOff.missing.service.desc.message");
        } else if (smDisco.serviceType.length() == 0) {
            throw new AMConsoleException("discovery.service.bootstrapResOff.missing.serviceType.message");
        } else if (smDisco.providerId.length() == 0) {
            throw new AMConsoleException("discovery.service.bootstrapResOff.missing.providerId.message");
        }
    }
    return smDisco;
}
Also used : CCEditableList(com.sun.web.ui.view.editablelist.CCEditableList) SMDiscoEntryData(com.sun.identity.console.service.model.SMDiscoEntryData) CCEditableListModel(com.sun.web.ui.model.CCEditableListModel) 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) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) OptionList(com.iplanet.jato.view.html.OptionList)

Example 49 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class SMProfileViewBean method beginDisplay.

/**
     * Sets the required information to display the page.
     *
     * @param event display event.
     * @throws ModelControlException if problem access value of component.
     */
public void beginDisplay(DisplayEvent event) throws ModelControlException {
    if (validSession) {
        super.beginDisplay(event);
        SMProfileModel model = (SMProfileModel) getModel();
        Map map = model.getServerNames();
        OptionList optList = new OptionList();
        CCDropDownMenu child = (CCDropDownMenu) getChild(CHILD_SERVER_NAME_MENU);
        String value = (String) child.getValue();
        if (map != null && !map.isEmpty()) {
            for (Iterator iter = map.keySet().iterator(); iter.hasNext(); ) {
                String str = (String) iter.next();
                String val = (String) map.get(str);
                optList.add(str, val);
                if (value == null) {
                    child.setValue(val);
                }
            }
        }
        child.setOptions(optList);
        value = (String) child.getValue();
        model.setProfileServerName(value);
        SMSessionCache cache = null;
        try {
            cache = model.getSessionCache(getFilterString());
            if (cache != null) {
                populateTableModel(cache.getSessions());
                String errorMessage = cache.getErrorMessage();
                if (errorMessage != null && errorMessage.length() > 0) {
                    setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", errorMessage);
                }
            }
        } catch (AMConsoleException ae) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ae.getMessage());
        }
        if (cache == null) {
            populateTableModel(Collections.EMPTY_LIST);
        }
        setPageSessionAttribute(SERVER_NAME, value);
        // Set our Sub-Tabs
        addSessionsTab(model, 1);
        // Both the SFO is Enabled and Repository Type has been Specified for view of HA Tabs.
        if ((!SystemPropertiesManager.get(CoreTokenConstants.IS_SFO_ENABLED, "false").equalsIgnoreCase("true")) && (SystemPropertiesManager.get(CoreTokenConstants.SYS_PROPERTY_SESSION_HA_REPOSITORY_TYPE, "None").equalsIgnoreCase("None"))) {
            removeSessionsTab();
        }
    }
}
Also used : SMSessionCache(com.sun.identity.console.session.model.SMSessionCache) SMProfileModel(com.sun.identity.console.session.model.SMProfileModel) Iterator(java.util.Iterator) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 50 with OptionList

use of com.iplanet.jato.view.html.OptionList in project OpenAM by OpenRock.

the class AgentProfileViewBean method setProperty.

private void setProperty(AgentsModel model, String type, String universalId) throws AMConsoleException {
    Set groups = new HashSet();
    Set set = new HashSet(2);
    set.add(type);
    String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    model.getAgentGroupNames(curRealm, set, "*", groups);
    CCDropDownMenu menu = (CCDropDownMenu) getChild(CHILD_AGENT_GROUP);
    Set groupNames = new TreeSet();
    for (Iterator i = groups.iterator(); i.hasNext(); ) {
        AMIdentity amid = (AMIdentity) i.next();
        groupNames.add(amid.getName());
    }
    OptionList optList = createOptionList(groupNames);
    optList.add(0, model.getLocalizedString("agentgroup.none"), "");
    menu.setOptions(optList);
    String group = model.getAgentGroup(curRealm, universalId);
    if (group != null) {
        menu.setValue(group);
    }
}
Also used : TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) Set(java.util.Set) TreeSet(java.util.TreeSet) AMIdentity(com.sun.identity.idm.AMIdentity) Iterator(java.util.Iterator) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList) HashSet(java.util.HashSet)

Aggregations

OptionList (com.iplanet.jato.view.html.OptionList)75 Set (java.util.Set)35 Iterator (java.util.Iterator)27 CCDropDownMenu (com.sun.web.ui.view.html.CCDropDownMenu)25 Map (java.util.Map)24 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)21 HashSet (java.util.HashSet)17 List (java.util.List)15 HashMap (java.util.HashMap)13 ArrayList (java.util.ArrayList)9 Option (com.iplanet.jato.view.html.Option)7 CCAddRemoveModel (com.sun.web.ui.model.CCAddRemoveModel)7 CCAddRemove (com.sun.web.ui.view.addremove.CCAddRemove)7 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)6 PolicyModel (com.sun.identity.console.policy.model.PolicyModel)6 CCRadioButton (com.sun.web.ui.view.html.CCRadioButton)6 TreeSet (java.util.TreeSet)6 IdentitySubjectModel (com.sun.identity.console.policy.model.IdentitySubjectModel)5 TaskModel (com.sun.identity.console.task.model.TaskModel)5 CCSelect (com.sun.web.ui.view.html.CCSelect)5