public class DefaultConfluenceWebResourceManager extends com.atlassian.plugin.webresource.WebResourceManagerImpl implements ConfluenceWebResourceManager
Constructor and Description |
---|
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.plugin.webresource.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,
EditorContextCompatibility editorContextCompatibility) |
Modifier and Type | Method and Description |
---|---|
String |
getAdminCssResources() |
String |
getCssResources()
Delegates to getCssResources(null)
|
String |
getCssResources(String spaceKey)
Returns the HTML output of
WebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter) , which includes
references to all the delayed CSS resources requested by WebResourceManager.requireResource(String) . |
String |
getEditorCssResources(String spaceKey) |
String |
getGlobalCssResourcePrefix()
Get the resource prefix for the global CSS file.
|
String |
getJsResources()
Returns the HTML output of
WebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter) , which includes
references to all the delayed Javascript resources requested by WebResourceManager.requireResource(String) . |
Map<String,String> |
getMetadata()
Returns the map of key-value pairs added via
ConfluenceWebResourceManager.putMetadata(String, String) . |
String |
getRequiredResources() |
String |
getResourceContent(String resourceName)
Gets the content of a resource specified.
|
String |
getResources()
Returns the HTML output of
WebResourceManager.includeResources(java.io.Writer, UrlMode) , which includes references to
all the delayed Javascript and CSS resources requested by WebResourceManager.requireResource(String) . |
String |
getResourceTags(String moduleCompleteKey) |
String |
getSpaceCssPrefix(String spaceKey)
Get the resource prefix for a particular space's CSS file.
|
String |
getStaticResourcePrefix() |
String |
getStaticResourcePrefix(String resourceCounter) |
String |
getStaticResourcePrefix(String resourceCounter,
com.atlassian.plugin.webresource.UrlMode urlMode) |
String |
getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode urlMode) |
String |
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 descriptor
|
executeInNewContext, getRequestLocalAssembledResources, getRequestLocalRequiredResources, getRequiredResources, getRequiredResources, getRequiredResources, getResourceTags, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, includeResources, includeResources, includeResources, requireResource
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeInNewContext, getRequiredResources, getRequiredResources, getResourceTags, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, includeResources, includeResources, includeResources, requireResource
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.plugin.webresource.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, EditorContextCompatibility editorContextCompatibility)
@PostConstruct public void init()
public void includeResources(Writer writer)
includeResources
in interface ConfluenceWebResourceManager
includeResources
in interface com.atlassian.plugin.webresource.WebResourceManager
includeResources
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
public String getRequiredResources()
getRequiredResources
in interface ConfluenceWebResourceManager
getRequiredResources
in interface com.atlassian.plugin.webresource.WebResourceManager
getRequiredResources
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
public void requireResource(String moduleCompleteKey, Writer writer)
requireResource
in interface ConfluenceWebResourceManager
requireResource
in interface com.atlassian.plugin.webresource.WebResourceManager
requireResource
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
public String getResourceTags(String moduleCompleteKey)
getResourceTags
in interface ConfluenceWebResourceManager
getResourceTags
in interface com.atlassian.plugin.webresource.WebResourceManager
getResourceTags
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
public String getStaticResourcePrefix()
getStaticResourcePrefix
in interface ConfluenceWebResourceManager
getStaticResourcePrefix
in interface com.atlassian.plugin.webresource.WebResourceManager
getStaticResourcePrefix
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
public String getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode urlMode)
getStaticResourcePrefix
in interface ConfluenceWebResourceManager
public String getStaticResourcePrefix(String resourceCounter)
getStaticResourcePrefix
in interface ConfluenceWebResourceManager
getStaticResourcePrefix
in interface com.atlassian.plugin.webresource.WebResourceManager
getStaticResourcePrefix
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
public String getStaticResourcePrefix(String resourceCounter, com.atlassian.plugin.webresource.UrlMode urlMode)
getStaticResourcePrefix
in interface ConfluenceWebResourceManager
public String getResources()
ConfluenceWebResourceManager
WebResourceManager.includeResources(java.io.Writer, UrlMode)
, which includes references to
all the delayed Javascript and CSS resources requested by WebResourceManager.requireResource(String)
.
This is a convenience method for velocity templates and is equivalent to calling includeResources with
UrlMode.AUTO
and DefaultWebResourceFilter
.
getResources
in interface ConfluenceWebResourceManager
public String getCssResources()
ConfluenceWebResourceManager
getCssResources
in interface ConfluenceWebResourceManager
ConfluenceWebResourceManager.getCssResources(String)
public String getCssResources(String spaceKey)
ConfluenceWebResourceManager
WebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter)
, which includes
references to all the delayed CSS resources requested by WebResourceManager.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
and CssWebResource
.
getCssResources
in interface ConfluenceWebResourceManager
spaceKey
- spaceKey if null global theme is used.public String getJsResources()
ConfluenceWebResourceManager
WebResourceManager.includeResources(Writer, UrlMode, WebResourceFilter)
, which includes
references to all the delayed Javascript resources requested by WebResourceManager.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
and JavascriptWebResource
.
getJsResources
in interface ConfluenceWebResourceManager
public String getThemeJsResources(String spaceKey)
ConfluenceWebResourceManager
null
or invalid,
the globally configured theme resources are returned.getThemeJsResources
in interface ConfluenceWebResourceManager
public void requireResource(String resourceName)
requireResource
in interface com.atlassian.plugin.webresource.WebResourceManager
requireResource
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
public String getGlobalCssResourcePrefix()
ConfluenceWebResourceManager
getGlobalCssResourcePrefix
in interface ConfluenceWebResourceManager
public String getSpaceCssPrefix(String spaceKey)
ConfluenceWebResourceManager
getSpaceCssPrefix
in interface ConfluenceWebResourceManager
spaceKey
- the key of the space we're viewing the CSS for, or null for the global CSS.public String getResourceContent(String resourceName)
ConfluenceWebResourceManager
getResourceContent
in interface ConfluenceWebResourceManager
resourceName
- The fully qualified plugin name and resource to include (eg confluence.web.resources:legacy-styles
)public boolean putMetadata(String key, String value)
ConfluenceWebResourceManager
putMetadata
in interface ConfluenceWebResourceManager
key
- a unique key to store the value againstvalue
- an HTML-safe stringpublic Map<String,String> getMetadata()
ConfluenceWebResourceManager
ConfluenceWebResourceManager.putMetadata(String, String)
.
Should report an error if called more than once in a request.getMetadata
in interface ConfluenceWebResourceManager
public String getAdminCssResources()
getAdminCssResources
in interface ConfluenceWebResourceManager
public String getEditorCssResources(String spaceKey)
getEditorCssResources
in interface ConfluenceWebResourceManager
spaceKey
- space key to allow custom styling. Can be null to use global configured theme.public void requireResourcesForContext(String context)
ConfluenceWebResourceManager
requireResourcesForContext
in interface ConfluenceWebResourceManager
requireResourcesForContext
in interface com.atlassian.plugin.webresource.WebResourceManager
requireResourcesForContext
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
context
- The name of the context for which you want to require resources (eg "confluence.main")Copyright © 2003–2020 Atlassian. All rights reserved.