public class DefaultCustomLayoutManager extends Object implements CustomLayoutManager
Constructor and Description |
---|
DefaultCustomLayoutManager(PersistentDecoratorDao persistentDecoratorDao,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
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.
|
public DefaultCustomLayoutManager(PersistentDecoratorDao persistentDecoratorDao, com.atlassian.event.api.EventPublisher eventPublisher)
public void saveOrUpdate(PersistentDecorator persistentDecorator)
CustomLayoutManager
saveOrUpdate
in interface CustomLayoutManager
public void saveOrUpdate(String spaceKey, String decoratorName, String content)
CustomLayoutManager
saveOrUpdate
in interface CustomLayoutManager
spaceKey
- null spaceKey indicates a global decoratordecoratorName
- the filename of the decoratorcontent
- the decorator bodypublic PersistentDecorator getPersistentDecorator(String spaceKey, String decoratorName)
CustomLayoutManager
getPersistentDecorator
in interface CustomLayoutManager
spaceKey
- null spaceKey indicates a global decoratordecoratorName
- the filename of the decoratorpublic Collection<PersistentDecorator> getCustomSpaceDecorators(String spaceKey)
CustomLayoutManager
getCustomSpaceDecorators
in interface CustomLayoutManager
spaceKey
- null spaceKey indicates a global decoratorpublic Collection<PersistentDecorator> getApplicableCustomDecoratorsForSpace(String spaceKey)
CustomLayoutManager
getApplicableCustomDecoratorsForSpace
in interface CustomLayoutManager
public Collection<PersistentDecorator> getCustomGlobalDecorators()
CustomLayoutManager
getCustomGlobalDecorators
in interface CustomLayoutManager
public boolean hasCustomSpaceDecorator(String spaceKey, String decoratorName)
CustomLayoutManager
hasCustomSpaceDecorator
in interface CustomLayoutManager
spaceKey
- null spaceKey indicates globaldecoratorName
- the filename of the decoratorpublic boolean hasCustomGlobalDecorator(String decoratorName)
CustomLayoutManager
hasCustomGlobalDecorator
in interface CustomLayoutManager
decoratorName
- the filename of the decoratorpublic boolean hasCustomDecorator(String spaceKey, String decoratorName)
CustomLayoutManager
hasCustomDecorator
in interface CustomLayoutManager
spaceKey
- null spaceKey indicates a global decoratordecoratorName
- the filename of the decoratorpublic boolean usesCustomLayout(String spaceKey)
CustomLayoutManager
usesCustomLayout
in interface CustomLayoutManager
spaceKey
- null spaceKey indicates globalpublic void remove(String spaceKey, String decoratorName)
CustomLayoutManager
remove
in interface CustomLayoutManager
spaceKey
- null spaceKey indicates a global decoratordecoratorName
- the filename of the decoratorpublic void remove(PersistentDecorator persistentDecorator)
CustomLayoutManager
remove
in interface CustomLayoutManager
persistentDecorator
- the custom decorator to deletepublic void removeAllCustomSpaceDecorators(String spaceKey)
CustomLayoutManager
removeAllCustomSpaceDecorators
in interface CustomLayoutManager
spaceKey
- null spaceKey indicates globalpublic void removeAllCustomGlobalDecorators()
CustomLayoutManager
removeAllCustomGlobalDecorators
in interface CustomLayoutManager
public DefaultDecorator getDefaultDecorator(String decoratorName)
CustomLayoutManager
getDefaultDecorator
in interface CustomLayoutManager
decoratorName
- The filename of the default decoratorpublic Collection<DefaultDecorator> getAllDefaultDecorators()
CustomLayoutManager
getAllDefaultDecorators
in interface CustomLayoutManager
Copyright © 2003–2021 Atlassian. All rights reserved.