Update MacroDefinition in execute

Andrey Klyuev October 8, 2018

Hi all, I am developing a Confluence plugin(type macro) and need change MacroDefinition of this macro in execute method.

public String execute(Map<String, String> params, String s, ConversionContext conversionContext)


I get this info

MacroDefinition macroDefinition = (MacroDefinition)conversionContext.getProperty("macroDefinition");

and try to change like this

String pageString = xhtmlContent.updateMacroDefinitions(ceo.getBodyAsString(), c, new MacroDefinitionUpdater()
{
@Override
public MacroDefinition update(MacroDefinition macroDefinition)
{
macroDefinition.setParameter("test", "test");
return macroDefinition;
}
});
ceo.setBodyAsString(pageString);

or 
just 

MacroDefinition macroDefinition = (MacroDefinition)conversionContext.getProperty("macroDefinition");
macroDefinition.setParameter("test", "test");

but in time of next call execute method macroDefinition in the same state, how I cant change and save it?

1 answer

0 votes
Alexander Demchenko January 13, 2023

@Andrey Klyuev  , did you succeed with it ?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events