You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Daniel Florey <da...@web.de> on 2004/11/13 21:15:44 UTC

Added projector documentation link

Hi folks,
I've added a link to the Slide website that points to my (work in progress)
documentation of Projector.

Cheers,
Daniel


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Stephane Bailliez <sb...@apache.org>.
Oliver Zeigermann wrote:
> 
> StringTemplate is a general template engine not geared towards HTML as
> well. I like Daniel's approach as it is cleaner and stricter in design
> than StringTemplate and both enforce MV separation. Some constructions
> in StringTemplate seem to be pretty random to me...

Well, all I was saying was to avoid the NIY syndrom.

Projector goal is to have the infrastructure for a event-driven 
workflow. I don't think it is a good idea to start designing a template 
engine, a rules engine and a workflow engine.

If all you ever need is a couple of conditional formatting, then a 
couple of taglibs will do fine for JSP rendering and tools will be fine 
for velocity (or you could use Tea templates[1] as well)

[1] http://teatrove.sourceforge.net/


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Oliver Zeigermann <ol...@gmail.com>.
On Sun, 14 Nov 2004 16:35:55 +0100, Stephane Bailliez
<sb...@apache.org> wrote:
> Daniel Florey wrote:
> If you feel like using a template language, I will probably recommend to
> look at StringTemplate (www.stringtemplate.org)
> Enforcing Strict Model-View Separation in Template Engines
> There's a nice paper from Terence Parr to read:
> http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf
> 
> Which I agree mostly except in definition 7 rule 3. I think the JSTL
> syntax ${empty elements} is actually kind of an interesting compromise.

StringTemplate is a general template engine not geared towards HTML as
well. I like Daniel's approach as it is cleaner and stricter in design
than StringTemplate and both enforce MV separation. Some constructions
in StringTemplate seem to be pretty random to me...

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


AW: AW: Added projector documentation link

Posted by Daniel Florey <da...@web.de>.

> -----Ursprüngliche Nachricht-----
> Von: slide-user-return-9608-daniel.florey=web.de@jakarta.apache.org
> [mailto:slide-user-return-9608-daniel.florey=web.de@jakarta.apache.org] Im
> Auftrag von Stephane Bailliez
> Gesendet: Sonntag, 14. November 2004 16:36
> An: slide-user@jakarta.apache.org
> Betreff: Re: AW: Added projector documentation link
> 
> Daniel Florey wrote:
> >
> > OK, the example you've picked out seems to be complicated (as I've state
> in
> > the documentation). My intention for this templating was:
> > 1. To make it very simple. You just mark the dynamic parts in html pages
> and
> > you optionally specify the matching content type.
> > 2. It is not targeted towards java programmers, but should be handy for
> > people with html knowledge. They can simple take their static html-pages
> and
> > turn them into projector templates without java skill.
> > 3. I've choosed the <%variable%> syntax as many html-editors (like adobe
> go
> > live) handle this correctly as it is close to ASP syntax.
> > 4. See documentation why I've added the <? ... ?>  expression.
> 
> > But I'm very open to suggestions how to make it even simpler. As the tag
> > identifiers are defined in a static String, it is very easy to replace
> them
> > with other tags.
> 
> - I don't think that the example you gave is extremely complicated but
> pretty simple.
> 
> - I'm not trusting the role separation up to this point. This is a nice
> marketing speech, but reality seems to be far different to me. Velocity
> 'or another template) is said to be targeted toward people with html
> knowledge when using it as a view in a mvc, but there's no way that
> someone with no programming knowledge will be able to go through more
> than 2 screens without duplicating massive logic between pages.
> 
> A dynamic page requires presentation logic, and there is no way that you
> can write such logic without programming knowledge (note: that does not
> mean the business logic is in the page). And presentation logic can (and
> need) to be factorized as well. Someone with no programming
> knowledge/concept can hardly do this.

