DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20677>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20677

StringResourceLoader

           Summary: StringResourceLoader
           Product: Velocity
           Version: 1.3.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Source
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Resource loader that works with Strings. Users should manualy add
resources to the repository that is know by the factory of this package. 

Below is an example configuration for this loader.
Note that 'repositoryimpl' is not mandatory;
if not provided, the factory will fall back on using the default
implementation of this package.

stringres.resource.loader.description = Velocity StringResource loader
stringres.resource.loader.class = 
org.apache.velocity.tools.stringresources.StringResourceLoader
stringres.resource.loader.repositoryimpl = 
org.apache.velocity.tools.stringresources.StringResourceRepositoryImpl

Resources can be added to the repository like this:

StringResourceRepositoryFactory vsRepository = null;
vsRepository = StringResourceRepositoryFactory.getRepository();
String myTemplateName = "/somewhere/intherepo/name";
String myTemplateBody = "Hi, ${username}... this is a some template!";
vsRepository.putStringResource(myTemplateName, myTemplateBody);

After this, the templates can be retrieved as usual

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to