velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: About DataSourceResourceLoader
Date Wed, 07 Nov 2001 13:25:45 GMT
On 11/6/01 11:09 AM, "Vitaly Repetenko" <vit@mtu.ru> wrote:

> Good day!
> 
> May be it will be useful to revise method init in
> DataSourceResourceLoader class and example configuration in JavaDoc,
> because current version of DataSourceResourceLoader does not work
> correctly with configuration.
> 

Yep - that was the solution :)

> Perhaps something like this:
> 
> init method:
>    public void init( ExtendedProperties configuration)
>    {
>        dataSourceName  = configuration.getString("datasource");
>        tableName       = configuration.getString("table");
>        keyColumn       = configuration.getString("keycolumn");
>        templateColumn  = configuration.getString("templatecolumn");
>        timestampColumn = configuration.getString("timestampcolumn");
> 
>        Runtime.info("Resources Loaded From: " + dataSourceName + "/" +
> tableName);
>        Runtime.info( "Resource Loader using columns: " + keyColumn +
> ", "
>                      + templateColumn + " and " + timestampColumn);
>        Runtime.info("Resource Loader Initalized.");
>    }
> 
> Example configuration snippet for velocity.properties:
> 
> resource.loader = datasource
> datasource.resource.loader.description = Velocity DataSource Resource
> Loader
> datasource.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.DataSourceResourceLoader
> datasource.resource.loader.datasource = jdbc/testDS
> datasource.resource.loader.table = template_table
> datasource.resource.loader.keycolumn = template_id
> datasource.resource.loader.templatecolumn = template_definition
> datasource.resource.loader.timestampcolumn = template_timestamp
> datasource.resource.loader.cache = false
> datasource.resource.loader.modificationCheckInterval = 60
> 
> 
> 
> Thanks in advance,
> Vitaly

I will start with this code you contributed :)

-- 
Geir Magnusson Jr.                                     geirm@optonline.net
System and Software Consulting
"He who throws mud only loses ground." - Fat Albert


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


Mime
View raw message