In my search request view plugin I have a velocity template that has a reference to an xslt file i wrote, I'd like my plugin to install this xslt file automatically (ideally in "http://myserver:2990/jira/styles/)
I've tried adding a resource in atlassian-pugin.xml but I can't figure out which url to use to reference the xslt file.
atlassian-plugin.xml:
<web-resource key="xslt-resources" name="Xslt Web Resources"> <resource type="download" name="test.xslt" location="/xslt/test.xslt"/> </web-resource>
vm file:
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="$webResourceManager.getStaticPluginResource("com.myplugin:xslt-resources","test.xslt")" type="text/xsl"?> ...
You can take a look at
https://developer.atlassian.com/display/PLUGINFRAMEWORK/Web+Resource+Plugin+Module
You can add param <param name=
"batch"
value=
"false"
/>
and then refer to the resource using the url pattern given in the documentation:
SERVER_ROOT/s/BUILD_NUM/PLUGIN_VERSION/SYSTEM_COUNTER/_/download/resources/PLUGIN_KEY:MODULE_KEY/RESOURCE_NAME |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can I use the resource from the velocity template this way?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you can. I can provide you with some sample code for atlassian-plugin.xml and the vm file if you give me an example of what you want to achieve exactly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is my velocity template (A modified version of the standard view issues xml) , I would like to have my xslt file instead of MYSTYLESHEET,
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="MYSTYLESHEET" type="text/xsl"?>
<rss version="0.92">
<channel>
<title>#xmlEscape($title)</title>
## Ensure we have no spaces around the link tag and its value. JRA-16175
<link>#xmlEscape($link)</link>
<description>#xmlEscape($!{description})</description>
#if ($rssLocale)
<language>$rssLocale</language>
#end
#if ($totalissue)
<issue start="$!{startissue}" end="$!{endissue}" total="$!{totalissue}"/>
#end
<build-info>
<version>#xmlEscape($version)</version>
<build-number>#xmlEscape($buildNumber)</build-number>
<build-date>#xmlEscape($buildDate)</build-date>
</build-info>
this is the configuration in atlassian-plugin.xml
<web-resource name="xslt" i18n-name-key="xslt.name" key="xslt">
<description key="xslt.description">.xslt resources for search request plugins</description>
<resource name="GroupByCategoriesEdt" type="download" location="xslt/GroupByCategoriesEdt.xslt">
<param name="batch" value="false"/>
</resource>
<resource name="GroupByDeveloppeur" type="download" location="xslt/GroupByDeveloppeur.xslt">
<param name="batch" value="false"/>
</resource>
</web-resource>
I tried with <?xml-stylesheet href="$webResourceManager.requireResource("xslt:GroupByDeveloppeur")" type="text/xsl"?> but It doesent seem to work, in the console it tells me "Cannot find we resource module for: xslt:GroupeByDeveloppeur"
Thanks for your help
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.