Package org.apache.jetspeed.request

Examples of org.apache.jetspeed.request.RequestContextComponent


            data.setMessage(message);
            data.setStackTrace(org.apache.turbine.util.StringUtils.stackTrace(other), other);
            return;
        }
       
        RequestContextComponent contextComponent = null;
        RequestContext context = null;
       
        try
        {           
            HttpServletRequest request = data.getRequest();
            HttpServletResponse response = data.getResponse();           
            NavigationalStateComponent nav = (NavigationalStateComponent)Jetspeed.getComponentManager().getComponent(NavigationalStateComponent.class);
           
            //
            // Handle Action Phase via Action Pipeline
            //
           
            // System.out.println("*** ACTION PARAM FOUND!!!!!!!!!!! ****");               
            ServletConfig config = data.getServletConfig();
            Engine engine = Jetspeed.getEngine();
            contextComponent = (RequestContextComponent)Jetspeed.getComponentManager().getComponent(RequestContextComponent.class);
            context = contextComponent.create(request, response, config);

           
            //
            // Sync up navigational state for J1 Portlet Control decorators
            //           
            //if (state.)
            //String state[] = nav.parsePortalParameter(request, "_ns"); // TODO don't hard code
            //if (state != null)
            context.setAttribute(PortalReservedParameters.PIPELINE, PortalReservedParameters.ACTION_PIPELINE);                               
            engine.service(context);
           
            PortalURL url = context.getPortalURL();
            if (url != null)
            {
                NavigationalState state = url.getNavigationalState();               
                PortletWindow actionWindow = state.getPortletWindowOfAction();
                if (actionWindow == null)
                {
                    Iterator windows = state.getWindowIdIterator();
                    while (windows.hasNext())
                    {
                        String windowId = (String)windows.next();
                        PortletMode mode = state.getMode(windowId);
                        WindowState wstate = state.getState(windowId);
                        if (wstate != null || mode != null)
                        {
                            String windowState = "";
                            if (wstate != null)
                                windowState = wstate.toString();
                           
                            String portletMode = "";
                            if (mode != null)
                                portletMode = mode.toString();
                           
                            Portlets portlets = ((JetspeedRunData)data).getProfile().getDocument().getPortlets();
                            traverse(portlets, windowId, windowState, portletMode, (JetspeedRunData)data);                           
                        }
                    }
                   
                }
                if (actionWindow != null)
                {
                    String windowId = actionWindow.getId().toString();
                    //String windowId = nav.getWindowIdFromKey(state[0]);
                    //System.out.println("got token = " + state[0]+ ", window id = " + windowId + ", action = " + state[1]);
                    Portlets portlets = ((JetspeedRunData)data).getProfile().getDocument().getPortlets();
                    //traverse(portlets, windowId, state[1], (JetspeedRunData)data);
                    String windowState = state.getState(actionWindow).toString();
                    if (windowState == null)
                    {
                        windowState = "";
                    }
                    PortletMode mode = state.getMode(actionWindow);
                    String portletMode = "";
                    if (mode != null)
                        portletMode = mode.toString();
                   
                    traverse(portlets, windowId, windowState, portletMode, (JetspeedRunData)data);
                    throwit = true;
                }               
            }
           
        }
        catch (Throwable t)
        {
            t.printStackTrace();
            log.error("error in fusion access controller", t);
        }
        finally
        {
            if (contextComponent != null && context != null)
            {
                contextComponent.release(context);
            }           
            if (throwit)               
                throw new Exception("redirecting");
        }               
    }
