-
Type:
Bug
-
Resolution: Cannot Reproduce
-
Priority:
Medium
-
None
-
Affects Version/s: 2.10.1
-
Component/s: Core - OSGi Plugins Platform
VelocityUtils uses the Confluence ClassLoader, so Velocity templates inside the plugin aren't visible to it.
We need to document a workaround for this. One possible one is loading the resource manually:
public void execute(Map params, String body, RenderContext renderContext) { // ... create context InputStream template = getClass().getClassLoader().getResourceAsStream("path/to/template.vm"); return VelocityUtils.getRenderedContent(IOUtils.toString(template), context); }
We should probably wrap this in some kind of helper for plugins though.