Class DefaultConfluenceWebResourceManager
java.lang.Object
com.atlassian.plugin.webresource.WebResourceManagerImpl
com.atlassian.confluence.plugin.webresource.DefaultConfluenceWebResourceManager
- All Implemented Interfaces:
ConfluenceWebResourceManager
,com.atlassian.webresource.api.WebResourceManager
public class DefaultConfluenceWebResourceManager
extends com.atlassian.plugin.webresource.WebResourceManagerImpl
implements ConfluenceWebResourceManager
-
Field Summary
Fields inherited from class com.atlassian.plugin.webresource.WebResourceManagerImpl
pageBuilderService, webResourceIntegration
-
Constructor Summary
ConstructorDescriptionDefaultConfluenceWebResourceManager
(com.atlassian.webresource.api.assembler.WebResourceAssemblerFactory webResourceAssemblerFactory, com.atlassian.plugin.webresource.assembler.LegacyPageBuilderService pageBuilderService, com.atlassian.plugin.webresource.PluginResourceLocator pluginResourceLocator, com.atlassian.plugin.webresource.WebResourceIntegration webResourceIntegration, com.atlassian.webresource.api.WebResourceUrlProvider webResourceUrlProvider, com.atlassian.plugin.webresource.ResourceBatchingConfiguration batchingConfiguration, com.atlassian.plugin.webresource.ResourceDependencyResolver resourceDependencyResolver, com.atlassian.plugin.PluginAccessor pluginAccessor, ResourceAccessor resourceAccessor, SettingsManager settingsManager, DefaultConfluenceWebResourceService confluenceWebResourceService) -
Method Summary
Modifier and TypeMethodDescriptionDelegates to getCssResources(null)getCssResources
(String spaceKey) Returns the HTML output ofWebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter)
, which includes references to all the delayed CSS resources requested byWebResourceManager.requireResource(String)
.getEditorCssResources
(String spaceKey) Get the resource prefix for the global CSS file.Returns the HTML output ofWebResourceManager.includeResources(Writer, UrlMode, WebResource1Filter)
, which includes references to all the delayed Javascript resources requested byWebResourceManager.requireResource(String)
.Returns the map of key-value pairs added viaConfluenceWebResourceManager.putMetadata(String, String)
.getResourceContent
(String resourceName) Gets the content of a resource specified.Returns the HTML output ofWebResourceManager.includeResources(java.io.Writer, UrlMode)
, which includes references to all the delayed Javascript and CSS resources requested byWebResourceManager.requireResource(String)
.getResourceTags
(String moduleCompleteKey) getSpaceCssPrefix
(String spaceKey) Get the resource prefix for a particular space's CSS file.getStaticResourcePrefix
(com.atlassian.webresource.api.UrlMode urlMode) getStaticResourcePrefix
(String resourceCounter) getStaticResourcePrefix
(String resourceCounter, com.atlassian.webresource.api.UrlMode urlMode) getThemeJsResources
(String spaceKey) Returns the script tags for the theme specific javascript resources.void
includeResources
(Writer writer) void
init()
boolean
putMetadata
(String key, String value) Adds key-value String pairs to a map to be rendered later.void
requireResource
(String resourceName) Wraps the parent method to provide logging.void
requireResource
(String moduleCompleteKey, Writer writer) void
requireResourcesForContext
(String context) Requires all resources which have the given context specified in their descriptorMethods inherited from class com.atlassian.plugin.webresource.WebResourceManagerImpl
getRequestLocalAssembledResources, getRequestLocalRequiredResources, getRequiredResources, getRequiredResources, getRequiredResources, getResourceTags, includeResources, includeResources, includeResources, requireResource
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.webresource.api.WebResourceManager
getRequiredResources, getRequiredResources, getResourceTags, includeResources, includeResources, includeResources, requireResource
-
Constructor Details
-
DefaultConfluenceWebResourceManager
public DefaultConfluenceWebResourceManager(com.atlassian.webresource.api.assembler.WebResourceAssemblerFactory webResourceAssemblerFactory, com.atlassian.plugin.webresource.assembler.LegacyPageBuilderService pageBuilderService, com.atlassian.plugin.webresource.PluginResourceLocator pluginResourceLocator, com.atlassian.plugin.webresource.WebResourceIntegration webResourceIntegration, com.atlassian.webresource.api.WebResourceUrlProvider webResourceUrlProvider, com.atlassian.plugin.webresource.ResourceBatchingConfiguration batchingConfiguration, com.atlassian.plugin.webresource.ResourceDependencyResolver resourceDependencyResolver, com.atlassian.plugin.PluginAccessor pluginAccessor, ResourceAccessor resourceAccessor, SettingsManager settingsManager, DefaultConfluenceWebResourceService confluenceWebResourceService) - Since:
- 6.7.0
-
-
Method Details
-
init
@PostConstruct public void init() -
includeResources
- Specified by:
includeResources
in interfaceConfluenceWebResourceManager
-
getRequiredResources
- Specified by:
getRequiredResources
in interfaceConfluenceWebResourceManager
-
requireResource
- Specified by:
requireResource
in interfaceConfluenceWebResourceManager
-
getResourceTags
- Specified by:
getResourceTags
in interfaceConfluenceWebResourceManager
-
getStaticResourcePrefix
- Specified by:
getStaticResourcePrefix
in interfaceConfluenceWebResourceManager
-
getStaticResourcePrefix
- Specified by:
getStaticResourcePrefix
in interfaceConfluenceWebResourceManager
-
getStaticResourcePrefix
- Specified by:
getStaticResourcePrefix
in interfaceConfluenceWebResourceManager
-
getStaticResourcePrefix
public String getStaticResourcePrefix(String resourceCounter, com.atlassian.webresource.api.UrlMode urlMode) - Specified by:
getStaticResourcePrefix
in interfaceConfluenceWebResourceManager
-
getResources
Description copied from interface:ConfluenceWebResourceManager
Returns the HTML output ofWebResourceManager.includeResources(java.io.Writer, UrlMode)
, which includes references to all the delayed Javascript and CSS resources requested byWebResourceManager.requireResource(String)
.This is a convenience method for velocity templates and is equivalent to calling includeResources with
UrlMode.AUTO
andDefaultWebResourceFilter
.- Specified by:
getResources
in interfaceConfluenceWebResourceManager
-
getCssResources
Description copied from interface:ConfluenceWebResourceManager
Delegates to getCssResources(null)- Specified by:
getCssResources
in interfaceConfluenceWebResourceManager
- See Also:
-
getCssResources
Description copied from interface:ConfluenceWebResourceManager
Returns the HTML output ofWebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter)
, which includes references to all the delayed CSS resources requested byWebResourceManager.requireResource(String)
.This method should only be called once for each request. Multiple calls to this method will result with
null
being returned.This is a convenience method for velocity templates and is equivalent to calling includeResources with
UrlMode.AUTO
andCssWebResource
.- Specified by:
getCssResources
in interfaceConfluenceWebResourceManager
- Parameters:
spaceKey
- spaceKey if null global theme is used.
-
getJsResources
Description copied from interface:ConfluenceWebResourceManager
Returns the HTML output ofWebResourceManager.includeResources(Writer, UrlMode, WebResource1Filter)
, which includes references to all the delayed Javascript resources requested byWebResourceManager.requireResource(String)
.This method should only be called once for each request. Multiple calls to this method will result with
null
being returned.This is a convenience method for velocity templates and is equivalent to calling includeResources with
UrlMode.AUTO
andJavascriptWebResource
.- Specified by:
getJsResources
in interfaceConfluenceWebResourceManager
-
getThemeJsResources
Description copied from interface:ConfluenceWebResourceManager
Returns the script tags for the theme specific javascript resources. If spaceKey isnull
or invalid, the globally configured theme resources are returned.- Specified by:
getThemeJsResources
in interfaceConfluenceWebResourceManager
-
requireResource
Wraps the parent method to provide logging.- Specified by:
requireResource
in interfacecom.atlassian.webresource.api.WebResourceManager
- Overrides:
requireResource
in classcom.atlassian.plugin.webresource.WebResourceManagerImpl
-
getGlobalCssResourcePrefix
Description copied from interface:ConfluenceWebResourceManager
Get the resource prefix for the global CSS file. This prefix should be updated every time there is a change to the global theme or colour scheme.- Specified by:
getGlobalCssResourcePrefix
in interfaceConfluenceWebResourceManager
-
getSpaceCssPrefix
Description copied from interface:ConfluenceWebResourceManager
Get the resource prefix for a particular space's CSS file. This prefix should be updated every time there is a change to the space's theme or colour scheme.- Specified by:
getSpaceCssPrefix
in interfaceConfluenceWebResourceManager
- Parameters:
spaceKey
- the key of the space we're viewing the CSS for, or null for the global CSS.
-
getResourceContent
Description copied from interface:ConfluenceWebResourceManager
Gets the content of a resource specified.- Specified by:
getResourceContent
in interfaceConfluenceWebResourceManager
- Parameters:
resourceName
- The fully qualified plugin name and resource to include (egconfluence.web.resources:legacy-styles
)- Returns:
- the content of the resource
-
putMetadata
Description copied from interface:ConfluenceWebResourceManager
Adds key-value String pairs to a map to be rendered later.- Specified by:
putMetadata
in interfaceConfluenceWebResourceManager
- Parameters:
key
- a unique key to store the value againstvalue
- an HTML-safe string- Returns:
- true if metadata added to map successfully
-
getMetadata
Description copied from interface:ConfluenceWebResourceManager
Returns the map of key-value pairs added viaConfluenceWebResourceManager.putMetadata(String, String)
. Should report an error if called more than once in a request.- Specified by:
getMetadata
in interfaceConfluenceWebResourceManager
-
getAdminCssResources
- Specified by:
getAdminCssResources
in interfaceConfluenceWebResourceManager
- Returns:
- the CSS for the admin pages. This should not include any custom/dangerous/user configured CSS
-
getEditorCssResources
- Specified by:
getEditorCssResources
in interfaceConfluenceWebResourceManager
- Parameters:
spaceKey
- space key to allow custom styling. Can be null to use global configured theme.- Returns:
- link tags for all the CSS used by the editor iframe.
-
requireResourcesForContext
Description copied from interface:ConfluenceWebResourceManager
Requires all resources which have the given context specified in their descriptor- Specified by:
requireResourcesForContext
in interfaceConfluenceWebResourceManager
- Specified by:
requireResourcesForContext
in interfacecom.atlassian.webresource.api.WebResourceManager
- Overrides:
requireResourcesForContext
in classcom.atlassian.plugin.webresource.WebResourceManagerImpl
- Parameters:
context
- The name of the context for which you want to require resources (eg "confluence.main")
-