Wiki source code of Supervisors

Show last authors
1 {{velocity}}
2 {{html clean="false" wiki="true"}}
3 #template('apice_macros.vm')
4 #setobjectspace("Theses")
5 #template('apice_thesis_macros.vm')
6 #### tag parameter possibly brings name to be used as tag
7 #if( !$request.tag )
8 ## no tag parameter --> just the cloud
9 ## set query
10 ## select the name strings themselves, rather than loading a document per thesis
11 #set( $queryTail = ", BaseObject as objThesis, LargeStringProperty as propSupervisors, StringProperty as propStatus, DateProperty as propEnddate
12 where objThesis.name = doc.fullName and objThesis.className = '${mainSpace}.Class' and objThesis.name <> '${objectPool}.Template' and propSupervisors.id.id = objThesis.id and propStatus.id.id = objThesis.id and propEnddate.id.id = objThesis.id and propSupervisors.name = 'supervisors' and propSupervisors.value <> '' and propStatus.name = 'status' and lower(propStatus.value) = 'completed' and propEnddate.name = 'end' order by propEnddate.value desc" )
13 ## execute query
14 #set( $itemFound = $xwiki.search("select doc.fullName, propSupervisors.value from XWikiDocument as doc${queryTail}") )
15 #set( $itemFoundNo = $itemFound.size() )
16 ## name-item map
17 #set( $nameMap = {} )
18 ## START EACH ITEM IN MAP
19 #foreach( $row in $itemFound )
20 ## set $doc & $obj
21 #set( $item = $row[0] )
22 #set( $nameList = $row[1].split(",") )
23 ## set user-item map
24 #foreach( $name in $nameList )
25 #### build name lists
26 #if( $nameMap.keySet().contains($name) )
27 ## nameMap already contains current name
28 ## add $item to nameMap for current name
29 #set( $discard = $nameMap[$name].add($item) )
30 #elseif( !$oneUser || $oneUser && $name != $userName )
31 ## nameMap does not contain name or selected user
32 ## add name / selected user to nameMap
33 #set( $nameMap[$name] = [] )
34 ## adding $item to nameMap for $name
35 #set( $discard = $nameMap[$name].add($item) )
36 #end
37 #end
38 #### END / feed name list from each item
39 #end
40 ## END EACH ITEM IN MAP
41 ## final values: $nameMap
42 #set( $nameFoundNo = $nameMap.keySet().size() )
43 ### CLOUD PAGE / START
44 <div class="mainheader">
45 $services.localization.render('theses').toLowerCase()
46 </div>
47 <div style='text-align: center'>
48 #foreach( $name in $nameMap.keySet() )
49 #set( $nameItemNo = $nameMap[$name].size() )
50 #if( $nameItemNo > 40 )#set( $tagSize = "140%" )
51 #elseif( $nameItemNo > 30 )#set( $tagSize = "135%" )
52 #elseif( $nameItemNo > 20 )#set( $tagSize = "130%" )
53 #elseif( $nameItemNo > 10 )#set( $tagSize = "125%" )
54 #elseif( $nameItemNo > 5 )#set( $tagSize = "120%" )
55 #elseif( $nameItemNo > 3 )#set( $tagSize = "110%" )
56 #elseif( $nameItemNo == 3 )#set( $tagSize = "105%" )
57 #elseif( $nameItemNo == 2 )#set( $tagSize = "100%" )
58 #else#set( $tagSize = "90%" )
59 #end
60 #set( $urlEscapedName = $escapetool.url($name) )
61 <span style='font-size:$tagSize; white-space: nowrap'>&ensp;[[#if( $name.startsWith("XWiki.") )$xwiki.getUserName($name,false)#else$name#end>>$doc||queryString="tag=$urlEscapedName"]]</span><sub class='textprimary' style="font-size: .75em">$nameItemNo</sub>&ensp;
62 #end
63 </div>
64 ## cloud bottom
65 <div class="menuqualifier" style="text-align: right">
66 [ $nameFoundNo #if( $nameFoundNo == 1 )$services.localization.render('supervisor').toLowerCase()#{else}$services.localization.render('supervisors').toLowerCase()#end / $itemFoundNo #if( $itemFoundNo == 1 )$services.localization.render('thesis').toLowerCase()#{else}$services.localization.render('theses').toLowerCase()#end ]
67 </div>
68 ### CLOUD PAGE / END
69 #else
70 ## yes tag parameter --> the item list
71 ##
72 #### TAG PAGE / START
73 #set( $query = ", BaseObject as objThesis, LargeStringProperty as propSupervisors, StringProperty as propStatus, DateProperty as propEnddate
74 where objThesis.name = doc.fullName and objThesis.className = '${mainSpace}.Class' and objThesis.name <> '${objectPool}.Template' and propSupervisors.id.id = objThesis.id and propStatus.id.id = objThesis.id and propEnddate.id.id = objThesis.id and propSupervisors.name = 'supervisors' and propSupervisors.value like '%$request.tag%' and propStatus.name = 'status' and lower(propStatus.value) = 'completed' and propEnddate.name = 'end' order by propEnddate.value desc" )
75 ## execute query
76 #set( $itemFound = $xwiki.searchDocuments($query) )
77 #set( $itemNo = $itemFound.size() )
78 ## subtitle
79 <div class="mainheader">
80 $itemNo
81 #if( $itemNo > 1)
82 $services.localization.render('theses').toLowerCase()
83 #else
84 $services.localization.render('thesis').toLowerCase()
85 #end
86 </div>
87 ## thesis list
88 #foreach( $item in $itemFound )
89 <div>
90 [[image:icon:book]] #thesislinked($item)
91 </div>
92 #end
93 ## thesis list bottom
94 <div class="menuqualifier" style="text-align: right">
95 [ [[{{stringEngIta eng="supervisor cloud" ita="nuvola relatori" /}}>>$doc.name]] / $services.localization.render('theses').toLowerCase() ]
96 </div>
97 #end
98 {{/html}}
99 {{/velocity}}{{pageDisplay sort="objectservice"/}}