logo       

Re: parsing variable name in a velocity template: msg#00135

jakarta.velocity.user

Subject: Re: parsing variable name in a velocity template


On Thursday, May 22, 2003, at 04:50 AM, Christoph.Reck@xxxxxx wrote:

Hey people, who's dreaming? Why hasn't someone else (the authors) spoken up?

I apparently just awake from a long slumber :)


There is a TemplateTool written for exactly this sort of use case. For more
information see the thread:

http://www.mail-archive.com/velocity-user@xxxxxxxxxxxxxxxxxx/ msg09348.html

You can download it from:

http://cvs.apache.org/viewcvs/jakarta-velocity/contrib/temporary/ templatetool/

(it would be nice to have the updates done for the TemplateTool to flow back
into the CVS).

Where are they?


Cheers,
Christoph

Dave Newton wrote:
On Tue, 2003-05-20 at 19:20, Barbara Baughman wrote:
Unless you want to be a mind reader, I'd ask the user to tell you their
template variable names that will feed into the template. Otherwise, tell
the user they can't have the format $something or ${something} in their
template without referring to a template variable. At this point, you
really aren't using Velocity at all.

[... snip ...]

The MVC model assumes that the programmer will know what pieces of
information the designer wants to pass from the knowledge base to the
template. I think it's reasonable to ask your users what pieces of
information the user wants to send to their template.
For the most part I agree with everything you've said, but I have a very
specific need to know when there are variables in the template that I
(the programmer) don't or didn't know about...
We use Velocity to generate our (opt-in, lemme alone!) email newsletter.
In order to facilitate idiot-proofing I have to know if the template
designer (definitely NOT a programmer :) either mis-spelled something,
left something out, or added something that I don't provide.
This knowledge allows us to unit-test (sorta) our email templates (which
we use for every email our site sends; registration confirmation,
newsletters, etc.) and make sure that an email template hasn't been
broken by me or the template designer.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: velocity-user-help@xxxxxxxxxxxxxxxxxx

--
:) Christoph Reck


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: velocity-user-help@xxxxxxxxxxxxxxxxxx


--
Geir Magnusson Jr 203-956-2604(w)
Adeptra, Inc. 203-434-2093(m)
geirm@xxxxxxxxxxx 203-247-1713(m)


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise