com.atlassian.confluence.plugin.descriptor
Class CustomMacroModuleDescriptor

java.lang.Object
  extended by com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
      extended by com.atlassian.confluence.plugin.descriptor.CustomMacroModuleDescriptor
All Implemented Interfaces:
MacroModuleDescriptor, PluginModuleFactory<com.atlassian.renderer.v2.macro.Macro>, UserLocaleAware, com.atlassian.plugin.ModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>, com.atlassian.plugin.Resourced, com.atlassian.plugin.StateAware, org.springframework.context.ApplicationContextAware

public class CustomMacroModuleDescriptor
extends com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
implements MacroModuleDescriptor, org.springframework.context.ApplicationContextAware, PluginModuleFactory<com.atlassian.renderer.v2.macro.Macro>, UserLocaleAware

A plugin macro in Confluence with metadata and notation guide help.

See Also:
Macro, Macro plugin documentation

Field Summary
 
Fields inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
moduleClass, moduleClassName, moduleFactory, plugin, resources, singleton
 
Constructor Summary
CustomMacroModuleDescriptor()
           
 
Method Summary
 com.atlassian.renderer.v2.macro.Macro createModule()
           
 void disabled()
           
 void enabled()
           
 java.lang.String getHelp()
          Returns the macro help as rendered HTML, or null if there is no help.
 com.atlassian.plugin.elements.ResourceDescriptor getHelpDescriptor()
          Returns the macro help descriptor, or null if there is no help.
 java.lang.String getHelpSection()
          Returns the section of notation guide in which the macro help appears.
 MacroMetadata getMacroMetadata()
           
 com.atlassian.renderer.v2.macro.Macro getModule()
          Returns the macro defined by this module descriptor.
 boolean hasHelp()
          Returns true if the macro has help, otherwise false.
 void init(com.atlassian.plugin.Plugin plugin, org.dom4j.Element element)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
           
 void setMacroMetadataParser(MacroMetadataParser macroMetadataParser)
           
 
Methods inherited from class com.atlassian.plugin.descriptors.AbstractModuleDescriptor
assertModuleClassImplements, destroy, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation, isEnabledByDefault, isSingleton, isSingletonByDefault, isSystemModule, loadClass, loadClass, provideValidationRules, satisfiesMinJavaVersion, setPlugin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.plugin.ModuleDescriptor
destroy, getCompleteKey, getDescription, getDescriptionKey, getI18nNameKey, getKey, getMinJavaVersion, getModuleClass, getName, getParams, getPlugin, getPluginKey, isEnabledByDefault, isSystemModule, satisfiesMinJavaVersion
 
Methods inherited from interface com.atlassian.plugin.Resourced
getResourceDescriptor, getResourceDescriptors, getResourceDescriptors, getResourceLocation
 

Constructor Detail

CustomMacroModuleDescriptor

public CustomMacroModuleDescriptor()
Method Detail

init

public void init(com.atlassian.plugin.Plugin plugin,
                 org.dom4j.Element element)
          throws com.atlassian.plugin.PluginParseException
Specified by:
init in interface com.atlassian.plugin.ModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
Overrides:
init in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
Throws:
com.atlassian.plugin.PluginParseException

getModule

public com.atlassian.renderer.v2.macro.Macro getModule()
Returns the macro defined by this module descriptor.

Specified by:
getModule in interface com.atlassian.plugin.ModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>
Specified by:
getModule in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>

createModule

public com.atlassian.renderer.v2.macro.Macro createModule()
Specified by:
createModule in interface PluginModuleFactory<com.atlassian.renderer.v2.macro.Macro>

enabled

public void enabled()
Specified by:
enabled in interface com.atlassian.plugin.StateAware
Overrides:
enabled in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>

disabled

public void disabled()
Specified by:
disabled in interface com.atlassian.plugin.StateAware
Overrides:
disabled in class com.atlassian.plugin.descriptors.AbstractModuleDescriptor<com.atlassian.renderer.v2.macro.Macro>

hasHelp

public boolean hasHelp()
Returns true if the macro has help, otherwise false. Help can be provided by defining a resource inside the macro descriptor in the plugin XML descriptor file. The help resource has a type of "velocity" and a name of "help". It can have either a body or a "location" attribute with a reference to a Velocity file within the plugin.


getHelpSection

public java.lang.String getHelpSection()
Returns the section of notation guide in which the macro help appears. Should be one of the values defined in NotationHelpAction#SECTION_KEYS. If the macro has no help, returns null.


getHelpDescriptor

public com.atlassian.plugin.elements.ResourceDescriptor getHelpDescriptor()
Returns the macro help descriptor, or null if there is no help. The help is defined as a resource with type "velocity" and name "help" inside the macro descriptor. The resource tag can have a location attribute, referring to a file within the plugin, or a body.

See Also:
getHelp()

getHelp

public java.lang.String getHelp()
Returns the macro help as rendered HTML, or null if there is no help. The help is defined as a resource with type "velocity" and name "help" inside the macro descriptor. The resource tag can have a location attribute, referring to a file within the plugin, or a body.

See Also:
getHelpDescriptor()

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
                           throws org.springframework.beans.BeansException
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware
Throws:
org.springframework.beans.BeansException

getMacroMetadata

public MacroMetadata getMacroMetadata()
Specified by:
getMacroMetadata in interface MacroModuleDescriptor
Returns:
MacroMetadata for this macro, may be null if not defined in the descriptor.

setI18NBeanFactory

public void setI18NBeanFactory(I18NBeanFactory i18NBeanFactory)
Specified by:
setI18NBeanFactory in interface UserLocaleAware
Parameters:
i18NBeanFactory - the user locale sensitive i18n bean factory

setMacroMetadataParser

public void setMacroMetadataParser(MacroMetadataParser macroMetadataParser)


Copyright © 2003-2011 Atlassian. All Rights Reserved.