Search in sources :

Example 1 with CCTabsModel

use of com.sun.web.ui.model.CCTabsModel 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 2 with CCTabsModel

use of com.sun.web.ui.model.CCTabsModel 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 3 with CCTabsModel

use of com.sun.web.ui.model.CCTabsModel 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)

Example 4 with CCTabsModel

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

the class AMViewConfig method addSessionTabs.

public CCTabsModel addSessionTabs(CCTabsModel tabModel, AMModel model) {
    if (tabModel == null) {
        tabModel = new CCTabsModel();
    }
    CCNavNode sessionNode = (CCNavNode) tabModel.getNodeById(AMAdminConstants.SESSIONS_NODE_ID);
    if (sessionNode != null) {
        if ((tabs == null) || (tabs.isEmpty()) || (sessionNode.getChildren() == null) || (sessionNode.getChildren().size() >= 2)) {
            return tabModel;
        }
        AMTabEntry[] entries = new AMTabEntry[2];
        entries[0] = (AMTabEntry) sessionNode.getChildren().get(0);
        entries[1] = (AMTabEntry) sessionNode.getChildren().get(1);
        for (AMTabEntry entry : entries) {
            sessionNode.addChild(new CCNavNode(entry.getID(), entry.getLabel(), entry.getTooltip(), entry.getStatus()));
        }
    }
    return tabModel;
}
Also used : CCTabsModel(com.sun.web.ui.model.CCTabsModel) CCNavNode(com.sun.web.ui.model.CCNavNode)

Example 5 with CCTabsModel

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

the class EntityEditViewBean method createPropertyModel.

protected boolean createPropertyModel() {
    boolean created = super.createPropertyModel();
    if (created) {
        String type = (String) getPageSessionAttribute(ENTITY_TYPE);
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        EntitiesModel model = (EntitiesModel) getModel();
        tabModel = new CCTabsModel();
        tabModel.addNode(new CCNavNode(TAB_PROFILE, "profile.tab", "", ""));
        if (model.canAssignService(curRealm, type)) {
            tabModel.addNode(new CCNavNode(TAB_SERVICES, "services.tab", "", ""));
        }
        try {
            Set memberOfs = model.getIdTypeMemberOf(curRealm, type);
            for (Iterator iter = memberOfs.iterator(); iter.hasNext(); ) {
                IdType t = (IdType) iter.next();
                tabModel.addNode(new CCNavNode(t.hashCode(), t.getName(), "", ""));
            }
            Set beMemberOfs = model.getIdTypeBeMemberOf(curRealm, type);
            if ((beMemberOfs != null) && !beMemberOfs.isEmpty()) {
                for (Iterator i = beMemberOfs.iterator(); i.hasNext(); ) {
                    IdType t = (IdType) i.next();
                    tabModel.addNode(new CCNavNode(t.hashCode(), t.getName(), "", ""));
                }
            }
        } catch (AMConsoleException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
        tabModel.setSelectedNode(TAB_PROFILE);
    }
    return created;
}
Also used : CCTabsModel(com.sun.web.ui.model.CCTabsModel) CCNavNode(com.sun.web.ui.model.CCNavNode) HashSet(java.util.HashSet) Set(java.util.Set) Iterator(java.util.Iterator) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel) IdType(com.sun.identity.idm.IdType)

Aggregations

CCNavNode (com.sun.web.ui.model.CCNavNode)5 CCTabsModel (com.sun.web.ui.model.CCTabsModel)5 Iterator (java.util.Iterator)4 OptionList (com.iplanet.jato.view.html.OptionList)2 AccessControlModel (com.sun.identity.console.base.model.AccessControlModel)2 AccessControlModelImpl (com.sun.identity.console.base.model.AccessControlModelImpl)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Set (java.util.Set)2 NodeList (org.w3c.dom.NodeList)2 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 HashSet (java.util.HashSet)1