You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <ji...@apache.org> on 2006/11/05 19:47:17 UTC

[jira] Updated: (VELOCITY-183) StringResourceLoader

     [ http://issues.apache.org/jira/browse/VELOCITY-183?page=all ]

Henning Schmiedehausen updated VELOCITY-183:
--------------------------------------------

      Bugzilla Id:   (was: 20677)
      Component/s: Engine
                       (was: Source)
    Fix Version/s: 1.5
         Assignee:     (was: Velocity-Dev List)

Either this will be a real late-comer to 1.5 (I can see a number of nice use cases from tests to dynamic webapps) or contrib or really early in 1.6. Schedule it for 1.5 revisiting. 

> StringResourceLoader
> --------------------
>
>                 Key: VELOCITY-183
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-183
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.3.1
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Eelco Hillenius
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: StringResource.java, StringResourceException.java, StringResourceLoader.java, StringResourceRepository.java, StringResourceRepositoryFactory.java, StringResourceRepositoryImpl.java
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org