org.apache.jetspeed.aggregator.impl
Class PortletRendererImpl

java.lang.Object
  extended by org.apache.jetspeed.aggregator.impl.PortletRendererImpl
All Implemented Interfaces:
org.apache.jetspeed.aggregator.PortletRenderer

public class PortletRendererImpl
extends Object
implements org.apache.jetspeed.aggregator.PortletRenderer

PortletRendererService
Jetspeed-2 Rendering service.

This service process all portlet rendering requests and interfaces with the portlet container to generate the resulting markup

Version:
$Id: PortletRendererImpl.java,v 1.30 2005/05/20 14:54:22 ate Exp $
Author:
Rapha?l Luta , David Sean Taylor, Woonsan Ko

Field Summary
protected  org.apache.jetspeed.security.SecurityAccessController accessController
          For security constraint checks
protected  DynamicTitleService addTitleService
           
protected  boolean checkSecurityConstraints
          flag indicating whether to check jetspeed-portlet.xml security constraints before rendering a portlet.
protected  org.apache.pluto.PortletContainer container
           
protected static org.apache.commons.logging.Log log
           
static String OUT_OF_SERVICE_MESSAGE
           
protected  boolean overrideTitles
          OutOfService Cache
protected  org.apache.jetspeed.cache.JetspeedCache portletContentCache
          JSR 168 Portlet Content Cache
protected  org.apache.jetspeed.aggregator.PortletTrackingManager portletTracking
           
protected  org.apache.jetspeed.statistics.PortalStatistics statistics
           
protected  org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor
           
protected  org.apache.jetspeed.aggregator.WorkerMonitor workMonitor
           
 
Constructor Summary
PortletRendererImpl(org.apache.pluto.PortletContainer container, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor, org.apache.jetspeed.aggregator.WorkerMonitor workMonitor)
           
PortletRendererImpl(org.apache.pluto.PortletContainer container, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor, org.apache.jetspeed.aggregator.WorkerMonitor workMonitor, org.apache.jetspeed.statistics.PortalStatistics statistics)
           
PortletRendererImpl(org.apache.pluto.PortletContainer container, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor, org.apache.jetspeed.aggregator.WorkerMonitor workMonitor, org.apache.jetspeed.statistics.PortalStatistics statistics, DynamicTitleService addTitleService)
           
PortletRendererImpl(org.apache.pluto.PortletContainer container, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor, org.apache.jetspeed.aggregator.WorkerMonitor workMonitor, org.apache.jetspeed.statistics.PortalStatistics statistics, DynamicTitleService addTitleService, org.apache.jetspeed.aggregator.PortletTrackingManager portletTracking, boolean checkSecurityConstraints, org.apache.jetspeed.security.SecurityAccessController accessController, org.apache.jetspeed.cache.JetspeedCache portletContentCache)
           
PortletRendererImpl(org.apache.pluto.PortletContainer container, org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor, org.apache.jetspeed.aggregator.WorkerMonitor workMonitor, org.apache.jetspeed.statistics.PortalStatistics statistics, DynamicTitleService addTitleService, org.apache.jetspeed.aggregator.PortletTrackingManager portletTracking, boolean checkSecurityConstraints, org.apache.jetspeed.security.SecurityAccessController accessController, org.apache.jetspeed.cache.JetspeedCache portletContentCache, boolean overrideTitles)
           
 
Method Summary
 void addTitleToHeader(org.apache.pluto.om.window.PortletWindow portletWindow, org.apache.jetspeed.om.page.ContentFragment fragment, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.jetspeed.aggregator.ContentDispatcherCtrl dispatcher, boolean isCacheTitle)
           
protected  void addToCache(org.apache.jetspeed.aggregator.PortletContent content)
           
protected  org.apache.jetspeed.aggregator.RenderingJob buildRenderingJob(org.apache.pluto.om.window.PortletWindow portletWindow, org.apache.jetspeed.om.page.ContentFragment fragment, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.jetspeed.request.RequestContext requestContext, boolean isParallel, org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition, org.apache.jetspeed.aggregator.ContentDispatcherCtrl dispatcher, org.apache.jetspeed.aggregator.PortletContent portletContent, int expirationCache, boolean contentIsCached, long timeoutMetadata)
           
protected  org.apache.jetspeed.aggregator.RenderingJob buildRenderingJob(org.apache.pluto.om.window.PortletWindow portletWindow, org.apache.jetspeed.om.page.ContentFragment fragment, org.apache.jetspeed.request.RequestContext requestContext, boolean isParallel, org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition, org.apache.jetspeed.aggregator.PortletContent portletContent, boolean contentIsCached, long timeoutMetadata)
           
