Package org.apache.jetspeed.aggregator

Examples of org.apache.jetspeed.aggregator.ContentDispatcherCtrl


   
    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


                                              PortletDefinitionComposite portletDefinition,
                                              PortletContent portletContent, boolean contentIsCached, long timeoutMetadata)
        throws PortletAccessDeniedException, FailedToRetrievePortletWindow, PortletEntityNotStoredException       
    {
        int expirationCache = getExpirationCache(portletDefinition);
        ContentDispatcherCtrl dispatcher = createDispatcher(requestContext, fragment, expirationCache);
        HttpServletRequest request = requestContext.getRequestForWindow(portletWindow);
        HttpServletResponse response = dispatcher.getResponseForWindow(portletWindow, requestContext);

        return buildRenderingJob( portletWindow, fragment, request, response,
                                  requestContext, isParallel,
                                  portletDefinition, dispatcher,
                                  portletContent, expirationCache, contentIsCached, timeoutMetadata );       
View Full Code Here

     */
    public void renderNow( ContentFragment fragment, RequestContext requestContext )
    {
        HttpServletRequest servletRequest =null;
        HttpServletResponse servletResponse = null;
        ContentDispatcherCtrl dispatcher = null;   
        boolean contentIsCached = false;
        try
        {
            PortletWindow portletWindow = getPortletWindow(fragment);
            PortletDefinitionComposite portletDefinition =
                (PortletDefinitionComposite) portletWindow.getPortletEntity().getPortletDefinition();          
            if (checkSecurityConstraints && !checkSecurityConstraint(portletDefinition, fragment))
            {
                throw new PortletAccessDeniedException("Access Denied.");
            }
            if (portletTracking.isOutOfService(portletWindow))
            {
                log.info("Taking portlet out of service: " + portletDefinition.getUniqueName() + " for window " + fragment.getId());
                fragment.overrideRenderedContent(OUT_OF_SERVICE_MESSAGE);
                return;
            }
            long timeoutMetadata = this.getTimeoutOnJob(portletDefinition);
            portletTracking.setExpiration(portletWindow, timeoutMetadata);           
            int expirationCache = getExpirationCache(portletDefinition);
            if (expirationCache != 0)
            {
                if (retrieveCachedContent(requestContext, fragment, portletWindow, expirationCache, portletDefinition))
                    return;
                contentIsCached = true;
            }
            if (dispatcher == null)
            {
                dispatcher = createDispatcher(requestContext, fragment, expirationCache);
            }
            servletRequest = requestContext.getRequestForWindow(portletWindow);
            servletResponse = dispatcher.getResponseForWindow(portletWindow, requestContext);
            RenderingJob rJob =
                buildRenderingJob(portletWindow, fragment, servletRequest, servletResponse,
                                  requestContext, false, portletDefinition, dispatcher, null,
                                  expirationCache, contentIsCached, timeoutMetadata);
            rJob.execute();
View Full Code Here

    public RenderingJob createRenderingJob(ContentFragment fragment, RequestContext requestContext)
    {
        RenderingJob job = null;
        HttpServletRequest servletRequest =null;
        HttpServletResponse servletResponse = null;
        ContentDispatcherCtrl dispatcher = null
        boolean contentIsCached = false;      
        try
        {
            PortletWindow portletWindow = getPortletWindow(fragment);
            PortletDefinitionComposite portletDefinition =
View Full Code Here

        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);
            HttpServletResponse servletResponse = dispatcher.getResponseForWindow(portletWindow, requestContext);

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

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

                                              PortletDefinitionComposite portletDefinition,
                                              PortletContent portletContent, boolean contentIsCached, long timeoutMetadata)
        throws PortletAccessDeniedException, FailedToRetrievePortletWindow, PortletEntityNotStoredException       
    {
        int expirationCache = getExpirationCache(portletDefinition);
        ContentDispatcherCtrl dispatcher = createDispatcher(requestContext, fragment, expirationCache);
        HttpServletRequest request = requestContext.getRequestForWindow(portletWindow);
        HttpServletResponse response = dispatcher.getResponseForWindow(portletWindow, requestContext);

        return buildRenderingJob( portletWindow, fragment, request, response,
                                  requestContext, isParallel,
                                  portletDefinition, dispatcher,
                                  portletContent, expirationCache, contentIsCached, timeoutMetadata );       
View Full Code Here

     */
    public void renderNow( ContentFragment fragment, RequestContext requestContext )
    {
        HttpServletRequest servletRequest =null;
        HttpServletResponse servletResponse = null;
        ContentDispatcherCtrl dispatcher = null;   
        boolean contentIsCached = false;
        try
        {
            PortletWindow portletWindow = getPortletWindow(fragment);
            PortletDefinitionComposite portletDefinition =
                (PortletDefinitionComposite) portletWindow.getPortletEntity().getPortletDefinition();          
            if (checkSecurityConstraints && !checkSecurityConstraint(portletDefinition, fragment))
            {
                throw new PortletAccessDeniedException("Access Denied.");
            }
            if (portletTracking.isOutOfService(portletWindow))
            {
                log.info("Taking portlet out of service: " + portletDefinition.getUniqueName() + " for window " + fragment.getId());
                fragment.overrideRenderedContent(OUT_OF_SERVICE_MESSAGE);
                return;
            }
            long timeoutMetadata = this.getTimeoutOnJob(portletDefinition);
            portletTracking.setExpiration(portletWindow, timeoutMetadata);           
            int expirationCache = getExpirationCache(portletDefinition);
            if (expirationCache != 0)
            {
                if (retrieveCachedContent(requestContext, fragment, portletWindow, expirationCache, portletDefinition))
                    return;
                contentIsCached = true;
            }
            if (dispatcher == null)
            {
                dispatcher = createDispatcher(requestContext, fragment, expirationCache);
            }
            servletRequest = requestContext.getRequestForWindow(portletWindow);
            servletResponse = dispatcher.getResponseForWindow(portletWindow, requestContext);
            RenderingJob rJob =
                buildRenderingJob(portletWindow, fragment, servletRequest, servletResponse,
                                  requestContext, false, portletDefinition, dispatcher, null,
                                  expirationCache, contentIsCached, timeoutMetadata);
            rJob.execute();
View Full Code Here

        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());
            return true;
        }       
        return false;
    }
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

TOP

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

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.