cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: Logicsheet philosophy
Date Thu, 07 Sep 2000 00:17:55 GMT
Jeffrey_M_Grossman@Countrywide.Com wrote:
>In programming with Cocoon XSP, and logicsheets, I come to a basic concept
>that for a large part prevents me from using logicsheets.
>A logic sheet is "run" as part of the XSL transforms. Processors have had
>there chance to modify the DOM for the page, and then logic sheets, and
>then (typically) last is the XSL transform.
>
>In my case I need to get a query string parameter, or session variable that
>contains a unique database key (lets say customer ID). This value is then
>placed into a an XML element, via XSP. My understanding is that the
>XSP:logic sections are placed into a java file that becomes the producer.
>The logicsheet then happens after the producer has been run, therefore is
>not able to interact with other XSP:logic code.

Not true. The logicsheet can contain code that is substituted in, and then 
interacts with the other xsp:logic code.


>What I see happening is the following:
>XSP logic become large enough or generic to be promoted.
>If promoted into a logicsheet, it is no longer capable of interacting with
>other XSP logic only other logicsheets)
>If promoted into a class library, then all the XSP logic is available,
>although through methods of the class, and can, although limited, interact
>with logic sheets.
>
>Based on these assumptions on my part I see almost no value to the
>logicsheet concept, other than to pick up some variable and put it down in
>the XML for the XSL to process (i.e. current date, user name, etc). Then I
>would extrapolate this concept so that logicsheets are only useful to XSL
>logic (presentation), and not XML (content).
>
>I am I right or have I missed something?


There are at least 3 big advantages to logicsheets IMO:

1. The easiest way to maintain compatibility between C1 and C2 is creating 
XML in XSP and logicsheets only, and never referring to DOM or SAX methods 
directly.

2. You can create variables in logicsheets.

E.g. At i-tao have a tag called

<i-tao:attribute name="xyz" default="foo"/>

which translates into something like

String xyz = session.getAttribute ("xyz");
if (xyz == null) xyz = "foo";

(it's more complicated that that actually - it checks the HTTP request 
parameter as well)

You simply can't create local variables in the XSP page, in an external 
method.

3. You can see which parameter is which.

E.g. <graphics:drawGraph x="1" y="1" width="100" height="400" data="numbers" 
xgap="50" ygap="50" color="green"/>

is clearer than the equivalent method call because you can see at a glance 
which parameter is which.


_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


Mime
View raw message