protected  boolean checkSecurityConstraint(org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portlet, org.apache.jetspeed.om.page.ContentFragment fragment)
           
 org.apache.jetspeed.aggregator.ContentDispatcherCtrl createDispatcher(org.apache.jetspeed.request.RequestContext request, org.apache.jetspeed.om.page.ContentFragment fragment, int expirationCache)
           
 org.apache.jetspeed.aggregator.RenderingJob createRenderingJob(org.apache.jetspeed.om.page.ContentFragment fragment, org.apache.jetspeed.request.RequestContext requestContext)
          Create a rendering job for the specified Page fragment.
 org.apache.jetspeed.aggregator.ContentDispatcher getDispatcher(org.apache.jetspeed.request.RequestContext request, boolean isParallel)
          Retrieve the ContentDispatcher for the specified request
protected  int getExpirationCache(org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition)
           
 org.apache.jetspeed.aggregator.PortletTrackingManager getPortletTrackingManager()
           
protected  org.apache.pluto.om.window.PortletWindow getPortletWindow(org.apache.jetspeed.om.page.ContentFragment fragment)
           
protected  long getTimeoutOnJob(org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition)
           
 void notifyContentComplete(org.apache.jetspeed.aggregator.PortletContent content)
           
 void processRenderingJob(org.apache.jetspeed.aggregator.RenderingJob job)
          Render the specified rendering job.
