Take notoce that this loader does not allow for modification detection: - /// Use Velocity's default FileResourceLoader for File resources. - /// - ///
Expects "spring.resource.loader" and "spring.resource.loader.path"
- /// application attributes in the Velocity runtime: the former of type
- /// IResourceLoader, the latter a String.
+ /// NVelocity's abstract ResourceLoader extension which serves
+ /// as an adapter that loads templates via a Spring IResourceLoader.
+ ///
+ ///
+ /// Used by VelocityEngineFactory for any resource loader path that
+ /// cannot be resolved to a File or an Assembly or for
+ /// implementations which rely on spring's IResourceLoader
+ /// mechanism.
+ ///
+ ///
+ /// Important: this loader does not allow for modification detection.
+ ///
+ /// Expects "spring.resource.loader" (IResourceLoader implementations)
+ /// and "spring.resource.loader.path" application attributes in the
+ /// NVelocity runtime.
///
System.IO.Stream that the Runtime will parse to create a template.
/// The optional "ConfigLocation" property sets the location of the Velocity
+ ///
+ /// The optional "ConfigLocation" property sets the location of the Velocity
/// properties file, within the current application. Velocity properties can be
/// overridden via "VelocityProperties", or even completely specified locally,
/// avoiding the need for an external properties file.
///
- ///
The "ResourceLoaderPath" property can be used to specify the Velocity
- /// resource loader path via Spring's Resource abstraction, possibly relative
+ ///
+ /// The "ResourceLoaderPath" property can be used to specify the Velocity
+ /// resource loader path via Spring's IResource abstraction, possibly relative
/// to the Spring application context.
///
- ///
If "OverrideLogging" is true (the default), the VelocityEngine will be
+ ///
+ /// If "OverrideLogging" is true (the default), the VelocityEngine will be
/// configured to log via Commons Logging, that is, using the Spring-provided
- /// "CommonsLoggingLogSystem" as log system.
+ /// CommonsLoggingLogSystem as log system.
///
- ///
The simplest way to use this class is to specify a ResourceLoaderPath
- /// property; the VelocityEngine typically then does not need any further
+ ///
+ /// The simplest way to use this class is to specify a ResourceLoaderPath
+ /// property. the VelocityEngine typically then does not need any further
/// configuration.
///
///
When populated via a String, standard URLs like "file:" and "assembly:"
- /// pseudo URLs are supported, as understood by ResourceLoader. Allows for
+ ///
+ /// When populated via a String, standard URLs like "file:" and "assembly:"
+ /// pseudo URLs are supported, as understood by IResourceLoader. Allows for
/// relative paths when running in an ApplicationContext.
- ///
Will define a path for the default Velocity resource loader with the name
- /// "file". If the specified resource cannot be resolved to a java.io.File,
+ ///
+ /// Will define a path for the default Velocity resource loader with the name
+ /// "file". If the specified resource cannot be resolved to a File,
/// a generic SpringResourceLoader will be used under the name "spring", without
/// modification detection.
- ///
Take notice that resource caching will be enabled in any case. With the file
+ ///
+ /// Take notice that resource caching will be enabled in any case. With the file
/// resource loader, the last-modified timestamp will be checked on access to
- /// detect changes. With SpringResourceLoader, the resource will be cached
- /// forever (for example for class path resources).
- ///
To specify a modification check interval for files, use Velocity's
+ /// detect changes. With SpringResourceLoader, the resource will be throughout
+ /// the life time of the application context (for example for class path resources).
+ ///
+ /// To specify a modification check interval for files, use Velocity's
/// standard "file.resource.loader.modificationCheckInterval" property. By default,
/// the file timestamp is checked on every access (which is surprisingly fast).
/// Of course, this just applies when loading resources from the file system.
- ///
To enforce the use of SpringResourceLoader, i.e. to not resolve a path
+ ///
+ /// To enforce the use of SpringResourceLoader, i.e. to not resolve a path
/// as file system resource in any case, turn off the "preferFileSystemAccess"
- /// flag. See the latter's javadoc for details.
+ /// flag. See the latter's documentation for details.
///
If this is enabled, VelocityEngineFactory will try to resolve the - /// specified "resourceLoaderPath" as file system resource (which will work - /// for expanded class path resources and ServletContext resources too). - ///
Default is "true". Turn this off to always load via SpringResourceLoader
+ ///
+ /// If this is enabled, VelocityEngineFactory will try to resolve the
+ /// specified "resourceLoaderPath" as file system resource.
+ ///
+ /// Default is "true". Turn this off to always load via SpringResourceLoader
/// (i.e. as stream, without hot detection of template changes), which might
- /// be necessary if some of your templates reside in an expanded classes
- /// directory while others reside in jar files.
+ /// be necessary if some of your templates reside in a directory while
+ /// others reside in assembly files.
///
Called by
- /// CreateVelocityEngine()
+ /// This is to overcome an issue with the current NVelocity library, it seems the
+ /// default runetime properties/directives (nvelocity.properties and directive.properties
+ /// files) are not being properly located in the library at load time. A jira should
+ /// be filed but for now we attempt to do this on our own. Particularly our
+ /// concern here is with several required properties which I don't want
+ /// to require users to re-defined. e.g.,:
+ ///
+ ///
+ /// Pre-requisites:
+ /// resource.manager.class=NVelocity.Runtime.Resource.ResourceManagerImpl
+ /// directive.manager=NVelocity.Runtime.Directive.DirectiveManager
+ /// runtime.introspector.uberspect=NVelocity.Util.Introspection.UberspectImpl
///
Called by CreateVelocityEngine().
+ ///
Called by CreateVelocityEngine().
///
Called by InitVelocityResourceLoader.
+ ///
Called by InitVelocityResourceLoader.
+ ///
+ /// Important: the NVeloctity ResourceLoaderFactory.getLoader
+ /// method replaces ';' with ',' when attempting to construct our resource
+ /// loader. The name on the SPRING_RESOURCE_LOADER_CLASS property
+ /// has to be in the form of "ClassFullName; AssemblyName" in replacement
+ /// of the tranditional "ClassFullName, AssemblyName" to work.
///
Called by CreateVelocityEngine()
+ ///
+ /// Called by CreateVelocityEngine
///
When using this method to prepare a text for a mail to be sent with Spring's - /// mail support, consider wrapping VelocityException in MailPreparationException. - ///
When using this method to prepare a text for a mail to be sent with Spring's - /// mail support, consider wrapping VelocityException in MailPreparationException. ///