|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface WebResourceManager
Manage 'css', 'javascript' and other 'resources' that are usually linked at the top of pages using <script>
and <link> tags.
| Nested Class Summary | |
|---|---|
static interface |
WebResourceManager.IncludeMode
Deprecated. Since 2.2 |
| Field Summary | |
|---|---|
static WebResourceManager.IncludeMode |
DELAYED_INCLUDE_MODE
Deprecated. Since 2.2. Use requireResource(String, Writer, UrlMode) instead. |
static WebResourceManager.IncludeMode |
INLINE_INCLUDE_MODE
Deprecated. Since 2.2. Use requireResource(String) instead. |
| Method Summary | |
|---|---|
String |
getRequiredResources()
Deprecated. As of 2.3.0, replaced by getRequiredResources(UrlMode) |
String |
getRequiredResources(UrlMode urlMode)
This is the equivalent of calling getRequiredResources(UrlMode, WebResourceFilter) with the given url
mode and a default filter that is dependent on the implementation. |
String |
getRequiredResources(UrlMode urlMode,
WebResourceFilter webResourceFilter)
Returns the resource tags for the previously required resources called via requireResource(String) that
match the specified web resource filter. |
String |
getResourceTags(String moduleCompleteKey)
Deprecated. As of 2.3.0, replaced by getResourceTags(String, UrlMode) |
String |
getResourceTags(String moduleCompleteKey,
UrlMode urlMode)
Returns the resource tags of the specified resource. |
String |
getStaticPluginResource(ModuleDescriptor<?> moduleDescriptor,
String resourceName)
Deprecated. As of 2.3.0, replaced by getStaticPluginResource(ModuleDescriptor, String, UrlMode) |
String |
getStaticPluginResource(ModuleDescriptor<?> moduleDescriptor,
String resourceName,
UrlMode urlMode)
Deprecated. As of 2.9.0, replaced by WebResourceUrlProvider.getStaticPluginResourceUrl(com.atlassian.plugin.ModuleDescriptor, String, UrlMode) |
String |
getStaticPluginResource(String moduleCompleteKey,
String resourceName)
Deprecated. As of 2.3.0, replaced by getStaticPluginResource(String, String, UrlMode) |
String |
getStaticPluginResource(String moduleCompleteKey,
String resourceName,
UrlMode urlMode)
Deprecated. As of 2.9.0, replaced by WebResourceUrlProvider.getStaticPluginResourceUrl(String, String, UrlMode) |
String |
getStaticPluginResourcePrefix(ModuleDescriptor<?> moduleDescriptor,
String resourceName)
Deprecated. Use #getStaticPluginResource instead |
String |
getStaticResourcePrefix()
Deprecated. As of 2.3.0, replaced by getStaticResourcePrefix(UrlMode) |
String |
getStaticResourcePrefix(String resourceCounter)
Deprecated. As of 2.3.0, replaced by getStaticResourcePrefix(String, UrlMode) |
String |
getStaticResourcePrefix(String resourceCounter,
UrlMode urlMode)
Deprecated. As of 2.9.0, replaced by WebResourceUrlProvider.getStaticResourcePrefix(String, UrlMode) |
String |
getStaticResourcePrefix(UrlMode urlMode)
Deprecated. As of 2.9.0, replaced by WebResourceUrlProvider.getStaticResourcePrefix(UrlMode) |
void |
includeResources(Iterable<String> moduleCompleteKeys,
Writer writer,
UrlMode urlMode)
Writes out the resource tags for a specified set of required resources and their dependencies. |
void |
includeResources(Writer writer)
Deprecated. As of 2.3.0, replaced by includeResources(Writer, UrlMode) |
void |
includeResources(Writer writer,
UrlMode urlMode)
This is the equivalent of calling includeResources(Writer, UrlMode, WebResourceFilter) with
the given url mode and a default web resource filter that is dependent on the implementation. |
void |
includeResources(Writer writer,
UrlMode urlMode,
WebResourceFilter webResourceFilter)
Writes out the resource tags to the previously required resources called via requireResource(String) for
the specified resource type. |
void |
requireResource(String moduleCompleteKey)
Indicates that a given plugin web resource is required. |
void |
requireResource(String moduleCompleteKey,
Writer writer)
Deprecated. As of 2.3.0, replaced by requireResource(String, Writer, UrlMode) |
void |
requireResource(String moduleCompleteKey,
Writer writer,
UrlMode urlMode)
Writes the resource tags of the specified resource to the writer. |
void |
requireResourcesForContext(String context)
Writes the resource tags of all resources that have the given context specified in their descriptor. |
void |
setIncludeMode(WebResourceManager.IncludeMode includeMode)
Deprecated. Since 2.2. |
| Field Detail |
|---|
@Deprecated static final WebResourceManager.IncludeMode DELAYED_INCLUDE_MODE
requireResource(String, Writer, UrlMode) instead.@Deprecated static final WebResourceManager.IncludeMode INLINE_INCLUDE_MODE
requireResource(String) instead.| Method Detail |
|---|
void requireResource(String moduleCompleteKey)
includeResources(Writer) is called.
moduleCompleteKey - The fully qualified plugin web resource module (eg jira.webresources:scriptaculous)includeResources(Writer, UrlMode)@Deprecated void includeResources(Writer writer)
includeResources(Writer, UrlMode)
requireResource(String). If
you need it as a String to embed the tags in a template, use getRequiredResources().
Example - if a 'javascript' resource has been required earlier with requireResource(), this method should
output:
<script type="text/javascript" src="$contextPath/scripts/javascript.js"></script>Similarly for other supported resources In general, the behavior of this method should be equivalent to calling
includeResources(Writer,
UrlMode) with a urlMode value of UrlMode.AUTO.
writer - The writer to write the links to
void includeResources(Iterable<String> moduleCompleteKeys,
Writer writer,
UrlMode urlMode)
requireResource(String).
moduleCompleteKeys - The set of web resource modules to includewriter - the writer to write the links tourlMode - specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to
decide
void includeResources(Writer writer,
UrlMode urlMode)
includeResources(Writer, UrlMode, WebResourceFilter) with
the given url mode and a default web resource filter that is dependent on the implementation.
includeResources(Writer, UrlMode, WebResourceFilter)
void includeResources(Writer writer,
UrlMode urlMode,
WebResourceFilter webResourceFilter)
requireResource(String) for
the specified resource type. If you need it as a String to embed the tags in a template, use
getRequiredResources(UrlMode).
Example - if a 'javascript' resource has been required earlier with requireResource() and this method is called
with JavascriptWebResource.FILTER_INSTANCE, it should output:
<script type="text/javascript" src="$contextPath/scripts/javascript.js"></script>Similarly for other supported resources. This method formats resource URLs in either relative or absolute format, depending on the value of
urlMode. See UrlMode for details of the different options for URL format.
writer - the writer to write the links tourlMode - specifies whether to use absolute URLs, relative URLs, or allow the concrete implementation to
decidewebResourceFilter - the web resource filter to filter resources on@Deprecated String getRequiredResources()
getRequiredResources(UrlMode)
requireResource(String). If
you are outputting the value to a Writer, use includeResources(Writer).
Example - if a 'javascript' resource has been required earlier with requireResource(), this method should
return:
<script type="text/javascript" src="$contextPath/scripts/javascript.js"></script>Similarly for other supported resources In general, the behavior of this method should be equivalent to calling
getRequiredResources(UrlMode)
with a urlMode value of UrlMode.AUTO.
includeResources(Writer)String getRequiredResources(UrlMode urlMode)
getRequiredResources(UrlMode, WebResourceFilter) with the given url
mode and a default filter that is dependent on the implementation.
includeResources(Writer, UrlMode),
getRequiredResources(UrlMode, WebResourceFilter)
String getRequiredResources(UrlMode urlMode,
WebResourceFilter webResourceFilter)
requireResource(String) that
match the specified web resource filter. If you are outputting the value to a Writer, use
includeResources(Writer, UrlMode).
Example - if a 'javascript' resource has been required earlier with requireResource() and this method is called
with JavascriptWebResource.FILTER_INSTANCE, it should return:
<script type="text/javascript" src="$contextPath/scripts/javascript.js"></script>Similarly for other supported resources. This method formats resource URLs in either relative or 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
decidewebResourceFilter - the web resource filter to filter resources on
includeResources(Writer, UrlMode, WebResourceFilter)
@Deprecated
void requireResource(String moduleCompleteKey,
Writer writer)
requireResource(String, Writer, UrlMode)
getResourceTags(String).
In general, the behavior of this method should be equivalent to calling requireResource(String, Writer,
UrlMode) with a urlMode value of UrlMode.AUTO.
moduleCompleteKey - The fully qualified plugin web resource module (eg jira.webresources:scriptaculous)writer - The writer to write the resource tags to.
void requireResource(String moduleCompleteKey,
Writer writer,
UrlMode urlMode)
getResourceTags(String, UrlMode).
This method formats resource URLs in either relative or absolute format, depending on the value of 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 decidevoid requireResourcesForContext(String context)
context - The name of the context for which you want to require resources (eg "atl.admin")@Deprecated String getResourceTags(String moduleCompleteKey)
getResourceTags(String, UrlMode)
Writer, use
requireResource(String, java.io.Writer).
In general, the behavior of this method should be equivalent to calling getResourceTags(String, UrlMode)
with a urlMode value of UrlMode.AUTO.
moduleCompleteKey - The fully qualified plugin web resource module (eg jira.webresources:scriptaculous)
requireResource(String, Writer)
String getResourceTags(String moduleCompleteKey,
UrlMode urlMode)
Writer, use
requireResource(String, java.io.Writer, UrlMode).
This method formats resource URLs in either relative or absolute format, depending on the value of 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
requireResource(String, Writer, UrlMode)@Deprecated String getStaticResourcePrefix()
getStaticResourcePrefix(UrlMode)
/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 UrlMode.AUTO.
@Deprecated String getStaticResourcePrefix(UrlMode urlMode)
WebResourceUrlProvider.getStaticResourcePrefix(UrlMode)
/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
@Deprecated String getStaticResourcePrefix(String resourceCounter)
getStaticResourcePrefix(String, UrlMode)
/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 UrlMode.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
@Deprecated
String getStaticResourcePrefix(String resourceCounter,
UrlMode urlMode)
WebResourceUrlProvider.getStaticResourcePrefix(String, UrlMode)
/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 counterurlMode - specifies whether to use absolute URLs, relative URLs, or allow the concrete
implementation to decide
@Deprecated
String getStaticPluginResource(String moduleCompleteKey,
String resourceName)
getStaticPluginResource(String, String, UrlMode)
/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 UrlMode.AUTO.
moduleCompleteKey - complete plugin module keyresourceName - the name of the resource as defined in the plugin manifest
@Deprecated
String getStaticPluginResource(String moduleCompleteKey,
String resourceName,
UrlMode urlMode)
WebResourceUrlProvider.getStaticPluginResourceUrl(String, String, UrlMode)
/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 keyresourceName - the name of the resource as defined in the plugin manifesturlMode - specifies whether to use absolute URLs, relative URLs, or allow the concrete
implementation to decide
@Deprecated
String getStaticPluginResource(ModuleDescriptor<?> moduleDescriptor,
String resourceName)
getStaticPluginResource(ModuleDescriptor, String, UrlMode)
/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(ModuleDescriptor, String, UrlMode) with a urlMode value of UrlMode.AUTO.
moduleDescriptor - plugin module descriptor that contains the resourceresourceName - the name of the resource as defined in the plugin manifest
getStaticPluginResource(String, String)
String getStaticPluginResource(ModuleDescriptor<?> moduleDescriptor,
String resourceName,
UrlMode urlMode)
WebResourceUrlProvider.getStaticPluginResourceUrl(com.atlassian.plugin.ModuleDescriptor, String, UrlMode)
/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.
moduleDescriptor - plugin module descriptor that contains the resourceresourceName - the name of the resource as defined in the plugin manifesturlMode - specifies whether to use absolute URLs, relative URLs, or allow the concrete
implementation to decide
getStaticPluginResource(String, String, UrlMode)
@Deprecated
String getStaticPluginResourcePrefix(ModuleDescriptor<?> moduleDescriptor,
String resourceName)
@Deprecated void setIncludeMode(WebResourceManager.IncludeMode includeMode)
includeMode - If there is no decorator for this request, set this to be INLINE_INCLUDE_MODEDELAYED_INCLUDE_MODE,
INLINE_INCLUDE_MODE
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||