View Full Code Here


        return createActionList(actions, jdata, portlet);
    }
   
    public void serviceNavsPipeline(RunData data, String entityId)
    {       
        RequestContextComponent contextComponent = null;
        RequestContext context = null;
        try
        {
            HttpServletRequest request = data.getRequest();
            HttpServletResponse response =  data.getResponse();
            ServletConfig config = data.getServletConfig();
            Engine engine = Jetspeed.getEngine();
            contextComponent = (RequestContextComponent)Jetspeed.getComponentManager().getComponent(RequestContextComponent.class);
            context = (RequestContext) data.getRequest().getAttribute(JetspeedFusionPortlet.FUSION_NAV_STATE);
            if (context == null)
            {
                context = contextComponent.create(request, response, config);
                data.getRequest().setAttribute(JetspeedFusionPortlet.FUSION_NAV_STATE, context);               
            }
           
            context.setAttribute(PortalReservedParameters.PORTLET_ENTITY, entityId);
            context.setAttribute(PortalReservedParameters.PIPELINE, FusionResources.NAVS_PIPELINE);
View Full Code Here

   
    public ConcreteElement service(RunData data, String entityId)
    {
        String result = "";
       
        RequestContextComponent contextComponent = null;
        RequestContext context = null;
        try
        {
            HttpServletRequest request = data.getRequest();
            HttpServletResponse response =  data.getResponse();
            ServletConfig config = data.getServletConfig();
            Engine engine = Jetspeed.getEngine();
            contextComponent = (RequestContextComponent)Jetspeed.getComponentManager().getComponent(RequestContextComponent.class);
           
            context = (RequestContext) data.getRequest().getAttribute(FUSION_NAV_STATE);
            if (context == null)
            {
                context = contextComponent.create(request, response, config);
                data.getRequest().setAttribute(JetspeedFusionPortlet.FUSION_NAV_STATE, context);                               
            }
            context.setAttribute(PortalReservedParameters.PORTLET_ENTITY, entityId);
            context.getRequest().removeAttribute(PortalReservedParameters.PIPELINE);
           
            engine.service(context);
           
        }
        catch (Throwable t)
        {
            t.printStackTrace();           
            return new JetspeedClearElement(t.getMessage());           
        }
        finally
        {
            if (contextComponent != null && context != null)
            {
                contextComponent.release(context);
            }                       
        }

        return new JetspeedClearElement(result);
    }
View Full Code Here

        {
            request.setAttribute(PortalReservedParameters.PIPELINE, PortalReservedParameters.LOGIN_PIPELINE);
            Engine engine = Jetspeed.getEngine();
            try
            {
                RequestContextComponent contextComponent = (RequestContextComponent) Jetspeed.getComponentManager()
                        .getComponent(RequestContextComponent.class);
                RequestContext context = contextComponent.create(request, response, getServletConfig());
                engine.service(context);
                contextComponent.release(context);
            }
            catch (JetspeedException e)
            {
                log.warn("Jetspeed engine does not work properly.", e);
                // forward to JetspeedServlet
View Full Code Here

    /**
     * @see org.apache.jetspeed.engine.Engine#getCurrentRequestContext()
     */
    public RequestContext getCurrentRequestContext()
    {
        RequestContextComponent contextComponent = (RequestContextComponent) getComponentManager()
            .getComponent(RequestContextComponent.class);
        return contextComponent.getRequestContext();
    }
View Full Code Here

        {
            request.setAttribute(PortalReservedParameters.PIPELINE, PortalReservedParameters.LOGIN_PIPELINE);
            Engine engine = Jetspeed.getEngine();
            try
            {
                RequestContextComponent contextComponent = (RequestContextComponent) Jetspeed.getComponentManager()
                        .getComponent(RequestContextComponent.class);
                RequestContext context = contextComponent.create(request, response, getServletConfig());
                engine.service(context);
                contextComponent.release(context);
            }
            catch (JetspeedException e)
            {
                log.warn("Jetspeed engine does not work properly.", e);
                // forward to JetspeedServlet
View Full Code Here

                res.setHeader("Cache-Control", "no-cache,no-store,private"); // HTTP/1.1 modern browser/proxy
                res.setHeader("Pragma", "no-cache");                         // HTTP/1.0 non-standard proxy
                res.setHeader("Expires", "0");                               // HTTP/1.0 browser/proxy

                // send request through pipeline
                RequestContextComponent contextComponent = (RequestContextComponent) Jetspeed.getComponentManager()
                        .getComponent(RequestContextComponent.class);
                RequestContext context = contextComponent.create(req, res, getServletConfig());
                engine.service(context);
                contextComponent.release(context);
            }

        }
        catch (JetspeedException e)
        {
View Full Code Here

    {
        this.request = request;
        this.config = config;
       
        // TODO: assemble this dependency when this provider is converted to a component
        RequestContextComponent rcc = (RequestContextComponent)Jetspeed.getComponentManager().getComponent(RequestContextComponent.class);
        this.context = rcc.getRequestContext(request);
    }
View Full Code Here

    {
        this.request = request;
        this.config = config;
       
        // TODO: assemble this dependency when this provider is converted to a component
        RequestContextComponent rcc = (RequestContextComponent)Jetspeed.getComponentManager().getComponent(RequestContextComponent.class);
        this.context = rcc.getRequestContext(request);
    }
View Full Code Here

    /**
     * @see org.apache.jetspeed.engine.Engine#getCurrentRequestContext()
     */
    public RequestContext getCurrentRequestContext()
    {
        RequestContextComponent contextComponent = (RequestContextComponent) getComponentManager()
            .getComponent(RequestContextComponent.class);
        return contextComponent.getRequestContext();
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.request.RequestContextComponent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.