This is true, but in terms of Projector the logic is encapsulated in
processors. So it's very easy to add some java code to Projector, by simply
adding a new processor (this can be done at runtime by simply dropping the
class in the repository) and you can print out templates and template
fragments easily.
I hope to be able to add some real life examples to the Projector
documentation to give people an impression how harder tasks can be
implemented without the need of coding inside of the templates.
You can have a look at the TableRenderer to get an impression how this will
work.
Cheers,
Daniel

> 
> > I'll avoid jsp's as it enabled people to fill programming code into the
> > templates and decreases reusability. I've worked in so many project
> where
> > all of the logic was coded into jsp that I still feel it's clever to
> > prohibit programming code in the templates.
> > Start using it and I hope you'll share this feeling ;-)
> 
> That's an understandable feeling. I know the pain. I'm part time on a
> project where every EJB lookup is right into the JSPs, and I know what a
> headache this is. One change in the model goes all the way till the
> pages where you have the business logic.
> 
> However.
> 
> I don't think we should forbid the use of fork and knife because it can
> be badly used by kids.
> 
> Having been doing projects with full xml/xslt and Velocity, I also know
> the pain of these solutions when applying it to a large number of
> screens. There's no silver bullet to me.
> 
> Someone even tried to sell me separating the presentation logic of
> secured data into a ldap directory so that we were close to the
> "invisible framework"[1] in the view: it was merely a <mytag:display/>,
> if you have ever tried customizing presentation logic by modifying data
> in a ldap directory, you should, that makes everything fun in comparison.
> :)
> 
> 
> [1] http://www.depeupleur.com/blog/TT_blog/archives/000020.html
> 
> If you feel like using a template language, I will probably recommend to
> look at StringTemplate (www.stringtemplate.org)
> Enforcing Strict Model-View Separation in Template Engines
> There's a nice paper from Terence Parr to read:
> http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf

Thanks for the link, I'll take a look at this.
Cheers,
Daniel

> 
> Which I agree mostly except in definition 7 rule 3. I think the JSTL
> syntax ${empty elements} is actually kind of an interesting compromise.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Stephane Bailliez <sb...@apache.org>.
Daniel Florey wrote:
> 
> OK, the example you've picked out seems to be complicated (as I've state in
> the documentation). My intention for this templating was:
> 1. To make it very simple. You just mark the dynamic parts in html pages and
> you optionally specify the matching content type.
> 2. It is not targeted towards java programmers, but should be handy for
> people with html knowledge. They can simple take their static html-pages and
> turn them into projector templates without java skill.
> 3. I've choosed the <%variable%> syntax as many html-editors (like adobe go
> live) handle this correctly as it is close to ASP syntax.
> 4. See documentation why I've added the <? ... ?>  expression.

> But I'm very open to suggestions how to make it even simpler. As the tag
> identifiers are defined in a static String, it is very easy to replace them
> with other tags.

- I don't think that the example you gave is extremely complicated but 
pretty simple.

- I'm not trusting the role separation up to this point. This is a nice 
marketing speech, but reality seems to be far different to me. Velocity 
'or another template) is said to be targeted toward people with html 
knowledge when using it as a view in a mvc, but there's no way that 
someone with no programming knowledge will be able to go through more 
than 2 screens without duplicating massive logic between pages.

A dynamic page requires presentation logic, and there is no way that you 
can write such logic without programming knowledge (note: that does not 
mean the business logic is in the page). And presentation logic can (and 
need) to be factorized as well. Someone with no programming 
knowledge/concept can hardly do this.

> I'll avoid jsp's as it enabled people to fill programming code into the
> templates and decreases reusability. I've worked in so many project where
> all of the logic was coded into jsp that I still feel it's clever to
> prohibit programming code in the templates.
> Start using it and I hope you'll share this feeling ;-)

That's an understandable feeling. I know the pain. I'm part time on a 
project where every EJB lookup is right into the JSPs, and I know what a 
headache this is. One change in the model goes all the way till the 
pages where you have the business logic.

However.

