Package org.apache.jetspeed.container

Examples of org.apache.jetspeed.container.PortletWindow


    {    
        boolean responseCommitted = false;
        boolean failure = false;
        try
        {           
            PortletWindow actionWindow = request.getActionWindow();
            if (actionWindow != null)
            {
                HttpServletRequest servletRequest = request.getRequest();
                HttpServletResponse serlvetResponse = request.getResponse();
               
                actionWindow.setAttribute("JETSPEED_ACTION", request);
                container.doAction(actionWindow,servletRequest,serlvetResponse);
                // The container redirects the client after PortletAction processing
                // so there is no need to continue the pipeline
               
                // clear the cache for all portlets on the current page
View Full Code Here


                        request.getResponse().sendError(HttpServletResponse.SC_NOT_FOUND);
                        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

     */
    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

        return portletWindows.get(windowId);
    }
   
    public synchronized PortletWindow getPortletWindow(ContentFragment fragment)
    {
        PortletWindow window = portletWindows.get(fragment.getId());
        if (window == null)
        {
            window = createPortletWindow(fragment);
        }
        return window;
View Full Code Here

        return getInstantlyCreatedPortletWindow(windowId, portletUniqueName, true);
    }
   
    public PortletWindow resolvePortletWindow(String windowId)
    {
        PortletWindow window = portletWindows.get(windowId);
        if (window == null)
        {
            // ensure RootContentFragment is initialized
            getPage().getRootContentFragment();
            ContentFragment fragment = getPage().getContentFragmentById(windowId);
View Full Code Here

        return window;
    }
   
    private PortletWindow createPortletWindow(ContentFragment fragment)
    {
        PortletWindow window = null;
        PortletDefinition pd = rcc.getPortletRegistry().getPortletDefinitionByUniqueName(fragment.getName(), true);
        if (pd != null)
        {
            window = new PortletWindowImpl(this, fragment, pd);
        }
        else
        {
            // invalid window: create one anyway so that this error condition is only "recorded" once for this request
            window = new PortletWindowImpl(this, fragment);
            fragment.overrideRenderedContent("Failed to retrieve Portlet Definition for " + fragment.getName());
            log.error(fragment.getOverriddenContent());
        }
        portletWindows.put(window.getWindowId(), window);
        return window;
    }
View Full Code Here

                        }                       
                    }
                }
            }
        }
        PortletWindow window = null;
        if (portletUniqueName != null)
        {
            Fragment fragment = new PortletAggregatorFragmentImpl(windowId);
            fragment.setType(Fragment.PORTLET);
            fragment.setName(portletUniqueName);
            window = createPortletWindow(new ContentFragmentImpl(fragment, new HashMap(), true));
           
            if (register && !registered && window.isValid())
            {
                if (session == null)
                {
                    session = getRequest().getSession(true);
                }
View Full Code Here

                        // syncState will reset the sessionState.WindowState
                    }                        
                }
                else
                {
                    PortletWindow maximizedWindow = context.resolvePortletWindow(pageState.maximizedWindowId);
                    if (maximizedWindow == null || !maximizedWindow.isValid())
                    {
                        // gone: remove sessionState
                        pageState.windowStates.remove(pageState.maximizedWindowId);
                        pageState.maximizedWindowId = null;
                    }
                    else
                    {
                        requestStates.setMaximizedWindow(maximizedWindow);
                    }
                }
            }
            else if ( !requestMaximizedWindowId.equals( pageState.maximizedWindowId ))
            {
                // When can a non-maximized window request maximized state while another already has it?
                // Maybe from a decoration portlet which always needs to be viewable?
                requestState = requestStates.getPortletWindowNavigationalState(pageState.maximizedWindowId);
                sessionState = pageState.windowStates.get(pageState.maximizedWindowId);
                if ( requestState == null || requestState.getWindowState() == null )
                {
                    // need to clear it ourselves first
                    sessionState.setWindowState(null);
                }
            }
        }
       
        if ( requestStates.getMaximizedWindow() != null )
        {
            // store the new MAXIMIZED window
            pageState.maximizedWindowId = requestStates.getMaximizedWindow().getId().toString();
        }
       
        // now synchronize requestStates and sessionStates
        Iterator<String> iter = requestStates.getWindowIdIterator();
        String actionWindowId = requestStates.getActionWindow() != null ? requestStates.getActionWindow().getWindowId() : null;
        boolean actionRequestState = false;
        while ( iter.hasNext() )
        {
            requestState = requestStates.getPortletWindowNavigationalState(iter.next());
            sessionState = pageState.windowStates.get(requestState.getWindowId());
            if ( sessionState == null )
            {
                if ( storeParameters )
                {
                    sessionState = new PortletWindowExtendedNavigationalState();
                }
                else
                {
                    sessionState = new PortletWindowBaseNavigationalState();
                }
                sessionState.setActionScopedRequestAttributes(requestState.isActionScopedRequestAttributes());
                pageState.windowStates.put(requestState.getWindowId(),sessionState);
            }

            actionRequestState = actionWindowId != null && actionWindowId.equals(requestState.getWindowId());
            boolean changed = syncStates(actionRequestState, requestStates, requestState, sessionState);     
            if (changed)
            {
                removeFromCache(context, requestState.getWindowId(), cache);
                removeFromCache(context, page.getId(), decorationCache);
                if (storeParameters)
                {
                    ((PortletWindowExtendedNavigationalState)sessionState).resetDecoratorActionEncodings();
                }
            }
        }

        // now copy missing requestStates from the pageState
        synchronized(pageState.windowStates)
        {
            iter = pageState.windowStates.keySet().iterator();
            String windowId;
            while ( iter.hasNext() )
            {
                windowId = iter.next();
                requestState = requestStates.getPortletWindowNavigationalState(windowId);
                if ( requestState == null )
                {
                    PortletWindow window = context.resolvePortletWindow(windowId);
                    if (window != null)
                    {
                        requestState = new PortletWindowRequestNavigationalState(windowId);
                        requestState.setPortletDefinition(window.getPortletDefinition());
                        sessionState = pageState.windowStates.get(windowId);
                        requestState.setActionScopedRequestAttributes(sessionState.isActionScopedRequestAttributes());
                        requestStates.addPortletWindowNavigationalState(windowId, requestState);
                        boolean changed = syncStates(false, requestStates, requestState, sessionState);
                        if (changed)
View Full Code Here

        if (entity == null)
        {
            return;
        }
       
        PortletWindow window = context.resolvePortletWindow(entity);
       
        if (window == null)
        {       
            String name = context.getRequestParameter(PortalReservedParameters.PORTLET);
           
            if (name == null)
            {
                name = (String)context.getAttribute(PortalReservedParameters.PORTLET);
            }
           
            if (name == null)
            {
                return;
            }
           
            window = context.getInstantlyCreatedPortletWindow(entity, name);
        }
       
        ContentFragment contentFragment = window.getFragment();
        renderer.renderNow(contentFragment, context);
       
        if (titleInHeader && contentFragment.getPortletContent() != null)
        {           
            context.getResponse().setHeader( "JS_PORTLET_TITLE", StringEscapeUtils.escapeHtml( contentFragment.getPortletContent().getTitle() ) );
View Full Code Here

    private Collection getSupportedModes()
    {
        RequestContext rc = Jetspeed.getCurrentRequestContext();
        if (rc != null)
        {
            PortletWindow window  = rc.getCurrentPortletWindow();
            if (window != null)
            {
                return window.getPortletDefinition().getApplication().getSupportedPortletModes();
            }
        }
        return JetspeedActions.getStandardPortletModes();
    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.container.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.