Interface ConfluenceWebResourceManager
-
- All Superinterfaces:
com.atlassian.plugin.webresource.WebResourceManager
- All Known Implementing Classes:
DefaultConfluenceWebResourceManager
public interface ConfluenceWebResourceManager extends com.atlassian.plugin.webresource.WebResourceManagerThis interface adds Confluence specific functionality toWebResourceManager. All new functionality should go toConfluenceWebResourceServiceas WebResourceManager is deprecated.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description StringgetAdminCssResources()StringgetCssResources()Delegates to getCssResources(null)StringgetCssResources(String spaceKey)Returns the HTML output ofWebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter), which includes references to all the delayed CSS resources requested byWebResourceManager.requireResource(String).StringgetEditorCssResources(String spaceKey)StringgetGlobalCssResourcePrefix()Get the resource prefix for the global CSS file.StringgetJsResources()Returns the HTML output ofWebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter), which includes references to all the delayed Javascript resources requested byWebResourceManager.requireResource(String).Map<String,String>getMetadata()Returns the map of key-value pairs added viaputMetadata(String, String).StringgetRequiredResources()Deprecated.since 5.5.StringgetResourceContent(String resourceName)Gets the content of a resource specified.StringgetResources()Deprecated.since 5.5.StringgetResourceTags(String moduleCompleteKey)Deprecated.since 5.5.StringgetSpaceCssPrefix(String spaceKey)Get the resource prefix for a particular space's CSS file.StringgetStaticResourcePrefix()Deprecated.since 5.5.StringgetStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode urlMode)Deprecated.since 5.5.StringgetStaticResourcePrefix(String resourceCounter)Deprecated.since 5.5.StringgetStaticResourcePrefix(String resourceCounter, com.atlassian.plugin.webresource.UrlMode urlMode)Deprecated.since 5.5.StringgetThemeJsResources(String spaceKey)Returns the script tags for the theme specific javascript resources.voidincludeResources(Writer writer)Deprecated.since 5.5.booleanputMetadata(String key, String value)Adds key-value String pairs to a map to be rendered later.voidrequireResource(String moduleCompleteKey, Writer writer)Deprecated.since 5.5.voidrequireResourcesForContext(String context)Requires all resources which have the given context specified in their descriptor-
Methods inherited from interface com.atlassian.plugin.webresource.WebResourceManager
executeInNewContext, getRequiredResources, getRequiredResources, getResourceTags, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, includeResources, includeResources, includeResources, requireResource, requireResource
-
-
-
-
Method Detail
-
includeResources
@Deprecated void includeResources(Writer writer)
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.includeResources(java.io.Writer)instead.- Specified by:
includeResourcesin interfacecom.atlassian.plugin.webresource.WebResourceManager
-
getRequiredResources
@Deprecated String getRequiredResources()
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getRequiredResources()instead.- Specified by:
getRequiredResourcesin interfacecom.atlassian.plugin.webresource.WebResourceManager
-
requireResource
@Deprecated void requireResource(String moduleCompleteKey, Writer writer)
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.requireResource(String, java.io.Writer)instead.- Specified by:
requireResourcein interfacecom.atlassian.plugin.webresource.WebResourceManager
-
getResourceTags
@Deprecated String getResourceTags(String moduleCompleteKey)
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getResourceTags(String)instead.- Specified by:
getResourceTagsin interfacecom.atlassian.plugin.webresource.WebResourceManager
-
getStaticResourcePrefix
@Deprecated String getStaticResourcePrefix()
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getStaticResourcePrefix()instead.- Specified by:
getStaticResourcePrefixin interfacecom.atlassian.plugin.webresource.WebResourceManager
-
getStaticResourcePrefix
@Deprecated String getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode urlMode)
Deprecated.since 5.5. UseWebResourceUrlProvider.getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode)instead.
-
getStaticResourcePrefix
@Deprecated String getStaticResourcePrefix(String resourceCounter)
Deprecated.since 5.5. UseVelocityFriendlyPageBuilderService.getStaticResourcePrefix(String)instead.- Specified by:
getStaticResourcePrefixin interfacecom.atlassian.plugin.webresource.WebResourceManager
-
getStaticResourcePrefix
@Deprecated String getStaticResourcePrefix(String resourceCounter, com.atlassian.plugin.webresource.UrlMode urlMode)
Deprecated.since 5.5. UseWebResourceUrlProvider.getStaticResourcePrefix(String, com.atlassian.plugin.webresource.UrlMode)instead.
-
getResources
@Deprecated String 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.AUTOandDefaultWebResourceFilter.
-
getCssResources
String getCssResources()
Delegates to getCssResources(null)- See Also:
getCssResources(String)
-
getCssResources
String 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).This method should only be called once for each request. Multiple calls to this method will result with
nullbeing returned.This is a convenience method for velocity templates and is equivalent to calling includeResources with
UrlMode.AUTOandCssWebResource.- Parameters:
spaceKey- spaceKey if null global theme is used.
-
getJsResources
String getJsResources()
Returns the HTML output ofWebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter), 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
nullbeing returned.This is a convenience method for velocity templates and is equivalent to calling includeResources with
UrlMode.AUTOandJavascriptWebResource.
-
getThemeJsResources
String getThemeJsResources(String spaceKey)
Returns the script tags for the theme specific javascript resources. If spaceKey isnullor 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
String getSpaceCssPrefix(String spaceKey)
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
String getResourceContent(String resourceName)
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
void requireResourcesForContext(String context)
Requires all resources which have the given context specified in their descriptor- Specified by:
requireResourcesForContextin interfacecom.atlassian.plugin.webresource.WebResourceManager- Parameters:
context- The name of the context for which you want to require resources (eg "confluence.main")
-
putMetadata
boolean putMetadata(String key, String value)
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
Map<String,String> 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
-
-