com.sdm.quasar.client.jsf.dialog
Class VisualRepresentationId

java.lang.Object
  extended bycom.sdm.quasar.client.jsf.dialog.VisualRepresentationId

public class VisualRepresentationId
extends java.lang.Object

The VisualRepresentationId defines the parameters which identify a VisualRepresentation. The parameters are added to a response as hidden fiels (addIdToPage(PostParameters) or as url parameters (addIdToRequestParameters(GetParameters)). They could also be addad as token to the view id (getIdAsToken()). Thus, in any case the corresponding VisualRepresentation will be identified at the next request from this page (identifyVisualRepresentation(HttpServletRequest, BrowserWindow)).

The Id of a VisualRepresentation is build out of the dialog id and the dialog instance id of the dialog of the VisualRepresentation.

Author:
Martin Haft

Field Summary
static java.lang.String DIALOGID_REQUEST_PARAMETER_NAME
          the tag identifying the dialog-id information
static java.lang.String DIALOGINSTANCEID_REQUEST_PARAMETER_NAME
          the tag identifying the dialog-instance-id information
 
Constructor Summary
protected VisualRepresentationId(VisualRepresentation visualRepresentation)
           
 
Method Summary
 void addIdToPage(PostParameters postParameters)
          Add the id parameters to the PostParameters.
 void addIdToRequestParameters(GetParameters parameters)
          Add the id parameters to the GetParameters.
protected static boolean check(com.sdm.quasar.client.jsf.dialog.InternalId internalId, VisualRepresentation visualRepresentation)
           
protected static java.lang.String getDialogIdFromToken(java.lang.String token)
           
protected static java.lang.String getDialogInstanceIdFromToken(java.lang.String token)
           
 java.lang.String getIdAsToken()
          Returns a unique token for this dialog-instance id.
static VisualRepresentation identifyVisualRepresentation(HttpServletRequest request, BrowserWindow browserWindow)
          A VisualRepresentation registered at a BrowserWindow is ideentified from the parameters of the request.
protected static com.sdm.quasar.client.jsf.dialog.InternalId readInternalId(HttpServletRequest request)
          Reads the id parameters from the request and returns then.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIALOGID_REQUEST_PARAMETER_NAME

public static java.lang.String DIALOGID_REQUEST_PARAMETER_NAME
the tag identifying the dialog-id information


DIALOGINSTANCEID_REQUEST_PARAMETER_NAME

public static java.lang.String DIALOGINSTANCEID_REQUEST_PARAMETER_NAME
the tag identifying the dialog-instance-id information

Constructor Detail

VisualRepresentationId

protected VisualRepresentationId(VisualRepresentation visualRepresentation)
Method Detail

addIdToRequestParameters

public void addIdToRequestParameters(GetParameters parameters)
Add the id parameters to the GetParameters.

Parameters:
parameters - the get parameters the id is added to

addIdToPage

public void addIdToPage(PostParameters postParameters)
                 throws java.io.IOException
Add the id parameters to the PostParameters.

Throws:
java.io.IOException

getIdAsToken

public java.lang.String getIdAsToken()
Returns a unique token for this dialog-instance id.

Returns:
the token representing the dialog-instance id

identifyVisualRepresentation

public static VisualRepresentation identifyVisualRepresentation(HttpServletRequest request,
                                                                BrowserWindow browserWindow)
A VisualRepresentation registered at a BrowserWindow is ideentified from the parameters of the request. If no VisualRepresentation of the given BrowserWindow matches the id parameters of the request, null is returned

Parameters:
request - the current request
browserWindow - the current BrowserWindow
Returns:
the identified VisualRepresentation or null if no VisualRepresentation is found.

readInternalId

protected static com.sdm.quasar.client.jsf.dialog.InternalId readInternalId(HttpServletRequest request)
Reads the id parameters from the request and returns then. If id parameters are missing, null is returned.

Parameters:
request - the current request
Returns:
the id parameters readed from the request or null if parameters are missing or incomplete.

check

protected static boolean check(com.sdm.quasar.client.jsf.dialog.InternalId internalId,
                               VisualRepresentation visualRepresentation)
Returns:
true, if the given VisualRepresentation is identified by the given Id

getDialogIdFromToken

protected static java.lang.String getDialogIdFromToken(java.lang.String token)

getDialogInstanceIdFromToken

protected static java.lang.String getDialogInstanceIdFromToken(java.lang.String token)