Using Soy Templates
All invocations run through the
render method. It takes three parameters:
String) – the fully-qualified plugin module key – e.g.,
String) – the Soy template's name, including its namespace – e.g.,
Map<String,Object>) – the data for the template. The keys should match with the names of the parameters in the Soy template.
To register your Soy template, you will need to add it to a web-resource somewhere.
JIRA has a web-resource called
soy-templates, which is defined in system-webresources-plugin.xml. For core JIRA assets, you should start there.
You can add a Soy template that is available on either the server-side only, or on both the server and client.
Calling from JSP
Calling from Velocity
Calling from a Java Class
This is not recommended.
You inject the
SoyTemplateRenderer differently in JIRA core and plugins. See the examples below.
Injecting in JIRA Core
SoyTemplateRenderer cannot be injected via pico, so get it from an injectable
Injecting in a Plugin
SoyTemplateRenderer in your atlassian-plugin.xml:
Then it can be directly injected: