Search in sources :

Example 1 with CCNavNode

use of com.sun.web.ui.model.CCNavNode in project OpenAM by OpenRock.

the class ServerEditAdvancedViewBean method createTabModel.

protected void createTabModel(String serverName) {
    AMViewConfig amconfig = AMViewConfig.getInstance();
    tabModel = amconfig.getTabsModel(ServerEditViewBeanBase.TAB_NAME, "/", getRequestContext().getRequest());
    if (serverName.equals(ServerConfiguration.DEFAULT_SERVER_CONFIG)) {
        CCNavNode node = (CCNavNode) tabModel.getNodeById(425);
        tabModel.removeNode(node);
    }
    registerChild(TAB_COMMON, CCTabs.class);
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig) CCNavNode(com.sun.web.ui.model.CCNavNode)

Example 2 with CCNavNode

use of com.sun.web.ui.model.CCNavNode in project OpenAM by OpenRock.

the class GenericAgentProfileViewBean method createTabModel.

protected void createTabModel() {
    String agentType = getAgentType();
    if (isLocalConfig(agentType)) {
        agentType = AgentsViewBean.AGENT_2_2;
    }
    if (agentType != null) {
        super.createTabModel();
        AgentsModel model = (AgentsModel) getModel();
        AgentTabManager mgr = AgentTabManager.getInstance();
        List tabs = mgr.getTabs(agentType);
        if ((tabs != null) && !tabs.isEmpty()) {
            for (int i = 0; i < tabs.size(); i++) {
                String tabName = (String) tabs.get(i);
                tabModel.addNode(new CCNavNode(Integer.parseInt(TAB_PREFIX + i), model.getLocalizedString("tab.label." + agentType + "." + tabName), "", ""));
            }
        } else {
            tabModel.addNode(new CCNavNode(TAB_GENERAL_ID, "tab.general", "", ""));
        }
        String group = (String) getPageSessionAttribute(IS_GROUP);
        if ((group != null) && group.equals("true")) {
            tabModel.addNode(new CCNavNode(TAB_GROUP_ID, "tab.group", "", ""));
        }
    }
}
Also used : CCNavNode(com.sun.web.ui.model.CCNavNode) List(java.util.List) AgentsModel(com.sun.identity.console.agentconfig.model.AgentsModel)

Example 3 with CCNavNode

use of com.sun.web.ui.model.CCNavNode in project OpenAM by OpenRock.

the class MAPClientManagerViewBean method createTab.

private View createTab(String name) {
    CCTabsModel tabModel = new CCTabsModel();
    MAPServiceModel model = (MAPServiceModel) getModel();
    Set profileNames = model.getProfileNames();
    if ((profileNames != null) && !profileNames.isEmpty()) {
        for (Iterator iter = profileNames.iterator(); iter.hasNext(); ) {
            String val = (String) iter.next();
            tabModel.addNode(new CCNavNode(val.hashCode(), val, val, val));
        }
        tabModel.setSelectedNode(getProfileName().hashCode());
    }
    return new CCTabs(this, tabModel, name);
}
Also used : CCTabsModel(com.sun.web.ui.model.CCTabsModel) MAPServiceModel(com.sun.identity.console.service.model.MAPServiceModel) CCNavNode(com.sun.web.ui.model.CCNavNode) CCTabs(com.sun.web.ui.view.tabs.CCTabs) Set(java.util.Set) Iterator(java.util.Iterator)

Example 4 with CCNavNode

use of com.sun.web.ui.model.CCNavNode in project OpenAM by OpenRock.

the class AMViewConfig method getTabsModel.

public CCTabsModel getTabsModel(String type, String realmName, HttpServletRequest req) {
    CCTabsModel tabModel = new CCTabsModel();
    AccessControlModel model = new AccessControlModelImpl(req);
    List tabs = getTabList(type);
    if ((tabs == null) || tabs.isEmpty()) {
        return null;
    }
    for (Iterator iter = tabs.iterator(); iter.hasNext(); ) {
        AMTabEntry entry = (AMTabEntry) iter.next();
        CCNavNode navNode = entry.getNavNode(model, realmName);
        if (navNode != null) {
            tabModel.addNode(navNode);
        }
    }
    return tabModel;
}
Also used : CCTabsModel(com.sun.web.ui.model.CCTabsModel) AccessControlModel(com.sun.identity.console.base.model.AccessControlModel) AccessControlModelImpl(com.sun.identity.console.base.model.AccessControlModelImpl) CCNavNode(com.sun.web.ui.model.CCNavNode) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List)

Example 5 with CCNavNode

use of com.sun.web.ui.model.CCNavNode in project OpenAM by OpenRock.

the class AMViewConfig method getSAMLv2TabsModel.

// all tabs for SAMLv2 property page are predefined in fmConsoleConfiguration.xml.
//here unwanted tabs are hidden based on the role of the respective entity.
public CCTabsModel getSAMLv2TabsModel(String type, String realmName, HttpServletRequest req, List tabsToDisplay) {
    CCTabsModel tabModel = new CCTabsModel();
    AccessControlModel model = new AccessControlModelImpl(req);
    List tabs = getTabList(type);
    if ((tabs == null) || tabs.isEmpty()) {
        return null;
    }
    for (Iterator iter = tabs.iterator(); iter.hasNext(); ) {
        AMTabEntry entry = (AMTabEntry) iter.next();
        for (Iterator tab_iter = tabsToDisplay.iterator(); tab_iter.hasNext(); ) {
            String roletoDisplay = (String) tab_iter.next();
            if (entry.getViewBean().contains(roletoDisplay)) {
                CCNavNode navNode = entry.getNavNode(model, realmName);
                if (navNode != null) {
                    tabModel.addNode(navNode);
                }
            }
        }
    }
    return tabModel;
}
Also used : CCTabsModel(com.sun.web.ui.model.CCTabsModel) AccessControlModel(com.sun.identity.console.base.model.AccessControlModel) AccessControlModelImpl(com.sun.identity.console.base.model.AccessControlModelImpl) CCNavNode(com.sun.web.ui.model.CCNavNode) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) OptionList(com.iplanet.jato.view.html.OptionList) List(java.util.List)

Aggregations

CCNavNode (com.sun.web.ui.model.CCNavNode)11 Iterator (java.util.Iterator)6 CCTabsModel (com.sun.web.ui.model.CCTabsModel)5 List (java.util.List)5 OptionList (com.iplanet.jato.view.html.OptionList)4 ArrayList (java.util.ArrayList)4 NodeList (org.w3c.dom.NodeList)4 AMViewConfig (com.sun.identity.console.base.AMViewConfig)2 AccessControlModel (com.sun.identity.console.base.model.AccessControlModel)2 AccessControlModelImpl (com.sun.identity.console.base.model.AccessControlModelImpl)2 Set (java.util.Set)2 AgentsModel (com.sun.identity.console.agentconfig.model.AgentsModel)1 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)1 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)1 MAPServiceModel (com.sun.identity.console.service.model.MAPServiceModel)1 IdType (com.sun.identity.idm.IdType)1 CCTabs (com.sun.web.ui.view.tabs.CCTabs)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1