cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Morandini" <luca.morandi...@tin.it>
Subject RE: XSP/ESQL - separation of concerns?
Date Wed, 18 Dec 2002 11:37:32 GMT
Robert,

you could try using SQLTransformer to handle just your SQL queries and then apply a stylesheet
to transform them, if need be, in
another XML dictionary before the final rendegin in HTML, WML, PDF, etc.

The advantages are:
- a streamlining of the source code
- the ability to easily replace XML produced by a query with a static XML file (and viceversa)

The caveats are:
- SQLTranformer in slower than ESQL
- use 2.0.4, since there is a nasty bug in 2.0.3 making hard, at times, the use of XSLT after
an SQLTransformer step

Best regards,

---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Robert Sösemann [mailto:robert.soesemann@gmx.de]
> Sent: Wednesday, December 18, 2002 12:22 PM
> To: cocoon-users@xml.apache.org
> Subject: XSP/ESQL - separation of concerns?
>
>
> Hello,
>
> in my current project I am using xsp and esql logicsheet for db retrivieval
> and tag generation only.
> Although I know that this is good for developing (no extra compilation) I am
> not very happy with it.
>
> What I don't like is:
> -------------------
> - many SQL statement (complex tag structure) mixed cionfusingly with the
> actual document elements
> - the low readability of the code, also hard to debug...
> - no "cocoon-like" separtion of concerns (mix SQL-logic with tags)
> - the feeling that it is not the most performant way of doing this
>
> What I would like better (but don't excately know how):
> -------------------------------------------------------
> - put all SQL that is needed for generating on specific page into another
> "thing" (beans?) that has no tags
> - make my xsp shorter, more readable
> - have the good balance of performance, easy debugging, extensibility and
> the typical "cocoon separation of concerns"
>
> Here is a short but typical code snippet:
> ---------------------------------------
>     <ROOT>
>         <esql:connection>
>             <esql:pool>mysql_pool</esql:pool>
>
>             <esql:execute-query>
>                 <esql:query>
>                 *COMPLEX QUERY, SOMETIMES 5 <esql:query> PER XSP *
>                 </esql:query>
>
>                 <esql:results>
>                     <esql:row-results>
>                         <ARTICLE>
>                             <xsp:attribute name="ID"><esql:get-int
> column="5"/></xsp:attribute>
>                             <xsp:attribute name="MAIN"><esql:get-string
> column="7"/></xsp:attribute>
>                             <xsp:attribute name="SUB"><esql:get-string
> column="8"/></xsp:attribute>
>                             <xsp:attribute name="PDFPRINT"><esql:get-int
> column="9"/></xsp:attribute>
>
>                             <!-- Attribute evtl. NULL bei Direktanzeige -->
>                             <xsp:logic>
>                                 if(!<esql:is-null column="3"/>) {
>                                     <HEADER><esql:get-string
> column="1"/></HEADER>
>                                 }
>
>                             </xsp:logic>
>
>                             <esql:get-xml column="2"/>
>
>                             <DATE><esql:get-string column="11"/></DATE>
>                             <AUTHOR><esql:get-string column="12"/></AUTHOR>
>                         </ARTICLE>
>                     </esql:row-results>
>                 </esql:results>
>                 <esql:no-results></esql:no-results>
>                 <esql:error-results></esql:error-results>
>             </esql:execute-query>
>         </esql:connection>
>     </ROOT>
>
> </xsp:page>
>
>
> Should I better use own generators or beans? What are your experiences?
>
> Robert
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message