Package org.apache.pluto.om.window

Examples of org.apache.pluto.om.window.PortletWindow


    {
        try
        {
            if ( !fragment.getType().equals( ContentFragment.LAYOUT ) )
            {
                PortletWindow portletWindow = getPortletWindowAccessor().getPortletWindow( fragment );
                PortletDefinition pd = portletWindow.getPortletEntity().getPortletDefinition();
                if ( pd != null && getPortletFactory().isPortletApplicationRegistered((PortletApplication)pd.getPortletApplicationDefinition() ) )
                {
                    String portletApplicationContextPath = pd.getPortletApplicationDefinition().getWebApplicationDefinition().getContextRoot();
                    Portlet portlet = getPortletFactory().getPortletInstance( context.getConfig().getServletContext().getContext( portletApplicationContextPath ), pd ).getRealPortlet();           
                    if ( portlet != null && portlet instanceof SupportsHeaderPhase )
View Full Code Here


            MutableNavigationalState state = (MutableNavigationalState)request.getPortalURL().getNavigationalState();
            if (state != null)
            {
                boolean redirect = false;
                Page page = request.getPage();
                PortletWindow window = state.getPortletWindowOfResource();
                if (window != null && page.getFragmentById(window.getId().toString()) == null)
                {
                    // target window doesn't exists anymore or the target page is not accessible (anymore)
                    request.getResponse().sendError(HttpServletResponse.SC_NOT_FOUND);
                    return;
                }
                window = state.getPortletWindowOfAction();
                if (window != null && page.getFragmentById(window.getId().toString()) == null)
                {
                    // target window doesn't exists anymore or the target page is not accessible (anymore)
                    // remove any navigational state for the window
                    state.removeState(window);
                    // as this is an action request which cannot be handled, perform a direct redirect after sync state (for the other windows)
                    redirect = true;
                }
                window = state.getMaximizedWindow();
                if (window != null && page.getFragmentById(window.getId().toString()) == null)
                {
                    // target window doesn't exists anymore or the target page is not accessible (anymore)
                    // remove any navigational state for the window
                    state.removeState(window);
                }
                state.sync(request);
                if (redirect)
                {
                    // target page doesn't contain (anymore) the targeted windowOfAction
                    // this can also occur when a session is expired and the target page isn't accessible for the anonymous user
                    // Redirect the user back to the target page (with possibly retaining the other windows navigational state).
                    request.getResponse().sendRedirect(request.getPortalURL().getPortalURL());
                    return;
                }

                PortletWindow actionWindow = state.getPortletWindowOfAction();
                if (null == actionWindow)
                {
                    // set to null to denote that no action was requested
                    request.setActionWindow(null);
                }
View Full Code Here

                {
                    // check PortletWindow still exists...
                    // depends on PortletWindowAccessor cache to be active
                    PortletWindowAccessor accessor =
                        (PortletWindowAccessor)Jetspeed.getComponentManager().getComponent(PortletWindowAccessor.class);
                    PortletWindow maximizedWindow = accessor.getPortletWindow(pageState.maximizedWindowId);
                    if ( maximizedWindow == null )
                    {
                        // gone: remove sessionState
                        pageState.windowStates.remove(pageState.maximizedWindowId);
                        pageState.maximizedWindowId = null;
View Full Code Here

                                  servletResponse,
                                  getServletConfig());

        PortalURL currentURL = env.getRequestedPortalURL();
        PortalControlParameter control = new PortalControlParameter(currentURL);
        PortletWindow actionWindow = control.getPortletWindowOfAction();
        if (actionWindow!=null)
        {
            try {
                PortletContainerFactory.
                    getPortletContainer().
View Full Code Here

     */
    public void doView( RenderRequest request, RenderResponse response ) throws PortletException, IOException
    {
        RequestContext context = getRequestContext(request);
        response.setContentType(context.getMimeType());       
        PortletWindow window = context.getPortalURL().getNavigationalState().getMaximizedWindow();
        boolean maximized = (window != null);
        boolean solo = false;

        if (maximized)
        {
View Full Code Here

                {
                    // check PortletWindow still exists...
                    // depends on PortletWindowAccessor cache to be active
                    PortletWindowAccessor accessor =
                        (PortletWindowAccessor)Jetspeed.getComponentManager().getComponent(PortletWindowAccessor.class);
                    PortletWindow maximizedWindow = accessor.getPortletWindow(pageState.maximizedWindowId);
                    if ( maximizedWindow == null )
                    {
                        // gone: remove sessionState
                        pageState.windowStates.remove(pageState.maximizedWindowId);
                        pageState.maximizedWindowId = null;
View Full Code Here

        request.setRequestURI("/jetspeed/portal/stuff");

        portalURL.setRequest(request);
        portalURL.setCharacterEncoding("UTF-8");

        PortletWindow window = new PortletWindowImpl("111");

        HashMap parameters = new HashMap();
        parameters.put("test",new String[]{"one","two","three"});

        String portletURL = portalURL.createPortletURL(window,parameters,PortletMode.EDIT,WindowState.MAXIMIZED,true,false);
View Full Code Here

    protected void doTestUrl(PortalURL portalURL, HttpServletRequest request)
    {            
      portalURL.setRequest(request);
      portalURL.setCharacterEncoding("UTF-8");
     
      PortletWindow window = new PortletWindowImpl("111");
      NavigationalState nav = portalURL.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();
      assertNotNull("target window is null", target);
      assertEquals("target window should equal window 111", target.getId(), "111");

      PortletWindow maximizedWindow = nav.getMaximizedWindow();
      assertNotNull("maximized window is null", maximizedWindow);
      assertEquals("maximized window should equal window 111", maximizedWindow.getId(), "111");

      Iterator iter = nav.getParameterNames(target);
      assertTrue("There should be one parameter",iter.hasNext());
      while ( iter.hasNext() ) {
          assertEquals("parameter name should equals \"test\"", (String)iter.next(), "test");
View Full Code Here

        {               
            if (!layout.equals(fragment.getName()))
            {
                fragment.setName(layout);
                ContentFragment contentFragment = new ContentFragmentImpl(fragment, new HashMap());                   
                PortletWindow window = windowAccess.getPortletWindow(contentFragment);
                if (window != null)
                {
                    entityAccess.updatePortletEntity(window.getPortletEntity(), contentFragment);
                    entityAccess.storePortletEntity(window.getPortletEntity());
                    windowAccess.createPortletWindow(window.getPortletEntity(), contentFragment.getId());
                    count++;
                    if ( isBlank(sizes) )
                    {
                        fragment.setLayoutSizes(null);
                    }
View Full Code Here

        {
            throw new JetspeedException("No root ContentFragment found in ContentPage");
        }
        // handle maximized state
        NavigationalState nav = context.getPortalURL().getNavigationalState();
        PortletWindow window = nav.getMaximizedWindow();
        if (null != window)
        {
            renderMaximizedWindow(context, page, root, window);
        }
        else
View Full Code Here

TOP

Related Classes of org.apache.pluto.om.window.PortletWindow

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.