velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vitaly Repetenko <...@mtu.ru>
Subject About DataSourceResourceLoader
Date Tue, 06 Nov 2001 16:09:28 GMT
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.

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


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