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

This widget could not be displayed.

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

This widget could not be displayed.

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

This widget could not be displayed.

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
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

475 views 6 6
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