Hi Guillaume,

  Thanks for your valuable reply.

  I have somewhat achieved to get the subspaces and pages like a tree
structure.
  This is the code snippet. I just changed the query in the child parent
code snippet for my requirement.

{{velocity}}
#macro (createDocumentTree $document $depth $level)
        #if ($depth > 0)
                #set($translated = $document.getTranslatedDocument())
                #set($name = $translated.getName())
                #set($fullname = $translated.getFullName())
                #set($prefixed = $translated.getPrefixedFullName())
                #set($where = "where doc.parent = '$name' or doc.parent =
'$fullname' or doc.parent = '$prefixed' order by doc.name")
                #if ($name == "WebHome")
                        #set($space = $document.getSpace())
                       ## changes made here for our requirement
                       #set($where1 = "where doc.parent = '$fullname' and
doc.name='WebHome'")            
               #end

                #foreach($name in $xwiki.searchDocuments($where))
                        #if ($xwiki.getDocument($name))
                                #set($document = $xwiki.getDocument($name))
                                #set($translated = 
$document.getTranslatedDocument())
                                #set($prefixed = 
$translated.getPrefixedFullName())
                                #set($title = $translated.getDisplayTitle())
                                #set($indent = "")
                                #foreach($n in [1..$level])
                                        #set($indent = "${indent}*")
                                #end
                                $indent [[$title>>$prefixed]]
                                #set($depth = $depth - 1)
                                #set($level = $level + 1)
                                #createDocumentTree($document $depth $level)
                                #set($depth = $depth + 1)
                                #set($level = $level - 1)
                        #end
                #end
               
        #end
#end
#createDocumentTree($doc 5 1)
{{/velocity}}

But here i am facing the problem.

I am creating a space and putting this velocity code in that space and its
displaying the whole tree structure related to it.
But i want this code in panel and the tree structure should come for all
spaces dynamically like Tree view Navigation. 
I put this code in panel but it displaying the tree related to panel. My
requirement is to show all spaces and its related subspace, pages as tree in
panel.

How can i get spaces and also specify the proper document object?

Is there any way to get successful in this. Kindly guide me.

Thanks in Advance.

Regards,
Nithya.




-- 
View this message in context: 
http://xwiki.475771.n2.nabble.com/How-to-list-the-subspace-under-the-space-tp5095367p5104916.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to