Package com.atlassian.confluence.themes
Class DefaultCustomLayoutManager
java.lang.Object
com.atlassian.confluence.themes.DefaultCustomLayoutManager
- All Implemented Interfaces:
CustomLayoutManager
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCustomLayoutManager(PersistentDecoratorDao persistentDecoratorDao, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves a collection of all default decorators without customizationgetApplicableCustomDecoratorsForSpace(String spaceKey) Returns allcustom decorators that apply to a space, whether they are space level or global level.Returns all global custom decorators (does not retrieve space level decorators)getCustomSpaceDecorators(String spaceKey) Returns all custom decorators defined for a specific space only (does not retrieve global decorators)getDefaultDecorator(String decoratorName) Retrieves the default decorator for a given decorator name without customizationgetPersistentDecorator(String spaceKey, String decoratorName) Retrieves a custom decorator for the (spaceKey, name) combination.booleanhasCustomDecorator(String spaceKey, String decoratorName) Determines if a given space overrides a default decorator with a custom one.booleanhasCustomGlobalDecorator(String decoratorName) Determines if a given default decorator is overridden globallybooleanhasCustomSpaceDecorator(String spaceKey, String decoratorName) Determines if a given space overrides a default decorator with a custom one at the space levelvoidremove(PersistentDecorator persistentDecorator) Removes the given custom decorator, and flushes it from the velocity cachevoidRemoves the custom decorator with the given (spaceKey, name) pair, and flushes it from the velocity cachevoidRemoves all globally defines custom decorators (does not remove space level custom decorators)voidremoveAllCustomSpaceDecorators(String spaceKey) Removes all custom decorators defined for a given space (does not remove global ones)voidsaveOrUpdate(PersistentDecorator persistentDecorator) Saves the given decorator (or updates it if it already exists), and updates the velocity cachevoidsaveOrUpdate(String spaceKey, String decoratorName, String content) Creates a decorator for the given spaceKey with the given name, and saves it.booleanusesCustomLayout(String spaceKey) Determines if a space has any custom layout decorators defined.
-
Constructor Details
-
DefaultCustomLayoutManager
public DefaultCustomLayoutManager(PersistentDecoratorDao persistentDecoratorDao, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
saveOrUpdate
Description copied from interface:CustomLayoutManagerSaves the given decorator (or updates it if it already exists), and updates the velocity cache- Specified by:
saveOrUpdatein interfaceCustomLayoutManager
-
saveOrUpdate
Description copied from interface:CustomLayoutManagerCreates 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:
saveOrUpdatein interfaceCustomLayoutManager- Parameters:
spaceKey- null spaceKey indicates a global decoratordecoratorName- the filename of the decoratorcontent- the decorator body
-
getPersistentDecorator
Description copied from interface:CustomLayoutManagerRetrieves a custom decorator for the (spaceKey, name) combination.- Specified by:
getPersistentDecoratorin interfaceCustomLayoutManager- Parameters:
spaceKey- null spaceKey indicates a global decoratordecoratorName- the filename of the decorator- Returns:
- The decorator if it exists, null otherwise
-
getCustomSpaceDecorators
Description copied from interface:CustomLayoutManagerReturns all custom decorators defined for a specific space only (does not retrieve global decorators)- Specified by:
getCustomSpaceDecoratorsin interfaceCustomLayoutManager- Parameters:
spaceKey- null spaceKey indicates a global decorator- Returns:
- Collection of custom decorators
-
getApplicableCustomDecoratorsForSpace
Description copied from interface:CustomLayoutManagerReturns 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:
getApplicableCustomDecoratorsForSpacein interfaceCustomLayoutManager- Returns:
- Collection of custom decorators
-
getCustomGlobalDecorators
Description copied from interface:CustomLayoutManagerReturns all global custom decorators (does not retrieve space level decorators)- Specified by:
getCustomGlobalDecoratorsin interfaceCustomLayoutManager- Returns:
- Collection of custom decorators
-
hasCustomSpaceDecorator
Description copied from interface:CustomLayoutManagerDetermines if a given space overrides a default decorator with a custom one at the space level- Specified by:
hasCustomSpaceDecoratorin interfaceCustomLayoutManager- Parameters:
spaceKey- null spaceKey indicates globaldecoratorName- the filename of the decorator- Returns:
- True if the decorator is overridden at the space level, false otherwise
-
hasCustomGlobalDecorator
Description copied from interface:CustomLayoutManagerDetermines if a given default decorator is overridden globally- Specified by:
hasCustomGlobalDecoratorin interfaceCustomLayoutManager- Parameters:
decoratorName- the filename of the decorator- Returns:
- True if the decorator is overridden at the global level, false otherwise
-
hasCustomDecorator
Description copied from interface:CustomLayoutManagerDetermines if a given space overrides a default decorator with a custom one.- Specified by:
hasCustomDecoratorin interfaceCustomLayoutManager- Parameters:
spaceKey- null spaceKey indicates a global decoratordecoratorName- the filename of the decorator- Returns:
- True if the decorator is overridden at either the space or global level, false otherwise
-
usesCustomLayout
Description copied from interface:CustomLayoutManagerDetermines if a space has any custom layout decorators defined.- Specified by:
usesCustomLayoutin interfaceCustomLayoutManager- Parameters:
spaceKey- null spaceKey indicates global- Returns:
- True if any default decorator is overridden for this space or globally, false otherwise
-
remove
Description copied from interface:CustomLayoutManagerRemoves the custom decorator with the given (spaceKey, name) pair, and flushes it from the velocity cache- Specified by:
removein interfaceCustomLayoutManager- Parameters:
spaceKey- null spaceKey indicates a global decoratordecoratorName- the filename of the decorator
-
remove
Description copied from interface:CustomLayoutManagerRemoves the given custom decorator, and flushes it from the velocity cache- Specified by:
removein interfaceCustomLayoutManager- Parameters:
persistentDecorator- the custom decorator to delete
-
removeAllCustomSpaceDecorators
Description copied from interface:CustomLayoutManagerRemoves all custom decorators defined for a given space (does not remove global ones)- Specified by:
removeAllCustomSpaceDecoratorsin interfaceCustomLayoutManager- Parameters:
spaceKey- null spaceKey indicates global
-
removeAllCustomGlobalDecorators
public void removeAllCustomGlobalDecorators()Description copied from interface:CustomLayoutManagerRemoves all globally defines custom decorators (does not remove space level custom decorators)- Specified by:
removeAllCustomGlobalDecoratorsin interfaceCustomLayoutManager
-
getDefaultDecorator
Description copied from interface:CustomLayoutManagerRetrieves the default decorator for a given decorator name without customization- Specified by:
getDefaultDecoratorin interfaceCustomLayoutManager- Parameters:
decoratorName- The filename of the default decorator
-
getAllDefaultDecorators
Description copied from interface:CustomLayoutManagerRetrieves a collection of all default decorators without customization- Specified by:
getAllDefaultDecoratorsin interfaceCustomLayoutManager
-