You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sandor Spruit <sa...@cs.uu.nl> on 2001/02/21 12:20:45 UTC

Re[2]: [Q] An example of using ESQL in a stylesheet ? Logicsheet ?

Paul,

On Wednesday, February 21, 2001, 12:13:11 PM, you wrote:

Paul> * Sandor Spruit (sandor@cs.uu.nl) wrote :

>> Could someone explain to me, preferably through an example, how I can
>> use database querying techniques in a XSL stylesheet, i.e. not in the
>> XML document that gets styled ?

Paul> You could do this using XSLT extension functions, although I'd
Paul> try to avoid it if you can -- it's not really a styling issue,
Paul> is it? 

Right - but ...
(see below)

>> What I'd like to do: in the Cocoon pipeline of an XML document, I'd
>> like to add elements that will eventually get rendered (in HTML) as
>> a toolbar of buttons or clickable images, above or below the content
>> of the original XML document.
>> The functions accessible through this toolbar obviously may depend on
>> the characteristics of the user, his access rights, session stuff or
>> a specific document subtype. So, while the stylesheets gets processed,
>> I'd like to query a database to see what elements need to be inserted,
>> then fiddle with these elements to render them as HTML.
>> Is this possible ?

Paul> Mm-hmm. Why not do this in the XSP page itself? In C2 you will
Paul> (honest) be able to do this using the content aggregation
Paul> functionality we're in the process of designing.

I'd like to keep the details on toolbars and such away from the folks
writing the XML documents. They'll at some point just upload, say, a
news item - recognizable by some document type, tag or attribute. As
this little XML document gets processing to be displayed, it needs to
be get the 'news item toolbar' built into the output HTML. Does this
sound reasonable ?

Regards,
Sandor

-- 
ir A.G.L. Spruit, Utrecht University, the Netherlands
Institute of information and computing sciences
"There is a bit of magic in everything, and then some
loss to even things out" (from: Lou Reed, "Magic and Loss")



Re: [Q] An example of using ESQL in a stylesheet ? Logicsheet ?

Posted by Ulrich Mayring <ul...@denic.de>.
Rick Wayne wrote:
> 
> we're doing something vaguely similar, but more on the back end: we want
> to take the user's input from a form, and perform an SQL query based on
> that.  i suspect an example that enlightens sandor will also help us
> quite a bit.

...
String query = "select " + request.getParameter("myparam") + " from
TABLE";
...
<esql:query><xsp:expr>query</xsp:expr></esql:query>
...


Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung

Re: Re[4]: [Q] An example of using ESQL in a stylesheet ? Logicsheet ?

Posted by Rick Wayne <fe...@facstaff.wisc.edu>.
may i add my voice to this request?  it will save my team a lot of 
fumbling-and-groping time.  we want to use ESQL, and promote it (it'll 
be at least a minor feature in an upcoming Software Development article
about open source), but a little guidance would provide a lot of leverage.

we're doing something vaguely similar, but more on the back end: we want
to take the user's input from a form, and perform an SQL query based on
that.  i suspect an example that enlightens sandor will also help us 
quite a bit.

thanks!

On 2001.02.22 05:47:26 -0600 Sandor Spruit wrote:
 
> Could you supply one complete, working example here ? The notion of a
> logicsheet is barely documented in 1.8.2, or so it seems. IMHO: some
> of the examples are really sniplets, where things like root elements,
> name space stuff etc. are used in confusing combinations. This gives
> me the (frustrating) feeling that what I want is something perfectly
> reasonable, it's possible, but I can't see how it should be done.
> 
> Any help will be much appreciated,
> Sandor
> -- 
-- 
rw

Re[4]: [Q] An example of using ESQL in a stylesheet ? Logicsheet ?

Posted by Sandor Spruit <sa...@cs.uu.nl>.
Donald,

I don't fully understand your interesting but brief reply. The point
is: Cocoon processes many things as XML documents, flexibility all
over the place. I'm not *that* experienced with Cocoon, yet.

Please refer to comments below.

