There are 2 comments.
 
 
XWiki Platform / cid:jira-generated-image-avatar-ccde53a5-d027-46eb-a7dd-b40b155bca2c XWIKI-20528 Open

Add parameter to open nodes of DocumentTree to given level/depth

 
View issue   ยท   Add comment
 

2 comments

 
cid:jira-generated-image-avatar-78096575-fa07-49e0-8958-7329cf9792cb Sebastian on 11/Mar/25 09:47
 

If it's easier to implement, one could define both parameters as mutually exclusive, i.e. you can use only one of them. I don't really care about the openTo parameter, because I don't have a scenario where it may be useful to me.

 
cid:jira-generated-image-avatar-ff60d84b-7180-4af3-9db1-49573abefa1f Marius Dumitru Florea on 11/Mar/25 09:56
 

Simon Urli  the way I see it, the two parameters, openTo and openToLevel are independent, and don't affect each other:

  • openToLevel is taken into account server-side when fetching the tree data to:
    • include in the JSON the descendants up the specified level
    • mark in the JSON the parent nodes from those levels as "expanded"
  • openTo is taken into account client-side, after the tree data is loaded and the tree is displayed, and its behavior doesn't change:
    • if the target tree node is already loaded then expand all its parent nodes (if not already expanded) and select the target node
    • otherwise, fetch from the server the path of the target node and then load and expand all its ancestor nodes (of course, if they are not already loaded and expanded)

So adding the new parameter shouldn't have any effect on the openTo parameter. It should not matter for the openTo if the tree is already loaded and expanded up to N level.