Hi,
How can I add a Macro into a Page with a Java-Plugin?.
I found that : https://answers.atlassian.com/questions/251765
But i doesn´t helped me at all.
Community moderators have prevented the ability to post new answers.
There are two ways to manage that.
The first way doesn´t work for me, using the Rest-API:
https://developer.atlassian.com/confdev/confluence-rest-api/confluence-rest-api-examples
because i got a verry confusing error at the PUT-Command.
BUT
with the Rest-Api GET command, i could find that XHTML-Statement which integrates the Plugin in the Page-Body.
So use the following code to add a Plugin:
Page page = pageManager.getPage(YOUR-PLUGIN-ID); ContentEntityObject pageCeo = page.getContentEntityObject(); BodyContent bc = pageCeo.getBodyContent(); String body = bc.getBody(); String newBody = "<ac:structured-macro ac:name=\"YOUR-PLUGIN-NAME\" />" +body; bc.setBody(newBody); pageCeo.setBodyContent(bc);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.