Interface ConfluenceWebResourceManager
- All Superinterfaces:
com.atlassian.webresource.api.WebResourceManager
- All Known Implementing Classes:
DefaultConfluenceWebResourceManager
public interface ConfluenceWebResourceManager
extends com.atlassian.webresource.api.WebResourceManager
This interface adds Confluence specific functionality to
WebResourceManager
. All new
functionality should go to
ConfluenceWebResourceService
as WebResourceManager is deprecated.-
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 viaputMetadata(String, String)
.Deprecated.since 5.5.getResourceContent
(String resourceName) Gets the content of a resource specified.Deprecated.since 5.5.getResourceTags
(String moduleCompleteKey) Deprecated.since 5.5.getSpaceCssPrefix
(String spaceKey) Get the resource prefix for a particular space's CSS file.Deprecated.since 5.5.getStaticResourcePrefix
(com.atlassian.webresource.api.UrlMode urlMode) Deprecated.since 5.5.getStaticResourcePrefix
(String resourceCounter) Deprecated.since 5.5.getStaticResourcePrefix
(String resourceCounter, com.atlassian.webresource.api.UrlMode urlMode) Deprecated.since 5.5.getThemeJsResources
(String spaceKey) Returns the script tags for the theme specific javascript resources.void
includeResources
(Writer writer) Deprecated.since 5.5.boolean
putMetadata
(String key, String value) Adds key-value String pairs to a map to be rendered later.void
requireResource
(String moduleCompleteKey, Writer writer) Deprecated.since 5.5.void
requireResourcesForContext
(String context) Requires all resources which have the given context specified in their descriptorMethods inherited from interface com.atlassian.webresource.api.WebResourceManager
getRequiredResources, getRequiredResources, getResourceTags, includeResources, includeResources, includeResources, requireResource, requireResource
-
Method Details
-
includeResources
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.includeResources(java.io.Writer)
instead. -
getRequiredResources
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getRequiredResources()
instead. -
requireResource
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.requireResource(String, java.io.Writer)
instead. -
getResourceTags
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getResourceTags(String)
instead. -
getStaticResourcePrefix
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getStaticResourcePrefix()
instead. -
getStaticResourcePrefix
Deprecated.since 5.5. UseWebResourceUrlProvider.getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode)
instead. -
getStaticResourcePrefix
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getStaticResourcePrefix(String)
instead. -
getStaticResourcePrefix
@Deprecated String getStaticResourcePrefix(String resourceCounter, com.atlassian.webresource.api.UrlMode urlMode) Deprecated.since 5.5. UseWebResourceUrlProvider.getStaticResourcePrefix(String, com.atlassian.plugin.webresource.UrlMode)
instead. -
getResources
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getRequiredResources()
instead.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
. -
getCssResources
String getCssResources()Delegates to getCssResources(null)- See Also:
-
getCssResources
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
.- Parameters:
spaceKey
- spaceKey if null global theme is used.
-
getJsResources
String getJsResources()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
. -
getThemeJsResources
Returns the script tags for the theme specific javascript resources. If spaceKey isnull
or invalid, the globally configured theme resources are returned. -
getGlobalCssResourcePrefix
String getGlobalCssResourcePrefix()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. -
getSpaceCssPrefix
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.- Parameters:
spaceKey
- the key of the space we're viewing the CSS for, or null for the global CSS.
-
getResourceContent
Gets the content of a resource specified.- Parameters:
resourceName
- The fully qualified plugin name and resource to include (egconfluence.web.resources:legacy-styles
)- Returns:
- the content of the resource
-
requireResourcesForContext
Requires all resources which have the given context specified in their descriptor- Specified by:
requireResourcesForContext
in interfacecom.atlassian.webresource.api.WebResourceManager
- Parameters:
context
- The name of the context for which you want to require resources (eg "confluence.main")
-
putMetadata
Adds key-value String pairs to a map to be rendered later.- Parameters:
key
- a unique key to store the value againstvalue
- an HTML-safe string- Returns:
- true if metadata added to map successfully
-
getMetadata
Returns the map of key-value pairs added viaputMetadata(String, String)
. Should report an error if called more than once in a request. -
getAdminCssResources
String getAdminCssResources()- Returns:
- the CSS for the admin pages. This should not include any custom/dangerous/user configured CSS
-
getEditorCssResources
- 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.
-