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

Programically executing macro

Marcin Urbański August 17, 2014

Do you know how to programically force macro to execute?

I mean xhtml macro from com.atlassian.confluence.macro.Macro

Thanks!

Marcin

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Tiago Santos August 20, 2014

How are you setting up the macro in that template?
I don't think you can force it to execute, but if you set it up correctly in the editor I think confluence will execute by itself once anyone opens it.

You can set it up in the template like so I think:

<p>
	<ac:macro ac:name="macroname">
		<ac:parameter ac:name="ag1"><at:var at:name="arg1var" /></ac:parameter>
		<ac:parameter ac:name="arg2"><at:var at:name="arg2var" /></ac:parameter>
	</ac:macro>
</p>

0 votes
Yagnesh Bhat
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.
August 17, 2014

Hi Marcin,

What does the execute() method of your macro return? Is it returning what you are expecting to be seen as the macro output?

Secondly, are you using user templates to render your macro and then using "Create from template" option? If not you can try creating a user template in your space and ask your macro use that template from that space. But again, before all this , you have to make sure that the execute method returns what you want your macro to return and then things can be taken further.

0 votes
Marcin Urbański August 17, 2014

The case is that I store a macro in template and then I am programically creating page from this template. It occurs that macro is not executing when new page is creating. Is there any way to force it?

0 votes
Alexey_Rjeutski__Polontech_
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.
August 17, 2014

Could you please give more context with example?

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events