Class DefaultCustomLayoutManager

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

public class DefaultCustomLayoutManager extends Object implements CustomLayoutManager
  • Constructor Details

    • DefaultCustomLayoutManager

      public DefaultCustomLayoutManager(PersistentDecoratorDao persistentDecoratorDao, com.atlassian.event.api.EventPublisher eventPublisher)
  • Method Details

    • 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