FishEye/Crucible plugins may define downloadable resources.
Web resources can also take advantage of caching (i.e. only download a resource if it has changed) and batching (i.e. serve multiple files in one request). If you would like to include other static files for download, such as images, please see Downloadable Plugin Resources.
Defining a Single Web Resource
Downloadable resources are configured to map a
name of some downloadable file to its
location within the plugin jar-file.
- Resources must be contained within a
keyof the webresource is how it will be referenced from within the application
- Each resource must be of
nameof the resource will be suffixed to the URL
locationof the resource is where it appears within the plugin itself
Referring to Web Resources
In your plugin's Velocity template, you need to refer to a
WebResourceManager, and call the
Because FishEye/Crucible does not transparently support template engines like Velocity of Freemarker, you will need to register the
WebResourceManager in the page context yourself, before passing control to your template engine of choice.
For instance, to use a web-resource in a velocity template, let FishEye/Crucible inject both the
VelocityHelper and the
WebResourceManager into your servlet and then register the
WebResourceManager in the velocity context before invoking the template engine:
You can then use the web-resource in the template