org.apache.tapestry.portlet
Class RenderService

java.lang.Object
  extended by org.apache.tapestry.portlet.RenderService
All Implemented Interfaces:
IEngineService

public class RenderService
extends Object
implements IEngineService

Responsible for rendering out a page; a Portlet render URL is built during action processing that stores the active page; this is the page that will be rendered. The render service is (typically) the only service that operates during a portlet RenderRequest. All other services will be an ActionRequest that (via PortletResponseRenderer, writes query parameters to activate this service during the render request.

Problematic is is anything related to the portlet mode or window state. As per the Portlet spec, when the user clicks the "help" or "edit" buttons (or the minimize, maximize, etc.), this causes a new RenderRequest, but explicitly keeps the render parameters set by the most recent ActionRequest. But what Tapestry needs is to detect that the mode or state has changed and select a different page to render the response. So we store the mode and state in effect when the ActionRequest executed as two more query parameters, and detect changes to mode and state that way. If there is a change, then we ignore the page query parameter and use the PortletPageResolver to figure out the correct page to display instead.

Since:
4.0
Author:
Howard M. Lewis Ship
See Also:
ResponseRendererImpl

Constructor Summary
RenderService()
           
 
Method Summary
 ILink getLink(boolean post, Object parameter)
          Builds a URL for a service.
 String getName()
          Returns the name of the service.
 void service(IRequestCycle cycle)
          Perform the service, interpreting the URL (from the HttpServletRequest) responding appropriately, and rendering a result page.
 void setPageResolver(PortletPageResolver pageResolver)
           
 void setPortletRenderer(PortletRenderer portletRenderer)
           
 void setRequest(javax.portlet.PortletRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderService

public RenderService()
Method Detail

getLink

public ILink getLink(boolean post,
                     Object parameter)
Description copied from interface: IEngineService
Builds a URL for a service. This is performed during the rendering phase of one request cycle and builds URLs that will invoke activity in a subsequent request cycle.

This method changed incompatibly between release 3.0 and release 4.0.

Specified by:
getLink in interface IEngineService
Parameters:
post - if true, then the link will be used for a post (not a get, i.e., for a HTML form); this may affect what information is encoded into the link
parameter - An object that provide any additional information needed by the service. Each service implementation will expect that an object of the proper type be passed in. In some cases, a simple String will do; in others, a specific object (possibly implementing an interface) will be required.
Returns:
The URL for the service. The URL will have to be encoded via HttpServletResponse.encodeURL(java.lang.String).

service

public void service(IRequestCycle cycle)
             throws IOException
Description copied from interface: IEngineService
Perform the service, interpreting the URL (from the HttpServletRequest) responding appropriately, and rendering a result page.

Specified by:
service in interface IEngineService
Parameters:
cycle - the incoming request
Throws:
IOException

getName

public String getName()
Description copied from interface: IEngineService
Returns the name of the service.

Specified by:
getName in interface IEngineService

setPortletRenderer

public void setPortletRenderer(PortletRenderer portletRenderer)

setRequest

public void setRequest(javax.portlet.PortletRequest request)

setPageResolver

public void setPageResolver(PortletPageResolver pageResolver)


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.