cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Rocha <rica...@apache.org>
Subject Re: [C2] Cocoon Error with LogicSheets!
Date Thu, 15 Mar 2001 12:03:51 GMT
This is a problem with the order in which logicsheets are applied.

If the esql logicsheet is applied _before_ the transaction logicsheet,
then no esql expansions will occur because the esql namespace is
not used in the XSP document. Later, when the transaction logicsheet
is applied, transaction tags will be transformed into esql tags but it
will be too late then: the final xsp logicsheet will interpret the resulting
esql tags as regular tags and will produce them as literals...

The key problem here is that the C2 xsp implementation doesn't
provide an appropriate ordering for logicsheets.

Given a collection of inter-related logicsheets, the xsp engine
should build a topological ordering that results in the correct
sequence including, probably, the case when the same logicsheet
may need to be applied more than once.

Ricardo

On Thursday 15 March 2001 17:44, Berin Loritsch wrote:
> Please help me with this issue, as I would really like to have
> my logicsheet working.  The issue is this:
>
> When I set up my logicsheet with the esql page directly, My XSP
> works without a hitch:
>
> <xsp:page
>   xmlns:xsp="http://apache.org/xsp"
>   xmlns:xsp-request="http://apache.org/xsp/request"
>   xmlns:session="http://apache.org/xsp/session"
>   xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
>   <document>
> 	<esql:connection>
> 	  <esql:pool>ad-approval</esql:pool>
> 	  <esql:autocommit>false</esql:autocommit>
> 	  <esql:execute-query>
> 	    <esql:query>
> 	      SELECT * FROM TransactionView WHERE TransactionId =
> 	      <esql:parameter><session:get-attribute name="id"/></esql:parameter>
> 	    </esql:query>
> 	    <esql:results>
> 	      <esql:row-results>
> 	        <xsp:logic>
> 	          int statusId = <esql:get-int column="statusId"/>;
> 		  int transactionId = <esql:get-int column="transactionId"/>;
> 	        </xsp:logic>
>                 <transaction>
>                   <xsp:attribute
> name="disposition"><xsp:expr>statusId</xsp:expr></xsp:attribute>
> <name><esql:get-string column="name"/></name>
>                  
> <image>transaction/<xsp:expr>transactionId</xsp:expr>.gif</image>
> <description><esql:get-ascii column="description"/></description>
> </transaction>
> 	      </esql:row-results>
> 	    </esql:results>
> 	  </esql:execute-query>
> 	</esql:connection>
>   </document>
> </xsp:page>
>
> Please note, that I altered the query and column names so as not to violate
> Disclosure agreements.
>
> The problem is that when I move the complex <esql:connection> code into a
> logic sheet, the ESQL logicsheet is not applied:
>
>
> <xsp:page
>   xmlns:xsp="http://apache.org/xsp"
>   xmlns:xsp-request="http://apache.org/xsp/request"
>   xmlns:session="http://apache.org/xsp/session"
>   xmlns:transaction="http://www.infoplanning.com/xsp/transaction"
>
>   <document>
>      <transaction:get-transaction dbpool="ap-pool">
>        <xsp:attribute name="transaction-id"><session:get-attribute
> name="id"/></xsp:attribute> </transaction:get-transaction>
>   </document>
> </xsp:page>
>
> This code properly detects my logicsheet, and applies the tags for XSP and
> TRANSACTION namespaces properly, but completely misses out on the ESQL
> logicsheet producing code like:
>
>     int statusId = this.contentHandler.startPrefixMapping("xsp",
> "http://apache.org/xsp");
> this.contentHandler.startPrefixMapping("xsp-request",
> "http://apache.org/xsp/request");
> this.contentHandler.startPrefixMapping("session",
> "http://apache.org/xsp/session");
> this.contentHandler.startPrefixMapping("ad",
> "http://www.infoplanning.com/xsp/ad");
> this.contentHandler.startPrefixMapping("esql",
> "http://apache.org/cocoon/SQL/v2"); xspAttr.addAttribute("", "column",
> "column", "CDATA", "statusId");
>
>     this.contentHandler.startElement("http://apache.org/cocoon/SQL/v2",
>                                      "get-int", "esql:get-int", xspAttr);
>     xspAttr.clear();
>
>     this.contentHandler.endElement("http://apache.org/cocoon/SQL/v2",
>                                    "get-int", "esql:get-int");
>
>     this.contentHandler.endPrefixMapping("xsp");
>     this.contentHandler.endPrefixMapping("xsp-request");
>     this.contentHandler.endPrefixMapping("session");
>     this.contentHandler.endPrefixMapping("ad");
>     this.contentHandler.endPrefixMapping("esql");
>     ;
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org

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


Mime
View raw message