Package org.apache.jetspeed.aggregator

Examples of org.apache.jetspeed.aggregator.PortletContent


    {
        ContentCacheKey cacheKey = portletContentCache.createCacheKey(requestContext, fragment.getId());       
        CacheElement cachedElement = portletContentCache.get(cacheKey);
        if (cachedElement != null)
        {
            PortletContent portletContent = (PortletContent)cachedElement.getContent();           
            fragment.setPortletContent(portletContent);
            ContentDispatcherCtrl dispatcher = new ContentDispatcherImpl(portletContent);
            HttpServletRequest servletRequest = requestContext.getRequestForWindow(portletWindow);

            this.addTitleService.setDynamicTitle(portletWindow, servletRequest, dispatcher.getPortletContent(fragment).getTitle());
View Full Code Here


    }
   
    public ContentDispatcherCtrl createDispatcher(RequestContext request, ContentFragment fragment, int expirationCache)
    {
        ContentCacheKey cacheKey = portletContentCache.createCacheKey(request, fragment.getId());               
        PortletContent content = new PortletContentImpl(this, cacheKey, expirationCache);
        ContentDispatcherCtrl dispatcher = new ContentDispatcherImpl(content);
        return dispatcher;
    }
View Full Code Here

        request.setAttribute(PortalReservedParameters.CONTENT_DISPATCHER_ATTRIBUTE, dispatcher);
        request.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, requestContext);       
        request.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, fragment);
        request.setAttribute(PortalReservedParameters.PATH_ATTRIBUTE, requestContext.getAttribute(PortalReservedParameters.PATH_ATTRIBUTE));
        request.setAttribute(PortalReservedParameters.PORTLET_WINDOW_ATTRIBUTE, portletWindow);
        PortletContent portletContent = dispatcher.getPortletContent(fragment);
        fragment.setPortletContent(portletContent);
        return new RenderingJobImpl(container, portletContent, fragment, request, response, requestContext, portletWindow, statistics);

    }
View Full Code Here

        request.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, fragment);
        request.setAttribute(PortalReservedParameters.CONTENT_DISPATCHER_ATTRIBUTE, dispatcher);
        request.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, requestContext);       
        request.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, fragment);
       
        PortletContent portletContent = dispatcher.getPortletContent(fragment);
        fragment.setPortletContent(portletContent);
        return new RenderingJob(container, portletContent, fragment, request, response, requestContext, portletWindow);

    }
View Full Code Here

                {
                    releaseBuffers(child, context);
                }
            }
        }
        PortletContent content = f.getPortletContent();
        if (content != null &&  content.getExpiration() == 0)
        {
            content.release();
        }
    }   
View Full Code Here

        {
            try
            {
                for (RenderingJob job : renderingJobs)
                {
                    PortletContent portletContent = job.getPortletContent();
                   
                    synchronized (portletContent)
                    {
                        if (!portletContent.isComplete())
                        {
                            portletContent.wait();
                        }
                    }
                }
            }
            catch (Exception e)
View Full Code Here

                       
                        boolean isTimeout = job.isTimeout();
                       
                        if (isTimeout)
                        {
                            PortletContent content = job.getPortletContent();
                           
                            if (interruptOnTimeout)
                            {
                                Thread worker = (Thread) job.getWorkerAttribute(WORKER_THREAD_ATTR);
                               
                                if (worker != null)
                                {
                                    synchronized (content)
                                    {
                                        if (!content.isComplete())
                                        {
                                            worker.interrupt();
                                            content.wait();
                                        }
                                    }
                                }
                            }
                            else
                            {
                                synchronized (content)
                                {
                                    content.complete();
                                }
                            }
                        }
                       
                        if (status == WorkEvent.WORK_COMPLETED || status == WorkEvent.WORK_REJECTED || isTimeout)
View Full Code Here

                {
                    PortletWindow window = job.getWindow();
                    log.warn("Portlet Rendering job to be interrupted by timeout (" + job.getTimeout() + "ms)" + (window != null ? ": "+window.getId().getStringId() : ""));
                }

                PortletContent content = job.getPortletContent();
                Thread worker = (Thread) job.getWorkerAttribute(WORKER_THREAD_ATTR);
               
                if (worker != null)
                {
                    synchronized (content)
                    {
                        if (!content.isComplete())
                        {
                            worker.interrupt();
                            content.wait();
                        }
                    }
                }
            }
            catch (Exception e)
View Full Code Here

            context.getResponse().setHeader( "JS_PORTLET_TITLE", StringEscapeUtils.escapeHtml( contentFragment.getPortletContent().getTitle() ) );
        }

        writeHeadElements(context, window);
        context.getResponse().getWriter().write(contentFragment.getRenderedContent());
        PortletContent content = contentFragment.getPortletContent();
       
        if (content != null && content.getExpiration() == 0)
        {
            contentFragment.getPortletContent().release();
        }       
    }
View Full Code Here

                    aggregateHeadElements(child, aggregatedHeadElements);
                }
            }
        }

        PortletContent portletContent = f.getPortletContent();
       
        // portletContent can be null if this method is invoked before the portlet window starts rendering
        if (portletContent != null)
        {
            // Brief explanation on head element aggregation algorithm (Thanks to Ate for the brilliant ideas!):
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.aggregator.PortletContent

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.