I don't think we should forbid the use of fork and knife because it can 
be badly used by kids.

Having been doing projects with full xml/xslt and Velocity, I also know 
the pain of these solutions when applying it to a large number of 
screens. There's no silver bullet to me.

Someone even tried to sell me separating the presentation logic of 
secured data into a ldap directory so that we were close to the 
"invisible framework"[1] in the view: it was merely a <mytag:display/>, 
if you have ever tried customizing presentation logic by modifying data 
in a ldap directory, you should, that makes everything fun in comparison. :)


[1] http://www.depeupleur.com/blog/TT_blog/archives/000020.html

If you feel like using a template language, I will probably recommend to 
look at StringTemplate (www.stringtemplate.org)
Enforcing Strict Model-View Separation in Template Engines
There's a nice paper from Terence Parr to read:
http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf

Which I agree mostly except in definition 7 rule 3. I think the JSTL 
syntax ${empty elements} is actually kind of an interesting compromise.


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Added projector documentation link

Posted by James Mason <ma...@apache.org>.
Cool. Thanks,

-James

On Wed, 2004-11-17 at 12:02 -0500, Tim Frank wrote:
> James Mason wrote on 17/11/04 11:50 AM:
> > On Wed, 2004-11-17 at 08:54 -0500, Tim Frank wrote:
> > 
> >>>One thing I don't think JXTemplate can handle (not sure on this) is
> >>>outputting non-marked-up content. This would be a problem with CSS
> >>>files, for example. I love the way the CSS theme is handled with the
> >>>example application (I've copied the idea into another system I'm
> >>>working on), so it would be a shame to lose that.
> >>
> >>You can output non XML content from JX templates, just as long as your 
> >>JX Template is a valid XML document. Same way you can output a 
> >>comma-delimited data file from an XSLT transformation. So outputting 
> >>CSS, Javascript, etc would not be a technical problem, but it might be 
> >>ugly to do so.
> > 
> > 
> > How would you do this? For the template to be valid xml there needs to
> > be a root tag, and I haven't seen anyway to keep the tag out of the
> > results. Is there a <jx:ignore-me> tag or something?
> > 
> 
> Well, if we are sticking within the Cocoon framework where JX Templates 
> work it is quite easy. This template:
> 
> <?xml version="1.0" ?>
> <jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
> This is my JX Template
> </jx:template>
> 
> Combined with this sitemap entry:
> 
> <map:match pattern="mytest.jx">
>    <map:generate type="jx" src="mytest.jx" />
>    <map:serialize type="text"/>
> </map:match>
> 
> Will output nothing more than a simple text file. No root tag required. 
> If you are serializing your JX to XML, of course you need at least a 
> root tag. For CSS/Javascript they DO have a "root" tag of <style> or 
> <script> which you could use and then serialise to XML. The text between 
> the root is always valid.
> 
> Sorry this is a little off topic for slide per-se.
> 
> Tim
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Added projector documentation link

Posted by Tim Frank <tf...@registrar.uoguelph.ca>.
James Mason wrote on 17/11/04 11:50 AM:
> On Wed, 2004-11-17 at 08:54 -0500, Tim Frank wrote:
> 
>>>One thing I don't think JXTemplate can handle (not sure on this) is
>>>outputting non-marked-up content. This would be a problem with CSS
>>>files, for example. I love the way the CSS theme is handled with the
>>>example application (I've copied the idea into another system I'm
>>>working on), so it would be a shame to lose that.
>>
>>You can output non XML content from JX templates, just as long as your 
>>JX Template is a valid XML document. Same way you can output a 
>>comma-delimited data file from an XSLT transformation. So outputting 
>>CSS, Javascript, etc would not be a technical problem, but it might be 
>>ugly to do so.
> 
> 
> How would you do this? For the template to be valid xml there needs to
> be a root tag, and I haven't seen anyway to keep the tag out of the
> results. Is there a <jx:ignore-me> tag or something?
> 

