Wiki source code of TreeMapMacro

Last modified by Eugen Colesnicov on 2013/03/24 06:00

Show last authors
1 {{velocity}}
2 #macro(getCorrespondenceTree $depth $design)
3 #if($depth>=1)
4 #set($class="etvcCorrespondence2Code.GroupSectionsClass")
5 #set($template="etvcCorrespondence2Code.GroupSectionsTemplate")
6 #set($xwlquery="from doc.object($class) as obj where doc.fullName <> '$template' order by obj.Index")
7 #set($list1=$services.query.xwql($xwlquery).execute())
8 #foreach($item1 in $list1)
9 #set($doc1 = $xwiki.getDocument($item1))
10 #if($design=="heading")
11 == [[$doc1.getTitle() ▼>>$item1]] ==
12 #elseif($design=="tree")
13 * [[$doc1.getTitle() ▼>>$item1]]
14 #else
15 [[$doc1.getTitle() ▼>>$item1]]**
16 #end
17 #if($depth>=2)
18 #if($design=="heading")
19 #set($h2="*")
20 #elseif($design=="tree")
21 #set($h2="**")
22 #else
23 #set($h2="*")
24 #end
25 #set($hide=false)
26 #set($class="etvcCorrespondence2Code.SectionsClass")
27 #set($template="etvcCorrespondence2Code.SectionsClassTemplate")
28 #set($xwlquery="from doc.object($class) as obj where doc.fullName <> '$template' and doc.parent='$doc1' order by obj.Index")
29 #set($list2=$services.query.xwql($xwlquery).execute())
30 #foreach($item2 in $list2)
31 #if($foreach.count==1 && $foreach.last==true) #set($hide=true) #end
32 #set($doc2 = $xwiki.getDocument($item2))
33 #if($hide==false)
34 $h2 [[$doc2.display('Index', 'view') - $doc2.display('NameFull', 'view')>>$item2]]
35 #end
36 #if($depth>=3 || $depth>=2 && $hide==true)
37 #if($hide==true)
38 #if($design=="heading")
39 #set($h3="*")
40 #elseif($design=="tree")
41 #set($h3="**")
42 #else
43 #set($h3="*")
44 #end
45 #else
46 #if($design=="heading")
47 #set($h3="**")
48 #elseif($design=="tree")
49 #set($h3="***")
50 #else
51 #set($h3="**")
52 #end
53 #end
54 #set($class="etvcCorrespondence2Code.FoldersClass")
55 #set($template="etvcCorrespondence2Code.FoldersClassTemplate")
56 #set($xwlquery="from doc.object($class) as obj where doc.fullName <> '$template' and doc.parent='$doc2' order by obj.Index")
57 #set($list3=$services.query.xwql($xwlquery).execute())
58 #foreach($item3 in $list3)
59 #set($doc3 = $xwiki.getDocument($item3))
60 $h3 [[$doc3.display('Index', 'view') - $doc3.display('Title', 'view')>>$item3]]
61 #end
62 #end
63 #end
64 #end
65 #end
66 #end
67 #end
68 {{/velocity}}