com.atlassian.confluence.themes
Interface CustomLayoutManager

All Known Implementing Classes:
DefaultCustomLayoutManager

public interface CustomLayoutManager

Manager for layouts -- theme-like Velocity templates that can be edited from within the Confluence administrative UI.


Method Summary
 java.util.Collection<DefaultDecorator> getAllDefaultDecorators()
          Retrieves a collection of all default decorators without customization
 java.util.Collection<PersistentDecorator> getApplicableCustomDecoratorsForSpace(java.lang.String spaceKey)
          Returns allcustom decorators that apply to a space, whether they are space level or global level.
 java.util.Collection<PersistentDecorator> getCustomGlobalDecorators()
          Returns all global custom decorators (does not retrieve space level decorators)
 java.util.Collection<PersistentDecorator> getCustomSpaceDecorators(java.lang.String spaceKey)
          Returns all custom decorators defined for a specific space only (does not retrieve global decorators)
 DefaultDecorator getDefaultDecorator(java.lang.String decoratorName)
          Retrieves the default decorator for a given decorator name without customization
 PersistentDecorator getPersistentDecorator(java.lang.String spaceKey, java.lang.String decoratorName)
          Retrieves a custom decorator for the (spaceKey, name) combination.
 boolean hasCustomDecorator(java.lang.String spaceKey, java.lang.String decoratorName)
          Determines if a given space overrides a default decorator with a custom one.
 boolean hasCustomGlobalDecorator(java.lang.String decoratorName)
          Determines if a given default decorator is overridden globally
 boolean hasCustomSpaceDecorator(java.lang.String spaceKey, java.lang.String decoratorName)
          Determines if a given space overrides a default decorator with a custom one at the space level
 void remove(PersistentDecorator persistentDecorator)
          Removes the given custom decorator, and flushes it from the velocity cache
 void remove(java.lang.String spaceKey, java.lang.String decoratorName)
          Removes the custom decorator with the given (spaceKey, name) pair, and flushes it from the velocity cache
 void removeAllCustomGlobalDecorators()
          Removes all globally defines custom decorators (does not remove space level custom decorators)
 void removeAllCustomSpaceDecorators(java.lang.String spaceKey)
          Removes all custom decorators defined for a given space (does not remove global ones)
 void saveOrUpdate(PersistentDecorator persistentDecorator)
          Saves the given decorator (or updates it if it already exists), and updates the velocity cache
 void saveOrUpdate(java.lang.String spaceKey, java.lang.String decoratorName, java.lang.String content)
          Creates a decorator for the given spaceKey with the given name, and saves it.
 boolean usesCustomLayout(java.lang.String spaceKey)
          Determines if a space has any custom layout decorators defined.
 

Method Detail

saveOrUpdate

void saveOrUpdate(PersistentDecorator persistentDecorator)
Saves the given decorator (or updates it if it already exists), and updates the velocity cache


saveOrUpdate

void saveOrUpdate(java.lang.String spaceKey,
                  java.lang.String decoratorName,
                  java.lang.String content)
Creates a decorator for the given spaceKey with the given name, and saves it. Will update an already existing decorator with the same (spaceKey, name) pair. Also updates the velocity cache

Parameters:
spaceKey - null spaceKey indicates a global decorator
decoratorName - the filename of the decorator
content - the decorator body

getPersistentDecorator

PersistentDecorator getPersistentDecorator(java.lang.String spaceKey,
                                           java.lang.String decoratorName)
Retrieves a custom decorator for the (spaceKey, name) combination.

Parameters:
spaceKey - null spaceKey indicates a global decorator
decoratorName - the filename of the decorator
Returns:
The decorator if it exists, null otherwise

getCustomSpaceDecorators

java.util.Collection<PersistentDecorator> getCustomSpaceDecorators(java.lang.String spaceKey)
Returns all custom decorators defined for a specific space only (does not retrieve global decorators)

Parameters:
spaceKey - null spaceKey indicates a global decorator
Returns:
Collection of custom decorators

getApplicableCustomDecoratorsForSpace

java.util.Collection<PersistentDecorator> getApplicableCustomDecoratorsForSpace(java.lang.String spaceKey)
Returns allcustom decorators that apply to a space, whether they are space level or global level. If a particular decorator is overridden at both levels, the space level one is returned

Returns:
Collection of custom decorators

getCustomGlobalDecorators

java.util.Collection<PersistentDecorator> getCustomGlobalDecorators()
Returns all global custom decorators (does not retrieve space level decorators)

Returns:
Collection of custom decorators

hasCustomSpaceDecorator

boolean hasCustomSpaceDecorator(java.lang.String spaceKey,
                                java.lang.String decoratorName)
Determines if a given space overrides a default decorator with a custom one at the space level

Parameters:
spaceKey - null spaceKey indicates global
decoratorName - the filename of the decorator
Returns:
True if the decorator is overridden at the space level, false otherwise

hasCustomGlobalDecorator

boolean hasCustomGlobalDecorator(java.lang.String decoratorName)
Determines if a given default decorator is overridden globally

Parameters:
decoratorName - the filename of the decorator
Returns:
True if the decorator is overridden at the global level, false otherwise

hasCustomDecorator

boolean hasCustomDecorator(java.lang.String spaceKey,
                           java.lang.String decoratorName)
Determines if a given space overrides a default decorator with a custom one.

Parameters:
spaceKey - null spaceKey indicates a global decorator
decoratorName - the filename of the decorator
Returns:
True if the decorator is overridden at either the space or global level, false otherwise

usesCustomLayout

boolean usesCustomLayout(java.lang.String spaceKey)
Determines if a space has any custom layout decorators defined.

Parameters:
spaceKey - null spaceKey indicates global
Returns:
True if any default decorator is overridden for this space or globally, false otherwise

remove

void remove(java.lang.String spaceKey,
            java.lang.String decoratorName)
Removes the custom decorator with the given (spaceKey, name) pair, and flushes it from the velocity cache

Parameters:
spaceKey - null spaceKey indicates a global decorator
decoratorName - the filename of the decorator

remove

void remove(PersistentDecorator persistentDecorator)
Removes the given custom decorator, and flushes it from the velocity cache

Parameters:
persistentDecorator - the custom decorator to delete

removeAllCustomSpaceDecorators

void removeAllCustomSpaceDecorators(java.lang.String spaceKey)
Removes all custom decorators defined for a given space (does not remove global ones)

Parameters:
spaceKey - null spaceKey indicates global

removeAllCustomGlobalDecorators

void removeAllCustomGlobalDecorators()
Removes all globally defines custom decorators (does not remove space level custom decorators)


getDefaultDecorator

DefaultDecorator getDefaultDecorator(java.lang.String decoratorName)
Retrieves the default decorator for a given decorator name without customization

Parameters:
decoratorName - The filename of the default decorator

getAllDefaultDecorators

java.util.Collection<DefaultDecorator> getAllDefaultDecorators()
Retrieves a collection of all default decorators without customization



Copyright © 2003-2014 Atlassian. All Rights Reserved.