Hi there,
I am trying to create PDF exports of pages using the Java API of Confluence. I am using @ComponentImport PdfExporterService
This groovy code example works:
import com.atlassian.confluence.pages.Page
import com.atlassian.confluence.pages.PageManager
import com.atlassian.confluence.user.AuthenticatedUserThreadLocal
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.extra.flyingpdf.analytic.PageExportMetrics;
import com.atlassian.confluence.extra.flyingpdf.PdfExporterService
import com.atlassian.user.User
Page page = ComponentLocator.getComponent(PageManager.class).getAbstractPage(114915234)
User user = AuthenticatedUserThreadLocal.getUser()
return pdfExporterService.createPdfForPage(user, page, "", new PageExportMetrics())
(I am using an own groovy console which allows me to inject a binding to the PdfExporterService)
Doing similar in Java fails with
java.lang.ClassNotFoundException: com.atlassian.confluence.extra.flyingpdf.analytic.PageExportMetrics
I played around with the class loaders a little, but nothing seems to help. How can I make the class loader find that class?