cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ard Schrijvers" <>
Subject RE: Cocoon database access strategy
Date Mon, 18 Jun 2007 10:11:14 GMT
IMHO, do not start using sql transformer but use some jdo implementation if you ask me. Search
for Brick cms, you will find a good starting point in there,

Regards Ard


Does the database you are using support stored procedures (even MySql now does)? If so, write
the complex SQL as a strored procedure and then execute the stored procedure from the SQLTransformer,
possibly using the ancestor construct that the SQLTransformer has specifically to support
nested Queries. 

Personally, I don't see a problem with doing some XSL transformation after one query before
doing another based on the output DOM; this is what XML pipelines are all about. Perhaps you
are not very familiar with XSL. Invest some time and you will be rewarded! 

XSL and Database Actions are deprecated so I would recommend the pipeline approach as you
will end up with a more maintainable and extensible solution because you will seperate the



On 16/06/07, Rob Frohwein <> wrote:

For some project I need to make rather deeply nested database queries.
I was looking for the best stategy (I am new to cocoon)

1 Doing all nested queries in one xsp or xml page. 
But this will be difficult to maintain and test.
2 extending queries in one pipeline
In this strategy a resultset is extended by following steps in the pipeline. 

        <map:match pattern="start">
        <map:generate type="file" src="query1.xml"/>

                <map:transform type="sql"> 

        <map:transform type="xslt" src="query2.xsl"/>

        <map:transform type="sql">


query1.xml could do a first level query.
query2.xsl could do some processing and at some point in the tree
do a new query and append the resultset there.(sqltaglib can be used in

But this seems not to work, because the first resultset creates 
elements like <sql:somename> the second sqltransform step will be
confused by these tags.
I could rename all <sql:somename> tags after the first sqltransform
step, but that is a bit clumsy.

So this does not work.
I also understood from the documentation that it's not possible
to use more then one xsp in a pipeline, so this approach will
also not be possible with esql?

3 Call pipeline entries from an xsp/xml sql query loop:

In this case I would like something like:

        <esql:execute-query >
                        select * from customers
                                Call query2.xsp(
                                        <esql:get-string column="id"/>
                                        <esql:get-string column="name"/> 
query2.xsp would do a new query with the supplied parameters.
query2.xsp could ofcourse do other queries.

But I could not find constructs like this.

What is the best approach to separate the nested queries? 


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

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

View raw message