net.sf.tacos.ajax
Interface ResponseBuilder

All Known Implementing Classes:
PrototypeResponseBuilder, RicoResponseBuilder

public interface ResponseBuilder

Represents the class responsible for interacting with components for an ajax request library version and type.

Author:
jkuhenrt

Method Summary
 void cleanupAfterRender()
          Invoked by AjaxDirectService after a request cycle so invokers can cleanup resources.
 AjaxWebRequest getAjaxRequest()
          The ajax request
 String getContentType()
          Should return the content type response that this builder generates.
 IMarkupWriter getWriter()
          The writer
 IMarkupWriter getWriter(IComponent component, IRequestCycle cycle, IMarkupWriter writer)
          Invoked by enhanced IRender.render(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle) methods before rendering to replace their incoming IMarkupWriter instance with the one provided by this class, which may return the same writer or a special writer depending on the circumstances.
 void prepareForRender()
          Called before invoking either updateComponentsDirect(IRequestCycle, IPage, IPage, IComponent), or if in full render mode invoking renderRequest(
 void renderResponse(IRequestCycle cycle, IPage activePage, IPage componentPage, IComponent component)
          Called to render a complete response to the client, in the case of of direct component updates being set to false.
 void setAjaxRequest(AjaxWebRequest ajaxRequest)
          Sets the associated ajax request.
 void setWriter(IMarkupWriter writer)
          Sets the text/xml response writer.
 void updateComponentsDirect(IRequestCycle cycle, IPage activePage, IPage componentPage, IComponent component)
          Called to update all components in cycle directly, without causing any other component to render output.
 

Method Detail

getAjaxRequest

public AjaxWebRequest getAjaxRequest()
The ajax request

Returns:

setAjaxRequest

public void setAjaxRequest(AjaxWebRequest ajaxRequest)
Sets the associated ajax request.

Parameters:
ajaxRequest -

getWriter

public IMarkupWriter getWriter()
The writer

Returns:

setWriter

public void setWriter(IMarkupWriter writer)
Sets the text/xml response writer.

Parameters:
writer -

getWriter

public IMarkupWriter getWriter(IComponent component,
                               IRequestCycle cycle,
                               IMarkupWriter writer)
Invoked by enhanced IRender.render(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle) methods before rendering to replace their incoming IMarkupWriter instance with the one provided by this class, which may return the same writer or a special writer depending on the circumstances.

Parameters:
component -
cycle -
writer - Current writer rendering response
Returns:
A valid IMarkupWriter, which may be a NullMarkupWriter, an ajax xml response stream, or a normal html response stream.

prepareForRender

public void prepareForRender()
Called before invoking either updateComponentsDirect(IRequestCycle, IPage, IPage, IComponent), or if in full render mode invoking renderRequest(


updateComponentsDirect

public void updateComponentsDirect(IRequestCycle cycle,
                                   IPage activePage,
                                   IPage componentPage,
                                   IComponent component)
Called to update all components in cycle directly, without causing any other component to render output.

Parameters:
cycle -
activePage -
componentPage -
component -

renderResponse

public void renderResponse(IRequestCycle cycle,
                           IPage activePage,
                           IPage componentPage,
                           IComponent component)
Called to render a complete response to the client, in the case of of direct component updates being set to false.

Parameters:
cycle -
activePage -
componentPage -
component -

cleanupAfterRender

public void cleanupAfterRender()
Invoked by AjaxDirectService after a request cycle so invokers can cleanup resources.

In the case of full page/non direct component invocations this causes all the buffered component IMarkupWriter instances to have their contents written to the response stream.


getContentType

public String getContentType()
Should return the content type response that this builder generates. Ie "text/plain" or "text/xml". These content types must also exist in the hivemodule.xml contribution tapestry.markup.MarkupFilters.

Returns:
A valid content type required by this builder.