Well, if we are sticking within the Cocoon framework where JX Templates 
work it is quite easy. This template:

<?xml version="1.0" ?>
<jx:template xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
This is my JX Template
</jx:template>

Combined with this sitemap entry:

<map:match pattern="mytest.jx">
   <map:generate type="jx" src="mytest.jx" />
   <map:serialize type="text"/>
</map:match>

Will output nothing more than a simple text file. No root tag required. 
If you are serializing your JX to XML, of course you need at least a 
root tag. For CSS/Javascript they DO have a "root" tag of <style> or 
<script> which you could use and then serialise to XML. The text between 
the root is always valid.

Sorry this is a little off topic for slide per-se.

Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Added projector documentation link

Posted by James Mason <ma...@apache.org>.
On Wed, 2004-11-17 at 08:54 -0500, Tim Frank wrote:
> > One thing I don't think JXTemplate can handle (not sure on this) is
> > outputting non-marked-up content. This would be a problem with CSS
> > files, for example. I love the way the CSS theme is handled with the
> > example application (I've copied the idea into another system I'm
> > working on), so it would be a shame to lose that.
> 
> You can output non XML content from JX templates, just as long as your 
> JX Template is a valid XML document. Same way you can output a 
> comma-delimited data file from an XSLT transformation. So outputting 
> CSS, Javascript, etc would not be a technical problem, but it might be 
> ugly to do so.

How would you do this? For the template to be valid xml there needs to
be a root tag, and I haven't seen anyway to keep the tag out of the
results. Is there a <jx:ignore-me> tag or something?

-James

> 
> Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Added projector documentation link

Posted by Tim Frank <tf...@registrar.uoguelph.ca>.
See inline below,

James Mason wrote on 17/11/04 01:52 AM:
> On Sun, 2004-11-14 at 02:34 +0100, Stephane Bailliez wrote:
> [snip...]

[snip again...]

> I don't think JXTemplate can handle conditional attributes, but I would
> like to point out that in most cases there's a "false" value that can be
> used to keep the same behavior as leaving the parameter off. The most
> obvious example I can think of is the "selected" attribute for <option>
> tags. Both selected="" and selected="false" should be valid for the
> unselected options.

There are conditional constructs for IF and CHOOSE similar/mirrored from 
XSLT. There is also an enhanced version of forEach, macros for creating 
custom tags, lots of goodies overall.

> One thing I don't think JXTemplate can handle (not sure on this) is
> outputting non-marked-up content. This would be a problem with CSS
> files, for example. I love the way the CSS theme is handled with the
> example application (I've copied the idea into another system I'm
> working on), so it would be a shame to lose that.

You can output non XML content from JX templates, just as long as your 
JX Template is a valid XML document. Same way you can output a 
comma-delimited data file from an XSLT transformation. So outputting 
CSS, Javascript, etc would not be a technical problem, but it might be 
ugly to do so.

Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Added projector documentation link

Posted by James Mason <ma...@apache.org>.
On Sun, 2004-11-14 at 02:34 +0100, Stephane Bailliez wrote:
[snip...]
> why did you make your own template language ?
> 
> When I see this:
> 
> <?username <h1 <?style style="<%style%>"?>>Hello 
> <%username;required;text/plain%>!</h1>?>
> 
> I'm already screaming of pain ! It's not readable !

This is something I had a problem with as well. I've never used
Velocity, but given its growing popularity there's a decent chance that
developers/designer coming to Projector have at least heard of it. Also,
since it's used elsewhere it would be a skill that could be applied to
other areas later, and hence have a greater incentive to learn (and be
less of a catch-point during product selection). It also means IDEs are
more likely to support the syntax, at least with syntax highlighting. It
was very frustrating to work on template files and have my editor tweak
out over what should be red and what should be gray.

