Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-14459

VelocityUtil.getRenderedTemplate doesn't load plugin Velocity templates in OSGi plugins

      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.

            [CONFSERVER-14459] VelocityUtil.getRenderedTemplate doesn't load plugin Velocity templates in OSGi plugins

            Katherine Yabut made changes -
            Workflow Original: JAC Bug Workflow v3 [ 2894275 ] New: CONFSERVER Bug Workflow v4 [ 2986826 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow v2 [ 2778055 ] New: JAC Bug Workflow v3 [ 2894275 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: JAC Bug Workflow [ 2734352 ] New: JAC Bug Workflow v2 [ 2778055 ]
            Owen made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2399761 ] New: JAC Bug Workflow [ 2734352 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 2298688 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2399761 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2233454 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 2298688 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2194726 ] New: Confluence Workflow - Public Facing - Restricted v5.1 - TEMP [ 2233454 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v5 [ 1945346 ] New: Confluence Workflow - Public Facing - Restricted v5 - TEMP [ 2194726 ]
            Katherine Yabut made changes -
            Workflow Original: Confluence Workflow - Public Facing - Restricted v3 [ 1741905 ] New: Confluence Workflow - Public Facing - Restricted v5 [ 1945346 ]
            Katherine Yabut made changes -
            Workflow Original: CONF Bug Subtask WF (TEMP) [ 1702512 ] New: Confluence Workflow - Public Facing - Restricted v3 [ 1741905 ]

              matt@atlassian.com Matt Ryall
              matt@atlassian.com Matt Ryall
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: