WebResourceManager has been superseded by PageBuilderService.@Deprecated public interface WebResourceManager
<script>
and <link> tags.
By using the WebResourceManager, components can declare dependencies on javascript and css that they would otherwise
have to embed inline (which means that it can't be cached, and are often duplicated in a page).
PageBuilderService,
WebResourceAssembler,
WebResourceSet| Modifier and Type | Method and Description |
|---|---|
<T> T |
executeInNewContext(com.google.common.base.Supplier<T> nestedExecution)
Deprecated.
Executes a Supplier within a new WebResourceManager context.
|
String |
getRequiredResources()
Deprecated.
As of 2.3.0, replaced by
getRequiredResources(UrlMode) |
String |
getRequiredResources(UrlMode urlMode)
Deprecated.
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)
Deprecated.
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)
Deprecated.
Returns the resource tags of the specified resource.
|
String |
getStaticPluginResource(com.atlassian.plugin.ModuleDescriptor<?> moduleDescriptor,
String resourceName)
Deprecated.
As of 2.3.0, replaced by
getStaticPluginResource(ModuleDescriptor, String, UrlMode) |
String |
getStaticPluginResource(com.atlassian.plugin.ModuleDescriptor<?> moduleDescriptor,
String resourceName,
UrlMode urlMode)
Deprecated.
|
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 |
getStaticResourcePrefix()
Deprecated.
As of 2.3.0, replaced by
WebResourceUrlProvider.getStaticResourcePrefix(UrlMode) |
String |
getStaticResourcePrefix(String resourceCounter)
Deprecated.
As of 2.3.0, replaced by
WebResourceUrlProvider.getStaticResourcePrefix(String, UrlMode) |
void |
includeResources(Iterable<String> moduleCompleteKeys,
Writer writer,
UrlMode urlMode)
Deprecated.
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)
Deprecated.
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)
Deprecated.
Writes out the resource tags to the previously required resources called via
requireResource(String) for
the specified resource type. |
void |
requireResource(String moduleCompleteKey)
Deprecated.
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)
Deprecated.
Writes the resource tags of the specified resource to the writer.
|
void |
requireResourcesForContext(String context)
Deprecated.
Writes the resource tags of all resources that have the given context specified in their descriptor.
|
void requireResource(String moduleCompleteKey)
includeResources(Writer, UrlMode) is called.moduleCompleteKey - The fully qualified plugin web resource module (eg jira.webresources:scriptaculous)includeResources(Writer, UrlMode),
RequiredResources.requireWebResource(String)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
decidevoid 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.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 a JavascriptWebResource, 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 onWebResourceSet.writeHtmlTags(java.io.Writer, com.atlassian.webresource.api.UrlMode, com.google.common.base.Predicate)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),
WebResourceSet.writeHtmlTags(java.io.Writer, com.atlassian.webresource.api.UrlMode)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 a JavascriptWebResource, 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 onincludeResources(Writer, UrlMode, WebResourceFilter),
WebResourceSet.writeHtmlTags(java.io.Writer, com.atlassian.webresource.api.UrlMode, com.google.common.base.Predicate)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")RequiredResources.requireContext(String)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 deciderequireResource(String, Writer, UrlMode)<T> T executeInNewContext(com.google.common.base.Supplier<T> nestedExecution)
nestedExecution - the code to be executed in the empty context.@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(com.atlassian.plugin.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 decidegetStaticPluginResource(String, String, UrlMode)@Deprecated String getStaticPluginResource(String moduleCompleteKey, String resourceName)
getStaticPluginResource(String, String, UrlMode)@Deprecated String getStaticPluginResource(com.atlassian.plugin.ModuleDescriptor<?> moduleDescriptor, String resourceName)
getStaticPluginResource(ModuleDescriptor, String, UrlMode)@Deprecated void includeResources(Writer writer)
includeResources(Writer, UrlMode)@Deprecated String getRequiredResources()
getRequiredResources(UrlMode)@Deprecated void requireResource(String moduleCompleteKey, Writer writer)
requireResource(String, Writer, UrlMode)@Deprecated String getResourceTags(String moduleCompleteKey)
getResourceTags(String, UrlMode)@Deprecated String getStaticResourcePrefix()
WebResourceUrlProvider.getStaticResourcePrefix(UrlMode)@Deprecated String getStaticResourcePrefix(String resourceCounter)
WebResourceUrlProvider.getStaticResourcePrefix(String, UrlMode)Copyright © 2019 Atlassian. All rights reserved.