com.atlassian.confluence.macro.browser.beans
Class MacroMetadata

java.lang.Object
  extended by com.atlassian.confluence.macro.browser.beans.MacroMetadata

public class MacroMetadata
extends java.lang.Object

A Bean that encapsulates the 'metadata' of the macro. Its purpose is to provide an overview of the macro for the Macro Browser's list of available macros, and to include information about how the macro should be displayed in the list (e.g. "hidden"). More detailed macro metadata including parameter details is encapsulated by the MacroFormDetails class.


Constructor Summary
MacroMetadata(java.lang.String macroName, java.lang.String pluginKey, java.lang.String title, java.lang.String icon, java.lang.String description, java.util.Set<java.lang.String> aliases, java.util.Set<java.lang.String> categories, boolean isBodyDeprecated, boolean hidden, MacroFormDetails formDetails)
           
 
Method Summary
 MacroFormDetails details()
          Note - this method is not getDetails so that it will not be Introspector'd.
 java.util.Set<java.lang.String> getAliases()
          Returns aliases for this macro.
 java.util.Set<java.lang.String> getCategories()
          Returns categories this macro should be displayed within in the Macro Browser.
 Message getDescription()
           
 java.lang.String getIcon()
           
 java.lang.String getMacroName()
           
 java.lang.String getPluginKey()
           
 Message getTitle()
           
 boolean isBodyDeprecated()
           
 boolean isHidden()
           
static MacroMetadata makeFreeformSummary(java.lang.String macroName, java.lang.String pluginKey, java.lang.String title, java.lang.String description, MacroFormDetails formDetails)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MacroMetadata

public MacroMetadata(java.lang.String macroName,
                     java.lang.String pluginKey,
                     java.lang.String title,
                     java.lang.String icon,
                     java.lang.String description,
                     java.util.Set<java.lang.String> aliases,
                     java.util.Set<java.lang.String> categories,
                     boolean isBodyDeprecated,
                     boolean hidden,
                     MacroFormDetails formDetails)
Method Detail

makeFreeformSummary

public static MacroMetadata makeFreeformSummary(java.lang.String macroName,
                                                java.lang.String pluginKey,
                                                java.lang.String title,
                                                java.lang.String description,
                                                MacroFormDetails formDetails)

getMacroName

public java.lang.String getMacroName()

getPluginKey

public java.lang.String getPluginKey()

getIcon

public java.lang.String getIcon()
Returns:
the url string to the macro icon

getTitle

public Message getTitle()

getDescription

public Message getDescription()

getAliases

public java.util.Set<java.lang.String> getAliases()
Returns aliases for this macro. Aliases are other macro names that can be substituted for the "main" macro name. For example "web-widget" can be used instead of "widget" for the "Widget Connector" macro. Only the "main" name is used by the macro-browser, so we use the Strings returned by this method to edit in the macro-browser those macros with an alias in their markup.

Returns:
a set of strings that are aliases of the macro name.

getCategories

public java.util.Set<java.lang.String> getCategories()
Returns categories this macro should be displayed within in the Macro Browser. Categories allow macros to be browsed instead of searched. The Macro Browser has a list view where all macros for a given category are displayed, and adding the category name to the set returned from this method displays this macro in that category list.

Returns:
a set of strings that are names of MacroCategory enum objects.

isBodyDeprecated

public boolean isBodyDeprecated()
Returns:
true if the body of the macro is deprecated (defined the macro configuration). Use this method to take precedence over the Macro.hasBody() implementation.

isHidden

public boolean isHidden()
Returns:
true if this metadata should not appear in the Macro Browser.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

details

public MacroFormDetails details()
Note - this method is not getDetails so that it will not be Introspector'd.

Returns:
MacroFormDetails used to populate form fields in the Macro Browser.


Copyright © 2003-2009 Atlassian Pty Ltd. All Rights Reserved.