I would like to read {key:value} pairs in Velocity templates (for user macros). These values are placed in an external resource file.
Is this possible?
Thank you,
Access to physical files would be a security risk and can't be done directly, Two options:
a) you could do this using a different approach, though a Beanshell (part of bobs Scripting plugin) that could load resources and generate markup. Some scripting/Dev skills required.
b) IIRC you can write a plugin that contributes the necessary resources as part of a plugin, with a Java accessor object written to read the data, that object could then be made available in the velocity context. Dev skills required.
I think b) is the way to go, is there any URL that document this approach?
Thank you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You'll need to create a plugin with a Velocity Context Module, that bundles the 'helper' you access from Velocity, along with the resources that may be packaged within the plugin or on your local OS if thats what you wanted to do.
- https://developer.atlassian.com/display/CONFDEV/Velocity+Context+Module
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.