commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [workflow] Jelly <-> Workflow maybe some crossover
Date Thu, 07 Mar 2002 20:41:04 GMT
Hi Paulo

----- Original Message -----
From: "Paulo Gaspar" <paulo.gaspar@krankikom.de>
> Hi James,
>
>
> I think that pnuts is not so efficient when using it trough BSF,
> but I do not remeber the specifics so well anymore.

Actually I've just done the BSF integration with Jelly and you're right. I
think I'll add a tag library to go direct to pnuts shortly, certainly
getting access to pnuts compiling would be better for sure. BSF just allows
you to get a CodeBuffer which contains the Java code in it, which you have
to compile & classload yourself.


> Using some of its specifics one can really minimize parsing and
> compiling to the minimum (once per change) and use each compiled
> instance in a multi threader application.

Agreed.

> It is also nice to allow external scripts, like in this fragment
> that actually is working somewhere:
>
>             <when uri="kino/film">
>                 <run-pnuts direct-out="true" >
>                     <text-url url="${film.folder}/film.pnut" />
>                 </run-pnuts>
>             </when>
>
> The text bit is more verbose but is due to the fact that I have
> a common text loading mechanism also present here, as in this
> debug code bit:
>
>                 <match-uri wildcard="**/*">
>                     <run-pnuts direct-out="true">
>                         <text>
>                             println();
>                             println("wildcard=**/*");
>                             println("&lt;h5&gt;matches = " + matches +
> "&lt;/H5&gt;");
>                         </text>
>                     </run-pnuts>
>                 </match-uri>
>
> ...but also present in non pnuts related bits, like with SQL
> statements. The text loading helps
>
>
> Actually I am NOT using the <text> mechanism for SQL anywhere
> because pnuts makes it so easy to write SQL by using those "`"
> quotes for multi-line strings, as in:
>   sql =
>   `SELECT
>     addr_id,
>     caption,
>     phone,
>     fax,
>     zipcode,
>     street,
>     doornumber,
>     city,
>     cityzone,
>     remarks
>   FROM address
>   WHERE ADDR_ID=` + id
>
> =:o)
>
> Pnuts documentation is not always easy to follow, but it is
> still much better than most open source projects. And although
> you might find some features/quirks weird, after some use all
> of it ends up making a lot of sense.
>
> For me Pnuts is one of those rare:
>   "the more I use it the more I like it!"
>
> I even get to think that generating JSPs troug Pnuts would
> simplify a LOT the current issues by compiling them (faster)
> without writing to the disk.

This all looks great stuff Paulo.

I'd be interested in finding out more on how you integrate pnuts with XML.
Maybe Jelly could be a useful engine for you? Much of the above code should
be pretty easy to use in Jelly. Fairly soon there'll be JSTL-style
<forEach>, <if>, <choose><when><otherwise>, <expr> and
<set> tags that work
with JavaScript/BSF/JPython, Beanshell, Velocity and Pnuts. The idea is that
we can bind any element name to a 'tag' to do anything, be it pnuts,
Velocity stuff, JavaScript, XSLT, XPath, SQL or whatnot.

James



--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message