Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

[Macro] How can I call Macro's in XHTML using Confluence 4.0?

Reto Grob October 26, 2011

Hi,


I have developed a Macro for Confluence 3.5 and now updated it to Confluence 4.0. How can I call these Macro's in XHTML? (without the UI)

We have pages that we are converting from another wiki and convert some macro's to the own 4.0 macro's. In Confluence 3.5, I could convert the old wiki macro syntax to {macro-key:params}. In Confluence 4.0 it does not work anymore. The log says that it cannot find the macro with the given key.

Do you know what is the way to call the macro in Confluence 4.0 (wihtout the UI)?

Regards,

Reto

4 answers

1 accepted

0 votes
Answer accepted
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 17, 2011
1 vote
Akeles
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 8, 2011

Let me try on this.

The equivalent of Confluence 3.x macro of

{children}

for Confluence 4.x is

<ac:macro ac:name="children" /> 

For an example with parameter

{children:reverse=true|sort=title|first=2}

The Confluence 4.x equivalent is

&lt;ac:macro ac:name="children"&gt;&lt;ac:parameter ac:name="reverse"&gt;true&lt;/ac:parameter&gt;&lt;ac:parameter ac:name="sort"&gt;title&lt;/ac:parameter&gt;&lt;ac:parameter ac:name="first"&gt;2&lt;/ac:parameter&gt;&lt;/ac:macro&gt;

0 votes
Reto Grob November 17, 2011

Hi,

In the UWC Converter, I say that the Macro should be called like this:

{macroName:param1=value1}

where macroName is the name that I defined in the plugin descriptor (atlassian-plugin.xml) in the section<xhtml-macro name="macroName" ..>

When I use <macro> for Confluence 3.5 macro's instead of <xhtml-macro.. > then it works. But I want to develop Confluence 4.0 macros.

How can I call 4.0 Macro's?

Regards,

Reto

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 17, 2011

Are you sure that you're using the UWC? It sounds like you've got your wires crossed.

Reto Grob November 17, 2011

Ok. Thanks.

Well, we tried the UWC beta for 4.0 and it almost worked for the conversion except for the 4.0 Macro's (the 3.5 macro's worked) ;)

So, you say, I have to make a 3.5 macro even when I only want to use Confluence 4.0.

Reto Grob November 17, 2011

Yes. the converter says:

2011-10-25 15:40:19,991 WARN [ajp-127.0.0.1-4050-5] [confluence.rpc.auth.TokenAuthenticationInvocationHandler] invokeAuthenticatedMethod Failure executing remote method: storePage: com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'NCAEmployeeMacro' is unknown.

The pages in MoinMoin use an own macro, that we rebuilt as Confluence 4.0 macro.

What would you recommend me, if I need to convert old wiki (moinmoin) to Confluence 4.0?

David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 17, 2011

The UWC doesn't currently work on Confluence 4. Use it with Confluence 3.5 and then upgrade to Confluence 4.0

0 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
November 13, 2011

Please add an example of what you're converting from and to.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events