Package org.apache.jetspeed.request

Examples of org.apache.jetspeed.request.RequestContextComponent


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


    }
   
    public void runTest(String xml, String defName, String method)
    throws Exception
    {
        RequestContextComponent rcc = (RequestContextComponent) new Mock(RequestContextComponent.class).proxy();
       
        MockServletConfig config = new MockServletConfig();
        MockServletContext context = new MockServletContext();
        MockHttpSession session = new MockHttpSession();
        session.setupServletContext(context);
View Full Code Here

    // Helper method
    public static RequestContext setupRequestContext(String p_sAction,
            String p_sPortletId, String p_sCol, String p_sRow)
    {
        RequestContextComponent rcc = (RequestContextComponent) new Mock(RequestContextComponent.class).proxy();
       
        MockServletConfig config = new MockServletConfig();
        MockServletContext context = new MockServletContext();
        MockHttpSession session = new MockHttpSession();
        session.setupServletContext(context);
View Full Code Here

    }
   
    public void runTest(String xml, String defName, String method)
    throws Exception
    {
        RequestContextComponent rcc = (RequestContextComponent) new Mock(RequestContextComponent.class).proxy();
       
        MockServletConfig config = new MockServletConfig();
        MockServletContext context = new MockServletContext();
        MockHttpSession session = new MockHttpSession();
        session.setupServletContext(context);
View Full Code Here

    // Helper method
    public static RequestContext setupRequestContext(String p_sAction,
            String p_sPortletId, String p_sCol, String p_sRow)
    {
        RequestContextComponent rcc = (RequestContextComponent) new Mock(RequestContextComponent.class).proxy();
       
        MockServletConfig config = new MockServletConfig();
        MockServletContext context = new MockServletContext();
        MockHttpSession session = new MockHttpSession();
        session.setupServletContext(context);
View Full Code Here

        if (Jetspeed.getEngine() != null)
        {
            request.setAttribute(PortalReservedParameters.PIPELINE, PortalReservedParameters.LOGIN_PIPELINE);
            Engine engine = Jetspeed.getEngine();
            RequestContextComponent contextComponent = null;
            RequestContext context = null;
            try
            {
                String jetuiMode = Jetspeed.getConfiguration().getString(PortalConfigurationConstants.JETUI_CUSTOMIZATION_METHOD, PortalConfigurationConstants.JETUI_CUSTOMIZATION_SERVER);
                boolean redirectHomeSpace = Jetspeed.getConfiguration().getBoolean(PortalConfigurationConstants.JETUI_REDIRECT_HOME_SPACE, true);
                if (redirectHomeSpace && jetuiMode.equals(PortalConfigurationConstants.JETUI_CUSTOMIZATION_AJAX)) {
                    String destination = (String)session.getAttribute(LoginConstants.DESTINATION);
                    if (destination == null) destination = "/";
                    String username = (String)session.getAttribute(LoginConstants.USERNAME);
                    if (username != null) {

                        if (!destination.endsWith("/"))
                            destination += "/";
                        destination += (Folder.RESERVED_USER_FOLDER_NAME + "/" + username);
                        session.setAttribute(LoginConstants.DESTINATION, destination);
                    }
                }
                contextComponent = (RequestContextComponent) Jetspeed.getComponentManager().getComponent(RequestContextComponent.class);
                context = contextComponent.create(request, response, getServletConfig());
                engine.service(context);
            }           
            catch (JetspeedException e)
            {
                log.warn("Jetspeed engine does not work properly.", e);
                // forward to JetspeedServlet
                response.sendRedirect(response.encodeURL(request.getContextPath() + "/"));
            }
            finally
            {
                if (contextComponent != null)
                {
                    contextComponent.setRequestContext(null);
                }
            }
        }
        else
        {
View Full Code Here

    }

    public void testRunner()
    throws Exception
    {
        RequestContextComponent rcc = (RequestContextComponent) new Mock(RequestContextComponent.class).proxy();       
        MockServletConfig config = new MockServletConfig();
        MockServletContext context = new MockServletContext();
        MockHttpSession session = new MockHttpSession();
        session.setupServletContext(context);
        final MockHttpServletRequest request = new MockHttpServletRequest();
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.