I'd like to suggest at least having a look at JXTemplate
[http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html]. It's
extremely simple, and was very fast to pick up. The documentation is a
single page and has (I think) everything you need to know. All templates
are valid XML which is very handy for people comfortable with XSLT, and
friendly to most IDEs and editors. JXTemplate uses a jstl-like syntax or
a jxpath syntax for referencing the object graph passed to the template.
It's very easy to echo values, so for simple templates just substituting
${header.title} for "Sample Header Title" should be enough.

I don't think JXTemplate can handle conditional attributes, but I would
like to point out that in most cases there's a "false" value that can be
used to keep the same behavior as leaving the parameter off. The most
obvious example I can think of is the "selected" attribute for <option>
tags. Both selected="" and selected="false" should be valid for the
unselected options.

One thing I don't think JXTemplate can handle (not sure on this) is
outputting non-marked-up content. This would be a problem with CSS
files, for example. I love the way the CSS theme is handled with the
example application (I've copied the idea into another system I'm
working on), so it would be a shame to lose that.

The last thing I'll throw out here is Zope Page Templates. There's a
java implementation [http://javazpt.sourceforge.net/] (GPL'd), so it
should be portable. I've only briefly glanced at zpt, but one capability
I noticed that was interesting was the capability to replace a piece of
text, an attribute, the contents of a tag or the entire tag (and all
attributes and contents) with dynamic content. This means a template can
contain as much placeholder content as a designer needs in order to work
with the template in their IDE/whatever while still containing all of
the presentation logic that makes it a real "template". If
ease-of-designer-use is a priority, this seems like a good approach.

-James


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Tassos Bassoukos <ab...@gmail.com>.
('m currently working on a project that uses Velocity)
Yes, Velocity can be used to output anything textual, not only HTML.
However, it is not a complete language, as it severely restricted in
the control statements available (foreach, the only looping construct
available, can only perform loops on collections, iterators or
arrays). It is very good for templating and calling JavaBeans...

Tassos

On Sun, 14 Nov 2004 16:49:33 +0100, Oliver Zeigermann
<ol...@gmail.com> wrote:
> Isn't velocity a more general (not restricted to HTML) template
> engine? Additionally it allows control structures like foreach,
> assignments, methods, etc.
> 
> This is a complete programming language while Projector templating is
> much simpler...
> 
> Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Oliver Zeigermann <ol...@gmail.com>.
Isn't velocity a more general (not restricted to HTML) template
engine? Additionally it allows control structures like foreach,
assignments, methods, etc.

This is a complete programming language while Projector templating is
much simpler...

Oliver


On Mon, 15 Nov 2004 00:34:27 +0900, Carlos Villegas <ca...@uniscope.jp> wrote:
> 
> 
> 
> 
> Daniel Florey wrote:
> >>Why not using a standard jsp/jstl solution, should it means creating
> >>taglibs ?
> >
> >
> > I'll avoid jsp's as it enabled people to fill programming code into the
> > templates and decreases reusability. I've worked in so many project where
> > all of the logic was coded into jsp that I still feel it's clever to
> > prohibit programming code in the templates.
> > Start using it and I hope you'll share this feeling ;-)
> 
> It sounds like the same goals as Velocity. Why not using Velocity?
> 
> Or some way to plug in your favorite template language.
> 
> 
> Carlos
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Carlos Villegas <ca...@uniscope.jp>.

Daniel Florey wrote:
>>Why not using a standard jsp/jstl solution, should it means creating
>>taglibs ?
> 
> 
> I'll avoid jsp's as it enabled people to fill programming code into the
> templates and decreases reusability. I've worked in so many project where
> all of the logic was coded into jsp that I still feel it's clever to
> prohibit programming code in the templates.
> Start using it and I hope you'll share this feeling ;-)

It sounds like the same goals as Velocity. Why not using Velocity?

Or some way to plug in your favorite template language.


Carlos

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


AW: Added projector documentation link

Posted by Daniel Florey <da...@web.de>.

> -----Ursprüngliche Nachricht-----
> Von: slide-user-return-9605-daniel.florey=web.de@jakarta.apache.org
> [mailto:slide-user-return-9605-daniel.florey=web.de@jakarta.apache.org] Im
> Auftrag von Stephane Bailliez
> Gesendet: Sonntag, 14. November 2004 02:34
> An: slide-user@jakarta.apache.org
> Cc: slide-dev@jakarta.apache.org
> Betreff: Re: Added projector documentation link
> 
> Daniel Florey wrote:
> > Hi folks,
> > I've added a link to the Slide website that points to my (work in
> progress)
> > documentation of Projector.
> 
> Congratulation Daniel, that's a cool documentation as an introduction to
> the projector.

Thanks. More to come soon as I'm still converting the docs to docbook (no
fun).

