@Deprecated public class WebResourceManagerImpl extends Object implements WebResourceManager
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
| Modifier and Type | Field and Description |
|---|---|
protected LegacyPageBuilderService |
pageBuilderService
Deprecated.
|
protected WebResourceIntegration |
webResourceIntegration
Deprecated.
|
| Constructor and Description |
|---|
WebResourceManagerImpl(PluginResourceLocator pluginResourceLocator,
WebResourceIntegration webResourceIntegration,
WebResourceUrlProvider webResourceUrlProvider)
Deprecated.
|
WebResourceManagerImpl(PluginResourceLocator pluginResourceLocator,
WebResourceIntegration webResourceIntegration,
WebResourceUrlProvider webResourceUrlProvider,
ResourceBatchingConfiguration batchingConfiguration)
Deprecated.
|
WebResourceManagerImpl(PrebakeWebResourceAssemblerFactory webResourceAssemblerFactory,
PluginResourceLocator pluginResourceLocator,
WebResourceIntegration webResourceIntegration,
WebResourceUrlProvider webResourceUrlProvider,
ResourceBatchingConfiguration batchingConfiguration)
Deprecated.
|
WebResourceManagerImpl(WebResourceAssemblerFactory webResourceAssemblerFactory,
LegacyPageBuilderService pageBuilderService,
PluginResourceLocator pluginResourceLocator,
WebResourceIntegration webResourceIntegration,
WebResourceUrlProvider webResourceUrlProvider,
ResourceBatchingConfiguration batchingConfiguration,
ResourceDependencyResolver resourceDependencyResolver)
Deprecated.
|
| 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.
|
protected AssembledResources |
getRequestLocalAssembledResources()
Deprecated.
|
protected RequiredResources |
getRequestLocalRequiredResources()
Deprecated.
|
String |
getRequiredResources()
Deprecated.
|
String |
getRequiredResources(UrlMode urlMode)
Deprecated.
This is the equivalent of calling
getRequiredResources(UrlMode, WebResourceFilter) with the given url
mode and a DefaultWebResourceFilter. |
String |
getRequiredResources(UrlMode urlMode,
WebResourceFilter filter)
Deprecated.
Returns a String of the resources tags to the previously required resources called via requireResource methods
for the specified url mode and resource filter.
|
protected String |
getRequiredResources(UrlMode urlMode,
WebResourceFilter webResourceFilter,
Set<String> excludedResourceKeys,
List<String> excludedContexts)
Deprecated.
Get the resources that have been required but excluding certain resource keys and certain contexts.
|
String |
getResourceTags(String moduleCompleteKey)
Deprecated.
|
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.
|
String |
getStaticPluginResource(com.atlassian.plugin.ModuleDescriptor<?> moduleDescriptor,
String resourceName,
UrlMode urlMode)
Deprecated.
|
String |
getStaticPluginResource(String moduleCompleteKey,
String resourceName)
Deprecated.
|
String |
getStaticPluginResource(String moduleCompleteKey,
String resourceName,
UrlMode urlMode)
Deprecated.
|
String |
getStaticResourcePrefix()
Deprecated.
|
String |
getStaticResourcePrefix(String resourceCounter)
Deprecated.
|
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.
|
void |
includeResources(Writer writer,
UrlMode urlMode)
Deprecated.
This is the equivalent of of calling
includeResources(Writer, UrlMode, WebResourceFilter) with
the given url mode and a DefaultWebResourceFilter. |
void |
includeResources(Writer writer,
UrlMode urlMode,
WebResourceFilter webResourceFilter)
Deprecated.
Writes out the resource tags to the previously required resources called via requireResource methods for the
specified url mode and resource filter.
|
void |
requireResource(String moduleCompleteKey)
Deprecated.
Indicates that a given plugin web resource is required.
|
void |
requireResource(String moduleCompleteKey,
Writer writer)
Deprecated.
|
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.
|
protected final LegacyPageBuilderService pageBuilderService
@Deprecated protected final WebResourceIntegration webResourceIntegration
public WebResourceManagerImpl(PluginResourceLocator pluginResourceLocator, WebResourceIntegration webResourceIntegration, WebResourceUrlProvider webResourceUrlProvider)
public WebResourceManagerImpl(PluginResourceLocator pluginResourceLocator, WebResourceIntegration webResourceIntegration, WebResourceUrlProvider webResourceUrlProvider, ResourceBatchingConfiguration batchingConfiguration)
public WebResourceManagerImpl(PrebakeWebResourceAssemblerFactory webResourceAssemblerFactory, PluginResourceLocator pluginResourceLocator, WebResourceIntegration webResourceIntegration, WebResourceUrlProvider webResourceUrlProvider, ResourceBatchingConfiguration batchingConfiguration)
public WebResourceManagerImpl(WebResourceAssemblerFactory webResourceAssemblerFactory, LegacyPageBuilderService pageBuilderService, PluginResourceLocator pluginResourceLocator, WebResourceIntegration webResourceIntegration, WebResourceUrlProvider webResourceUrlProvider, ResourceBatchingConfiguration batchingConfiguration, ResourceDependencyResolver resourceDependencyResolver)
public void requireResource(String moduleCompleteKey)
WebResourceManagerWebResourceManager.includeResources(Writer, UrlMode) is called.requireResource in interface WebResourceManagermoduleCompleteKey - The fully qualified plugin web resource module (eg jira.webresources:scriptaculous)WebResourceManager.includeResources(Writer, UrlMode),
RequiredResources.requireWebResource(String)public void requireResourcesForContext(String context)
WebResourceManagerrequireResourcesForContext in interface WebResourceManagercontext - The name of the context for which you want to require resources (eg "atl.admin")RequiredResources.requireContext(String)public void includeResources(Iterable<String> moduleCompleteKeys, Writer writer, UrlMode urlMode)
WebResourceManagerWebResourceManager.requireResource(String).includeResources in interface WebResourceManagermoduleCompleteKeys - 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
decidepublic void includeResources(Writer writer, UrlMode urlMode)
includeResources(Writer, UrlMode, WebResourceFilter) with
the given url mode and a DefaultWebResourceFilter.includeResources in interface WebResourceManagerincludeResources(Writer, UrlMode, WebResourceFilter)public void includeResources(Writer writer, UrlMode urlMode, WebResourceFilter webResourceFilter)
includeResources in interface WebResourceManagerwriter - the writer to write the links tourlMode - the url mode to write resource url links inwebResourceFilter - the resource filter to filter resources onWebResourceSet.writeHtmlTags(java.io.Writer, com.atlassian.webresource.api.UrlMode, com.google.common.base.Predicate)public String getRequiredResources(UrlMode urlMode)
getRequiredResources(UrlMode, WebResourceFilter) with the given url
mode and a DefaultWebResourceFilter.getRequiredResources in interface WebResourceManagergetRequiredResources(UrlMode, WebResourceFilter)public String getRequiredResources(UrlMode urlMode, WebResourceFilter filter)
getRequiredResources in interface WebResourceManagerurlMode - the url mode to write out the resource tagsfilter - the web resource filter to filter resources onWebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter),
WebResourceSet.writeHtmlTags(java.io.Writer, com.atlassian.webresource.api.UrlMode, com.google.common.base.Predicate)protected String getRequiredResources(UrlMode urlMode, WebResourceFilter webResourceFilter, Set<String> excludedResourceKeys, List<String> excludedContexts)
You should note that the WebResourceManager cannot break context batch resources down beyond the granularity of the context so excluding particular resource keys does not necessary exclude them from a context batch. To safely use this method it is expected that after the initial page load any subsequent "dynamic" requests for resources should be at the granularity of individual resources and not contexts. However you can request contexts if you are confident that there hasn't been an overlap of contexts and dynamically requested macros. A typical safe example is in Confluence when rendering macros the macro rendering process will have requested individual resources which will not exist in any contexts.
This method is available for use by sub-classes but is not part of the public interface since it does not form a complete solution for dynamic resource handling.
urlMode - the url mode to write out the resource tagswebResourceFilter - the web resource filter to filter resources onexcludedResourceKeys - the complete key of resources to be excluded. These exclusion will not apply to any requested contexts
so if a context happens to include these resource keys it will still be served (unless excluded as a context).excludedContexts - contexts to be excluded when the tags are writtenpublic void requireResource(String moduleCompleteKey, Writer writer, UrlMode urlMode)
WebResourceManagerWebResourceManager.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.
requireResource in interface WebResourceManagermoduleCompleteKey - 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 decidepublic String getResourceTags(String moduleCompleteKey, UrlMode urlMode)
WebResourceManagerWriter, use
WebResourceManager.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.
getResourceTags in interface WebResourceManagermoduleCompleteKey - 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 decideWebResourceManager.requireResource(String, Writer, UrlMode)@Deprecated public String getStaticPluginResource(String moduleCompleteKey, String resourceName, UrlMode urlMode)
WebResourceManager
/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.
getStaticPluginResource in interface WebResourceManagermoduleCompleteKey - 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 public String getStaticPluginResource(com.atlassian.plugin.ModuleDescriptor<?> moduleDescriptor, String resourceName, UrlMode urlMode)
WebResourceManager
/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.
getStaticPluginResource in interface WebResourceManagermoduleDescriptor - 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 decideWebResourceManager.getStaticPluginResource(String, String, UrlMode)@Deprecated public String getStaticPluginResource(com.atlassian.plugin.ModuleDescriptor<?> moduleDescriptor, String resourceName)
getStaticPluginResource in interface WebResourceManager@Deprecated public String getStaticPluginResource(String moduleCompleteKey, String resourceName)
getStaticPluginResource in interface WebResourceManagerpublic <T> T executeInNewContext(com.google.common.base.Supplier<T> nestedExecution)
WebResourceManagerexecuteInNewContext in interface WebResourceManagernestedExecution - the code to be executed in the empty context.protected AssembledResources getRequestLocalAssembledResources()
protected RequiredResources getRequestLocalRequiredResources()
public void includeResources(Writer writer)
includeResources in interface WebResourceManagerpublic String getRequiredResources()
getRequiredResources in interface WebResourceManagerpublic void requireResource(String moduleCompleteKey, Writer writer)
requireResource in interface WebResourceManagerpublic String getResourceTags(String moduleCompleteKey)
getResourceTags in interface WebResourceManagerpublic String getStaticResourcePrefix()
getStaticResourcePrefix in interface WebResourceManagerpublic String getStaticResourcePrefix(String resourceCounter)
getStaticResourcePrefix in interface WebResourceManagerCopyright © 2017 Atlassian. All rights reserved.