cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jakob Praher ...@hapra.at>
Subject XMLForm: FormModel lifecycle interception
Date Wed, 18 Dec 2002 22:54:04 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
configuration.

--- 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.
registeration should also be able to 

--- 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 ...

thanks

-- Jakob


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message