com.atlassian.confluence.macro
Class GenericVelocityMacro

java.lang.Object
  extended by com.atlassian.confluence.macro.GenericVelocityMacro
All Implemented Interfaces:
Macro

public class GenericVelocityMacro
extends Object
implements Macro

A configurable and generic macro that renders a Velocity template as part of its execution.

Since:
4.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.confluence.macro.Macro
Macro.BodyType, Macro.OutputType
 
Constructor Summary
GenericVelocityMacro()
           
 
Method Summary
 String execute(Map<String,String> parameters, String body, ConversionContext context)
           
 Macro.BodyType getBodyType()
          The type of body that this macro has, this is used to infer the migration task if no custom one is provided.
 String getName()
           
 Macro.OutputType getOutputType()
           
 String getTemplate()
           
 boolean isEscapeBody()
           
 boolean isLegacyWikiTemplate()
          Deprecated. as of Confluence 4.0. This is a transition method that will be removed fairly quickly after the 4.0 release since we expected admin's to manually fix their user macros to no longer use wiki templates. See ReportUserMacrosWithWikiTemplateUpgradeTask.
 void setBodyType(Macro.BodyType bodyType)
           
 void setBootstrapManager(BootstrapManager bootstrapManager)
           
 void setEscapeBody(boolean escapeBody)
           
 void setHtmlToXmlConverter(HtmlToXmlConverter htmlToXmlConverter)
           
 void setLegacyWikiTemplate(boolean legacyWikiTemplate)
           
 void setName(String name)
           
 void setSpaceManager(SpaceManager spaceManager)
           
 void setStorageToViewTransformer(Transformer storageToViewTransformer)
           
 void setSubRenderer(com.atlassian.renderer.v2.V2SubRenderer subRenderer)
          Deprecated. as of Confluence 4.0. Rendering wiki macro templates is no longer supported. You will need to manually fix any macros with wiki templates. See ReportUserMacrosWithWikiTemplateUpgradeTask.
 void setTemplate(String template)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericVelocityMacro

public GenericVelocityMacro()
Method Detail

execute

public String execute(Map<String,String> parameters,
                      String body,
                      ConversionContext context)
               throws MacroExecutionException
Specified by:
execute in interface Macro
Throws:
MacroExecutionException

getBodyType

public Macro.BodyType getBodyType()
Description copied from interface: Macro
The type of body that this macro has, this is used to infer the migration task if no custom one is provided.

Specified by:
getBodyType in interface Macro
Returns:
The type of body this macro has.

setBodyType

public void setBodyType(Macro.BodyType bodyType)

getOutputType

public Macro.OutputType getOutputType()
Specified by:
getOutputType in interface Macro

isLegacyWikiTemplate

@Deprecated
public boolean isLegacyWikiTemplate()
Deprecated. as of Confluence 4.0. This is a transition method that will be removed fairly quickly after the 4.0 release since we expected admin's to manually fix their user macros to no longer use wiki templates. See ReportUserMacrosWithWikiTemplateUpgradeTask.

Returns:
true if this is a user macro that still uses a wiki template.
Since:
4.0

setLegacyWikiTemplate

public void setLegacyWikiTemplate(boolean legacyWikiTemplate)

getTemplate

public String getTemplate()
Returns:
the Velocity template rendered by this macro.

setTemplate

public void setTemplate(String template)
Parameters:
template - the Velocity template to be rendered by this macro.

getName

public String getName()

setName

public void setName(String name)

isEscapeBody

public boolean isEscapeBody()

setEscapeBody

public void setEscapeBody(boolean escapeBody)

setBootstrapManager

public void setBootstrapManager(BootstrapManager bootstrapManager)

setSpaceManager

public void setSpaceManager(SpaceManager spaceManager)

setHtmlToXmlConverter

public void setHtmlToXmlConverter(HtmlToXmlConverter htmlToXmlConverter)

setStorageToViewTransformer

public void setStorageToViewTransformer(Transformer storageToViewTransformer)

setSubRenderer

@Deprecated
public void setSubRenderer(com.atlassian.renderer.v2.V2SubRenderer subRenderer)
Deprecated. as of Confluence 4.0. Rendering wiki macro templates is no longer supported. You will need to manually fix any macros with wiki templates. See ReportUserMacrosWithWikiTemplateUpgradeTask.

Parameters:
subRenderer - the v2 subRenderer to be used if this is an old user macro with a wiki template which has not yet been fixed.


Copyright © 2003-2012 Atlassian. All Rights Reserved.