You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2003/12/18 11:38:38 UTC

Complete database sample with Cocoon 2.1 ?

Does anyone know of a more comprehensive sample
than the one supplied in the Cocoon samples directory?
(under cocoon/samples/databases/mod-db).  In the sitemap,
the comment is made that:

* no parameter validation is done (in a real application, you'd
want to check their values as well)
* you'd want to use an action set for this or even better, 
call these actions from the flow layer!

(The sitemap for this example also seems very verbose;
considering just one table or two tables are being handled;
can this approach not be 'generalized' further so that it can
easily scale up to handle a more complex database - on the
order of 20-60 tables....)

I assume that checking could (should?) be done with woody
form - is there any single sample (even for one database table)
that:

* uses modular database actions
* calls actions from a flow script
* uses woody forms for validation [and shows how and 
where this fits into validation paradigm]

If someone has worked through all these and is prepared
to make something available, I can try and help out with
documentation and explanation (to help the next person 
through the learning curve).

It seems that Cocoon can be incredibly powerful ito separation
of concerns, but that sometimes that power is hidden below
layers of (unnecessary?) complexity.

Thanks
Derek

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


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


Re: Complete database sample with Cocoon 2.1 ?

Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
Derek Hohls wrote:
> Does anyone know of a more comprehensive sample
> than the one supplied in the Cocoon samples directory?
> (under cocoon/samples/databases/mod-db).  In the sitemap,
> the comment is made that:
> 
> * no parameter validation is done (in a real application, you'd
> want to check their values as well)
> * you'd want to use an action set for this or even better, 
> call these actions from the flow layer!

This last ability has been removed from flow. One can call actions
like any other component from flow, but considering the required setup
to fulfill the parameters needed for the act() method....

> (The sitemap for this example also seems very verbose;
> considering just one table or two tables are being handled;
> can this approach not be 'generalized' further so that it can
> easily scale up to handle a more complex database - on the
> order of 20-60 tables....)

The key would be to use e.g. request parameters to select the right
table-set and validation-set. However, this approach does not scale
to complex transactions.

> I assume that checking could (should?) be done with woody
> form - is there any single sample (even for one database table)
> that:

Adding cocoon forms aka woody and flow to the picture would also
suggest to use eg OJB or Hibernate for a persistence layer. There's
a OJB block in the distribution which illustrates the basic usage.

To use the mod-db actions (which is possible) would require to use
some JXPath enabled input module that can access the form model.
I believe there's no ready made one, but creating one should be
quite simple.

However, if there's (almost) no business logic involved and syntactic
validation of single values that can be done eg with regular
expressions, you might look into the simple form transformer and 
accompanying simple form instance transformer plus form validator
action. Anyway, this does not scale to complex business logic.

HTH
	Chris.


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


Re: Complete database sample with Cocoon 2.1 ?

Posted by leo leonid <te...@leonid.de>.
Hi,

I hoped, and I still hope, that the Petstore sample will become a such 
a comprehensive sample, showing how all the different components 
working together in a best practice way. With the patch 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24463 the 
functionality of the Petstore is almost complete and I added form 
validation with woody, but the sample is still far away from being best 
practice. The sample needs refactoring, especially the model and the DB 
part, that is currently completely coded in JS.
I volunteer to help refactoring, for example I can improve woody part.

/Leo




On Dec 18, 2003, at 11:38 AM, Derek Hohls wrote:

> Does anyone know of a more comprehensive sample
> than the one supplied in the Cocoon samples directory?
> (under cocoon/samples/databases/mod-db).  In the sitemap,
> the comment is made that:
>
> * no parameter validation is done (in a real application, you'd
> want to check their values as well)
> * you'd want to use an action set for this or even better,
> call these actions from the flow layer!
>
> (The sitemap for this example also seems very verbose;
> considering just one table or two tables are being handled;
> can this approach not be 'generalized' further so that it can
> easily scale up to handle a more complex database - on the
> order of 20-60 tables....)
>
> I assume that checking could (should?) be done with woody
> form - is there any single sample (even for one database table)
> that:
>
> * uses modular database actions
> * calls actions from a flow script
> * uses woody forms for validation [and shows how and
> where this fits into validation paradigm]
>
> If someone has worked through all these and is prepared
> to make something available, I can try and help out with
> documentation and explanation (to help the next person
> through the learning curve).
>
> It seems that Cocoon can be incredibly powerful ito separation
> of concerns, but that sometimes that power is hidden below
> layers of (unnecessary?) complexity.
>
> Thanks
> Derek
>
> -- 
> This message has been scanned for viruses and
> dangerous content by MailScanner, and is
> believed to be clean.
> MailScanner thanks transtec Computers for their support.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


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