cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Praher <>
Subject XMLForm: FormModel lifecycle interception
Date Wed, 18 Dec 2002 22:57:48 GMT
hi all, (again)

[ hope that someone reads my previous post ... ]

I would like to intercept the lifecycle of the Form Model object.

if I understand the architecture right, then the Action (which extends
AbstractXMLFormAction), when started creates a new Form instance and
stores it in the request attribute or in the Session, depending on the

--- form creation --------------------------------------

* AbstractXMLFormAction.getForm( )

and the model is created using 

* AbstractXMLFormAction.getFormModel( )

which looks up the class form the parameters and does a Class.forName( )

-- form deletion ----------------------------------------

Form.remove( objectModel, id );

now what I would like to do is the following:

a) in the START state: intercept FormModel initialization 

b) in the END state: intercept FormModel disposal

mechanisms would be:

--- extend the listeners and add: -----------------------

interface FormModelLifecycleListener
	void beforeInitialize( );
	void afterInitialize( Object amodel );
	void beforeDispose( int formstate, Object amodel );
	void afterDispose( );

which can be registered.

--- let the model implement avalon activity interfaces ---

class MyModel implements Disposable, Initializable
	void initialize( ) { /* do soemthing here .. */ }
	void dispose( )    { /* do something here .. */ }

With these interceptors I could load the model with data from an
appserver prior to using it in the form .... 

also important would be something like:

/* AWT ActionListener ... */
interface ActionListener {
	void actionPerformed( ActionEvent e ) {


With such an interface the business logic could intercept the outcome of
the form handling and could take appropriate steps (like use the
formModel to change data ). 

I need something like the above in order to application server handling.

I am just getting started with XMLForm - so please bear with me.
Also it is already pretty late, but nevertheless I post my initial ideas
on that.

I look forward to hearing any resposne ...


-- Jakob

To unsubscribe, e-mail:
For additional commands, email:

View raw message