Search in sources :

Example 16 with AMViewBeanBase

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

the class ServerConfigXMLViewBean method nodeClicked.

/**
     * Handles tab selected event. 
     *
     * @param event Request Invocation Event.
     * @param nodeID Selected Node ID.
     */
public void nodeClicked(RequestInvocationEvent event, int nodeID) {
    try {
        AMViewBeanBase vb = getTabNodeAssociatedViewBean("cscGeneral", nodeID);
        String 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("ServerEditGeneralViewBean.nodeClicked", e);
        forwardTo();
    }
}
Also used : AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 17 with AMViewBeanBase

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

the class ServerSiteViewBean method forwardToServerProfilePage.

private void forwardToServerProfilePage(String serverName) {
    setPageSessionAttribute(ServerEditGeneralViewBean.PG_ATTR_SERVER_NAME, serverName);
    String tabIdx = (String) getPageSessionAttribute(ServerEditGeneralViewBean.TAB_TRACKER);
    int idxTab = 421;
    if (tabIdx != null) {
        idxTab = Integer.parseInt(tabIdx);
    }
    AMViewConfig config = AMViewConfig.getInstance();
    try {
        AMViewBeanBase vb = config.getTabViewBean(this, "/", getModel(), ServerEditGeneralViewBean.TAB_NAME, idxTab, -1);
        unlockPageTrail();
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
    }
}
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 18 with AMViewBeanBase

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

the class SMDiscoveryDescriptionViewBeanBase method handleButton2Request.

/**
     * Handles cancel request.
     *
     * @param event Request Invocation Event.
     */
public void handleButton2Request(RequestInvocationEvent event) {
    AMViewBeanBase vb = getReturnToViewBean();
    backTrail();
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase)

Example 19 with AMViewBeanBase

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

the class AgentsViewBean method handleTblDataActionHrefRequest.

/**
     * Forwards request to edit agent view bean.
     *
     * @param event Request Invocation Event.
     */
public void handleTblDataActionHrefRequest(RequestInvocationEvent event) {
    AgentsModel model = (AgentsModel) getModel();
    String agentType = getDisplayIDType();
    String universalId = hexToString((String) getDisplayFieldValue(TBL_DATA_ACTION_HREF));
    setPageSessionAttribute(AgentProfileViewBean.UNIVERSAL_ID, universalId);
    SSOToken ssoToken = model.getUserSSOToken();
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    StringTokenizer st = new StringTokenizer(universalId, "=,");
    st.nextToken();
    String agentName = st.nextToken();
    try {
        AMIdentity amid = new AMIdentity(ssoToken, agentName, IdType.AGENTONLY, realm, null);
        if (agentType.equals(AgentsViewBean.AGENT_WEB) || (agentType.equals(AgentsViewBean.DEFAULT_ID_TYPE))) {
            if (isPropertiesLocallyStored(amid)) {
                setPageSessionAttribute(LOCAL_OR_NOT, PROP_LOCAL);
            } else {
                setPageSessionAttribute(LOCAL_OR_NOT, PROP_CENTRAL);
            }
        }
        Class clazz = getAgentCustomizedViewBean(model.getAgentType(amid));
        AMViewBeanBase vb = (AMViewBeanBase) getViewBean(clazz);
        setPageSessionAttribute(PG_SESSION_SUPERCEDE_AGENT_TYPE, model.getAgentType(amid));
        removePageSessionAttribute(GenericAgentProfileViewBean.PS_TABNAME);
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (IdRepoException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getErrorString(e));
        forwardTo();
    } catch (SSOException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getErrorString(e));
        forwardTo();
    } catch (AMConsoleException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getErrorString(e));
        forwardTo();
    } catch (ClassNotFoundException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getErrorString(e));
        forwardTo();
    }
}
Also used : AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase) StringTokenizer(java.util.StringTokenizer) SSOToken(com.iplanet.sso.SSOToken) AMIdentity(com.sun.identity.idm.AMIdentity) IdRepoException(com.sun.identity.idm.IdRepoException) SSOException(com.iplanet.sso.SSOException) AgentsModel(com.sun.identity.console.agentconfig.model.AgentsModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 20 with AMViewBeanBase

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

the class EntitiesViewBean method handleTblDataActionHrefRequest.

/**
     * Forwards request to edit policy view bean.
     *
     * @param event Request Invocation Event.
     */
public void handleTblDataActionHrefRequest(RequestInvocationEvent event) {
    EntitiesModel model = (EntitiesModel) getModel();
    String universalId = hexToString((String) getDisplayFieldValue(TBL_DATA_ACTION_HREF));
    setPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID, universalId);
    try {
        AMIdentity amid = IdUtils.getIdentity(model.getUserSSOToken(), universalId);
        String idType = amid.getType().getName();
        AMViewBeanBase vb = (AMViewBeanBase) getViewBean(EntityEditViewBean.class);
        setPageSessionAttribute(EntityOpViewBeanBase.ENTITY_NAME, amid.getName());
        setPageSessionAttribute(EntityOpViewBeanBase.ENTITY_TYPE, idType);
        unlockPageTrail();
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } catch (IdRepoException e) {
        setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getErrorString(e));
        forwardTo();
    }
}
Also used : AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase) AMIdentity(com.sun.identity.idm.AMIdentity) IdRepoException(com.sun.identity.idm.IdRepoException) EntitiesModel(com.sun.identity.console.idm.model.EntitiesModel)

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