> 
> I have yet to digest everything and think more about it, but I have one
> feeling to share:
> 
> why did you make your own template language ?
> 
> When I see this:
> 
> <?username <h1 <?style style="<%style%>"?>>Hello
> <%username;required;text/plain%>!</h1>?>
> 
> I'm already screaming of pain ! It's not readable !
> 

OK, the example you've picked out seems to be complicated (as I've state in
the documentation). My intention for this templating was:
1. To make it very simple. You just mark the dynamic parts in html pages and
you optionally specify the matching content type.
2. It is not targeted towards java programmers, but should be handy for
people with html knowledge. They can simple take their static html-pages and
turn them into projector templates without java skill.
3. I've choosed the <%variable%> syntax as many html-editors (like adobe go
live) handle this correctly as it is close to ASP syntax.
4. See documentation why I've added the <? ... ?>  expression.

But I'm very open to suggestions how to make it even simpler. As the tag
identifiers are defined in a static String, it is very easy to replace them
with other tags.

> Why not using a standard jsp/jstl solution, should it means creating
> taglibs ?

I'll avoid jsp's as it enabled people to fill programming code into the
templates and decreases reusability. I've worked in so many project where
all of the logic was coded into jsp that I still feel it's clever to
prohibit programming code in the templates.
Start using it and I hope you'll share this feeling ;-)

Cheers,
Daniel


> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Tim Frank <tf...@registrar.uoguelph.ca>.
Stephane

I clipped the message as I wanted to expand on the XSLT item.

Stephane Bailliez wrote:
> 
> I'm not too keen on xslt because I find it extremely difficult to find 
> people that can jump into it. It takes a long time to learn tips and 
> tricks even from people that are developpers. And it is a major pain to 
> debug.
> 

Yes, XSLT can be very complicated. Yes it can be hard for somebody to 
jump right in and develop from scratch. I guess what I had in mind with 
mentioning it, is to use the technology to build some abstraction. Since 
XSLT can be applied to results of other XSLT transformations that create 
XML, I was thinking you could have a core template set that could act on 
a more simple "layout" template or something like that.

So you could have a simple XML/XSLT template to layout a page or decide 
which functions go on a page. Then you could have the more complex core 
templates that actually do the meat of the work. For those adept at XSLT 
they can easily extend/override the core templates without any java 
knowledge to change the look of the application.

I guess the idea is roughly along the lines of the Docbook XSL templates 
where you can choose to override any that you want, but if you don't, it 
just works "as-is".

Tim

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Stephane Bailliez <sb...@apache.org>.
Tim Frank wrote:
> Daniel,
> 
> Sorry to jump in the middle of this one, but I find it somewhat amusing 
> that you are having a huge discussion about separation of logic/layout 
> and then throw in an example from the HTML side of things that basically 
> goes back to mixing "logic/layout".
> 
> How do you handle HTML style attributes when outputting HTML from 
> programming code? You don't. You class the HTML elements, if necessary, 
> and use CSS to control style. That's it, done. Have your code output

Absolutely. Ultimately all is needed to modify is a class or id attribute.

