Hi there,
I don't get how to work properly with the Java API of Confluence Data Center.
There are Manager interfaces like in Jira, for instance the PageManager. But all of the getPage() methods has been deprecated with a reference to the PageManagerInternal interface which do not provide simple getPage() methods, for example for just throwing in a known page ID.
So my question is: How to work with the Confluence Java API directly? We use ScriptRunner and do not (nor want to) write dedicated/custom plugins.
Best regards,
Hauke
I am not very familiar with ScriptRunner. For my custom plugin I use:
com.atlassian.confluence.api.service.content.ContentService;
com.atlassian.confluence.api.service.content.SpaceService;
com.atlassian.confluence.api.service.people.GroupService;
com.atlassian.confluence.api.service.people.PersonService;
For ScriptRunner it should work using:
@PluginModule
ContentService contentService
Reference: https://community.developer.atlassian.com/t/how-to-use-expansions-on-contentpropertyservice/46866/4
They work similar to the REST API, here's an example using ContentService (page) and expanding the space.
ContentService.SingleContentFetcher contentFinder = contentService
.find(new Expansion(Content.Expansions.SPACE))
.withType(ContentType.PAGE)
.withId(ContentId.of(pageId));
Similar approaches is for the other services. If you need more specific example, let me know.
More about the ContentService can be found in ContentService (Atlassian Confluence 8.5.0 API)
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.