com.atlassian.confluence.renderer
Class UserMacroLibrary

java.lang.Object
  extended by com.atlassian.confluence.renderer.UserMacroLibrary

public class UserMacroLibrary
extends Object

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
static String LIBRARY_KEY
           
 
Constructor Summary
UserMacroLibrary(com.atlassian.bandana.BandanaManager bandanaManager, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 void addUpdateMacro(UserMacroConfig userMacroConfig)
           
 UserMacroConfig getMacro(String name)
           
 SortedSet<String> getMacroNames()
           
 Map<String,UserMacroConfig> getMacros()
           
 boolean hasMacro(String name)
           
 void pluginMacroRegistered(PluginMacroRegisteredEvent event)
           
 void pluginMacroUnregistered(PluginMacroUnregisteredEvent event)
           
 void removeMacro(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIBRARY_KEY

public static final String LIBRARY_KEY
See Also:
Constant Field Values
Constructor Detail

UserMacroLibrary

public UserMacroLibrary(com.atlassian.bandana.BandanaManager bandanaManager,
                        com.atlassian.event.api.EventPublisher eventPublisher)
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)


Copyright © 2003-2012 Atlassian. All Rights Reserved.