> On the topic of "Yet another template system", I would at least agree 
> theoretically that it would be better to adopt something standard. XSL 
> has always worked great for me and I am experimenting right now with 
> building a frontend for slide with XML/XSL using Cocoon. Cocoon also 
> offers JXTemplates which connect javascript/java code to a template 
> system. I am not familiar with the other ones mentioned, but you have to 
> remember, things start off simple, then somebody wants it to do X, Y, 
> and Z and before you know it, simple is lost.

Agreed. There are things introduced like the dateFormatter that makes it 
already quite evident that there are dozen of things needed to be 
introduced later.

I'm already wondering how to do something standard such as (that's 
pseudo language):
if (messages){
	<div id="message">${message}</div>
} else {
	<table><td><th>A</th><th>B</th></tr>
	if (list.isEmpty()){
		<tr colspan="2"><td>No elements in this list</td></tr>
	} else {
		foreach( item in list){
		set (alternate = count%2 == 0 ? "even" : "odd"
		<tr class="${alternate}"><td>${item.a}</td><td>${item.b}</td></tr>
		}
	}
	</table>
}


I'm not too keen on xslt because I find it extremely difficult to find 
people that can jump into it. It takes a long time to learn tips and 
tricks even from people that are developpers. And it is a major pain to 
debug.

> As for a web designer having to do logic code, no they shouldn't. They 
> should be in the CSS realm for layout. Let the programmer spit out the 
> tags, class them, let the designer style the hell out of it. You 
> inevitably will need display logic no matter what templating system you 
> use.

Well, in theory, your mockup design is done way before you start to make 
them dynamic, so if you have in your team someone that is not a killer 
developper but excellent designer, you can still use it to code things 
above which he should be able to do without too much problem as he also 
should know some javascript.

> Sorry for the long message, but I really hate to see effort wasted on 
> things that already exist and can be adapted.

ditto.


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: AW: Added projector documentation link

Posted by Tim Frank <tf...@registrar.uoguelph.ca>.
Daniel,

Sorry to jump in the middle of this one, but I find it somewhat amusing 
that you are having a huge discussion about separation of logic/layout 
and then throw in an example from the HTML side of things that basically 
goes back to mixing "logic/layout".

How do you handle HTML style attributes when outputting HTML from 
programming code? You don't. You class the HTML elements, if necessary, 
and use CSS to control style. That's it, done. Have your code output

<body>

Then include a CSS file that does this

body {
     background-color: yellow;
}

If you REALLY need it to be dynamic, have the CSS dynamically generated 
for each page, but I often find that is not required once a 
"theme/style" are set.

What happens when you want to change the colour? Change the style sheet. 
Your WEB DESIGNER will know how to do this, no programming, no config 
files, or tables of attributes. Gives you more control than you will 
ever need. Once you have all elements classed the style possibilities 
are unlimited.

For those unfamiliar with how far this can go, check out 
http://www.csszengarden.com/ for the extreme.



On the topic of "Yet another template system", I would at least agree 
theoretically that it would be better to adopt something standard. XSL 
has always worked great for me and I am experimenting right now with 
building a frontend for slide with XML/XSL using Cocoon. Cocoon also 
offers JXTemplates which connect javascript/java code to a template 
system. I am not familiar with the other ones mentioned, but you have to 
remember, things start off simple, then somebody wants it to do X, Y, 
and Z and before you know it, simple is lost.

As for a web designer having to do logic code, no they shouldn't. They 
should be in the CSS realm for layout. Let the programmer spit out the 
tags, class them, let the designer style the hell out of it. You 
inevitably will need display logic no matter what templating system you use.

Sorry for the long message, but I really hate to see effort wasted on 
things that already exist and can be adapted.

Tim

Daniel Florey wrote:
> 
>>-----Ursprüngliche Nachricht-----
>>Von: slide-user-return-9605-daniel.florey=web.de@jakarta.apache.org
>>[mailto:slide-user-return-9605-daniel.florey=web.de@jakarta.apache.org] Im
>>Auftrag von Stephane Bailliez
>>Gesendet: Sonntag, 14. November 2004 02:34
>>An: slide-user@jakarta.apache.org
>>Cc: slide-dev@jakarta.apache.org
>>Betreff: Re: Added projector documentation link
>>
>>Daniel Florey wrote:
>>
>>>Hi folks,
>>>I've added a link to the Slide website that points to my (work in
>>
>>progress)
>>
>>>documentation of Projector.
>>
>>Congratulation Daniel, that's a cool documentation as an introduction to
>>the projector.
>>
>>I have yet to digest everything and think more about it, but I have one
>>feeling to share:
>>
>>why did you make your own template language ?
>>
>>When I see this:
>>
>><?username <h1 <?style style="<%style%>"?>>Hello
>><%username;required;text/plain%>!</h1>?>
> 
> 
> BTW: What do you think is the best way to handle optional attributes? In
> Java we would write something like this:
> 
> String bgcolor = someDynamicBgColorValue;
> StringBuffer output = new StringBuffer();
> output.append("<body");
> if ( bgcolor != null ) {
> 	output.append(" bgcolor=\"").append(bgcolor).append("\"");
> }
> output.append(">");
> String renderedOutput = output.toString();
> 
> In Projector templating you write
> 
> <body <?bgcolor bgcolor="<%bgcolor%>"?>>
> 
> Any ideas how to deal with it even more comfortable?
> 
> Daniel
> 
> 
> 
>>I'm already screaming of pain ! It's not readable !
>>
>>Why not using a standard jsp/jstl solution, should it means creating
>>taglibs ?
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


