com.atlassian.confluence.plugin.webresource
Interface ConfluenceWebResourceManager

All Superinterfaces:
com.atlassian.plugin.webresource.WebResourceManager
All Known Implementing Classes:
DefaultConfluenceWebResourceManager

public interface ConfluenceWebResourceManager
extends com.atlassian.plugin.webresource.WebResourceManager

This interface adds Confluence specific functionality to WebResourceManager. All new functionality should go to ConfluenceWebResourceService as WebResourceManager is deprecated.


Method Summary
 java.lang.String getAdminCssResources()
           
 java.lang.String getCssResources()
          Delegates to getCssResources(null)
 java.lang.String getCssResources(java.lang.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).
 java.lang.String getEditorCssResources(java.lang.String spaceKey)
           
 java.lang.String getGlobalCssResourcePrefix()
          Get the resource prefix for the global CSS file.
 java.lang.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).
 java.util.Map<java.lang.String,java.lang.String> getMetadata()
          Returns the map of key-value pairs added via putMetadata(String, String).
 java.lang.String getRequiredResources()
          Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getRequiredResources() instead.
 java.lang.String getResourceContent(java.lang.String resourceName)
          Gets the content of a resource specified.
 java.lang.String getResources()
          Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getRequiredResources() instead.
 java.lang.String getResourceTags(java.lang.String moduleCompleteKey)
          Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getResourceTags(String) instead.
 java.lang.String getResourceTagsForAdditionalContextsHtml(java.util.List<java.lang.String> contexts)
          Deprecated. since 5.2
 java.lang.String getSpaceCssPrefix(java.lang.String spaceKey)
          Get the resource prefix for a particular space's CSS file.
 java.lang.String getStaticResourcePrefix()
          Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getStaticResourcePrefix() instead.
 java.lang.String getStaticResourcePrefix(java.lang.String resourceCounter)
          Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getStaticResourcePrefix(String) instead.
 java.lang.String getStaticResourcePrefix(java.lang.String resourceCounter, com.atlassian.plugin.webresource.UrlMode urlMode)
          Deprecated. since 5.5. Use WebResourceUrlProvider.getStaticResourcePrefix(String, com.atlassian.plugin.webresource.UrlMode) instead.
 java.lang.String getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode urlMode)
          Deprecated. since 5.5. Use WebResourceUrlProvider.getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode) instead.
 java.lang.String getThemeJsResources(java.lang.String spaceKey)
          Returns the script tags for the theme specific javascript resources.
 void includeResources(java.io.Writer writer)
          Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.includeResources(java.io.Writer) instead.
 boolean putMetadata(java.lang.String key, java.lang.String value)
          Adds key-value String pairs to a map to be rendered later.
 void requireResource(java.lang.String moduleCompleteKey, java.io.Writer writer)
          Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.requireResource(String, java.io.Writer) instead.
 void requireResourcesForContext(java.lang.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(java.io.Writer writer)
Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.includeResources(java.io.Writer) instead.

Specified by:
includeResources in interface com.atlassian.plugin.webresource.WebResourceManager

getRequiredResources

@Deprecated
java.lang.String getRequiredResources()
Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getRequiredResources() instead.

Specified by:
getRequiredResources in interface com.atlassian.plugin.webresource.WebResourceManager

requireResource

@Deprecated
void requireResource(java.lang.String moduleCompleteKey,
                                java.io.Writer writer)
Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.requireResource(String, java.io.Writer) instead.

Specified by:
requireResource in interface com.atlassian.plugin.webresource.WebResourceManager

getResourceTags

@Deprecated
java.lang.String getResourceTags(java.lang.String moduleCompleteKey)
Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getResourceTags(String) instead.

Specified by:
getResourceTags in interface com.atlassian.plugin.webresource.WebResourceManager

getStaticResourcePrefix

@Deprecated
java.lang.String getStaticResourcePrefix()
Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getStaticResourcePrefix() instead.

Specified by:
getStaticResourcePrefix in interface com.atlassian.plugin.webresource.WebResourceManager

getStaticResourcePrefix

@Deprecated
java.lang.String getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode urlMode)
Deprecated. since 5.5. Use WebResourceUrlProvider.getStaticResourcePrefix(com.atlassian.plugin.webresource.UrlMode) instead.


getStaticResourcePrefix

@Deprecated
java.lang.String getStaticResourcePrefix(java.lang.String resourceCounter)
Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getStaticResourcePrefix(String) instead.

Specified by:
getStaticResourcePrefix in interface com.atlassian.plugin.webresource.WebResourceManager

getStaticResourcePrefix

@Deprecated
java.lang.String getStaticResourcePrefix(java.lang.String resourceCounter,
                                                    com.atlassian.plugin.webresource.UrlMode urlMode)
Deprecated. since 5.5. Use WebResourceUrlProvider.getStaticResourcePrefix(String, com.atlassian.plugin.webresource.UrlMode) instead.


getResources

@Deprecated
java.lang.String getResources()
Deprecated. since 5.5. Use VelocityFriendlyPageBuilderService.getRequiredResources() instead.

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). This is a convenience method for velocity templates and is equivalent to calling includeResources with UrlMode.AUTO and DefaultWebResourceFilter.


getResourceTagsForAdditionalContextsHtml

@Deprecated
java.lang.String getResourceTagsForAdditionalContextsHtml(java.util.List<java.lang.String> contexts)
Deprecated. since 5.2

Get the resource tags that would be necessary for the supplied List of extra contexts. That is, return the resource tags for these requested contexts but exclude any contexts that have already been required (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.

Parameters:
contexts - the extra contexts to return resource tags for
Returns:
the HTML tags for the required extra resources (an empty String if there are none required)

getCssResources

java.lang.String getCssResources()
Delegates to getCssResources(null)

See Also:
getCssResources(String)

getCssResources

java.lang.String getCssResources(java.lang.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). 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.

Parameters:
spaceKey - spaceKey if null global theme is used.

getJsResources

java.lang.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). 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.


getThemeJsResources

java.lang.String getThemeJsResources(java.lang.String spaceKey)
Returns the script tags for the theme specific javascript resources. If spaceKey is null or invalid, the globally configured theme resources are returned.


getGlobalCssResourcePrefix

java.lang.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

java.lang.String getSpaceCssPrefix(java.lang.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

java.lang.String getResourceContent(java.lang.String resourceName)
Gets the content of a resource specified.

Parameters:
resourceName - The fully qualified plugin name and resource to include (eg confluence.web.resources:legacy-styles)
Returns:
the content of the resource

requireResourcesForContext

void requireResourcesForContext(java.lang.String context)
Requires all resources which have the given context specified in their descriptor

Specified by:
requireResourcesForContext in interface com.atlassian.plugin.webresource.WebResourceManager
Parameters:
context - The name of the context for which you want to require resources (eg "confluence.main")

putMetadata

boolean putMetadata(java.lang.String key,
                    java.lang.String value)
Adds key-value String pairs to a map to be rendered later.

Parameters:
key - a unique key to store the value against
value - an HTML-safe string
Returns:
true if metadata added to map successfully

getMetadata

java.util.Map<java.lang.String,java.lang.String> getMetadata()
Returns the map of key-value pairs added via putMetadata(String, String). Should report an error if called more than once in a request.


getAdminCssResources

java.lang.String getAdminCssResources()
Returns:
the CSS for the admin pages. This should not include any custom/dangerous/user configured CSS

getEditorCssResources

java.lang.String getEditorCssResources(java.lang.String spaceKey)
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.


Copyright © 2003-2014 Atlassian. All Rights Reserved.