Package com.atlassian.confluence.macro
Class GenericVelocityMacro
java.lang.Object
com.atlassian.confluence.macro.GenericVelocityMacro
- All Implemented Interfaces:
- Macro
A configurable and generic macro that renders a Velocity template as part of its execution.
- Since:
- 4.0
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.atlassian.confluence.macro.MacroMacro.BodyType, Macro.OutputType
- 
Field SummaryFieldsModifier and TypeFieldDescriptionThe value of "macro.required.velocity.context.keys" is a string of keys inMacroUtils.defaultVelocityContext(), split by ",".
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionThe type of body that this macro has, this is used to infer the migration task if no custom one is provided.getName()booleanbooleanDeprecated.since 4.0.voidsetBodyType(Macro.BodyType bodyType) voidsetEscapeBody(boolean escapeBody) voidsetHtmlToXmlConverter(HtmlToXmlConverter htmlToXmlConverter) voidsetLegacyWikiTemplate(boolean legacyWikiTemplate) voidsetMacroParameters(List<MacroParameter> macroParameters) voidvoidsetSpaceManager(SpaceManager spaceManager) voidsetStorageToViewTransformer(Transformer storageToViewTransformer) voidsetSubRenderer(com.atlassian.renderer.v2.V2SubRenderer subRenderer) Deprecated.since 4.0.voidsetTemplate(String template) voidsetVelocityHelperService(VelocityHelperService velocityHelperService) 
- 
Field Details- 
REQUIRED_VELOCITY_CONTEXT_KEYSThe value of "macro.required.velocity.context.keys" is a string of keys inMacroUtils.defaultVelocityContext(), split by ",".
 
- 
- 
Constructor Details- 
GenericVelocityMacropublic GenericVelocityMacro()
 
- 
- 
Method Details- 
executepublic String execute(Map<String, String> parameters, String body, ConversionContext context) throws MacroExecutionException- Specified by:
- executein interface- Macro
- Throws:
- MacroExecutionException
 
- 
getBodyTypeDescription 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 interface- Macro
- Returns:
- The type of body this macro has.
 
- 
setBodyType
- 
getOutputType- Specified by:
- getOutputTypein interface- Macro
 
- 
isLegacyWikiTemplateDeprecated.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
 
- 
setLegacyWikiTemplatepublic void setLegacyWikiTemplate(boolean legacyWikiTemplate) 
- 
getTemplate- Returns:
- the Velocity template rendered by this macro.
 
- 
setTemplate- Parameters:
- template- the Velocity template to be rendered by this macro.
 
- 
getName
- 
setName
- 
isEscapeBodypublic boolean isEscapeBody()
- 
setEscapeBodypublic void setEscapeBody(boolean escapeBody) 
- 
setSpaceManager
- 
setHtmlToXmlConverter
- 
setStorageToViewTransformer
- 
getMacroParameters
- 
setMacroParameters
- 
setSubRendererDeprecated.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- Since:
- 8.6
 
 
-