Search in sources :

Example 6 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 7 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 8 with AMPostViewBean

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

the class AbstractEventHandlerEditViewBean method backToProfileViewBean.

private void backToProfileViewBean() {
    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 9 with AMPostViewBean

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

the class AbstractEventHandlerAddViewBean method backToProfileViewBean.

private void backToProfileViewBean() {
    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 10 with AMPostViewBean

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

the class SMDiscoveryServiceViewBean method handleEntityOperationRequest.

private void handleEntityOperationRequest(String realm, String univId, 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(EntityEditViewBean.UNIVERSAL_ID, univId);
        setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
        unlockPageTrail();
        EntityResourceOfferingViewBean vb = (EntityResourceOfferingViewBean) getViewBean(EntityResourceOfferingViewBean.class);
        passPgSessionMap(vb);
        vb.forwardTo(rc);
    } else {
        setPageSessionAttribute(PG_SESSION_PAGE_TRAIL_ID, req.getParameter(PG_SESSION_PAGE_TRAIL_ID));
        setPageSessionAttribute(EntityEditViewBean.UNIVERSAL_ID, univId);
        setPageSessionAttribute(AMAdminConstants.CURRENT_REALM, realm);
        setPageSessionAttribute(EntityEditViewBean.ENTITY_TYPE, rc.getRequest().getParameter("type"));
        EntityResourceOfferingModel entityModel = new EntityResourceOfferingModelImpl(req, getPageSessionAttributes());
        try {
            entityModel.assignService(univId);
        } catch (AMConsoleException e) {
            debug.error("SMDiscoveryServiceViewBean.handleEntityOperationRequest", e);
        }
        backTrail();
        AMPostViewBean vb = (AMPostViewBean) getViewBean(AMPostViewBean.class);
        passPgSessionMap(vb);
        vb.setTargetViewBeanURL("../idm/EntityServices");
        vb.forwardTo(rc);
    }
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) EntityResourceOfferingViewBean(com.sun.identity.console.idm.EntityResourceOfferingViewBean) EntityResourceOfferingModel(com.sun.identity.console.idm.model.EntityResourceOfferingModel) EntityResourceOfferingModelImpl(com.sun.identity.console.idm.model.EntityResourceOfferingModelImpl) AMConsoleException(com.sun.identity.console.base.model.AMConsoleException) 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