protected  void processRenderingJob(org.apache.jetspeed.aggregator.RenderingJob job, boolean parallelOnly)
           
 org.apache.jetspeed.aggregator.RenderingJob render(org.apache.jetspeed.om.page.ContentFragment fragment, org.apache.jetspeed.request.RequestContext requestContext)
          Render the specified Page fragment.
 void renderNow(org.apache.jetspeed.om.page.ContentFragment fragment, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Render the specified Page fragment.
 void renderNow(org.apache.jetspeed.om.page.ContentFragment fragment, org.apache.jetspeed.request.RequestContext requestContext)
          Render the specified Page fragment.
protected  boolean retrieveCachedContent(org.apache.jetspeed.request.RequestContext requestContext, org.apache.jetspeed.om.page.ContentFragment fragment, org.apache.pluto.om.window.PortletWindow portletWindow, int expiration, org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition)
          Retrieve cached content, if content retrieved successfully return true, if no content found return false
protected  void setTimeoutOnJob(long timeoutMetadata, org.apache.jetspeed.aggregator.RenderingJob rJob)
           
 void start()
           
 void stop()
           
 void waitForRenderingJobs(List renderingJobs)
          Wait for all rendering jobs in the collection to finish successfully or otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.commons.logging.Log log

workMonitor

protected org.apache.jetspeed.aggregator.WorkerMonitor workMonitor

container

protected org.apache.pluto.PortletContainer container

windowAccessor

protected org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor

statistics

protected org.apache.jetspeed.statistics.PortalStatistics statistics

addTitleService

protected DynamicTitleService addTitleService

portletTracking

protected org.apache.jetspeed.aggregator.PortletTrackingManager portletTracking

checkSecurityConstraints

protected boolean checkSecurityConstraints
flag indicating whether to check jetspeed-portlet.xml security constraints before rendering a portlet. If security check fails, do not display portlet content


accessController

protected org.apache.jetspeed.security.SecurityAccessController accessController
For security constraint checks


portletContentCache

protected org.apache.jetspeed.cache.JetspeedCache portletContentCache
JSR 168 Portlet Content Cache


overrideTitles

protected boolean overrideTitles
OutOfService Cache


OUT_OF_SERVICE_MESSAGE

public static final String OUT_OF_SERVICE_MESSAGE
See Also:
Constant Field Values
Constructor Detail

PortletRendererImpl

public PortletRendererImpl(org.apache.pluto.PortletContainer container,
                           org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor,
                           org.apache.jetspeed.aggregator.WorkerMonitor workMonitor,
                           org.apache.jetspeed.statistics.PortalStatistics statistics,
                           DynamicTitleService addTitleService,
                           org.apache.jetspeed.aggregator.PortletTrackingManager portletTracking,
                           boolean checkSecurityConstraints,
                           org.apache.jetspeed.security.SecurityAccessController accessController,
                           org.apache.jetspeed.cache.JetspeedCache portletContentCache,
                           boolean overrideTitles)

PortletRendererImpl

public PortletRendererImpl(org.apache.pluto.PortletContainer container,
                           org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor,
                           org.apache.jetspeed.aggregator.WorkerMonitor workMonitor,
                           org.apache.jetspeed.statistics.PortalStatistics statistics,
                           DynamicTitleService addTitleService,
                           org.apache.jetspeed.aggregator.PortletTrackingManager portletTracking,
                           boolean checkSecurityConstraints,
                           org.apache.jetspeed.security.SecurityAccessController accessController,
                           org.apache.jetspeed.cache.JetspeedCache portletContentCache)

PortletRendererImpl

public PortletRendererImpl(org.apache.pluto.PortletContainer container,
                           org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor,
                           org.apache.jetspeed.aggregator.WorkerMonitor workMonitor,
                           org.apache.jetspeed.statistics.PortalStatistics statistics,
                           DynamicTitleService addTitleService)

PortletRendererImpl

public PortletRendererImpl(org.apache.pluto.PortletContainer container,
                           org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor,
                           org.apache.jetspeed.aggregator.WorkerMonitor workMonitor,
                           org.apache.jetspeed.statistics.PortalStatistics statistics)

PortletRendererImpl

public PortletRendererImpl(org.apache.pluto.PortletContainer container,
                           org.apache.jetspeed.container.window.PortletWindowAccessor windowAccessor,
                           org.apache.jetspeed.aggregator.WorkerMonitor workMonitor)
Method Detail

start

public void start()

stop

public void stop()

renderNow

public void renderNow(org.apache.jetspeed.om.page.ContentFragment fragment,
                      org.apache.jetspeed.request.RequestContext requestContext)
Render the specified Page fragment. Result is returned in the PortletResponse.

Specified by:
renderNow in interface org.apache.jetspeed.aggregator.PortletRenderer
Throws:
org.apache.jetspeed.aggregator.FailedToRenderFragmentException
org.apache.jetspeed.container.window.FailedToRetrievePortletWindow
org.apache.jetspeed.aggregator.UnknownPortletDefinitionException

renderNow

public void renderNow(org.apache.jetspeed.om.page.ContentFragment fragment,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
Render the specified Page fragment. Result is returned in the PortletResponse.

Specified by:
renderNow in interface org.apache.jetspeed.aggregator.PortletRenderer
Throws:
org.apache.jetspeed.aggregator.FailedToRenderFragmentException
org.apache.jetspeed.container.window.FailedToRetrievePortletWindow
org.apache.jetspeed.aggregator.UnknownPortletDefinitionException
org.apache.jetspeed.aggregator.PortletAccessDeniedException

getExpirationCache

protected int getExpirationCache(org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition)

render

public org.apache.jetspeed.aggregator.RenderingJob render(org.apache.jetspeed.om.page.ContentFragment fragment,
                                                          org.apache.jetspeed.request.RequestContext requestContext)
Render the specified Page fragment. The method returns before rendering is complete, rendered content can be accessed through the Content Dispatcher

Specified by:
render in interface org.apache.jetspeed.aggregator.PortletRenderer
Returns:
the asynchronous portlet rendering job to synchronize

createRenderingJob

public org.apache.jetspeed.aggregator.RenderingJob createRenderingJob(org.apache.jetspeed.om.page.ContentFragment fragment,
                                                                      org.apache.jetspeed.request.RequestContext requestContext)
Create a rendering job for the specified Page fragment. The method returns a rendering job which should be passed to 'processRenderingJob(RenderingJob job)' method.

Specified by:
createRenderingJob in interface org.apache.jetspeed.aggregator.PortletRenderer
Returns:
portlet rendering job to pass to render(RenderingJob job) method
Throws:
org.apache.jetspeed.container.window.FailedToRetrievePortletWindow
org.apache.jetspeed.aggregator.UnknownPortletDefinitionException
org.apache.jetspeed.aggregator.PortletAccessDeniedException

processRenderingJob

public void processRenderingJob(org.apache.jetspeed.aggregator.RenderingJob job)
Render the specified rendering job. The method returns before rendering is complete when the job is processed in parallel mode. When it is not parallel mode, it returns after rendering is complete.

Specified by:
processRenderingJob in interface org.apache.jetspeed.aggregator.PortletRenderer
Throws:
org.apache.jetspeed.aggregator.FailedToRenderFragmentException

processRenderingJob

protected void processRenderingJob(org.apache.jetspeed.aggregator.RenderingJob job,
                                   boolean parallelOnly)

waitForRenderingJobs

public void waitForRenderingJobs(List renderingJobs)
Wait for all rendering jobs in the collection to finish successfully or otherwise.

Specified by:
waitForRenderingJobs in interface org.apache.jetspeed.aggregator.PortletRenderer
Parameters:
renderingJobs - the Collection of rendering job objects to wait for.

retrieveCachedContent

protected boolean retrieveCachedContent(org.apache.jetspeed.request.RequestContext requestContext,
                                        org.apache.jetspeed.om.page.ContentFragment fragment,
                                        org.apache.pluto.om.window.PortletWindow portletWindow,
                                        int expiration,
                                        org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition)
                                 throws Exception
Retrieve cached content, if content retrieved successfully return true, if no content found return false

Parameters:
requestContext -
fragment -
portletWindow -
Returns:
true when content found, otherwise false
Throws:
Exception

createDispatcher

public org.apache.jetspeed.aggregator.ContentDispatcherCtrl createDispatcher(org.apache.jetspeed.request.RequestContext request,
                                                                             org.apache.jetspeed.om.page.ContentFragment fragment,
                                                                             int expirationCache)

getDispatcher

public org.apache.jetspeed.aggregator.ContentDispatcher getDispatcher(org.apache.jetspeed.request.RequestContext request,
                                                                      boolean isParallel)
Retrieve the ContentDispatcher for the specified request

Specified by:
getDispatcher in interface org.apache.jetspeed.aggregator.PortletRenderer

getPortletWindow

protected org.apache.pluto.om.window.PortletWindow getPortletWindow(org.apache.jetspeed.om.page.ContentFragment fragment)
                                                             throws org.apache.jetspeed.container.window.FailedToRetrievePortletWindow,
                                                                    org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException
Throws:
org.apache.jetspeed.container.window.FailedToRetrievePortletWindow
org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException

buildRenderingJob

protected org.apache.jetspeed.aggregator.RenderingJob buildRenderingJob(org.apache.pluto.om.window.PortletWindow portletWindow,
                                                                        org.apache.jetspeed.om.page.ContentFragment fragment,
                                                                        org.apache.jetspeed.request.RequestContext requestContext,
                                                                        boolean isParallel,
                                                                        org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition,
                                                                        org.apache.jetspeed.aggregator.PortletContent portletContent,
                                                                        boolean contentIsCached,
                                                                        long timeoutMetadata)
                                                                 throws org.apache.jetspeed.aggregator.PortletAccessDeniedException,
                                                                        org.apache.jetspeed.container.window.FailedToRetrievePortletWindow,
                                                                        org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException
Throws:
org.apache.jetspeed.aggregator.PortletAccessDeniedException
org.apache.jetspeed.container.window.FailedToRetrievePortletWindow
org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException

buildRenderingJob

protected org.apache.jetspeed.aggregator.RenderingJob buildRenderingJob(org.apache.pluto.om.window.PortletWindow portletWindow,
                                                                        org.apache.jetspeed.om.page.ContentFragment fragment,
                                                                        javax.servlet.http.HttpServletRequest request,
                                                                        javax.servlet.http.HttpServletResponse response,
                                                                        org.apache.jetspeed.request.RequestContext requestContext,
                                                                        boolean isParallel,
                                                                        org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition,
                                                                        org.apache.jetspeed.aggregator.ContentDispatcherCtrl dispatcher,
                                                                        org.apache.jetspeed.aggregator.PortletContent portletContent,
                                                                        int expirationCache,
                                                                        boolean contentIsCached,
                                                                        long timeoutMetadata)
                                                                 throws org.apache.jetspeed.aggregator.PortletAccessDeniedException,
                                                                        org.apache.jetspeed.container.window.FailedToRetrievePortletWindow,
                                                                        org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException
Throws:
org.apache.jetspeed.aggregator.PortletAccessDeniedException
org.apache.jetspeed.container.window.FailedToRetrievePortletWindow
org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException

getTimeoutOnJob

protected long getTimeoutOnJob(org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portletDefinition)

setTimeoutOnJob

protected void setTimeoutOnJob(long timeoutMetadata,
                               org.apache.jetspeed.aggregator.RenderingJob rJob)

addTitleToHeader

public void addTitleToHeader(org.apache.pluto.om.window.PortletWindow portletWindow,
                             org.apache.jetspeed.om.page.ContentFragment fragment,
                             javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             org.apache.jetspeed.aggregator.ContentDispatcherCtrl dispatcher,
                             boolean isCacheTitle)
Specified by:
addTitleToHeader in interface org.apache.jetspeed.aggregator.PortletRenderer

checkSecurityConstraint

protected boolean checkSecurityConstraint(org.apache.jetspeed.om.common.portlet.PortletDefinitionComposite portlet,
                                          org.apache.jetspeed.om.page.ContentFragment fragment)

addToCache

protected void addToCache(org.apache.jetspeed.aggregator.PortletContent content)

notifyContentComplete

public void notifyContentComplete(org.apache.jetspeed.aggregator.PortletContent content)
Specified by:
notifyContentComplete in interface org.apache.jetspeed.aggregator.PortletRenderer

getPortletTrackingManager

public org.apache.jetspeed.aggregator.PortletTrackingManager getPortletTrackingManager()
Specified by:
getPortletTrackingManager in interface org.apache.jetspeed.aggregator.PortletRenderer


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.