Changes for page Document Tree
Last modified by Ludovic Dubost on 2024/07/22 15:50
From version 3.1
edited by Ludovic Dubost
on 2015/11/28 14:58
on 2015/11/28 14:58
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-index-tree-macro-7.3]
To version 6.1
edited by Ludovic Dubost
on 2018/07/01 11:40
on 2018/07/01 11:40
Change comment:
Install extension [org.xwiki.platform:xwiki-platform-index-tree-macro/10.5]
Summary
-
Objects (1 modified, 3 added, 0 removed)
Details
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,37 +1,12 @@ 1 -{{ includereference="XWiki.DocumentTreeConfig" /}}1 +{{template name="documentTree_macros.vm" /}} 2 2 3 3 {{velocity}} 4 -#macro (escapeMacroParam $value)$!value.replaceAll('([~"])', '~$1')#end 5 -## showChildDocuments is deprecated since 7.2M2. Fall-back on hierarchyMode for backwards compatibility. 6 -#if ($xcontext.macro.params.showChildDocuments == 'true') 7 - #set ($discard = $xcontext.macro.params.set('hierarchyMode', 'parentchild')) 4 +#set ($options = {}) 5 +#foreach ($parameterName in $xcontext.macro.params.parameterNames) 6 + #set ($discard = $options.put($parameterName, $xcontext.macro.params.get($parameterName))) 8 8 #end 9 -#set ($resourceParams = {'outputSyntax': 'plain'}) 10 -#foreach ($entry in $docTreeConfig.entrySet()) 11 - #set ($value = $xcontext.macro.params.get($entry.key)) 12 - #if ("$!value" != '' && $value != "$!entry.value") 13 - #set ($discard = $resourceParams.put($entry.key, $value)) 14 - #end 15 -#end 16 -#set ($reference = "path:$xwiki.getURL($xcontext.macro.doc.documentReference, 'get', $escapetool.url($resourceParams))") 17 -#set ($editable = $xcontext.macro.params.readOnly != 'true') 18 -#set ($isFullWidthAvailable = $xcontext.macro.params.compact != 'true') 19 -#set ($links = $xcontext.macro.params.links == 'true') 20 -#set ($checkboxes = $xcontext.macro.params.checkboxes == 'true') 21 -#set ($finder = $xcontext.macro.params.finder == 'true') 22 -## We use directly FontAwesome for the tree node icons for two reasons: 23 -## * the XWiki icon set (available through the icon themes) is limited 24 -## * jsTree expects an URL/path or a CSS class name as the value of the tree node icon configuration when JSON source is 25 -## used; the icon theme API is currently only able to render an icon but there's no way to get the icon configuration 26 -## as jsTree expects it. The alternative is to use the HTML source to feed the tree but then the tree definition and 27 -## configuration becomes complex. 28 -## We don't load the FontAwesome CSS directly from its WebJar because it contains some relative paths that currently are 29 -## not handled correctly by the WebJar action. This has been fixed in the FontAwesome icon theme so we load the theme 30 -## SSX instead. 31 -#set ($discard = $xwiki.ssx.use('IconThemes.FontAwesome')) 32 -## Include also the fix for the FontAwesome loading issue on IE8. 33 -#set ($discard = $xwiki.jsx.use('IconThemes.FontAwesome')) 34 -{{tree reference="#escapeMacroParam($reference)" dragAndDrop="$editable" contextMenu="$editable" 35 - icons="$isFullWidthAvailable" edges="$isFullWidthAvailable" links="$links" checkboxes="$checkboxes" 36 - openTo="#escapeMacroParam($xcontext.macro.params.openTo)" finder="$finder" /}} 8 +{{html clean="false"}} 9 +#prepareTreeOptions($options) 10 +#documentTree($options) 11 +{{/html}} 37 37 {{/velocity}}
- XWiki.WikiMacroParameterClass[19]
-
- Parameter default value
-
... ... @@ -1,0 +1,1 @@ 1 +true - Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +Set this parameter to false if you want to include the hidden documents in the tree. Otherwise, if the value is true, the hidden documents are excluded or included based on current user's preferences. - Parameter mandatory
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter name
-
... ... @@ -1,0 +1,1 @@ 1 +filterHiddenDocuments
- XWiki.WikiMacroParameterClass[20]
-
- Parameter default value
-
... ... @@ -1,0 +1,1 @@ 1 +15 - Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +The maximum number of child nodes to display when expanding a parent node for the first time. The rest of the child nodes are accessible through a "more ..." link. This parameter is basically used to paginate the child nodes and thus helps the tree scale when the number of child nodes is large. - Parameter mandatory
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter name
-
... ... @@ -1,0 +1,1 @@ 1 +limit
- XWiki.WikiMacroParameterClass[21]
-
- Parameter description
-
... ... @@ -1,0 +1,1 @@ 1 +The list of nodes to exclude from the tree. The nodes are specified by their id and separated by comma. - Parameter mandatory
-
... ... @@ -1,0 +1,1 @@ 1 +No - Parameter name
-
... ... @@ -1,0 +1,1 @@ 1 +exclusions