Search in sources :

Example 1 with AMPostViewBean

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

the class AbstractEventHandlerSelectViewBean method handleButton2Request.

/**
     * Handles Cancel request.
     *
     * @param event Request invocation event
     */
@SuppressWarnings("unused")
public void handleButton2Request(RequestInvocationEvent event) {
    String url = (String) ((List) getPageSessionAttribute(PG_SESSION_PROFILE_VIEWBEANS)).get(0);
    AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
    backTrail();
    passPgSessionMap(vb);
    vb.setTargetViewBeanURL(url);
    vb.forwardTo(getRequestContext());
}
Also used : AMPostViewBean(com.sun.identity.console.base.AMPostViewBean)

Example 2 with AMPostViewBean

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

the class SMDiscoveryServiceViewBean method handleRealmOperationRequest.

private void handleRealmOperationRequest(String realm, RequestContext rc) {
    HttpServletRequest req = rc.getRequest();
    String op = req.getParameter("Op");
    if (op.equals(AMAdminConstants.OPERATION_EDIT)) {
        setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
        setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
        unlockPageTrail();
        RealmResourceOfferingViewBean vb = (RealmResourceOfferingViewBean) getViewBean(RealmResourceOfferingViewBean.class);
        passPgSessionMap(vb);
        vb.forwardTo(rc);
    } else {
        setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
        setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
        RealmResourceOfferingModel realmModel = new RealmResourceOfferingModelImpl(req, getPageSessionAttributes());
        try {
            realmModel.assignService(realm);
        } catch (AMConsoleException e) {
            debug.error("SMDiscoveryServiceViewBean.handleRealmOperationRequest", e);
        }
        backTrail();
        AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
        passPgSessionMap(vb);
        vb.setTargetViewBeanURL("../realm/Services");
        vb.forwardTo(rc);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) RealmResourceOfferingViewBean(com.sun.identity.console.realm.RealmResourceOfferingViewBean) RealmResourceOfferingModel(com.sun.identity.console.realm.model.RealmResourceOfferingModel) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) RealmResourceOfferingModelImpl(com.sun.identity.console.realm.model.RealmResourceOfferingModelImpl) AMPostViewBean(com.sun.identity.console.base.AMPostViewBean)

Example 3 with AMPostViewBean

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

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

the class SCConfigViewBean method forwardToProfile.

protected void forwardToProfile(String serviceName) {
    SCConfigModel model = (SCConfigModel) getModel();
    setPageSessionAttribute(AMServiceProfile.SERVICE_NAME, serviceName);
    unlockPageTrail();
    String url = model.getServicePropertiesViewBeanURL(serviceName);
    if ((url != null) && (url.length() != 0)) {
        AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
        passPgSessionMap(vb);
        vb.setTargetViewBeanURL(url);
        vb.forwardTo(getRequestContext());
    } else {
        // check if this service has any attributes to display.
        if (model.hasConfigAttributes(serviceName)) {
            SCServiceProfileViewBean vb = (SCServiceProfileViewBean) getViewBean(SCServiceProfileViewBean.class);
            passPgSessionMap(vb);
            vb.forwardTo(getRequestContext());
        } else {
            setPageSessionAttribute(AMAdminConstants.SAVE_VB_NAME, getClass().getName());
            ServicesNoAttributeViewBean vb = (ServicesNoAttributeViewBean) getViewBean(ServicesNoAttributeViewBean.class);
            passPgSessionMap(vb);
            vb.forwardTo(getRequestContext());
        }
    }
}
Also used : ServicesNoAttributeViewBean(com.sun.identity.console.realm.ServicesNoAttributeViewBean) SCConfigModel(com.sun.identity.console.service.model.SCConfigModel) AMPostViewBean(com.sun.identity.console.base.AMPostViewBean)

Example 5 with AMPostViewBean

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

the class SubConfigEditViewBean method backToProfileViewBean.

private void backToProfileViewBean() {
    List urls = (List) getPageSessionAttribute(PG_SESSION_PROFILE_VIEWBEANS);
    String url = (String) urls.remove(0);
    List parentIds = (List) getPageSessionAttribute(AMServiceProfile.PG_SESSION_SUB_CONFIG_IDS);
    parentIds.remove(0);
    AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
    backTrail();
    passPgSessionMap(vb);
    vb.setTargetViewBeanURL(url);
    vb.forwardTo(getRequestContext());
}
Also used : ArrayList(java.util.ArrayList) List(java.util.List) AMPostViewBean(com.sun.identity.console.base.AMPostViewBean)

Aggregations

AMPostViewBean (com.sun.identity.console.base.AMPostViewBean)14 AMConsoleException (com.sun.identity.console.base.model.AMConsoleException)5 List (java.util.List)4 ArrayList (java.util.ArrayList)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 OptionList (com.iplanet.jato.view.html.OptionList)2 HashSet (java.util.HashSet)2 Set (java.util.Set)2 AgentsModel (com.sun.identity.console.agentconfig.model.AgentsModel)1 AMViewBeanBase (com.sun.identity.console.base.AMViewBeanBase)1 AMViewConfig (com.sun.identity.console.base.AMViewConfig)1 EntityResourceOfferingViewBean (com.sun.identity.console.idm.EntityResourceOfferingViewBean)1 EntityResourceOfferingModel (com.sun.identity.console.idm.model.EntityResourceOfferingModel)1 EntityResourceOfferingModelImpl (com.sun.identity.console.idm.model.EntityResourceOfferingModelImpl)1 RealmResourceOfferingViewBean (com.sun.identity.console.realm.RealmResourceOfferingViewBean)1 ServicesNoAttributeViewBean (com.sun.identity.console.realm.ServicesNoAttributeViewBean)1 RealmResourceOfferingModel (com.sun.identity.console.realm.model.RealmResourceOfferingModel)1 RealmResourceOfferingModelImpl (com.sun.identity.console.realm.model.RealmResourceOfferingModelImpl)1 SCConfigModel (com.sun.identity.console.service.model.SCConfigModel)1 IdType (com.sun.identity.idm.IdType)1