Search in sources :

Example 6 with AMViewConfig

use of com.sun.identity.console.base.AMViewConfig 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 7 with AMViewConfig

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

the class ServerConfigXMLViewBean method createTabModel.

protected void createTabModel() {
    if (tabModel == null) {
        AMViewConfig amconfig = AMViewConfig.getInstance();
        tabModel = amconfig.getTabsModel(ServerEditViewBeanBase.TAB_NAME, "/", getRequestContext().getRequest());
        registerChild(TAB_COMMON, CCTabs.class);
    }
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig)

Example 8 with AMViewConfig

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

the class ServerEditViewBeanBase 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("cscGeneral", nodeID);
        unlockPageTrailForSwapping();
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (AMConsoleException e) {
        debug.error("ServerEditGeneralViewBean.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)

Example 9 with AMViewConfig

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

the class AgentsViewBean method nodeClicked.

/**
     * Handles tab selected event.
     *
     * @param event Request Invocation Event.
     * @param nodeID Selected Node ID.
     */
public void nodeClicked(RequestInvocationEvent event, int nodeID) {
    boolean forwardTo = false;
    String strNodeId = Integer.toString(nodeID);
    if (strNodeId.length() > 2) {
        String prefix = strNodeId.substring(0, 2);
        if (prefix.equals(AMAdminConstants.TAB_AGENT_PREFIX)) {
            setPageSessionAttribute(getTrackingTabIDName(), Integer.toString(nodeID));
            AMViewConfig amconfig = AMViewConfig.getInstance();
            List list = amconfig.getSupportedAgentTypes(getModel());
            strNodeId = strNodeId.substring(2);
            int idx = Integer.parseInt(strNodeId);
            if (idx < list.size()) {
                setPageSessionAttribute(PG_SESSION_AGENT_TYPE, (String) list.get(idx));
                AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
                passPgSessionMap(vb);
                vb.setTargetViewBeanURL("../agentconfig/Agents");
                vb.forwardTo(getRequestContext());
                forwardTo = true;
            }
        }
    }
    if (!forwardTo) {
        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("AgentViewBean.nodeClicked", e);
            forwardTo();
        }
    }
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig) AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase) List(java.util.List) ArrayList(java.util.ArrayList) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) AMPostViewBean(com.sun.identity.console.base.AMPostViewBean)

Example 10 with AMViewConfig

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

the class AgentsViewBean method getAgentNames.

private void getAgentNames() {
    AgentsModel model = (AgentsModel) getModel();
    String filter = ((String) getDisplayFieldValue(TF_FILTER));
    String gfilter = ((String) getDisplayFieldValue(TF_GROUP_FILTER));
    if ((filter == null) || (filter.length() == 0)) {
        filter = "*";
        setDisplayFieldValue(TF_FILTER, "*");
    } else {
        filter = filter.trim();
    }
    if ((gfilter == null) || (gfilter.length() == 0)) {
        gfilter = "*";
        setDisplayFieldValue(TF_GROUP_FILTER, "*");
    } else {
        gfilter = gfilter.trim();
    }
    // this is to faciliate combined types.
    String agentType = getDisplayIDType();
    AMViewConfig cfg = AMViewConfig.getInstance();
    Set agentTypes = cfg.getCombineAgentTypes(agentType);
    if (agentTypes == null) {
        agentTypes = new HashSet(2);
        agentTypes.add(agentType);
    } else {
        supportedTypes.addAll(agentTypes);
    }
    try {
        Set agents = new HashSet();
        String curRealm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
        int errorCode = model.getAgentNames(curRealm, agentTypes, filter, agents);
        switch(errorCode) {
            case IdSearchResults.SIZE_LIMIT_EXCEEDED:
                setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.sizelimit.exceeded");
                break;
            case IdSearchResults.TIME_LIMIT_EXCEEDED:
                setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.timelimit.exceeded");
                break;
        }
        Set agentGroups = new HashSet();
        errorCode = model.getAgentGroupNames(curRealm, agentTypes, gfilter, agentGroups);
        switch(errorCode) {
            case IdSearchResults.SIZE_LIMIT_EXCEEDED:
                setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.sizelimit.exceeded");
                break;
            case IdSearchResults.TIME_LIMIT_EXCEEDED:
                setInlineAlertMessage(CCAlert.TYPE_WARNING, "message.warning", "message.timelimit.exceeded");
                break;
        }
        Map results = new HashMap(4);
        results.put(CACHE_AGENTS, agents);
        results.put(CACHE_AGENT_GROUPS, agentGroups);
        populateTableModel(results);
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        CCButton b = (CCButton) getChild(TBL_BUTTON_ADD);
        b.setDisabled(true);
        b = (CCButton) getChild(TBL_BUTTON_ADD_GROUP);
        b.setDisabled(true);
    }
}
Also used : AMViewConfig(com.sun.identity.console.base.AMViewConfig) Set(java.util.Set) TreeSet(java.util.TreeSet) HashSet(java.util.HashSet) HashMap(java.util.HashMap) CCButton(com.sun.web.ui.view.html.CCButton) AgentsModel(com.sun.identity.console.agentconfig.model.AgentsModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) Map(java.util.Map) HashMap(java.util.HashMap) HashSet(java.util.HashSet)

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