Hi,
we develop a custom macro that create pages into a workspace.
When we save the new page and call the API to add the new page to the page tree, it's not showned also is we invoke the reindex methods.
Here below our code:
Page parentPage = createRequirementPage(usr, sp, requirementTitle, sg, type, idReq, pdm);
List<Page> contribList = createContributePages(usr, sp, requirementTitle, sg, type, parentPage, idReq);
pageManager.saveContentEntity(parentPage, null);
indexer.index(parentPage);
for (Page contrib: contribList){
pageManager.saveContentEntity(contrib, null);
parentPage.addChild(contrib);
pageManager.saveContentEntity(parentPage, null);
indexer.index(contrib);
}
indexer.reIndex(parentPage);
indexer.reIndex(sp);
where createRequirementPage is:
Page page = createBasePage(usr, sp);
page.setTitle(sg+": "+requirementTitle);
page.setParentPage(sp.getHomePage());
page.setAncestors(new ArrayList<>(Arrays.asList(sp.getHomePage())));
and createContributePages is:
Page contrib = createBasePage(usr, sp);
contrib.setTitle(String.format("Contribute %s %s %s", idReq, sg, system));
contrib.setParentPage(reqPage);
contrib.setAncestors(new ArrayList<>(Arrays.asList(sp.getHomePage(), reqPage)));
private Page createBasePage(ConfluenceUser usr, Space sp){
Page page = new Page();
page.setVersion(1);
page.setCreator(usr);
page.setSpace(sp);
return page;
}
what happens is that not is shown on lateral page tree
but is present when the move into the home.
Could you please assist with issue?
thank you and regards