net.sf.tacos.ajax
Interface AjaxWebRequest

All Known Implementing Classes:
AjaxWebRequestImpl

public interface AjaxWebRequest

Represents a threaded ajax request to tapestry. This class can be thought of as similar to a HttpRequest or WebRequest in that it relates directly to the incoming http request.

Because the foundation of all of the current library work being done with ajax seems to be uniformly based off of prototype, this particular instance will represent all of the logic contained within the prototype core request. See:http://prototype.conio.net/

Author:
jkuhnert

Field Summary
static String AJAX_REQUEST_TYPE
          Value of REQUEST_TYPE_HEADER that represents ajax requests
static String PROTOTYPE_VERSION_HEADER
          Key in Http header for Prototype library version
static String REQUEST_TYPE_HEADER
          Key in Http headers for request type
 
Method Summary
 boolean containsComponentId(String id)
          Checks if this request contains the specified component id.
 ResponseBuilder getResponseBuilder()
          The class responsible for invoking and rendering the responses received from components.
 String getType()
          The type of ajax request made, which should be AJAX_REQUEST_TYPE in all cases for now.
 List getUpdateBlocks()
          Optional list of html block id's that were specified in the AjaxDirectLink request.
 List getUpdateComponents()
          List of unique component id's that will have their contents refreshed on this request.
 String getVersion()
          The version of the ajax client library that was used to invoke the ajax cycle.
 boolean isDirectUpdate()
          Whether or not this request expects components to be updated directly, without requiring that the entire page be rendered.
 boolean isValidRequest()
          For instances where an ajax request link was setup, but the client invocation of that link could not create a valid ajax request for one reason or another.
 void setDirectUpdate(boolean direct)
          Sets whether or not this request should directly update components.
 void setResponseBuilder(ResponseBuilder invoker)
          Sets the response builder.
 void setType(String type)
          Sets the type of ajax request.
 void setVersion(String version)
          Sets the request version.
 

Field Detail

REQUEST_TYPE_HEADER

public static final String REQUEST_TYPE_HEADER
Key in Http headers for request type

See Also:
Constant Field Values

AJAX_REQUEST_TYPE

public static final String AJAX_REQUEST_TYPE
Value of REQUEST_TYPE_HEADER that represents ajax requests

See Also:
Constant Field Values

PROTOTYPE_VERSION_HEADER

public static final String PROTOTYPE_VERSION_HEADER
Key in Http header for Prototype library version

See Also:
Constant Field Values
Method Detail

getType

public String getType()
The type of ajax request made, which should be AJAX_REQUEST_TYPE in all cases for now.

Returns:
The string found in header for REQUEST_TYPE_HEADER.

setType

public void setType(String type)
Sets the type of ajax request.

Parameters:
type -

getVersion

public String getVersion()
The version of the ajax client library that was used to invoke the ajax cycle.

Returns:
Currently the value of PROTOTYPE_VERSION_HEADER header.

setVersion

public void setVersion(String version)
Sets the request version.

Parameters:
version -

isValidRequest

public boolean isValidRequest()
For instances where an ajax request link was setup, but the client invocation of that link could not create a valid ajax request for one reason or another. If this is true the response will be rendered back to the client in text/html mode as a normal request.

Returns:

getUpdateBlocks

public List getUpdateBlocks()
Optional list of html block id's that were specified in the AjaxDirectLink request.

Example:

 

Returns:

getUpdateComponents

public List getUpdateComponents()
List of unique component id's that will have their contents refreshed on this request.

Returns:

isDirectUpdate

public boolean isDirectUpdate()
Whether or not this request expects components to be updated directly, without requiring that the entire page be rendered.

Returns:
True if components are updated directly, false otherwise.

setDirectUpdate

public void setDirectUpdate(boolean direct)
Sets whether or not this request should directly update components.

Parameters:
direct -

getResponseBuilder

public ResponseBuilder getResponseBuilder()
The class responsible for invoking and rendering the responses received from components.

Returns:

setResponseBuilder

public void setResponseBuilder(ResponseBuilder invoker)
Sets the response builder.


containsComponentId

public boolean containsComponentId(String id)
Checks if this request contains the specified component id.

Parameters:
id - Id returned by invoking IComponent#getId().
Returns:
True if request contains update request for specified component.