You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Geir Magnusson Jr." <ge...@optonline.net> on 2002/03/10 23:44:07 UTC

Re: Obtaining a Template from a specific resource loader ???

On 3/10/02 5:45 PM, "mraruba" <mr...@aaahawk.com> wrote:

> Hi 
> I would like to use a specific ResourceLoader to obtain a Template from
> my Runtime environment variable even though I may have multiple resource
> loaders defined in the properties file.
> 
> For example I want to do the following:
> template = Velocity.getTemplate
> (templateFile,RuntimeConstants.ENCODING_DEFAULT,"file");
> 
> Or
> 
> template = Velocity.getTemplate
> (templateFile,RuntimeConstants.ENCODING_DEFAULT,"database");
> 
> Besides the current cpability
> 
> template = Velocity.getTemplate
> (templateFile,RuntimeConstants.ENCODING_DEFAULT);
> 
> The current implementation does not provide this capability or allow me
> to extend and create my own Runtime environment todo so. Is there a
> reason for this ?

Yes.  The thinking behind the resource management is that you should be able
to write your applications independent of the configuration of the resource
loaders, so that way they can be switched beneath you w/o harm.

We are going to add some additional functionality to v1.4 regarding resource
loading, so your suggestion might be something for us to look at for that.

> 
> If I wanted to add this capability to the current release and check this
> in, how would I go about doing this ?

You could offer a patch with the functionality if you wish to...

geir

> 
> Thanks
> 
> Gerry
> 
> "One Thread to rule them all, One Thread to find them, One Thread to
> bring them all and in the darkness bind them!"
> 
> 
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 

-- 
Geir Magnusson Jr.                       geirm@optonline.net
System and Software Consulting
You're going to end up getting pissed at your software
anyway, so you might as well not pay for it. Try Open Source.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>