java.lang.Object | |
↳ | com.atlassian.plugin.webresource.WebResourceManagerImpl |
A handy super-class that handles most of the resource management.
To use this manager, you need to have the following UrlRewriteFilter code:<rule> <from>^/s/(.*)/_/(.*)</from> <run class="com.atlassian.plugin.servlet.ResourceDownloadUtils" method="addCachingHeaders" /> <to type="forward">/$2</to> </rule>Sub-classes should implement the abstract methods
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
batchingConfiguration | |||||||||||
dependencyResolver | |||||||||||
pluginResourceLocator | |||||||||||
webResourceFormatters | |||||||||||
webResourceIntegration |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.atlassian.plugin.webresource.WebResourceManager
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This is the equivalent of calling
getRequiredResources(UrlMode, WebResourceFilter) with the given url
mode and a DefaultWebResourceFilter . | |||||||||||
This is the equivalent of calling
getRequiredResources(UrlMode, WebResourceFilter) with
AUTO and a DefaultWebResourceFilter . | |||||||||||
Returns a String of the resources tags to the previously required resources called via requireResource methods
for the specified url mode and resource filter.
| |||||||||||
Returns the resource tags of the specified resource.
| |||||||||||
Returns the resource tags of the specified resource.
| |||||||||||
A helper method to return a url for 'plugin' resources.
| |||||||||||
A helper method to return a url for 'plugin' resources.
| |||||||||||
This method is deprecated.
Use
getStaticPluginResource(com.atlassian.plugin.ModuleDescriptor, String) instead
| |||||||||||
A helper method to return a prefix for 'system' static resources.
| |||||||||||
A helper method to return a prefix for 'system' static resources.
| |||||||||||
A helper method to return a prefix for 'system' static resources.
| |||||||||||
A helper method to return a prefix for 'system' static resources.
| |||||||||||
This is the equivalent of of calling
includeResources(Writer, UrlMode, WebResourceFilter) with
the given url mode and a DefaultWebResourceFilter . | |||||||||||
Writes out the resource tags to the previously required resources called via requireResource methods for the
specified url mode and resource filter.
| |||||||||||
Writes out the resource tags for a specified set of required resources and their dependencies.
| |||||||||||
This is the equivalent of of calling
includeResources(Writer, UrlMode, WebResourceFilter) with
AUTO and a DefaultWebResourceFilter . | |||||||||||
Writes the resource tags of the specified resource to the writer.
| |||||||||||
Indicates that a given plugin web resource is required.
| |||||||||||
Writes the resource tags of the specified resource to the writer.
| |||||||||||
Writes the resource tags of all resources that have the given context specified in their descriptor.
| |||||||||||
This method is deprecated.
Since 2.2.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.plugin.webresource.WebResourceManager
|
This is the equivalent of calling getRequiredResources(UrlMode, WebResourceFilter)
with the given url
mode and a DefaultWebResourceFilter
.
This is the equivalent of calling getRequiredResources(UrlMode, WebResourceFilter)
with
AUTO
and a DefaultWebResourceFilter
.
Returns a String of the resources tags to the previously required resources called via requireResource methods for the specified url mode and resource filter. Note that this method will NOT clear the list of previously required resources.
urlMode | the url mode to write out the resource tags |
---|---|
webResourceFilter | the web resource filter to filter resources on |
Returns the resource tags of the specified resource. If you are outputting the value to a Writer
, use
requireResource(String, java.io.Writer, UrlMode)
.
urlMode
. See UrlMode
for details of the different options for URL format.moduleCompleteKey | The fully qualified plugin web resource module (eg jira.webresources:scriptaculous ) |
---|---|
urlMode | specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide |
Returns the resource tags of the specified resource. If you are outputting the value to a Writer
, use
requireResource(String, java.io.Writer)
.
getResourceTags(String, UrlMode)
with a urlMode
value of AUTO
.moduleCompleteKey | The fully qualified plugin web resource module (eg jira.webresources:scriptaculous ) |
---|
A helper method to return a url for 'plugin' resources. Generally the implementation will return
/s/{build num
/{system counter}/{plugin version}/_/download/resources/plugin.key:module.key/resource.name}
Note that the servlet context is prepended, and there is no trailing slash.
Typical usage is to replace:
<%= request.getContextPath() %>/download/resources/plugin.key:module.key/resource.name
with <%=
webResourceManager.getStaticPluginResource(descriptor, resourceName) %>
In general, the behavior of this method should be equivalent to calling getStaticPluginResource(String, String, UrlMode)
with a urlMode
value of AUTO
.moduleCompleteKey | complete plugin module key |
---|---|
resourceName | the name of the resource as defined in the plugin manifest |
A helper method to return a url for 'plugin' resources. Generally the implementation will return
/s/{build num
/{system counter}/{plugin version}/_/download/resources/plugin.key:module.key/resource.name}
Note that the servlet context is prepended, and there is no trailing slash.
Typical usage is to replace:
<%= request.getContextPath() %>/download/resources/plugin.key:module.key/resource.name
with <%=
webResourceManager.getStaticPluginResource(descriptor, resourceName) %>
This method returns a URL in either a relative or an absolute format, depending on the value of urlMode
.
See UrlMode
for details of the different options for URL format.moduleCompleteKey | complete plugin module key |
---|---|
resourceName | the name of the resource as defined in the plugin manifest |
urlMode | specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide |
This method is deprecated.
Use getStaticPluginResource(com.atlassian.plugin.ModuleDescriptor, String)
instead
A helper method to return a prefix for 'system' static resources. This method should be used for resources that change more frequently than system resources, and therefore have their own resource counter.
Generally the implementation will return/s/{build num
/{system counter}/{resource counter}/_}
Note that the servlet context is prepended, and there is no trailing slash.
Typical usage is to replace:
<%= request.getContextPath() %>/styles/global.css
with <%= webResourceManager.getStaticResourcePrefix(resourceCounter)
%>/styles/global.css
This method returns a URL in either a relative or an absolute format, depending on the value of urlMode
.
See UrlMode
for details of the different options for URL format.resourceCounter | A number that represents the unique version of the resource you require. Every time this resource changes, you need to increment the resource counter |
---|---|
urlMode | specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide |
A helper method to return a prefix for 'system' static resources. This method should be used for resources that change more frequently than system resources, and therefore have their own resource counter.
Generally the implementation will return/s/{build num
/{system counter}/{resource counter}/_}
Note that the servlet context is prepended, and there is no trailing slash.
Typical usage is to replace:
<%= request.getContextPath() %>/styles/global.css
with <%= webResourceManager.getStaticResourcePrefix(resourceCounter)
%>/styles/global.css
In general, the behavior of this method should be equivalent to calling getStaticResourcePrefix(String, UrlMode)
with a urlMode
value of AUTO
.resourceCounter | A number that represents the unique version of the resource you require. Every time this resource changes, you need to increment the resource counter |
---|
A helper method to return a prefix for 'system' static resources. Generally the implementation will return
/s/{build num
/{system counter}/_}
Note that the servlet context is prepended, and there is no trailing slash.
Typical usage is to replace:
<%= request.getContextPath() %>/styles/global.css
with <%= webResourceManager.getStaticResourcePrefix()
%>/styles/global.css
This method returns a URL in either a relative or an absolute format, depending on the value of urlMode
.
See UrlMode
for details of the different options for URL format.urlMode | specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide |
---|
A helper method to return a prefix for 'system' static resources. Generally the implementation will return
/s/{build num
/{system counter}/_}
Note that the servlet context is prepended, and there is no trailing slash.
Typical usage is to replace:
<%= request.getContextPath() %>/styles/global.css
with <%= webResourceManager.getStaticResourcePrefix()
%>/styles/global.css
In general, the behavior of this method should be equivalent to calling getStaticResourcePrefix(UrlMode)
with a urlMode
value of AUTO
.This is the equivalent of of calling includeResources(Writer, UrlMode, WebResourceFilter)
with
the given url mode and a DefaultWebResourceFilter
.
Writes out the resource tags to the previously required resources called via requireResource methods for the specified url mode and resource filter. Note that this method will clear the list of previously required resources.
writer | the writer to write the links to |
---|---|
urlMode | the url mode to write resource url links in |
webResourceFilter | the resource filter to filter resources on |
Writes out the resource tags for a specified set of required resources and their dependencies. Does not write out
tags for resources specified in calls to requireResource(String)
.
moduleCompleteKeys | The set of web resource modules to include |
---|---|
writer | the writer to write the links to |
urlMode | specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide |
This is the equivalent of of calling includeResources(Writer, UrlMode, WebResourceFilter)
with
AUTO
and a DefaultWebResourceFilter
.
writer | The writer to write the links to |
---|
Writes the resource tags of the specified resource to the writer. If you need it as a String to embed the tags in
a template, use getResourceTags(String)
.
requireResource(String, Writer, UrlMode)
with a urlMode
value of AUTO
.moduleCompleteKey | The fully qualified plugin web resource module (eg jira.webresources:scriptaculous ) |
---|---|
writer | The writer to write the resource tags to. |
Indicates that a given plugin web resource is required. All resources called via this method must be included
when includeResources(Writer)
is called.
moduleCompleteKey | The fully qualified plugin web resource module (eg jira.webresources:scriptaculous ) |
---|
Writes the resource tags of the specified resource to the writer. If you need it as a String to embed the tags in
a template, use getResourceTags(String, UrlMode)
.
urlMode
. See UrlMode
for details of the different options for URL format.moduleCompleteKey | The fully qualified plugin web resource module (eg jira.webresources:scriptaculous ) |
---|---|
writer | The writer to write the resource tags to. |
urlMode | specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to decide |
Writes the resource tags of all resources that have the given context specified in their descriptor.
context | The name of the context for which you want to require resources (eg "atl.admin") |
---|
This method is deprecated.
Since 2.2.
Whether resources should be included inline, or at the top of the page. In most cases, you want to leave this as the default. However, for pages that don't have a decorator, you will not be able to 'delay' including the resources (css, javascript), and therefore need to include them directly inline.
includeMode | If there is no decorator for this request, set this to be INLINE_INCLUDE_MODE |
---|