Package com.atlassian.confluence.macro
Class GenericVelocityMacro
- java.lang.Object
-
- com.atlassian.confluence.macro.GenericVelocityMacro
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.confluence.macro.Macro
Macro.BodyType, Macro.OutputType
-
-
Field Summary
Fields Modifier and Type Field Description static List<String>REQUIRED_VELOCITY_CONTEXT_KEYSThe value of "macro.required.velocity.context.keys" is a string of keys inMacroUtils.defaultVelocityContext(), split by ",".
-
Constructor Summary
Constructors Constructor Description GenericVelocityMacro()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Stringexecute(Map<String,String> parameters, String body, ConversionContext context)Macro.BodyTypegetBodyType()The type of body that this macro has, this is used to infer the migration task if no custom one is provided.List<MacroParameter>getMacroParameters()StringgetName()Macro.OutputTypegetOutputType()StringgetTemplate()booleanisEscapeBody()booleanisLegacyWikiTemplate()Deprecated.since 4.0.voidsetBodyType(Macro.BodyType bodyType)voidsetEscapeBody(boolean escapeBody)voidsetHtmlToXmlConverter(HtmlToXmlConverter htmlToXmlConverter)voidsetLegacyWikiTemplate(boolean legacyWikiTemplate)voidsetMacroParameters(List<MacroParameter> macroParameters)voidsetName(String name)voidsetSpaceManager(SpaceManager spaceManager)voidsetStorageToViewTransformer(Transformer storageToViewTransformer)voidsetSubRenderer(com.atlassian.renderer.v2.V2SubRenderer subRenderer)Deprecated.since 4.0.voidsetTemplate(String template)voidsetVelocityHelperService(VelocityHelperService velocityHelperService)
-
-
-
Field Detail
-
REQUIRED_VELOCITY_CONTEXT_KEYS
public static final List<String> REQUIRED_VELOCITY_CONTEXT_KEYS
The value of "macro.required.velocity.context.keys" is a string of keys inMacroUtils.defaultVelocityContext(), split by ",". By default, it is "generalUtil,bootstrap".
-
-
Method Detail
-
execute
public String execute(Map<String,String> parameters, String body, ConversionContext context) throws MacroExecutionException
- Specified by:
executein interfaceMacro- Throws:
MacroExecutionException
-
getBodyType
public Macro.BodyType getBodyType()
Description copied from interface:MacroThe type of body that this macro has, this is used to infer the migration task if no custom one is provided.- Specified by:
getBodyTypein interfaceMacro- Returns:
- The type of body this macro has.
-
setBodyType
public void setBodyType(Macro.BodyType bodyType)
-
getOutputType
public Macro.OutputType getOutputType()
- Specified by:
getOutputTypein interfaceMacro
-
isLegacyWikiTemplate
@Deprecated public boolean isLegacyWikiTemplate()
Deprecated.since 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.- 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)
-
setSpaceManager
public void setSpaceManager(SpaceManager spaceManager)
-
setHtmlToXmlConverter
public void setHtmlToXmlConverter(HtmlToXmlConverter htmlToXmlConverter)
-
setStorageToViewTransformer
public void setStorageToViewTransformer(Transformer storageToViewTransformer)
-
getMacroParameters
public List<MacroParameter> getMacroParameters()
-
setMacroParameters
public void setMacroParameters(List<MacroParameter> macroParameters)
-
setSubRenderer
@Deprecated public void setSubRenderer(com.atlassian.renderer.v2.V2SubRenderer subRenderer)
Deprecated.since 4.0. Rendering wiki macro templates is no longer supported. You will need to manually fix any macros with wiki templates.- 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.
-
setVelocityHelperService
public void setVelocityHelperService(VelocityHelperService velocityHelperService)
- Since:
- 8.6
-
-