Search in sources :

Example 31 with CCDropDownMenu

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

the class SMProfileViewBean method createChild.

/**
     * Creates user interface components used by this view bean.
     *
     * @param name of component
     * @return child component
     */
protected View createChild(String name) {
    View view = null;
    if (name.equals(TBL_SESSIONS)) {
        SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
        populateTableModel((List) szCache.getSerializedObj());
        view = new CCActionTable(this, tblModel, name);
    } else if (name.equals(PAGETITLE)) {
        view = new CCPageTitle(this, ptModel, name);
    } else if (tblModel.isChildSupported(name)) {
        view = tblModel.createChild(this, name);
    } else if (name.equals(CHILD_SERVER_NAME_MENU)) {
        view = new CCDropDownMenu(this, name, null);
    } else if (name.equals(LOGOUT_URL)) {
        return new CCStaticTextField(this, LOGOUT_URL, "");
    } else if (name.equals(CHILD_SERVER_NAME_HREF)) {
        view = new CCHref(this, name, null);
    } else {
        view = super.createChild(name);
    }
    return view;
}
Also used : SerializedField(com.sun.identity.console.components.view.html.SerializedField) CCActionTable(com.sun.web.ui.view.table.CCActionTable) CCHref(com.sun.web.ui.view.html.CCHref) View(com.iplanet.jato.view.View) CCPageTitle(com.sun.web.ui.view.pagetitle.CCPageTitle) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) CCStaticTextField(com.sun.web.ui.view.html.CCStaticTextField)

Example 32 with CCDropDownMenu

use of com.sun.web.ui.view.html.CCDropDownMenu 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)

Example 33 with CCDropDownMenu

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

the class AuthPropertiesViewBean method populateConfigMenu.

private void populateConfigMenu() {
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    if ((realm == null) || (realm.length() == 0)) {
        realm = AMModelBase.getStartDN(getRequestContext().getRequest());
    }
    AuthPropertiesModel model = (AuthPropertiesModel) getModel();
    OrderedSet configs = new OrderedSet();
    configs.addAll(AuthConfigurationModelImpl.getNamedConfigurations(model.getUserSSOToken(), realm));
    OptionList containers = new OptionList();
    for (Iterator i = configs.iterator(); i.hasNext(); ) {
        String entry = (String) i.next();
        containers.add(entry, entry);
    }
    CCDropDownMenu ac = (CCDropDownMenu) getChild(AUTH_CONFIG);
    ac.setOptions(containers);
    CCDropDownMenu aac = (CCDropDownMenu) getChild(ADMIN_AUTH_CONFIG);
    aac.setOptions(containers);
}
Also used : OrderedSet(com.sun.identity.shared.datastruct.OrderedSet) Iterator(java.util.Iterator) AuthPropertiesModel(com.sun.identity.console.authentication.model.AuthPropertiesModel) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 34 with CCDropDownMenu

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

the class ImportEntityViewBean method populateRealmData.

private void populateRealmData() {
    Set realmNames = Collections.EMPTY_SET;
    ImportEntityModel model = (ImportEntityModel) getModel();
    try {
        realmNames = model.getRealmNames("/", "*");
        CCDropDownMenu menu = (CCDropDownMenu) getChild(ImportEntityModel.REALM_NAME);
        OptionList sortedList = createOptionList(realmNames);
        OptionList optList = new OptionList();
        int size = sortedList.size();
        for (int i = 0; i < size; i++) {
            String name = sortedList.getValue(i);
            optList.add(getPath(name), name);
        }
        menu.setOptions(optList);
    } catch (AMConsoleException e) {
        debug.warning("ImportEntityViewBean.populateRealmData ", e);
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", "import.entity.populaterealmdata.error");
    }
}
Also used : Set(java.util.Set) ImportEntityModel(com.sun.identity.console.federation.model.ImportEntityModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) OptionList(com.iplanet.jato.view.html.OptionList)

Example 35 with CCDropDownMenu

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

the class ConfigureSalesForceAppsViewBean method beginDisplay.

public void beginDisplay(DisplayEvent e) {
    HttpServletRequest req = getRequestContext().getRequest();
    try {
        TaskModel model = (TaskModel) getModel();
        Map map = model.getRealmCotWithHostedIDPs();
        Set realms = new TreeSet();
        realms.addAll(map.keySet());
        CCDropDownMenu menuRealm = (CCDropDownMenu) getChild(REALM);
        menuRealm.setOptions(createOptionList(realms));
        String realm = req.getParameter("realm");
        if ((realm != null) && (realm.trim().length() > 0)) {
            setDisplayFieldValue(REALM, realm);
        } else {
            if (!realms.isEmpty()) {
                realm = (String) realms.iterator().next();
            }
        }
        if ((realm != null) && (realm.trim().length() > 0)) {
            Map mapCots = (Map) map.get(realm);
            Set cots = new TreeSet();
            cots.addAll(mapCots.keySet());
            CCDropDownMenu menuCOT = (CCDropDownMenu) getChild("choiceCOT");
            menuCOT.setOptions(createOptionList(cots));
            String cot = req.getParameter("cot");
            if ((cot != null) && (cot.trim().length() > 0)) {
                setDisplayFieldValue("choiceCOT", cot);
            } else {
                if (!cots.isEmpty()) {
                    cot = (String) cots.iterator().next();
                }
            }
            if ((cot != null) && (cot.trim().length() > 0)) {
                Set idps = new TreeSet();
                idps.addAll((Set) mapCots.get(cot));
                CCDropDownMenu menuIDP = (CCDropDownMenu) getChild("choiceIDP");
                menuIDP.setOptions(createOptionList(idps));
                String idp = req.getParameter("entityId");
                if ((idp != null) && (idp.trim().length() > 0)) {
                    setDisplayFieldValue("choiceIDP", idp);
                }
            }
            //attrmapping
            populateTableModel();
            Set userAttrNames = AMAdminUtils.getUserAttributeNames();
            userAttrNames.remove("iplanet-am-user-account-life");
            CCDropDownMenu menuUserAttribute = (CCDropDownMenu) getChild("menuUserAttributes");
            OptionList optList = createOptionList(userAttrNames);
            optList.add(0, "name.attribute.mapping.select", "");
            menuUserAttribute.setOptions(optList);
        }
    } catch (AMConsoleException ex) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", ex.getMessage());
    }
    String cot = req.getParameter("cot");
    if ((cot != null) && (cot.trim().length() > 0)) {
        setDisplayFieldValue(COT_CHOICE, cot);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) Set(java.util.Set) TreeSet(java.util.TreeSet) TreeSet(java.util.TreeSet) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) CCDropDownMenu(com.sun.web.ui.view.html.CCDropDownMenu) TaskModel(com.sun.identity.console.task.model.TaskModel) 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