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


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 interface com.atlassian.plugin.webresource.WebResourceManager
DELAYED_INCLUDE_MODE, INLINE_INCLUDE_MODE
 
Method Summary
 String getAdminCssResources()
          Returns the CSS for the admin pages.
 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)
          Returns link tags for all the CSS used by the editor iframe.
 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 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 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 requireResourcesForContext(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, getRequiredResources, getResourceTags, getResourceTags, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResource, getStaticPluginResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, getStaticResourcePrefix, includeResources, includeResources, includeResources, includeResources, requireResource, requireResource, requireResource, setIncludeMode
 

Method Detail

getResources

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


getCssResources

String getCssResources()
Delegates to getCssResources(null)

See Also:
getCssResources(String)

getCssResources

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

Parameters:
spaceKey - spaceKey if null global theme is used. UrlMode.AUTO and CssWebResource.

getJsResources

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

String getThemeJsResources(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

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 (eg confluence.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:
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(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 against
value - 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 via putMetadata(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

Returns:

getEditorCssResources

String getEditorCssResources(String spaceKey)
Returns link tags for all the CSS used by the editor iframe.

Parameters:
spaceKey - space key to allow custom styling. Can be null to use global configured theme.
Returns:


Copyright © 2003-2012 Atlassian. All Rights Reserved.