Examples of JetspeedRequestContext


Examples of org.apache.jetspeed.request.JetspeedRequestContext

        request.setContextPath("/jetspeed");
        request.setServletPath("/portal");
        request.setPathInfo("stuff");
        request.setRequestURI("/jetspeed/portal/stuff");

        JetspeedRequestContext context = new JetspeedRequestContext(request, response, config, null );
       
        // create base PortletURL
        PortalURL url = component.createURL(context.getRequest(), context.getCharacterEncoding());
        context.setPortalURL(url);

        PortletWindow window = new PortletWindowImpl("111");
        PortletWindow window2 = new PortletWindowImpl("222");
        PortletWindow window3 = new PortletWindowImpl("333");
        HashMap parameters = new HashMap();
        parameters.put("test",new String[]{"one","two","three"});

        String portletURL = url.createPortletURL(window,parameters,PortletMode.EDIT,WindowState.MAXIMIZED,true,false);
       
        String navStateParameterName = Jetspeed.getContext().getConfigurationProperty("portalurl.navigationalstate.parameter.name", AbstractPortalURL.DEFAULT_NAV_STATE_PARAMETER);

        if ( useQueryStringPortalURL )
        {
            request.setupAddParameter(navStateParameterName,portletURL.substring(portletURL.indexOf('=')+1));           
        }
        else
        {
            request.setPathInfo(portletURL.substring(portletURL.indexOf("/portal")+7));
        }
       
        context = new JetspeedRequestContext(request, response, config, null );
               
        url = component.createURL(context.getRequest(), context.getCharacterEncoding());
        context.setPortalURL(url);
        NavigationalState nav = url.getNavigationalState();

        // Check that they come out correctly
        assertTrue("window mode is not set", nav.getMode(window).equals(PortletMode.EDIT));
        assertTrue("window state is not set", nav.getState(window).equals(WindowState.MAXIMIZED));
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

            // been accessed, flush the cache and rebuild the map.
            currentRequest = getRequest();           
            portletParameters = new HashMap();

            // get portlet params
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute("org.apache.jetspeed.request.RequestContext");
            if (context != null)
            {
                PortalURL url = context.getPortalURL();
                Iterator iter = url.getNavigationalState().getParameterNames(portletWindow);
                while (iter.hasNext())
                {
                    String name = (String) iter.next();
                    String[] values = url.getNavigationalState().getParameterValues(portletWindow, name);
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

    public Object getAttribute( String name )
    {
        Object value = super.getAttribute(name);
        if (name.equals(PortletRequest.USER_INFO))
        {
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
            if (null != context)
            {
                String entityID = "--NULL--";
                PortletEntity entity = portletWindow.getPortletEntity();
                if (entity != null)
                {
                    entityID = entity.getId().toString();
                }
                PortletApplicationEntity portletAppEntity = portletWindow.getPortletEntity()
                        .getPortletApplicationEntity();
                PortletApplicationDefinition portletAppDef = entity.getPortletDefinition()
                        .getPortletApplicationDefinition();

                if (null != portletAppDef)
                {
                    value = context.getUserInfoMap(portletAppDef.getId());
                    if (log.isDebugEnabled() && (null != value))
                        log.debug(PortletRequest.USER_INFO + " map size: " + ((Map) value).size());
                }
                else
                {
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        }

        request.setSession(session);
        MockHttpServletResponse response = new MockHttpServletResponse();

        RequestContext a_oRC = new JetspeedRequestContext(request, response,
                config, null);

        Page a_oPage = setupPage();
        ContentPage a_oContentPage = new ContentPageImpl(a_oPage);

        a_oRC.setPage(a_oContentPage);

        return a_oRC;
    }
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        request.setContextPath("/jetspeed");
        request.setServletPath("/portal");
        request.setPathInfo("stuff");
        request.setRequestURI("/jetspeed/portal/stuff");

        JetspeedRequestContext context = new JetspeedRequestContext(request, response, config, null );
       
        // create base PortletURL
        PortalURL url = component.createURL(context.getRequest(), context.getCharacterEncoding());
        context.setPortalURL(url);

        PortletWindow window = new PortletWindowImpl("111");
        PortletWindow window2 = new PortletWindowImpl("222");
        PortletWindow window3 = new PortletWindowImpl("333");
        HashMap parameters = new HashMap();
        parameters.put("test",new String[]{"one","two","three"});

        String portletURL = url.createPortletURL(window,parameters,PortletMode.EDIT,WindowState.MAXIMIZED,true,false);
       
        String navStateParameterName = Jetspeed.getContext().getConfigurationProperty("portalurl.navigationalstate.parameter.name", AbstractPortalURL.DEFAULT_NAV_STATE_PARAMETER);

        if ( useQueryStringPortalURL )
        {
            request.setupAddParameter(navStateParameterName,portletURL.substring(portletURL.indexOf('=')+1));           
        }
        else
        {
            request.setPathInfo(portletURL.substring(portletURL.indexOf("/portal")+7));
        }
       
        context = new JetspeedRequestContext(request, response, config, null );
               
        url = component.createURL(context.getRequest(), context.getCharacterEncoding());
        context.setPortalURL(url);
        NavigationalState nav = url.getNavigationalState();

        // Check that they come out correctly
        assertTrue("window mode is not set", nav.getMode(window).equals(PortletMode.EDIT));
        assertTrue("window state is not set", nav.getState(window).equals(WindowState.MAXIMIZED));
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

            // been accessed, flush the cache and rebuild the map.
            currentRequest = getRequest();           
            portletParameters = new HashMap();

            // get portlet params
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute("org.apache.jetspeed.request.RequestContext");
            if (context != null)
            {
                PortalURL url = context.getPortalURL();
                Iterator iter = url.getNavigationalState().getParameterNames(portletWindow);
                while (iter.hasNext())
                {
                    String name = (String) iter.next();
                    String[] values = url.getNavigationalState().getParameterValues(portletWindow, name);
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

    public Object getAttribute( String name )
    {
        Object value = super.getAttribute(name);
        if (name.equals(PortletRequest.USER_INFO))
        {
            JetspeedRequestContext context = (JetspeedRequestContext) getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
            if (null != context)
            {
                String entityID = "--NULL--";
                PortletEntity entity = portletWindow.getPortletEntity();
                if (entity != null)
                {
                    entityID = entity.getId().toString();
                }
                PortletApplicationEntity portletAppEntity = portletWindow.getPortletEntity()
                        .getPortletApplicationEntity();
                PortletApplicationDefinition portletAppDef = entity.getPortletDefinition()
                        .getPortletApplicationDefinition();

                if (null != portletAppDef)
                {
                    value = context.getUserInfoMap(portletAppDef.getId());
                    if (log.isDebugEnabled() && (null != value))
                        log.debug(PortletRequest.USER_INFO + " map size: " + ((Map) value).size());
                }
                else
                {
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        request.setupAddParameter("name", defName);
        request.setSession(session);
        MockHttpServletResponse response = new MockHttpServletResponse();

        final RequestContext rc =
            new JetspeedRequestContext(rcc, request, response, config, null);
       
        Set principals = new HashSet();
        principals.add(new TestUser("admin"));
        principals.add(new TestRole("admin"));
        Subject subject = new Subject(true, principals, new HashSet(), new HashSet());
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        }

        request.setSession(session);
        MockHttpServletResponse response = new MockHttpServletResponse();

        RequestContext a_oRC = new JetspeedRequestContext(rcc, request, response,
                config, null);
       
        a_oRC.setSubject(new Subject());
       
        Page a_oPage = setupPage();
        ContentPage a_oContentPage = new ContentPageImpl(a_oPage);

        a_oRC.setPage(a_oContentPage);

        return a_oRC;
    }
View Full Code Here

Examples of org.apache.jetspeed.request.JetspeedRequestContext

        request.setupAddParameter("name", defName);
        request.setSession(session);
        MockHttpServletResponse response = new MockHttpServletResponse();

        final RequestContext rc =
            new JetspeedRequestContext(rcc, request, response, config, null);
       
        Set principals = new HashSet();
        principals.add(new TestUser("admin"));
        principals.add(new TestRole("admin"));
        principals.add(new TestRole("user"));       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.