You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sylvain Wallez <sy...@apache.org> on 2003/11/01 23:56:14 UTC
Dynamic woody templates?
Hi Woody'ers
Lately, I encountered several use cases where I found that the current
<wt:repeater-widget> we have today is not enough.
Here are some:
- if the repeater is empty, the "delete selected items" should not
appear underneath
- I'm currently writing move up/move down row actions, and I don't want
to display the "up" on the first row nor the "down" on the last one
- when a repeater is empty, I want to display e.g. "there are currently
no items" instead of just the table headers
The first two items can eventually be solved by having the widgets
generating nothing when some condition is verified, but the third cannot
be solved without adding new information in the form template.
So I was thinking to add new esql-like statements (analoguous to
esql:results, esql:no-results, etc) in the woody template.
What do you think?
But I'm also wondering, as woody usage increases, if we will not need to
write form templates involving more and more conditional parts. And for
this, JXTemplate shines. But mixing jx-like access to the form model
with wt: templates elements is likely to quickly become unnatural. A
solution could be to augment the JXTemplate syntax with new
Woody-related instructions. Taglibs for JXTemplate?
What do you think (again)?
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance - http://www.orixo.com
Re: Dynamic woody templates?
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Sylvain Wallez dijo:
>>>But I'm also wondering, as woody usage increases, if we will not need
>>> to write form templates involving more and more conditional parts. And
>>> for this, JXTemplate shines. But mixing jx-like access to the form
>>> model with wt: templates elements is likely to quickly become
>>> unnatural. A solution could be to augment the JXTemplate syntax with
>>> new Woody-related instructions. Taglibs for JXTemplate?
>>
>>>What do you think (again)?
>>
>>Don't know I am not sure if is a good idea to mantain a copy of
>> JXTemplate lib just for woody in another namespace. It will cause
>> overhead.
>
> That's not what I meant: I was suggesting to turn JXTemplate to an
> expandable language to which tag libraries can be added. Just like XSP,
> JSP or... the taglib transformer. I have to look deeper at this last
> one, as it may be close to what I need (but I'd like to have a
> generator)
I don't think it is a good idea, but let time decides if this is OK.
>>I understand the idea of using just one taglib for "wt" namespace. But
>> I think not is a good choice for every case. I think the user that need
>> or want to use JXTemplate, let then use it by defining the namespace
>> and on the same time who does not want it, then don't add then
>> overprocessing by checking for non existent tags.
>
> Sorry, I don't understand clearly. Do you mean that using JXTemplate
> should not be mandatory to use Woody? I agree with this, and was more or
> less thinking to having the woody taglib to define the exact same tags
> than the transformer does, _plus_ some additional tags.
Nope. I mean about the taglibs you suggested above.
Best Regards,
Antonio Gallardo
Re: Dynamic woody templates?
Posted by Sylvain Wallez <sy...@apache.org>.
Bruno Dumon wrote:
>On Sun, 2003-11-02 at 11:09, Sylvain Wallez wrote:
>
>
<snip/>
>>>>So I was thinking to add new esql-like statements (analoguous to esql:results, esql:no-results, etc) in the woody template.
>>>>
>>>>What do you think?
>>>>
>>>>
>
>sounds good
>
>
>>>>But I'm also wondering, as woody usage increases, if we will not need to write form templates involving more and more conditional parts. And for this, JXTemplate shines.
>>>>
>>>>
>
>
>Contrasting this:
>
>
>> But mixing jx-like access to the form model with wt: templates elements is likely to quickly become unnatural. A solution could be to augment the JXTemplate syntax with new Woody-related instructions. Taglibs for JXTemplate?
>>
>>
>
>with this:
>
>
>><snip/> I agree with this, and was more or less thinking to having the woody taglib to define the exact same tags than the transformer does, _plus_ some additional tags.
>>
>>
>
>it wouldn't change much for the user, except for not having to put the woody transformer in the pipeline?
>
>
Exactly. And the feature set available in a JX Template taglib would be
a superset of what the transformer provides.
>I see several positive points though:
>* it would make it more obvious for the user that they can be combined
>* making a generator out of it has the advantage that the template can be precompiled into an object model, which might make it easier to implement certain things then in SAX-streaming mode.
>
>About the only disadvantage I can think of is that it forces the usage of JXTemplate. What if we suddenly realize Garbage is much better? (haven't look at it yet).
>
>
Yep. We still haven't found the perfect template language (remember this
long thread?), which means that if we go the taglib way, we'll have to
reimplement or adapt it to the various template language experiments.
Now isn't it possible to define a common taglib interface that template
languages should be able to handle? After all, what's the fundamental
difference between them (not talking of XSP that produces code)? Isn't
it mostly syntactic sugar?
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance - http://www.orixo.com
Re: Dynamic woody templates?
Posted by Bruno Dumon <br...@outerthought.org>.
On Sun, 2003-11-02 at 11:09, Sylvain Wallez wrote:
> Antonio Gallardo wrote:
>
> >Sylvain Wallez dijo:
> >
> >
> >>Hi Woody'ers
> >>
> >>
> >
> >Wondering about in his Australian meaning! lol.
> >
> >
>
> Oops... Hope I haven't said something dirty ;-)
dirtyness is in the eye of the beholder.
>
> >>Lately, I encountered several use cases where I found that the current
> >><wt:repeater-widget> we have today is not enough.
> >>
<snip/>
> >>So I was thinking to add new esql-like statements (analoguous to
> esql:results, esql:no-results, etc) in the woody template.
> >>
> >>
> >>What do you think?
> >>
sounds good
> >>But I'm also wondering, as woody usage increases, if we will not
> need to write form templates involving more and more conditional
> parts. And for this, JXTemplate shines.
Contrasting this:
> But mixing jx-like access to the form model with wt: templates
> elements is likely to quickly become unnatural. A solution could be to
> augment the JXTemplate syntax with new Woody-related instructions.
> Taglibs for JXTemplate?
with this:
> <snip/> I agree with this, and was more or
> less thinking to having the woody taglib to define the exact same tags
> than the transformer does, _plus_ some additional tags.
it wouldn't change much for the user, except for not having to put the
woody transformer in the pipeline?
I see several positive points though:
* it would make it more obvious for the user that they can be combined
* making a generator out of it has the advantage that the template can
be precompiled into an object model, which might make it easier to
implement certain things then in SAX-streaming mode.
About the only disadvantage I can think of is that it forces the usage
of JXTemplate. What if we suddenly realize Garbage is much better?
(haven't look at it yet).
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org bruno@apache.org
Re: Dynamic woody templates?
Posted by Sylvain Wallez <sy...@apache.org>.
Antonio Gallardo wrote:
>Sylvain Wallez dijo:
>
>
>>Hi Woody'ers
>>
>>
>
>Wondering about in his Australian meaning! lol.
>
>
Oops... Hope I haven't said something dirty ;-)
>>Lately, I encountered several use cases where I found that the current
>><wt:repeater-widget> we have today is not enough.
>>
>>Here are some:
>>- if the repeater is empty, the "delete selected items" should not appear underneath
>>
>>
>
>Yep.
>
>
>>- I'm currently writing move up/move down row actions, and I don't want to display the "up" on the first row nor the "down" on the last one
>>- when a repeater is empty, I want to display e.g. "there are currently no items" instead of just the table headers
>>
>>
>
>This is a good idea.
>
>
>
>>The first two items can eventually be solved by having the widgets generating nothing when some condition is verified, but the third cannot be solved without adding new information in the form template.
>>
>>So I was thinking to add new esql-like statements (analoguous to esql:results, esql:no-results, etc) in the woody template.
>>
>>
>
>Yep.
>
>
>
>>What do you think?
>>
>>
>
>Cool!
>
>
>
>>But I'm also wondering, as woody usage increases, if we will not need to write form templates involving more and more conditional parts. And for this, JXTemplate shines. But mixing jx-like access to the form model with wt: templates elements is likely to quickly become unnatural. A solution could be to augment the JXTemplate syntax with new Woody-related instructions. Taglibs for JXTemplate?
>>
>>
>
>
>
>>What do you think (again)?
>>
>>
>
>Don't know I am not sure if is a good idea to mantain a copy of JXTemplate
>lib just for woody in another namespace. It will cause overhead.
>
>
That's not what I meant: I was suggesting to turn JXTemplate to an
expandable language to which tag libraries can be added. Just like XSP,
JSP or... the taglib transformer. I have to look deeper at this last
one, as it may be close to what I need (but I'd like to have a generator)
>I understand the idea of using just one taglib for "wt" namespace. But I think not is a good choice for every case. I think the user that need or want to use JXTemplate, let then use it by defining the namespace and on the same time who does not want it, then don't add then overprocessing by checking for non existent tags.
>
>
Sorry, I don't understand clearly. Do you mean that using JXTemplate
should not be mandatory to use Woody? I agree with this, and was more or
less thinking to having the woody taglib to define the exact same tags
than the transformer does, _plus_ some additional tags.
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance - http://www.orixo.com
Re: Dynamic woody templates?
Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Sylvain Wallez dijo:
> Hi Woody'ers
Wondering about in his Australian meaning! lol.
> Lately, I encountered several use cases where I found that the current
> <wt:repeater-widget> we have today is not enough.
>
> Here are some:
> - if the repeater is empty, the "delete selected items" should not
> appear underneath
Yep.
> - I'm currently writing move up/move down row actions, and I don't want
> to display the "up" on the first row nor the "down" on the last one -
> when a repeater is empty, I want to display e.g. "there are currently
> no items" instead of just the table headers
This is a good idea.
> The first two items can eventually be solved by having the widgets
> generating nothing when some condition is verified, but the third cannot
> be solved without adding new information in the form template.
>
> So I was thinking to add new esql-like statements (analoguous to
> esql:results, esql:no-results, etc) in the woody template.
Yep.
> What do you think?
Cool!
> But I'm also wondering, as woody usage increases, if we will not need to
> write form templates involving more and more conditional parts. And for
> this, JXTemplate shines. But mixing jx-like access to the form model
> with wt: templates elements is likely to quickly become unnatural. A
> solution could be to augment the JXTemplate syntax with new
> Woody-related instructions. Taglibs for JXTemplate?
> What do you think (again)?
Don't know I am not sure if is a good idea to mantain a copy of JXTemplate
lib just for woody in another namespace. It will cause overhead.
I understand the idea of using just one taglib for "wt" namespace. But I
think not is a good choice for every case. I think the user that need or
want to use JXTemplate, let then use it by defining the namespace and on
the same time who does not want it, then don't add then overprocessing by
checking for non existent tags.
Best Regards,
Antonio Gallardo
Re: Dynamic woody templates?
Posted by Sylvain Wallez <sy...@apache.org>.
Reinhard Poetz wrote:
>From: Sylvain Wallez
>
>
>
>>But I'm also wondering, as woody usage increases, if we will not need to write form templates involving more and more conditional parts. And for this, JXTemplate shines. But mixing jx-like access to the form model with wt: templates elements is likely to quickly become unnatural. A solution could be to augment the JXTemplate syntax with new Woody-related instructions. Taglibs for JXTemplate?
>>
>>What do you think (again)?
>>
>>
>
>
>I think what we need is a possibility to extand a basic JXTemplateGenerator/Transformer to add your own syntax. Otherwise we will end in many different TemplateGenerators/Transformers which have to be maintained separatly. But I think you meant this with Taglibs, don't you?
>
>
Exactly. Specialized extensions are really not the way to go, or we'll
be f**ked as soon as we will want to combine them.
>Anyway, a big +1 for *one* official *extensible* templating approach in Cocoon - otherwise we will confuse our users.
>
>
Experience has shown that the "official" template generator evolves over
time (XSP, JXTemplate, Garbage?). That's why I'd like, if we go the
taglib way, to separate as far as possible taglib definitions from the
syntactic details of the template language.
Sylvain
--
Sylvain Wallez Anyware Technologies
http://www.apache.org/~sylvain http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
Orixo, the opensource XML business alliance - http://www.orixo.com
RE: Dynamic woody templates?
Posted by Reinhard Poetz <re...@apache.org>.
From: Sylvain Wallez
> But I'm also wondering, as woody usage increases, if we will
> not need to
> write form templates involving more and more conditional
> parts. And for
> this, JXTemplate shines. But mixing jx-like access to the form model
> with wt: templates elements is likely to quickly become unnatural. A
> solution could be to augment the JXTemplate syntax with new
> Woody-related instructions. Taglibs for JXTemplate?
>
> What do you think (again)?
I think what we need is a possibility to extand a basic
JXTemplateGenerator/Transformer to add your own syntax. Otherwise we
will end in many different *TemplateGenerators/Transformers which have
to be maintained separatly. But I think you meant this with Taglibs,
don't you?
Anyway, a big +1 for *one* official *extensible* templating approach in
Cocoon - otherwise we will confuse our users.
--
Reinhard