Class UserMacroLibrary
- java.lang.Object
-
- com.atlassian.confluence.renderer.UserMacroLibrary
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
public class UserMacroLibrary extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
A library of user defined macros, stored in and retrieved from Bandana on request.
Note that since Confluence 4.0 this UserMacroLibrary is now aware of when user macros have been hidden by an identically named macro from a plugin (even a user macro from a plugin). So the existing methods on the library will now only return macros that are not hidden.
-
-
Field Summary
Fields Modifier and Type Field Description static String
LIBRARY_KEY
-
Constructor Summary
Constructors Constructor Description UserMacroLibrary(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.event.api.EventPublisher eventPublisher, TenantRegistry tenantRegistry)
Deprecated.since 5.9.UserMacroLibrary(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.event.api.EventPublisher eventPublisher, TenantRegistry tenantRegistry, MacroManager macroManager)
Deprecated.since 5.10.UserMacroLibrary(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.event.api.EventPublisher eventPublisher, TenantRegistry tenantRegistry, com.atlassian.util.concurrent.Supplier<MacroManager> macroManagerSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUpdateMacro(UserMacroConfig userMacroConfig)
void
afterPropertiesSet()
void
destroy()
UserMacroConfig
getMacro(String name)
SortedSet<String>
getMacroNames()
Map<String,UserMacroConfig>
getMacros()
boolean
hasMacro(String name)
void
pluginMacroRegistered(PluginMacroRegisteredEvent event)
void
pluginMacroUnregistered(PluginMacroUnregisteredEvent event)
void
pluginSystemStarted(PluginFrameworkStartedEvent event)
void
removeMacro(String name)
-
-
-
Field Detail
-
LIBRARY_KEY
public static final String LIBRARY_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UserMacroLibrary
@Deprecated public UserMacroLibrary(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.event.api.EventPublisher eventPublisher, TenantRegistry tenantRegistry)
Deprecated.since 5.9. UseUserMacroLibrary(BandanaManager, EventPublisher, TenantRegistry, Supplier)
instead.
-
UserMacroLibrary
@Deprecated public UserMacroLibrary(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.event.api.EventPublisher eventPublisher, TenantRegistry tenantRegistry, MacroManager macroManager)
Deprecated.since 5.10. UseUserMacroLibrary(BandanaManager, EventPublisher, TenantRegistry, Supplier)
instead.- Since:
- 5.9
-
UserMacroLibrary
public UserMacroLibrary(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.event.api.EventPublisher eventPublisher, TenantRegistry tenantRegistry, com.atlassian.util.concurrent.Supplier<MacroManager> macroManagerSupplier)
- Since:
- 5.10
-
-
Method Detail
-
addUpdateMacro
public void addUpdateMacro(UserMacroConfig userMacroConfig)
-
hasMacro
public boolean hasMacro(String name)
-
getMacro
public UserMacroConfig getMacro(String name)
-
removeMacro
public void removeMacro(String name)
-
getMacroNames
public SortedSet<String> getMacroNames()
- Returns:
- the names of all the user macros except for those that are hidden by a duplicate macro from a plugin.
-
getMacros
public Map<String,UserMacroConfig> getMacros()
- Returns:
- all the user macros except for those that are hidden by a duplicate macro from a plugin.
-
pluginMacroRegistered
@EventListener public void pluginMacroRegistered(PluginMacroRegisteredEvent event)
-
pluginMacroUnregistered
@EventListener public void pluginMacroUnregistered(PluginMacroUnregisteredEvent event)
-
pluginSystemStarted
@EventListener public void pluginSystemStarted(PluginFrameworkStartedEvent event)
-
destroy
public void destroy() throws Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
-
-