AW: Added projector documentation link

Posted by Daniel Florey <da...@web.de>.

> -----Ursprüngliche Nachricht-----
> Von: slide-user-return-9605-daniel.florey=web.de@jakarta.apache.org
> [mailto:slide-user-return-9605-daniel.florey=web.de@jakarta.apache.org] Im
> Auftrag von Stephane Bailliez
> Gesendet: Sonntag, 14. November 2004 02:34
> An: slide-user@jakarta.apache.org
> Cc: slide-dev@jakarta.apache.org
> Betreff: Re: Added projector documentation link
> 
> Daniel Florey wrote:
> > Hi folks,
> > I've added a link to the Slide website that points to my (work in
> progress)
> > documentation of Projector.
> 
> Congratulation Daniel, that's a cool documentation as an introduction to
> the projector.
> 
> I have yet to digest everything and think more about it, but I have one
> feeling to share:
> 
> why did you make your own template language ?
> 
> When I see this:
> 
> <?username <h1 <?style style="<%style%>"?>>Hello
> <%username;required;text/plain%>!</h1>?>

BTW: What do you think is the best way to handle optional attributes? In
Java we would write something like this:

String bgcolor = someDynamicBgColorValue;
StringBuffer output = new StringBuffer();
output.append("<body");
if ( bgcolor != null ) {
	output.append(" bgcolor=\"").append(bgcolor).append("\"");
}
output.append(">");
String renderedOutput = output.toString();

In Projector templating you write

<body <?bgcolor bgcolor="<%bgcolor%>"?>>

Any ideas how to deal with it even more comfortable?

Daniel


> 
> I'm already screaming of pain ! It's not readable !
> 
> Why not using a standard jsp/jstl solution, should it means creating
> taglibs ?
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org


Re: Added projector documentation link

Posted by Stephane Bailliez <sb...@apache.org>.
Daniel Florey wrote:
> Hi folks,
> I've added a link to the Slide website that points to my (work in progress)
> documentation of Projector.

Congratulation Daniel, that's a cool documentation as an introduction to 
the projector.

I have yet to digest everything and think more about it, but I have one 
feeling to share:

why did you make your own template language ?

When I see this:

<?username <h1 <?style style="<%style%>"?>>Hello 
<%username;required;text/plain%>!</h1>?>

I'm already screaming of pain ! It's not readable !

Why not using a standard jsp/jstl solution, should it means creating 
taglibs ?


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org