From version < 3.6 >
edited by Guillaume Delhumeau
on 2016/02/25
To version < 3.7 >
edited by Guillaume Delhumeau
on 2016/02/25
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -12,8 +12,10 @@
12 12  
13 13  == Parent/Child relationship ==
14 14  
15 -The user was able to specify a **parent** page for each page she had created. This parent could have been any page, for example the page ##Movies.ItsAWonderfulLife## could have ##Directors.FrankCapra##. Then ##ItsAWonderfulLife## was listed as ##Child## of ##FrankCapra##.
15 +The user was able to specify a **parent** page for each page she had created. This parent could have been any page, for example the page ##Movies.ItsAWonderfulLife## could have ##Directors.FrankCapra## as parent. Then ##ItsAWonderfulLife## was listed as ##Child## of ##FrankCapra##. This relationship was displayed in the //breadcrumb// at the top of each page. The user was able to navigate through this //hierarchy//.
16 16  
17 +Some applications used this parent/child relationship to organized their data. For them, this relationship is crucial.
18 +
17 17  = Principle =
18 18  
19 19  After having upgrade the XWiki instance to a recent version (7.4+), you should convert your existing pages to nested ones. This will permit:

A bit of history

Before the introduction of the Nested Pages concept (in 7.2), the content in a wiki was organized like this:

  • we had some Spaces, that you can see as "folder"
  • inside these spaces, we had Pages, where you were able to write some texts or store applications entries.

In that time, we cannot have spaces inside spaces, so all pages were placed inside a one-level space. The pages were identified like this: NameOfTheSpace.NameOfThePage.

Some pages were a bit special. They were the "home" page of a space. Every time a user wanted to reach a space without specifying a precise page name, she was redirected to that space home page. These pages were called "WebHome" (because at the very beginning of XWiki, "spaces" were called "web").

Parent/Child relationship

The user was able to specify a parent page for each page she had created. This parent could have been any page, for example the page Movies.ItsAWonderfulLife could have Directors.FrankCapra. Then ItsAWonderfulLife was listed as Child of FrankCapra.

The user was able to specify a parent page for each page she had created. This parent could have been any page, for example the page Movies.ItsAWonderfulLife could have Directors.FrankCapra as parent. Then ItsAWonderfulLife was listed as Child of FrankCapra. This relationship was displayed in the breadcrumb at the top of each page. The user was able to navigate through this hierarchy. 

Some applications used this parent/child relationship to organized their data. For them, this relationship is crucial.

Principle

After having upgrade the XWiki instance to a recent version (7.4+), you should convert your existing pages to nested ones. This will permit:

  • (1) to keep the existing hierarchy between pages, made with the parent/child relationship, which will be lost otherwise.
  • (2) give you the opportunity to create pages under any old page, as you could under new pages.

To perform this conversion, we have developed an application called Nested Pages Migrator Application. Its principle is to move all existing pages under their parent, so that the old parent/child relationship become physically represented by the Nested Pages hierarchy.

Fix the hierarchy

However, the current hierarchy may be messy. For example, so pages inside the space Proposal could have Main.WebHome as parent instead of Proposal.WebHome which would be more logical. It happens when the user is invited to create pages in the space Proposal directly from the main page (ex: http://design.xwiki.org/).

It's important to identify such a case before applying the migration tool, because the tool won't be able to detect this kind of unwanted hierarchies.

In the previous example, the solution was to put manually the parent of all pages of the Proposal space that had Main.WebHome as parent, to Proposal.WebHome. The following script have been used to migrate (ex: http://design.xwiki.org/):

#set ($xwql = "where doc.space in ('Proposal', 'Design', 'Improvements') and doc.parent = 'Main.WebHome'")
#foreach($r in $services.query.xwql($xwql).execute())
 #set ($d = $xwiki.getDocument($r))
 #set ($discard = $d.setParent('Proposal.WebHome'))
 #set ($discard = $d.save())
  * $r updated
#end 

Install Nested Pages Migrator Application

Go to the Extension Manager, and install Nested Pages Migrator Application. Then go to the page NestedPagesMigration.WebHome.

Get Connected