SortedDocumentTree Plugin
This plugin isn't bundled with any XWiki product by default.
Plugin contributed by VladimirRiha.
This plugin can be downloaded.
Plugin contributed by VladimirRiha.
This plugin can be downloaded.
SortedDocumentTree Plugin
The Sorted Document Tree Plugin creates a hierarchical link list of all pages in the current space and it allows to specify the position of each page in the list. In the list there are only pages that are either parents of other pages or children of other pages (so there must be some relationship between them).Installation
- Copy the jar archive into %xwikipath%/WEB-INF/lib/
- Add com.xpn.xwiki.plugin.SortedTree.SortedTree to xwiki.cfg
- Import all XWiki pages from the xar archive to your XWiki
How to use it
You need to call one method of the plugin called index() which has 4 parameters. For example $xwiki.sortedTree.index($doc.space, $context.user,4,0)- The first parameter specifies the space which is supposed to be searched
- The second parameter specifies the current user (because each user is able to see only pages on which he has "view" rights )
- The third specifies Max depth for searching
- The fourth parameter is used for changing the order of the list
Changing the list order
If you want to have some page higher (or lower...) in the list than others you must specify the page's weight. There are two ways to do that:- use XWiki class XWiki.TagClass (instances are added to all pages by default)
- or use imported class (section Installation step 3) called XWiki.SortedTreePageClass
- if the weight starts with 0, then child pages are not included in the list, but the parent page is. For example page A has weight 025 and this page has some child page B. Then this page B is not in the list (and also all children of B are not in the list) but page A is included in the list and its weight is considered to be 25
- if the weight is less then 0, then this page is not in the list and also all it's children (and children of them...) are not in the list. So this could be used to exclude some pages from the list
Example
In the page you want to see this list type:$xwiki.sortedTree.index($doc.space, $context.user,4,0)