Search in sources :

Example 11 with AMViewBeanBase

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

the class STSEditViewBeanBase method handleButton3Request.

/**
     * Handles back button request.
     *
     * @param event Request invocation event
     */
public void handleButton3Request(RequestInvocationEvent event) throws ModelControlException, AMConsoleException {
    removePageSessionAttribute(PAGE_MODIFIED);
    AMViewBeanBase vb = getPreviousPage();
    passPgSessionMap(vb);
    vb.forwardTo(getRequestContext());
}
Also used : AMViewBeanBase(com.sun.identity.console.base.AMViewBeanBase)

Example 12 with AMViewBeanBase

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

the class AgentsViewBean method handleTblDataActionGroupHrefRequest.

/**
     * Forwards request to edit agent group view bean.
     *
     * @param event Request Invocation Event.
     */
public void handleTblDataActionGroupHrefRequest(RequestInvocationEvent event) {
    AgentsModel model = (AgentsModel) getModel();
    String idType = getDisplayIDType();
    String universalId = hexToString((String) getDisplayFieldValue(TBL_DATA_ACTION_HREF_GROUP));
    setPageSessionAttribute(AgentProfileViewBean.UNIVERSAL_ID, universalId);
    SSOToken ssoToken = model.getUserSSOToken();
    String realm = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
    StringTokenizer st = new StringTokenizer(universalId, "=,");
    st.nextToken();
    String agentGrpName = st.nextToken();
    try {
        AMIdentity amid = new AMIdentity(ssoToken, agentGrpName, IdType.AGENTGROUP, realm, null);
        String vbName = (String) agentViewBeans.get(idType);
        if (vbName == null) {
            vbName = GENERIC_VIEW_BEAN;
        }
        Class clazz = Thread.currentThread().getContextClassLoader().loadClass(vbName);
        AMViewBeanBase vb = (AMViewBeanBase) getViewBean(clazz);
        removePageSessionAttribute(GenericAgentProfileViewBean.PS_TABNAME);
        setPageSessionAttribute(PG_SESSION_SUPERCEDE_AGENT_TYPE, model.getAgentType(amid));
        passPgSessionMap(vb);
        vb.forwardTo(getRequestContext());
    } 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) AgentsModel(com.sun.identity.console.agentconfig.model.AgentsModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException)

Example 13 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 14 with AMViewBeanBase

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

the class AgentConfigInheritViewBean method handleButton3Request.

/**
     * Handles return to server configuration page request.
     *
     * @param event Request invocation event
     */
public void handleButton3Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        AMViewBeanBase vb = (AMViewBeanBase) getViewBean(Class.forName((String) getPageSessionAttribute(PG_ATTR_CONFIG_PAGE)));
        removePageSessionAttribute(PG_ATTR_CONFIG_PAGE);
        removePageSessionAttribute(PG_ATTR_PROPERTY_NAMES);
        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)

Example 15 with AMViewBeanBase

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

the class AgentDumpViewBean method handleButton1Request.

public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
    try {
        AMViewBeanBase vb = (AMViewBeanBase) getViewBean(Class.forName((String) getPageSessionAttribute(PG_ATTR_CONFIG_PAGE)));
        removePageSessionAttribute(PG_ATTR_CONFIG_PAGE);
        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)

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