PageTree problem in Confuence

Hi Everyone.

Maybee anyone can help me to solve my problem. I'am creating plugin for Confluence witch adding new Pages

Page page = new Page();

page.setTitle(myTitle);

page.setSpace(getSpace());

.......

pageManager.saveContentEntity(page, null);

and this is works fine!

The problem is with PageTree, beocouse it's starting show new Pages in strukture after LONG time.

What is the reason of that? Should I call any function to render Pagetree?

Many thanks for any help.

Regards

Mik

3 answers

As far as I know Pagetree only shows indexed pages. Could you check if you can find your page via the Search function while it is not shown in your pagetree?

If not there is an indexing issue.

Hi Thomas, many thanks for answer.

I can find them by search function.

I can find/see my pages (added by plugin) after restart server or if I for example add one more page manualy.

Regards

Mik

Hi Thomas, many thanks for answer.

I can find them by search function.

I can find/see my pages (added by plugin) after restart server or if I for example add one more page manualy.

Regards

Mik

Maybe you have to call the indexer after the "page adding" programatically to avoid your server restart problem.

Inject the ConfluenceIndexer to your class

public void setIndexer(ConfluenceIndexer indexer){
    this.indexer = indexer;
}

Then call the reindex after adding your page:

this.indexer.reIndex(page);

Hi Sandro

Many thanks for your tips. Unfortunately it still not works correctly.

I'm calling reindexing after save, but no pages in PageTree, I can see them only after server restart.

pageManager.saveContentEntity(page, saveContext);

this.indexer.reIndex(page);

Regards
Mik

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

370 views 20 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you