public class

V2UserMacroAdapter

extends BaseMacro
java.lang.Object
   ↳ com.atlassian.renderer.v2.macro.BaseMacro
     ↳ com.atlassian.confluence.renderer.v2.macros.V2UserMacroAdapter

Class Overview

An adapter class to allow XHTML user macros (i.e. 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.

Summary

[Expand]
Inherited Constants
From interface com.atlassian.renderer.v2.macro.Macro
Public Constructors
V2UserMacroAdapter(Macro xhtmlUserMacro)
Public Methods
String execute(Map parameters, String body, RenderContext renderContext)
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())

We don't need to respect F_HTMLESCAPE here, as this concern is handled in the execution of GenericVelocityMacro (also see CONFDEV-1509)

Macro getXhtmlMacro()
boolean hasBody()
[Expand]
Inherited Methods
From class com.atlassian.renderer.v2.macro.BaseMacro
From class java.lang.Object
From interface com.atlassian.renderer.v2.macro.Macro

Public Constructors

public V2UserMacroAdapter (Macro xhtmlUserMacro)

Public Methods

public String execute (Map parameters, String body, RenderContext renderContext)

Throws
MacroException

public 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())

We don't need to respect F_HTMLESCAPE here, as this concern is handled in the execution of GenericVelocityMacro (also see CONFDEV-1509)

public Macro getXhtmlMacro ()

public boolean hasBody ()