This plugin isn't bundled with any XWiki product by default.
Plugin contributed by Friedemann Loew.
This plugin cannot currently be downloaded separately.

DocumentTree Plugin

The document tree plugin builds a tree of child pages. It can be used to show the child pages of a defined page or to show all pages of a space.

Installation

Copy the jar-Archive to the %xwikipath%/WEB-INF/lib/ directory of your xwiki installation and add com.xpn.xwiki.plugin.doctree.DocumentTreePlugin to the xwiki.cfg.

The DocumentTreePlugin has two main methods to call:

$xwiki.doctree.getDocumentTree(rootDocument, sorted)

$xwiki.doctree.getSpaceDocumentTree(spaceName, sorted)

The default for sorted is true. In this way you get a tree with alphabetically sorted nodes. If you want the tree to contain the nodes in order of creation, you have to set sorted to false.

Example

To get a Tree with the children of a page, alphabetically sorted nodes:

$xwiki.doctree.getDocumentTree($doc)

To get a Tree with all the Documents of a space, nodes in order of creation:

$xwiki.doctree.getSpaceDocumentTree($doc.web, false)

Also see Child Page Snippet

The jar Archive also contains examples for use.

Version 8.3 last modified by ThomasMortagne on 21/06/2008 at 01:50

Comments 7

FriedemannLoew | 20.03.2007 at 03:31 PM
New version available!

Thanks to greyfairer for the help.

The new version is not compatible to the previous one.


MikeOliver | 19.03.2008 at 02:04 AM
Where can we get one of these?

tdl | 22.04.2008 at 08:05 AM
Where can we get one of these?

tdl | 22.04.2008 at 08:10 AM
mikeoliver You can get it at http://code.xwiki.org/xwiki/bin/view/Snippets/ChildPageSnippet attachement

ThomasMortagne | 13.05.2008 at 12:00 PM
This plugin should have a download page like other plugins. See Acronym To Link Plugin and Acronym To Link Plugin Downloads for example.

GabrielaRadu | 20.06.2008 at 01:44 PM
this works only one level… is there a n-level tree available?

blaine | 21.06.2008 at 01:50 AM
I suspect that this Plugin supports arbitrary number of levels, because otherwise it would not be a "tree". One level of ancestry does not make a tree.

Perhaps the problem you're seeing (Gabriela) is due to the Xwiki's pitiful page ancestry design. The default .xar AllDocs tree index page shows no ancestry at all other than pages-within-a-space. There is absolutely no validation that parents exist when setting parents. There is actually nothing tying the parent names to real page names. You can set parent to "nosuchthing", and that's what it will be saved as, and shown as in your page header.

Of course, it wouldn't be all that surprising if the problem you're seeing with the plugin is unrelated.

Attachments 0

No attachments for this document

Creator: FriedemannLoew on 2007/02/27 17:02
This wiki is licensed under a Creative Commons license
1.4.1.10194