public class V2UserMacroAdapter
extends com.atlassian.renderer.v2.macro.BaseMacro
GenericVelocityMacro
)
to be used as v2 macros.
As of Confluence 4.0, all user macros are automatically converted over to being XHTML macros. That is, user macros
that use be represented as a GenericVelocityMacro
pre-4.0, are now represented as GenericVelocityMacro
.
To ensure that we can still render user macros that appear in wiki markup, we need an adapter to allow our new XHTML user macros to be used as v2 macros by the v2 renderer.
Constructor and Description |
---|
V2UserMacroAdapter(Macro xhtmlUserMacro) |
Modifier and Type | Method and Description |
---|---|
String |
execute(Map parameters,
String body,
com.atlassian.renderer.RenderContext renderContext) |
com.atlassian.renderer.v2.RenderMode |
getBodyRenderMode()
There are only two render modes that we need to support: suppress F_FIRST_PARA and allow F_HTMLESCAPE (see old version of com.atlassian.confluence.renderer.UserMacroConfig#toMacro())
|
Macro |
getXhtmlMacro() |
boolean |
hasBody() |
public V2UserMacroAdapter(Macro xhtmlUserMacro)
public String execute(Map parameters, String body, com.atlassian.renderer.RenderContext renderContext) throws com.atlassian.renderer.v2.macro.MacroException
com.atlassian.renderer.v2.macro.MacroException
public com.atlassian.renderer.v2.RenderMode getBodyRenderMode()
We don't need to respect F_HTMLESCAPE here, as this concern is handled in the execution of GenericVelocityMacro
(also see CONFDEV-1509)
public boolean hasBody()
public Macro getXhtmlMacro()
Copyright © 2003–2020 Atlassian. All rights reserved.