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 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​(String spaceKey,
                          String decoratorName,
                          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​(String spaceKey,
                                                   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

        Collection<PersistentDecorator> getCustomSpaceDecorators​(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

        Collection<PersistentDecorator> getApplicableCustomDecoratorsForSpace​(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

        Collection<PersistentDecorator> getCustomGlobalDecorators()
        Returns all global custom decorators (does not retrieve space level decorators)
        Returns:
        Collection of custom decorators
      • hasCustomSpaceDecorator

        boolean hasCustomSpaceDecorator​(String spaceKey,
                                        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​(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​(String spaceKey,
                                   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​(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​(String spaceKey,
                    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​(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​(String decoratorName)
        Retrieves the default decorator for a given decorator name without customization
        Parameters:
        decoratorName - The filename of the default decorator
      • getAllDefaultDecorators

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