You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alan <al...@engrm.com> on 2004/02/10 10:29:29 UTC
JXTemplate Status
I'm learning forms.
The registration example uses JXTemplate to generate the
confirmation page. Where does JXTemplate stand these days? Is it
a first class citizen of the Repblic of Cocoon?
It seems that JXPath is used elsewhere in Cocoon, which bodes
well for JXTemplate.
Beside handling form output, where else would I use JXTemplate
in my sitemap?
Danke.
--
Alan / alan@engrm.com / http://engrm.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Feb 10, 2004, at 11:31 AM, Alan wrote:
>
> What are the other possiblities for templating? Pointers
> appreciated.
VelocityGenerator:
http://cocoon.apache.org/2.1/userdocs/generators/velocity-
generator.html
JPath logicsheet:
http://cocoon.apache.org/2.1/userdocs/flow/jpath.html
> By the way, this discussion has done much to improve my
> understanding of the problem JXTemplate and XSP address.
>
> Sometimes a template is a cleaner implementation than a
> transform. Cocoon needs to offer developers a way to inject
> variables into a document structure.
>
Lately there have been some articles on a Cocoon component for Betwixt,
which is an XML Java bean serializer:
http://wiki.cocoondev.org/Wiki.jsp?page=BetwixtTransformer
I haven't played with it yet, but it seems like there's a lot of power
there, because unlike the template approaches you don't have to say up
front what parts of the object you want — you just say "I want this
object", and then the whole thing is available (e.g. to query with
Xpath expressions in your XSLT, or whatever else you want to do with
it, since it's XML). It seems like it'd be trickier to implement,
because the serializer has to be smart about cycles. But easy to use,
I imagine.
This touches on what you said in your blog entry ("Why not just... ah,
well that would probably be a pain in the butt", or something like that
— you know the part I'm talking about :-). Yes, now you have the whole
object... so the next thing might be to discover that this isn't so
convenient after all, and we'd end up creating special-purpose Java
Beans as interfaces, whose sole purpose is to be serialized into XML.
At that point, we're not really better off than if we had just written
a light JXTemplate to get the parts we're interested in... or if one
preferred an "imperative" to a "declarative" style for this, written a
little flowscript to do it. Same thing. It boils down to: somewhere,
you have to specify what you want, and in the end it probably doesn't
matter so much where you do it.
There's also an analogy with the Woody transformer vs. generator
thread... I have a form template that really just serves as a carrier
to get the widget instances into the pipeline. In the same way, you
might have a JXTemplate that doesn't contain much of anything, just
some minimal XML with JXPath or Jexl expressions as the element
contents. In that case you might say, "to heck with the template...
just give me the object!" and go with something like Betwixt.
best regards,
~ml
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Alan <al...@engrm.com>.
* Joerg Heinicke <jo...@gmx.de> [2004-02-10 19:09]:
> On 10.02.2004 19:44, Alan wrote:
>
> >>>I'm learning forms.
> >>>
> >>> The registration example uses JXTemplate to generate the
> >>> confirmation page. Where does JXTemplate stand these days? Is it
> >>> a first class citizen of the Repblic of Cocoon?
> >Here's another metric:
> > [alan@bled cocoon-2.1.3]$ find . -name \*.xsp | wc
> > 150 150 9546
> > [alan@bled cocoon-2.1.3]$ find . -name \*.jx | wc
> > 13 13 800
> >
> > It appears that XSP, although folks are moving away from it,
> > still does a lot of work in the Cocoon 2.1.3 distribution.
> >
> > JXTemplate doesn't look like it has as much employment, yet.
> Of course. Have a look how long JXTemplate exists. Furthermore
> finding files by endings is a disadvantage for jx (e.g.
> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/woody/samples/forms/form2_jx.xml).
> Grepping on the namespace URIs should give better results.
Another shot from the hip:
[alan@ljubljana cocoon-2.1.3]$ find . -name \*.xsp | wc
103 103 5230
[alan@ljubljana cocoon-2.1.3]$ grep -l -r --include="*.xml" --include="*.jx" \
"http://apache.org/cocoon/templates/jx/1.0" . | wc
31 31 1595
I offer this as a rigrous application of the scientific method that
proves irrefutably that JXTemplate is used 30% less than XSP in
the Cocoon 2.1.3 distribution.
> >>> Beside handling form output, where else would I use JXTemplate
> >>> in my sitemap?
> >
> >>You can use it everywhere where you need a template technique. Or shall
> >>I say where a template technique is powerful enough for you? In
> >>comparison to JSP you have the advantage of applying transformer
> >>afterwards.
> >
> >Is JXTemplate moving into the vacuum created by XSP then? Anyone else want
> >to
> > chime in? It seems to me to be the case if JXTemplate has been moved to
> > the core (from the CVS log) and XSP is moving out.
>
> Not that official as replacement for XSP, but it's one possibility.
> JXTemplate was probably in the scratchpad before. XSP will probably
> moved out of core in Cocoon 2.2 in its own block (but no deeper
> discussion or vote on this have taken place yet).
What are the other possiblities for templating? Pointers
appreciated.
By the way, this discussion has done much to improve my
understanding of the problem JXTemplate and XSP address.
Sometimes a template is a cleaner implementation than a
transform. Cocoon needs to offer developers a way to inject
variables into a document structure.
Thanks for the guidence.
--
Alan / alan@engrm.com / http://engrm.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Joerg Heinicke <jo...@gmx.de>.
On 10.02.2004 19:44, Alan wrote:
>>>I'm learning forms.
>>>
>>> The registration example uses JXTemplate to generate the
>>> confirmation page. Where does JXTemplate stand these days? Is it
>>> a first class citizen of the Repblic of Cocoon?
>
>>The best resource on this is the CVS:
>>http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java.
>
> Here's another metric:
>
> [alan@bled cocoon-2.1.3]$ find . -name \*.xsp | wc
> 150 150 9546
> [alan@bled cocoon-2.1.3]$ find . -name \*.jx | wc
> 13 13 800
>
> It appears that XSP, although folks are moving away from it, still does a
> lot of work in the Cocoon 2.1.3 distribution.
>
> JXTemplate doesn't look like it has as much employment, yet.
Of course. Have a look how long JXTemplate exists. Furthermore finding
files by endings is a disadvantage for jx (e.g.
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/blocks/woody/samples/forms/form2_jx.xml).
Grepping on the namespace URIs should give better results.
>>> Beside handling form output, where else would I use JXTemplate
>>> in my sitemap?
>
>>You can use it everywhere where you need a template technique. Or shall
>>I say where a template technique is powerful enough for you? In
>>comparison to JSP you have the advantage of applying transformer afterwards.
>
> Is JXTemplate moving into the vacuum created by XSP then? Anyone else want to
> chime in? It seems to me to be the case if JXTemplate has been moved to
> the core (from the CVS log) and XSP is moving out.
Not that official as replacement for XSP, but it's one possibility.
JXTemplate was probably in the scratchpad before. XSP will probably
moved out of core in Cocoon 2.2 in its own block (but no deeper
discussion or vote on this have taken place yet).
>>And to answer your fears on your blog: The problem of XSP is the
>>implementation, not the idea. It allows to much, so that we can't be
>>restrictive on validating or similar. We don't get bugs fixed as we
>>can't hit all use cases (e.g.
>>http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15841).
>
> I'm not sure what I'm looking at in the bug report, but I can see that there
> is no good way to validate XSP. Especially if you can inject elements from
> Java snippets.
That's exactly the problem I wanted to point out. There are probably
more examples on this.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Alan <al...@engrm.com>.
* Joerg Heinicke <jo...@gmx.de> [2004-02-11 00:06]:
> On 10.02.2004 20:41, Alan wrote:
>
> >>Actually I think Woody was not designed to be used with Flow. Joerg
> >>used the word "propagated", and that seems right. When Flow was
> >>introduced, Woody was brought forward to play together with it ??well,
> >>the WoodyTemplateTransformer, anyway!
> >
> >
> >I can't find a definition of propagated that fits that sentence.
> >
> > http://www.m-w.com/cgi-bin/dictionary?va=propagated
> >
> > Er, extend maybe, but propagetion is really something rabbits do.
>
> Propagate should means publicize, maybe propagandize is more in use, or
> announce, or ...
>
> http://dict.tu-chemnitz.de/dings.cgi?o=3001;count=50;dlink=self;service=de-en;query=propagieren
Definition 3b in the http://m-w.com/ entry does fit your sentence.
Propagate is pretty tightly bound to perpetuate, pass on,
continue, like in propagtion of execptions.
Propagandize is the better verb to evoke politics. Publicize is
a straight-foward way to say it.
When its time for me to talk about my software, however, I don't
publicize, I proselyzize:
http://www.m-w.com/cgi-bin/dictionary?va=proselytize
Thanks for the dictionary link, one of my New Years Resolutions is
to learn German.
We now return to or regularly scheduled programme (maybe).
--
Alan / alan@engrm.com / http://engrm.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Joerg Heinicke <jo...@gmx.de>.
On 10.02.2004 20:41, Alan wrote:
>>Actually I think Woody was not designed to be used with Flow. Joerg
>>used the word "propagated", and that seems right. When Flow was
>>introduced, Woody was brought forward to play together with it ??well,
>>the WoodyTemplateTransformer, anyway!
>
>
> I can't find a definition of propagated that fits that sentence.
>
> http://www.m-w.com/cgi-bin/dictionary?va=propagated
>
> Er, extend maybe, but propagetion is really something rabbits do.
Propagate should means publicize, maybe propagandize is more in use, or
announce, or ...
http://dict.tu-chemnitz.de/dings.cgi?o=3001;count=50;dlink=self;service=de-en;query=propagieren
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Feb 10, 2004, at 11:41 AM, Alan wrote:
> * Mark Lundquist <ml...@wrinkledog.com> [2004-02-10 19:10]:
>> Actually I think Woody was not designed to be used with Flow. Joerg
>> used the word "propagated", and that seems right. When Flow was
>> introduced, Woody was brought forward to play together with it
>
> I can't find a definition of propagated that fits that sentence.
>
> http://www.m-w.com/cgi-bin/dictionary?va=propagated
>
> Er, extend maybe, but propagetion is really something rabbits do.
OK, you're saying that rabbits propagated Woody?
:-)
~ml
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Alan <al...@engrm.com>.
* Mark Lundquist <ml...@wrinkledog.com> [2004-02-10 19:10]:
>
> On Feb 10, 2004, at 10:44 AM, Alan wrote:
> > > BTW Woody is propagated to be used with Flow, but not bound to
> > > it.
> > >
> >
> > Woody is designed to be used with Flow, but not bound to it. Check.
> Actually I think Woody was not designed to be used with Flow. Joerg
> used the word "propagated", and that seems right. When Flow was
> introduced, Woody was brought forward to play together with it ??well,
> the WoodyTemplateTransformer, anyway!
I can't find a definition of propagated that fits that sentence.
http://www.m-w.com/cgi-bin/dictionary?va=propagated
Er, extend maybe, but propagetion is really something rabbits do.
I think you are trying to tell me that they developed
independently.
Woody was extended to work with Flow. But don't let the seamless
integeration fool you: Woody works nicely with Flow, but is not
bound to it.
Cheers.
--
Alan / alan@engrm.com / http://engrm.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Feb 10, 2004, at 10:44 AM, Alan wrote:
>
> Here's another metric:
>
> [alan@bled cocoon-2.1.3]$ find . -name \*.xsp | wc
> 150 150 9546
> [alan@bled cocoon-2.1.3]$ find . -name \*.jx | wc
> 13 13 800
>
> It appears that XSP, although folks are moving away from it, still
> does a
> lot of work in the Cocoon 2.1.3 distribution.
>
> JXTemplate doesn't look like it has as much employment, yet.
A couple of points to throw out:
1) All of those occurrences (both of .xsp and .jx) are in the samples,
so neither are used 'in' Cocoon per se. My guess is that samples that
exemplify something useful are going to be around for a while, even if
they happen to use XSP just because that's what there was to use when
the sample was written.
2) JXTemplate vs. XSP is a bit of an apples & oranges comparison...
Flow+JXTemplate vs. XSP might be more fair to compare.
> <..snip..>
>
>> BTW Woody is propagated to be used with Flow, but not bound to it.
>
> Woody is designed to be used with Flow, but not bound to it. Check.
Actually I think Woody was not designed to be used with Flow. Joerg
used the word "propagated", and that seems right. When Flow was
introduced, Woody was brought forward to play together with it — well,
the WoodyTemplateTransformer, anyway! The WoodyGenerator missed that
train, as we've covered in other posts. The core of Woody doesn't
depend on flow. You can look right at the heart of Woody+Flow
integration, it's a fairly small flowscript program that you load at
the beginning of every Woody controller flowscript:
org/apache/cocoon/woody/flow/javascript/woody2.js
...and it's instructive to do so, as it really helps with understanding
how all this works (it's helped me, anyway).
Cheers,
~ml
Re: JXTemplate Status
Posted by Alan <al...@engrm.com>.
* Joerg Heinicke <jo...@gmx.de> [2004-02-10 11:04]:
> On 10.02.2004 10:29, Alan wrote:
> >I'm learning forms.
> >
> > The registration example uses JXTemplate to generate the
> > confirmation page. Where does JXTemplate stand these days? Is it
> > a first class citizen of the Repblic of Cocoon?
> The best resource on this is the CVS:
> http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java.
> See how often it was changed in the last days/weeks/months. From
> the commit message you should also get the importance of a change.
Here's another metric:
[alan@bled cocoon-2.1.3]$ find . -name \*.xsp | wc
150 150 9546
[alan@bled cocoon-2.1.3]$ find . -name \*.jx | wc
13 13 800
It appears that XSP, although folks are moving away from it, still does a
lot of work in the Cocoon 2.1.3 distribution.
JXTemplate doesn't look like it has as much employment, yet.
> > It seems that JXPath is used elsewhere in Cocoon, which bodes
> > well for JXTemplate.
> >
> > Beside handling form output, where else would I use JXTemplate
> > in my sitemap?
> You can use it everywhere where you need a template technique. Or shall
> I say where a template technique is powerful enough for you? In
> comparison to JSP you have the advantage of applying transformer afterwards.
Is JXTemplate moving into the vacuum created by XSP then? Anyone else want to
chime in? It seems to me to be the case if JXTemplate has been moved to
the core (from the CVS log) and XSP is moving out.
> And to answer your fears on your blog: The problem of XSP is the
> implementation, not the idea. It allows to much, so that we can't be
> restrictive on validating or similar. We don't get bugs fixed as we
> can't hit all use cases (e.g.
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15841).
I'm not sure what I'm looking at in the bug report, but I can see that there
is no good way to validate XSP. Especially if you can inject elements from
Java snippets.
> BTW Woody is propagated to be used with Flow, but not bound to it.
Woody is designed to be used with Flow, but not bound to it. Check.
--
Alan / alan@engrm.com / http://engrm.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: JXTemplate Status
Posted by Joerg Heinicke <jo...@gmx.de>.
On 10.02.2004 10:29, Alan wrote:
> I'm learning forms.
>
> The registration example uses JXTemplate to generate the
> confirmation page. Where does JXTemplate stand these days? Is it
> a first class citizen of the Repblic of Cocoon?
The best resource on this is the CVS:
http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/java/org/apache/cocoon/generation/JXTemplateGenerator.java.
See how often it was changed in the last days/weeks/months. From the
commit message you should also get the importance of a change.
> It seems that JXPath is used elsewhere in Cocoon, which bodes
> well for JXTemplate.
>
> Beside handling form output, where else would I use JXTemplate
> in my sitemap?
You can use it everywhere where you need a template technique. Or shall
I say where a template technique is powerful enough for you? In
comparison to JSP you have the advantage of applying transformer afterwards.
And to answer your fears on your blog: The problem of XSP is the
implementation, not the idea. It allows to much, so that we can't be
restrictive on validating or similar. We don't get bugs fixed as we
can't hit all use cases (e.g.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15841).
BTW Woody is propagated to be used with Flow, but not bound to it.
Joerg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org