velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geir Magnusson Jr. <ge...@adeptra.com>
Subject Re: parsing variable name in a velocity template
Date Fri, 23 May 2003 03:49:54 GMT

On Thursday, May 22, 2003, at 04:50 AM, Christoph.Reck@dlr.de 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@jakarta.apache.org/ 
> 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@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
> -- 
> :) Christoph Reck
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-956-2604(w)
Adeptra, Inc.                                       203-434-2093(m)
geirm@adeptra.com                                   203-247-1713(m)


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


Mime
View raw message