Search in sources :

Example 1 with AMViewBeanBase

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

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

the class SMDiscoveryDescriptionViewBeanBase method handleButton3Request.

/**
     * Handles the "Back to" page request. Essentially this is just canceling 
     * the page and returning to the previous page. Same as a cancel request
     * from the create page. 
     *
     * @param event Request Invocation Event.
     */
public void handleButton3Request(RequestInvocationEvent event) {
    AMViewBeanBase vb = getReturnToViewBean();
    backTrail();
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase)

Example 3 with AMViewBeanBase

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

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

the class GenericAgentProfileViewBean method nodeClicked.

/**
     * Handles tab selection.
     *
     * @param event Request Invocation Event.
     * @param nodeID Tab Id.
     */
public void nodeClicked(RequestInvocationEvent event, int nodeID) {
    String agentType = getAgentType();
    AgentTabManager mgr = AgentTabManager.getInstance();
    boolean forward = false;
    if (nodeID == TAB_GENERAL_ID) {
        removePageSessionAttribute(PS_TABNAME);
        setPageSessionAttribute(getTrackingTabIDName(), Integer.toString(nodeID));
    } else if (nodeID == TAB_GROUP_ID) {
        AgentGroupMembersViewBean vb = (AgentGroupMembersViewBean) getViewBean(AgentGroupMembersViewBean.class);
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
        forward = true;
    } else {
        List tabs = mgr.getTabs(agentType);
        String strIdx = Integer.toString(nodeID);
        strIdx = strIdx.substring(TAB_PREFIX.length());
        int idx = Integer.parseInt(strIdx);
        String tabName = (String) tabs.get(idx);
        setPageSessionAttribute(PS_TABNAME, tabName);
        setPageSessionAttribute(getTrackingTabIDName(), Integer.toString(nodeID));
    }
    if (!forward) {
        try {
            Class clazz = AgentsViewBean.getAgentCustomizedViewBean(agentType);
            AMViewBeanBase vb = (AMViewBeanBase) getViewBean(clazz);
            passPgSessionMap(vb);
            vb.forwardTo(getRequestContext());
        } catch (ClassNotFoundException e) {
            setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
        }
    }
}
Also used : AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase) List(java.util.List)

Example 5 with AMViewBeanBase

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

the class ServicesEditViewBean method forwardToServicesViewBean.

protected void forwardToServicesViewBean() {
    AMViewBeanBase vb = getCallingView();
    if (vb != null) {
        backTrail();
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } else {
        forwardTo();
    }
}
Also used : AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase)

Aggregations

AMViewBeanBase (com.sun.identity.console.base.AMViewBeanBase)24 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)10 AMViewConfig (com.sun.identity.console.base.AMViewConfig)6 AMIdentity (com.sun.identity.idm.AMIdentity)3 SSOToken (com.iplanet.sso.SSOToken)2 AgentsModel (com.sun.identity.console.agentconfig.model.AgentsModel)2 IdRepoException (com.sun.identity.idm.IdRepoException)2 List (java.util.List)2 StringTokenizer (java.util.StringTokenizer)2 SSOException (com.iplanet.sso.SSOException)1 AMPostViewBean (com.sun.identity.console.base.AMPostViewBean)1 EntitiesModel (com.sun.identity.console.idm.model.EntitiesModel)1 RMRealmModel (com.sun.identity.console.realm.model.RMRealmModel)1 ArrayList (java.util.ArrayList)1