com.sdm.quasar.client.jsf.dialog
Interface DialogParameterHandler

All Known Implementing Classes:
DefaultDialogParameterHandler

public interface DialogParameterHandler

Requests with incomplete, outdated or unknown request parameters are passed to this. Concrete DialogRequestParameters implement the strategy how to handle these requests. An implementation has to be registrated at the ConfigManager with the key DIALOG_PARAMETER_HANDLER_CONFIG_KEY.

Author:
Martin Haft

Field Summary
static java.lang.String DIALOG_PARAMETER_HANDLER_CONFIG_KEY
          The key that is used for retrieving the name of the implementation of this interface to be used.
 
Method Summary
 boolean checkIsAjaxRequest(HttpServletRequest request, ServletResponse response)
          The indication of an AJAX request depends on the concrete ajax framework.
 boolean handleInvalidSequenceNumber(HttpServletRequest request, ServletResponse response, DialogControl sessionDialogControl, DialogInstanceId dialogInstanceId, java.lang.String url, DialogParameterHandlerCallback callback)
          This method is called when the sequence number is invalid.
 boolean handleMissingDialogParameters(HttpServletRequest request, ServletResponse response, DialogControl sessionDialogControl, DialogParameterHandlerCallback callback)
          This method is called when the dialog parameters, i.e. the dialog id or the dialog instance id, are incomplete.
 

Field Detail

DIALOG_PARAMETER_HANDLER_CONFIG_KEY

public static final java.lang.String DIALOG_PARAMETER_HANDLER_CONFIG_KEY
The key that is used for retrieving the name of the implementation of this interface to be used.

Method Detail

handleMissingDialogParameters

public boolean handleMissingDialogParameters(HttpServletRequest request,
                                             ServletResponse response,
                                             DialogControl sessionDialogControl,
                                             DialogParameterHandlerCallback callback)
This method is called when the dialog parameters, i.e. the dialog id or the dialog instance id, are incomplete. This may be a request to enter the application, a request from a bookmark or a request from a dialog that is closed and should not be recreated automatically.

Returns:
true if the response is completed e.g. due to a redirect to a determined dialog. The servlet filter chain will not be processed further, but the redirect will be performed immediately.

handleInvalidSequenceNumber

public boolean handleInvalidSequenceNumber(HttpServletRequest request,
                                           ServletResponse response,
                                           DialogControl sessionDialogControl,
                                           DialogInstanceId dialogInstanceId,
                                           java.lang.String url,
                                           DialogParameterHandlerCallback callback)
This method is called when the sequence number is invalid. This may indicate a double submit or a requset from an old page. This can happen when the same dialog instance (e.g. a singleton instance) is open in two browsers or two tabs of one browser or from a double submit.

Parameters:
dialogInstanceId - DialogInstanceId of the dialog that is out of sequence
url - an URL for the corresponding dialog in its actual state
Returns:
true if the response is completed e.g. due to a redirect to a determined dialog. The servlet filter chain will not be processed further, but the redirect will be performed immediately.

checkIsAjaxRequest

public boolean checkIsAjaxRequest(HttpServletRequest request,
                                  ServletResponse response)
The indication of an AJAX request depends on the concrete ajax framework. Please take a look at the request parameters to tell us if we are dealing with an AJAX request.

Returns:
true, if the given request is an AJAX request.