Search in sources :

Example 16 with AMViewConfig

use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.

the class AgentsViewBean method createTabModel.

protected void createTabModel() {
    if (tabModel == null) {
        AMViewConfig amconfig = AMViewConfig.getInstance();
        String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        if (realmName != null) {
            tabModel = amconfig.getTabsModel("realms", realmName, getRequestContext().getRequest());
            String tabIdx = (String) getPageSessionAttribute(getTrackingTabIDName());
            if (tabIdx != null) {
                selectedNode = addAgentsTab(Integer.parseInt(tabIdx));
                setPageSessionAttribute("CCTabs.SelectedTabId", tabIdx);
            } else {
                addAgentsTab(-1);
            }
            registerChild(TAB_COMMON, CCTabs.class);
        }
        tabModel.clear();
        registerChild(TAB_COMMON, CCTabs.class);
    }
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig)

Example 17 with AMViewConfig

use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.

the class AgentsViewBean method addAgentsTab.

private CCNavNode addAgentsTab(int idx) {
    AgentsModel model = (AgentsModel) getModel();
    AMViewConfig config = AMViewConfig.getInstance();
    return config.addAgentTabs(tabModel, model, idx);
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig) AgentsModel(com.sun.identity.console.agentconfig.model.AgentsModel)

Example 18 with AMViewConfig

use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.

the class HomeViewBean method forwardTo.

public void forwardTo(RequestContext reqContext) throws NavigationException {
    EntitiesModel model = (EntitiesModel) getModel();
    AMViewConfig config = AMViewConfig.getInstance();
    List supported = config.getSupportedAgentTypes(model);
    if (supported.isEmpty()) {
        super.forwardTo(reqContext);
    } else {
        AgentsViewBean vb = (AgentsViewBean) getViewBean(AgentsViewBean.class);
        setPageSessionAttribute(AgentsViewBean.PG_SESSION_AGENT_TYPE, (String) supported.iterator().next());
        passPgSessionMap(vb);
        vb.forwardTo(reqContext);
    }
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig) List(java.util.List) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

Example 19 with AMViewConfig

use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.

the class EntityPropertiesBase method createTabModel.

protected void createTabModel() {
    String profile = getProfileName();
    String entity = (String) getPageSessionAttribute(ENTITY_NAME);
    String realm = (String) getPageSessionAttribute("entityRealm");
    EntityModel eModel = (EntityModel) getEntityModel();
    if (tabModel == null) {
        if (profile.equals(eModel.SAMLV2)) {
            AMViewConfig amconfig = AMViewConfig.getInstance();
            List tabstoDisplay = eModel.getSAMLv2Roles(entity, realm);
            tabModel = amconfig.getSAMLv2TabsModel("SAMLv2", "/", getRequestContext().getRequest(), tabstoDisplay);
            registerChild(TAB_COMMON, CCTabs.class);
            tabModel.clear();
        } else if (!profile.equals(eModel.SAMLV2)) {
            AMViewConfig amconfig = AMViewConfig.getInstance();
            List entries = eModel.getTabMenu(profile, entity, realm);
            if ((entries != null) && (entries.size() > 0)) {
                amconfig.addTabEntries(profile, entries, true);
            }
            tabModel = amconfig.getTabsModel(profile, "/", getRequestContext().getRequest());
            tabModel.clear();
            tabModel.setSelectedNode(1);
        }
    }
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig) EntityModel(com.sun.identity.console.federation.model.EntityModel) List(java.util.List)

Example 20 with AMViewConfig

use of com.sun.identity.console.base.AMViewConfig in project OpenAM by OpenRock.

the class RealmPropertiesBase method nodeClicked.

/**
     * Handles tab selected event. 
     *
     * @param event Request Invocation Event.
     * @param nodeID Selected Node ID.
     */
public void nodeClicked(RequestInvocationEvent event, int nodeID) {
    AMViewConfig amconfig = AMViewConfig.getInstance();
    try {
        AMViewBeanBase vb = getTabNodeAssociatedViewBean("realms", nodeID);
        String tmp = (String) getPageSessionAttribute(AMAdminConstants.PREVIOUS_REALM);
        vb.setPageSessionAttribute(AMAdminConstants.PREVIOUS_REALM, tmp);
        tmp = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        vb.setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, tmp);
        tmp = (String) getPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID);
        vb.setPageSessionAttribute(AMAdminConstants.PREVIOUS_TAB_ID, tmp);
        unlockPageTrailForSwapping();
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (AMConsoleException e) {
        debug.error("RealmPropertiesBase.nodeClicked", e);
        forwardTo();
    }
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig) AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Aggregations

AMViewConfig (com.sun.identity.console.base.AMViewConfig)21 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)7 AMViewBeanBase (com.sun.identity.console.base.AMViewBeanBase)6 List (java.util.List)4 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)3 AgentsModel (com.sun.identity.console.agentconfig.model.AgentsModel)2 CCNavNode (com.sun.web.ui.model.CCNavNode)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 AMPostViewBean (com.sun.identity.console.base.AMPostViewBean)1 EntityModel (com.sun.identity.console.federation.model.EntityModel)1 RMRealmModel (com.sun.identity.console.realm.model.RMRealmModel)1 CCActionTableModel (com.sun.web.ui.model.CCActionTableModel)1 CCButton (com.sun.web.ui.view.html.CCButton)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1