cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@media.demon.co.uk>
Subject Re: SQL Editor
Date Mon, 03 Feb 2003 18:02:59 GMT

On Monday, Feb 3, 2003, at 14:28 Europe/London, Ugo Cei wrote:

> Jeremy Quinn wrote:
>> Hi Guys
>> I am looking into implementing a forms-based editor for a complex set 
>> of inter-related SQL Tables (with lots of gruesome link tables etc.).
>> What is currently considered the best technique to be using in Cocoon 
>> right now?
>> XMLForm (we don't use Beans)
>> OriginalDBActions (obsolete ? )
>> ModularDBActions (Actions are not liked by many)
>> SQL Inserts/Updates using SQLTransformer (maybe not capable of the 
>> job due to complexities of the multiple Table updating required ? )
>> SQL Inserts/Updates using ESQL TagLib (complex and difficult to 
>> maintain ? )
>> OutputModules+FlowScript (too unknown ? )
>
> XMLForm + FlowScript + some persistence framework.
>
> If you don't use beans for your business entities, you should ;-).

Whoa! ;)

I would not know what a 'business entity' is .... or whether our data 
should be one ....

> The application I'm currently working on uses Hibernate for mapping 
> objects to an RDBMS, Flow for the application flow control and XMLForm 
> for data entry and validation.
>
> It goes something like this (this is a flowscript fragment for 
> retrieving a business entity, having "id" as it's POID [1], into a 
> bean, associating it with a form, posting it to the user, awaiting 
> submission, validating and storing):
>
> session = sessionFactory.openSession();
> var entity = new BusinessEntity();
> session.load(entity, id);
> session.close();
> var form = getForm("entity-form", entity, 
> "context://flows/workflow-schema.xml");
> while (true) {
>   form.save(cocoon.environment.getObjectModel(), "request");
>   sendPageAndWait("entity-form", {});
>   form.populate(cocoon.environment.getObjectModel());
>   form.validate("phase");
>   if (form.getViolations() != null && form.getViolations().size() > 0) 
> {
>     continue;
>   }
>   break;
> }
> session = sessionFactory.openSession();
> session.saveOrUpdate(entity);
> session.flush();
> session.close();
>
> IMHO, you can't beat the elegance and clarity of this approach.

I see what you mean, but is this not merely hiding a lot of complexity 
that you have had to put elsewhere?

regards Jeremy


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


Mime
View raw message