|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.plugin.webresource.WebResourceManagerImpl
com.atlassian.confluence.plugin.webresource.DefaultConfluenceWebResourceManager
public class DefaultConfluenceWebResourceManager
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.plugin.webresource.WebResourceManager |
---|
com.atlassian.plugin.webresource.WebResourceManager.IncludeMode |
Field Summary |
---|
Fields inherited from class com.atlassian.plugin.webresource.WebResourceManagerImpl |
---|
batchingConfiguration, dependencyResolver, pluginResourceLocator, webResourceFormatters, webResourceIntegration |
Fields inherited from interface com.atlassian.plugin.webresource.WebResourceManager |
---|
DELAYED_INCLUDE_MODE, INLINE_INCLUDE_MODE |
Constructor Summary | |
---|---|
DefaultConfluenceWebResourceManager(com.atlassian.plugin.webresource.PluginResourceLocator pluginResourceLocator,
com.atlassian.plugin.webresource.WebResourceIntegration webResourceIntegration,
com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider,
com.atlassian.plugin.webresource.ResourceBatchingConfiguration batchingConfiguration,
ThemeManager themeManager,
StylesheetManager stylesheetManager,
CssResourceCounterManager cssResourceCounterManager,
com.atlassian.plugin.PluginAccessor pluginAccessor,
ResourceAccessor resourceAccessor,
SettingsManager settingsManager,
Counter pluginCounter)
|
Method Summary | |
---|---|
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 |
getResourceContent(String resourceName)
Gets the content of a resource specified. |
String |
getResources()
Returns the HTML output of WebResourceManager.includeResources(java.io.Writer) , which includes references to
all the delayed Javascript and CSS resources requested by WebResourceManager.requireResource(String) . |
String |
getResourceTags(String resourceName)
|
String |
getResourceTagsForAdditionalContextsHtml(List<String> contexts)
Get the resource tags that would be necessary for the supplied List of extra contexts. |
String |
getSpaceCssPrefix(String spaceKey)
Get the resource prefix for a particular space's CSS file. |
String |
getThemeJsResources(String spaceKey)
Returns the script tags for the theme specific javascript resources. |
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. |
Methods inherited from class com.atlassian.plugin.webresource.WebResourceManagerImpl |
---|
executeInNewContext, getRequiredResources, getRequiredResources, getRequiredResources, getRequiredResources, getResourceTags, getResourceTagsForAdditionalContexts, getResourceTagsForAdditionalContexts, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, includeResources, includeResources, includeResources, includeResources, requireResource, requireResource, requireResourcesForContext, setIncludeMode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.confluence.plugin.webresource.ConfluenceWebResourceManager |
---|
requireResourcesForContext |
Methods inherited from interface com.atlassian.plugin.webresource.WebResourceManager |
---|
executeInNewContext, getRequiredResources, getRequiredResources, getRequiredResources, getResourceTags, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, includeResources, includeResources, includeResources, includeResources, requireResource, requireResource, setIncludeMode |
Constructor Detail |
---|
public DefaultConfluenceWebResourceManager(com.atlassian.plugin.webresource.PluginResourceLocator pluginResourceLocator, com.atlassian.plugin.webresource.WebResourceIntegration webResourceIntegration, com.atlassian.plugin.webresource.WebResourceUrlProvider webResourceUrlProvider, com.atlassian.plugin.webresource.ResourceBatchingConfiguration batchingConfiguration, ThemeManager themeManager, StylesheetManager stylesheetManager, CssResourceCounterManager cssResourceCounterManager, com.atlassian.plugin.PluginAccessor pluginAccessor, ResourceAccessor resourceAccessor, SettingsManager settingsManager, Counter pluginCounter)
Method Detail |
---|
public String getResources()
ConfluenceWebResourceManager
WebResourceManager.includeResources(java.io.Writer)
, 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 String getResourceTags(String resourceName)
getResourceTags
in interface com.atlassian.plugin.webresource.WebResourceManager
getResourceTags
in class com.atlassian.plugin.webresource.WebResourceManagerImpl
public String getResourceTagsForAdditionalContextsHtml(List<String> contexts)
ConfluenceWebResourceManager
ConfluenceWebResourceManager.requireResourcesForContext(String)
).
A typical use for this would be to store the resources to be loaded if you want to dynamically add a
new context to a rendered page. For example, you might want to dynamically load the Editor (therefore
the 'editor' context) from a 'viewpage' context and this method will let you store the resources
required on the page as it is rendered in its original state.
getResourceTagsForAdditionalContextsHtml
in interface ConfluenceWebResourceManager
contexts
- the extra contexts to return resource tags for
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 string
public 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |