com.atlassian.confluence.themes
Class DefaultCustomLayoutManager

java.lang.Object
  extended by com.atlassian.confluence.themes.DefaultCustomLayoutManager
All Implemented Interfaces:
CustomLayoutManager

public class DefaultCustomLayoutManager
extends Object
implements CustomLayoutManager


Constructor Summary
DefaultCustomLayoutManager(PersistentDecoratorDao persistentDecoratorDao)
           
 
Method Summary
 Collection<DefaultDecorator> getAllDefaultDecorators()
          Retrieves a collection of all default decorators without customization
 Collection<PersistentDecorator> getApplicableCustomDecoratorsForSpace(String spaceKey)
          Returns allcustom decorators that apply to a space, whether they are space level or global level.
 Collection<PersistentDecorator> getCustomGlobalDecorators()
          Returns all global custom decorators (does not retrieve space level decorators)
 Collection<PersistentDecorator> getCustomSpaceDecorators(String spaceKey)
          Returns all custom decorators defined for a specific space only (does not retrieve global decorators)
 DefaultDecorator getDefaultDecorator(String decoratorName)
          Retrieves the default decorator for a given decorator name without customization
 PersistentDecorator getPersistentDecorator(String spaceKey, String decoratorName)
          Retrieves a custom decorator for the (spaceKey, name) combination.
 boolean hasCustomDecorator(String spaceKey, String decoratorName)
          Determines if a given space overrides a default decorator with a custom one.
 boolean hasCustomGlobalDecorator(String decoratorName)
          Determines if a given default decorator is overridden globally
 boolean hasCustomSpaceDecorator(String spaceKey, 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(String spaceKey, 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(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(String spaceKey, String decoratorName, String content)
          Creates a decorator for the given spaceKey with the given name, and saves it.
 boolean usesCustomLayout(String spaceKey)
          Determines if a space has any custom layout decorators defined.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCustomLayoutManager

public DefaultCustomLayoutManager(PersistentDecoratorDao persistentDecoratorDao)
Method Detail

saveOrUpdate

public void saveOrUpdate(PersistentDecorator persistentDecorator)
Description copied from interface: CustomLayoutManager
Saves the given decorator (or updates it if it already exists), and updates the velocity cache

Specified by:
saveOrUpdate in interface CustomLayoutManager

saveOrUpdate

public void saveOrUpdate(String spaceKey,
                         String decoratorName,
                         String content)
Description copied from interface: CustomLayoutManager
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

Specified by:
saveOrUpdate in interface CustomLayoutManager
Parameters:
spaceKey - null spaceKey indicates a global decorator
decoratorName - the filename of the decorator
content - the decorator body

getPersistentDecorator

public PersistentDecorator getPersistentDecorator(String spaceKey,
                                                  String decoratorName)
Description copied from interface: CustomLayoutManager
Retrieves a custom decorator for the (spaceKey, name) combination.

Specified by:
getPersistentDecorator in interface CustomLayoutManager
Parameters:
spaceKey - null spaceKey indicates a global decorator
decoratorName - the filename of the decorator
Returns:
The decorator if it exists, null otherwise

getCustomSpaceDecorators

public Collection<PersistentDecorator> getCustomSpaceDecorators(String spaceKey)
Description copied from interface: CustomLayoutManager
Returns all custom decorators defined for a specific space only (does not retrieve global decorators)

Specified by:
getCustomSpaceDecorators in interface CustomLayoutManager
Parameters:
spaceKey - null spaceKey indicates a global decorator
Returns:
Collection of custom decorators

getApplicableCustomDecoratorsForSpace

public Collection<PersistentDecorator> getApplicableCustomDecoratorsForSpace(String spaceKey)
Description copied from interface: CustomLayoutManager
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

Specified by:
getApplicableCustomDecoratorsForSpace in interface CustomLayoutManager
Returns:
Collection of custom decorators

getCustomGlobalDecorators

public Collection<PersistentDecorator> getCustomGlobalDecorators()
Description copied from interface: CustomLayoutManager
Returns all global custom decorators (does not retrieve space level decorators)

Specified by:
getCustomGlobalDecorators in interface CustomLayoutManager
Returns:
Collection of custom decorators

hasCustomSpaceDecorator

public boolean hasCustomSpaceDecorator(String spaceKey,
                                       String decoratorName)
Description copied from interface: CustomLayoutManager
Determines if a given space overrides a default decorator with a custom one at the space level

Specified by:
hasCustomSpaceDecorator in interface CustomLayoutManager
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

public boolean hasCustomGlobalDecorator(String decoratorName)
Description copied from interface: CustomLayoutManager
Determines if a given default decorator is overridden globally

Specified by:
hasCustomGlobalDecorator in interface CustomLayoutManager
Parameters:
decoratorName - the filename of the decorator
Returns:
True if the decorator is overridden at the global level, false otherwise

hasCustomDecorator

public boolean hasCustomDecorator(String spaceKey,
                                  String decoratorName)
Description copied from interface: CustomLayoutManager
Determines if a given space overrides a default decorator with a custom one.

Specified by:
hasCustomDecorator in interface CustomLayoutManager
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

public boolean usesCustomLayout(String spaceKey)
Description copied from interface: CustomLayoutManager
Determines if a space has any custom layout decorators defined.

Specified by:
usesCustomLayout in interface CustomLayoutManager
Parameters:
spaceKey - null spaceKey indicates global
Returns:
True if any default decorator is overridden for this space or globally, false otherwise

remove

public void remove(String spaceKey,
                   String decoratorName)
Description copied from interface: CustomLayoutManager
Removes the custom decorator with the given (spaceKey, name) pair, and flushes it from the velocity cache

Specified by:
remove in interface CustomLayoutManager
Parameters:
spaceKey - null spaceKey indicates a global decorator
decoratorName - the filename of the decorator

remove

public void remove(PersistentDecorator persistentDecorator)
Description copied from interface: CustomLayoutManager
Removes the given custom decorator, and flushes it from the velocity cache

Specified by:
remove in interface CustomLayoutManager
Parameters:
persistentDecorator - the custom decorator to delete

removeAllCustomSpaceDecorators

public void removeAllCustomSpaceDecorators(String spaceKey)
Description copied from interface: CustomLayoutManager
Removes all custom decorators defined for a given space (does not remove global ones)

Specified by:
removeAllCustomSpaceDecorators in interface CustomLayoutManager
Parameters:
spaceKey - null spaceKey indicates global

removeAllCustomGlobalDecorators

public void removeAllCustomGlobalDecorators()
Description copied from interface: CustomLayoutManager
Removes all globally defines custom decorators (does not remove space level custom decorators)

Specified by:
removeAllCustomGlobalDecorators in interface CustomLayoutManager

getDefaultDecorator

public DefaultDecorator getDefaultDecorator(String decoratorName)
Description copied from interface: CustomLayoutManager
Retrieves the default decorator for a given decorator name without customization

Specified by:
getDefaultDecorator in interface CustomLayoutManager
Parameters:
decoratorName - The filename of the default decorator

getAllDefaultDecorators

public Collection<DefaultDecorator> getAllDefaultDecorators()
Description copied from interface: CustomLayoutManager
Retrieves a collection of all default decorators without customization

Specified by:
getAllDefaultDecorators in interface CustomLayoutManager


Copyright © 2003-2013 Atlassian. All Rights Reserved.