Package org.apache.jetspeed.container.url

Examples of org.apache.jetspeed.container.url.PortalURL


            portletParameters = new HashMap();

            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);
                    portletParameters.put(name, values);

                }
            }
View Full Code Here


    * @param context
    * @return
    */
    public PortalURL createURL( HttpServletRequest request, String characterEncoding )
    {
        PortalURL url = null;

        try
        {
            Constructor constructor = urlClass.getConstructor(new Class[]{HttpServletRequest.class, String.class,
                    NavigationalState.class});
View Full Code Here

        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));
        PortletWindow target = nav.getPortletWindowOfAction();
View Full Code Here

            {
                portletParameters.put(portletParameter, request.getParameterValues(name) );
            }
        }

        PortalURL url = context.getPortalURL();
       
        Iterator iterator = url.getNavigationalState().getParameterNames(portletWindow);
        while (iterator.hasNext())
        {
            String name = (String)iterator.next();

            String[] values = url.getNavigationalState().getParameterValues(portletWindow, name);

            portletParameters.put(name, values );

        }
View Full Code Here

    * @param context
    * @return
    */
    public PortalURL createURL( HttpServletRequest request, String characterEncoding )
    {
        PortalURL url = (PortalURL) beanFactory.getBean(urlBeanName, PortalURL.class);
        url.setRequest(request);
        url.setCharacterEncoding(characterEncoding);
        return url;
    }
View Full Code Here

     */
    protected DecoratorAction createPortletModeAction(PortletWindow window, String actionName, PortletMode mode,
            String resourceBase)
    {
        DecoratorAction action = createDecoratorAction(resourceBase, actionName);
        PortalURL portalURL = getRequestContext().getPortalURL();
        action.setAction(renderResponse.encodeURL(portalURL.createPortletURL(window, mode, null, portalURL.isSecure())
                .toString()));
        return action;
    }
View Full Code Here

     */
    protected DecoratorAction createWindowStateAction(PortletWindow window, String actionName, WindowState state,
            String resourceBase)
    {
        DecoratorAction action = createDecoratorAction(resourceBase, actionName);
        PortalURL portalURL = getRequestContext().getPortalURL();
        action.setAction(renderResponse.encodeURL(portalURL.createPortletURL(window, null, state, portalURL.isSecure())
                .toString()));
        return action;
    }
View Full Code Here

            // 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);
                    portletParameters.put(name, values);

                }
            }
View Full Code Here

            {
                portletParameters.put(portletParameter, request.getParameterValues(name) );
            }
        }

        PortalURL url = context.getPortalURL();
       
        Iterator iterator = url.getNavigationalState().getParameterNames(portletWindow);
        while (iterator.hasNext())
        {
            String name = (String)iterator.next();

            String[] values = url.getNavigationalState().getParameterValues(portletWindow, name);

            portletParameters.put(name, values );

        }
View Full Code Here

    protected DecoratorAction createPortletModeAction(PortletWindow window, String actionName, PortletMode mode,
            RequestContext requestContext, Decoration decoration)
    {
        DecoratorAction action = createDecoratorAction(actionName, decoration);       
       
        PortalURL portalURL = requestContext.getPortalURL();
        action.setAction(portalURL.createPortletURL(window, mode, null, portalURL.isSecure())
                .toString());
        return action;
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.container.url.PortalURL

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.