HDIV API 2.0.4

org.hdiv.dataComposer
Class AbstractDataComposer

java.lang.Object
  extended by org.hdiv.dataComposer.AbstractDataComposer
All Implemented Interfaces:
IDataComposer
Direct Known Subclasses:
DataComposerMemory

public abstract class AbstractDataComposer
extends java.lang.Object
implements IDataComposer

It processes the data contributed by the HDIV custom tags. The aim of this class is to create an object of type IState for each possible request (form or link) in every page processed by the HDIV custom tags. The IState object is used to validate client's later requests.

The process of creating an IState object is as follows: Each time a link or a form processing begins, HDIV custom tags set the request beginning by calling beginRequest method. Once the beginning is set, an IState object is created and it is fill in with all the data of the request(parameter values, non editable values, parameter types) using the compose method. After processing all the request data of the link or form, custom tags set the end of the processing by calling endRequest method.

Depending on the strategy defined in HDIV configuration (memory, encoded or hash), the IState object is stored in the user session or is sent to the client in the html code by adding an extra parameter called _HDIV_STATE_.

In the memory strategy IState objects are stored in the user session (HttpSession) while in the encoded and hash strategies these objects are stored in the client.

Author:
Roberto Velasco

Constructor Summary
AbstractDataComposer()
           
 
Method Summary
 void beginRequest()
          It is called by each request or form of the html page sent back by the server.
 void beginRequest(java.lang.String action)
          It is called by each request or form of the html page returned by the server, as long as the destiny of the request is an action.
 java.lang.String getAction()
           
 IApplication getApplication()
           
 java.lang.String getPageId()
          Obtains the page identifier that contains the request or form in process
 ISession getSession()
           
 void init(ISession session, IApplication application)
          Initializes IdataComposer with the user session and the application context
 void initPageId()
          Obtains a new unique identifier for the page
 void setAction(java.lang.String action)
           
 void setApplication(IApplication application)
           
 void setSession(ISession session)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hdiv.dataComposer.IDataComposer
addFlowId, compose, compose, compose, compose, compose, endPage, endRequest, getHDIVParameter, mergeParameters, startPage
 

Constructor Detail

AbstractDataComposer

public AbstractDataComposer()
Method Detail

init

public void init(ISession session,
                 IApplication application)
Initializes IdataComposer with the user session and the application context

Specified by:
init in interface IDataComposer
Parameters:
session - Http session wrapper
application - ServletContext wrapper

beginRequest

public void beginRequest()
It is called by each request or form of the html page sent back by the server.

Specified by:
beginRequest in interface IDataComposer

beginRequest

public void beginRequest(java.lang.String action)
It is called by each request or form of the html page returned by the server, as long as the destiny of the request is an action.

Specified by:
beginRequest in interface IDataComposer
Parameters:
action - target name

getPageId

public java.lang.String getPageId()
Obtains the page identifier that contains the request or form in process

Returns:
Returns the pageId.

initPageId

public void initPageId()
Obtains a new unique identifier for the page


getAction

public java.lang.String getAction()

setAction

public void setAction(java.lang.String action)

getSession

public ISession getSession()
Specified by:
getSession in interface IDataComposer
Returns:
Returns the session.

setSession

public void setSession(ISession session)
Specified by:
setSession in interface IDataComposer
Parameters:
session - The session to set.

getApplication

public IApplication getApplication()
Specified by:
getApplication in interface IDataComposer
Returns:
Returns the application.

setApplication

public void setApplication(IApplication application)
Specified by:
setApplication in interface IDataComposer
Parameters:
application - The application to set.

HDIV 2.0.4

Copyright © 2008 hdiv.org. All Rights Reserved.