PageTree problem in Confuence

Mik April 24, 2012

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

0 votes
Sandro Herrmann [Communardo]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2012

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);

Mik April 26, 2012

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

0 votes
Mik April 25, 2012

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

0 votes
Thomas Krug April 25, 2012

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.

Mik April 25, 2012

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events