On Wednesday, February 21, 2001, 6:38:23 PM, you wrote:

Donald> On Wed, 21 Feb 2001, Sandor Spruit wrote:

>> >> What I'd like to do: in the Cocoon pipeline of an XML document, I'd
>> >> like to add elements that will eventually get rendered (in HTML) as
>> >> a toolbar of buttons or clickable images, above or below the content
>> >> of the original XML document.
>> >> The functions accessible through this toolbar obviously may depend on
>> >> the characteristics of the user, his access rights, session stuff or
>> >> a specific document subtype. So, while the stylesheets gets processed,
>> >> I'd like to query a database to see what elements need to be inserted,
>> >> then fiddle with these elements to render them as HTML.
>> >> Is this possible ?
>>
>> Paul> Mm-hmm. Why not do this in the XSP page itself? In C2 you will
>> Paul> (honest) be able to do this using the content aggregation
>> Paul> functionality we're in the process of designing.
>>
>> I'd like to keep the details on toolbars and such away from the folks
>> writing the XML documents. They'll at some point just upload, say, a
>> news item - recognizable by some document type, tag or attribute. As
>> this little XML document gets processing to be displayed, it needs to
>> be get the 'news item toolbar' built into the output HTML. Does this
>> sound reasonable ?

Donald> write your own xsp logicsheet which transforms elements like
Donald> this:

Donald> <foo:toolbar type="new item"/>

Donald> into calls to the esql logicsheet or whatever. then your page
Donald> authors needs only know about the 'foo' namespace, and don't
Donald> need to worry about esql or java code in their pages. this is
Donald> _key_ to the whole xsp idea. 

Do you mean a pipeline like this:

   XML doc with <foo:toolbar> tags
   <XSP-processor> yields calls to esql tags
   <XSLT-processor> transforms toolbar stuff to HTML buttons

Could you supply one complete, working example here ? The notion of a
logicsheet is barely documented in 1.8.2, or so it seems. IMHO: some
of the examples are really sniplets, where things like root elements,
name space stuff etc. are used in confusing combinations. This gives
me the (frustrating) feeling that what I want is something perfectly
reasonable, it's possible, but I can't see how it should be done.

Any help will be much appreciated,
Sandor
-- 
ir A.G.L. Spruit, Utrecht University, the Netherlands
Institute of information and computing sciences
"There is a bit of magic in everything, and then some
loss to even things out" (from: Lou Reed, "Magic and Loss")



Re: Re[2]: [Q] An example of using ESQL in a stylesheet ? Logicsheet ?

Posted by Donald Ball <ba...@webslingerZ.com>.
On Wed, 21 Feb 2001, Sandor Spruit wrote:

> >> What I'd like to do: in the Cocoon pipeline of an XML document, I'd
> >> like to add elements that will eventually get rendered (in HTML) as
> >> a toolbar of buttons or clickable images, above or below the content
> >> of the original XML document.
> >> The functions accessible through this toolbar obviously may depend on
> >> the characteristics of the user, his access rights, session stuff or
> >> a specific document subtype. So, while the stylesheets gets processed,
> >> I'd like to query a database to see what elements need to be inserted,
> >> then fiddle with these elements to render them as HTML.
> >> Is this possible ?
>
> Paul> Mm-hmm. Why not do this in the XSP page itself? In C2 you will
> Paul> (honest) be able to do this using the content aggregation
> Paul> functionality we're in the process of designing.
>
> I'd like to keep the details on toolbars and such away from the folks
> writing the XML documents. They'll at some point just upload, say, a
> news item - recognizable by some document type, tag or attribute. As
> this little XML document gets processing to be displayed, it needs to
> be get the 'news item toolbar' built into the output HTML. Does this
> sound reasonable ?

write your own xsp logicsheet which transforms elements like this:

<foo:toolbar type="new item"/>

into calls to the esql logicsheet or whatever. then your page authors
needs only know about the 'foo' namespace, and don't need to worry about
esql or java code in their pages. this is _key_ to the whole xsp idea.

- donald