velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Colson" <tcol...@cisco.com>
Subject RE: #parse content from a variable?
Date Sun, 19 Sep 2004 15:43:16 GMT
> > > #parse directive and the (View)RenderTool combined?  
> > Yes, I think so. 
> Picky, picky, picky... ;)
:-) 

> Okay, then how about this:
> 1. Create a ResourceLoader that does something like RenderTool.
> 2. Add it to the ResourceLoader stack.
> This way, anything that's not found in the other loaders will 
> be parsed as VTL.

Yep, I like that idea. :-)

> I think a quick-fix should look something like
> public class TimoResourceLoader extends ResourceLoader

Ok -- Thanks -- I'll give that a try, and have a look at the other resource
loaders for inspiration/understanding.


> > Or maybe there is a way to have *.var trigger the custom 
> resource loader?
> None that I know of.
Ok -- probably not an issue anyway.

> OR, of course, you can make a cool tool that does all this 
> stuff for you.
I know that. :-)

Here is why I don't want to use a tool -- I want this to be "same"
experience for HTML Designer -- always use #parse() keeps it simple. I do
the 'magic' on the backend.

I just want to tell them:
1) There are three external resources available:
  "personalized_thingy.vm" - "custom_thingy.vm" - "default_thingy.vm" 
2) If you want to customize the template, add a file here:
/templates/custom_thingy.vm
3) On the page where you want this component, just add :
   #parse("$thingy")
  NOTE: The user will see their own personalized thingy, or if not exists -
fallback to the custom component, or if that is not provided --> the default
thingy.
  NOTE to Developers: personalized will come from Dynamic DB/COOKIE/FORM,
custom will come from filesystem, and default will come from the
standard_templates.jar. 

Cheers,
Timo



---------------------------------------------------------------------
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