Changes for page Supervisors

From version 68.1
edited by Andrea Omicini
on 08/11/2021 01:41
Change comment: There is no comment for this version
To version 69.3
edited by Andrea Omicini
on 08/11/2021 14:17
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,0 +1,1 @@
1 +#if($xcontext.language=="it")Nuvola dei tag delle tesi#{else}Thesis Tag Cloud#end
Content
... ... @@ -1,32 +1,81 @@
1 -{{include reference = "MacroSheet" /}}{{velocity}}
1 +{{include reference='Theses.Environment'/}}{{include reference='Environment'/}}{{velocity}}
2 +## publication page with menus
3 +#set( $thesisMenu = true )
4 +##
5 +#set( $userSelected = false )
6 +##
2 2  #if( !$request.tag )
3 -## no tag specified in the query
8 +## START NO TAG specified in the query
9 + #if( $userName && $xwiki.exists($userName) )
10 + #set( $userDoc = $xwiki.getDocument($userName) )
11 + #set( $userFirstName = $userDoc.display("first_name") )
12 + #set( $userLastName = $userDoc.display("last_name") )
13 + #set( $userSelected = true )
14 + #end
15 + #if( !$userSelected && $request.user )
16 + #if( $xwiki.exists("XWiki.$request.user") )
17 + #set( $userSelected = true )
18 + #set( $userName = "XWiki.$request.user" )
19 + #elseif( $xwiki.exists("$request.user") )
20 + #set( $userSelected = true )
21 + #set( $userName = "$request.user" )
22 + #else
23 +{{warning}}"$request.user" looks not like any known APICe user{{/warning}}
24 + #end
25 + #if( $userSelected )
26 + #set( $userDoc = $xwiki.getDocument($userName) )
27 + #set( $userFirstName = $userDoc.display("first_name") )
28 + #set( $userLastName = $userDoc.display("last_name") )
29 + #end
30 + #end
31 + #if( $userSelected )
32 +> **Tag Cloud** / {{stringEngIta eng = "Theses" ita = "Tesi" /}} / $userFirstName $userLastName
33 +
34 + #set( $from = ", BaseObject as obj0, StringProperty as prop0, LargeStringProperty as prop1, LargeStringProperty as prop2, LargeStringProperty as prop3" )
35 + #set( $where = "obj0.name = doc.fullName and obj0.className = 'Theses.ThesisClass' and obj0.name <> 'Theses.ThesisClassTemplate' and obj0.name <> 'Theses.ThesisTemplate' and prop0.id.id = obj0.id and prop1.id.id = obj0.id and prop2.id.id = obj0.id and prop3.id.id = obj0.id and prop0.name = 'status' and prop0.value = 'Completed' and prop1.name = 'supervisors' and prop2.name = 'cosupervisors' and prop3.name = 'contacts' and ( prop1.value like '%$userName%' or prop2.value like '%$userName%' or prop3.value like '%$userName%' )" )
36 + #else
4 4  >**Tag Cloud** / {{stringEngIta eng="Theses" ita="Tesi" /}}
5 5  
6 -#set( $from = ", BaseObject as obj0" )
7 -#set( $where = " obj0.name = doc.fullName and obj0.className = 'Theses.ThesisClass' and obj0.name <> 'Theses.ThesisClassTemplate' and obj0.name <> 'Theses.ThesisTemplate' " )
8 -#set( $tagCount = $xwiki.tag.getTagCountForQuery($from, $where) )
9 -(% style='text-align: center' %)(((
10 -#foreach( $thesisTag in $tagCount.keySet() )
39 + #set( $from = ", BaseObject as obj0, StringProperty as prop0" )
40 + #set( $where = "obj0.name = doc.fullName and obj0.className = 'Theses.ThesisClass' and obj0.name <> 'Theses.ThesisClassTemplate' and obj0.name <> 'Theses.ThesisTemplate' and prop0.id.id = obj0.id and and prop0.name = 'status' and prop0.value = 'Completed'" )
41 + #end
42 + ##
43 + #set( $tagCount = $xwiki.tag.getTagCountForQuery($from, $where) )
44 + #set( $tagInstanceNo = 0 )
45 + #set( $tagNo = 0 )
46 +(% style='text-align:center' %)(((
47 + #foreach( $thesisTag in $tagCount.keySet() )
11 11   #set( $thesisCount = $tagCount.get($thesisTag) )
12 - #if( $thesisCount > 20 ) #set ( $tagSize = "140%" )
13 - #elseif( $thesisCount > 10 ) #set ( $tagSize = "130%" )
14 - #elseif( $thesisCount > 5 ) #set ( $tagSize = "120%" )
15 - #elseif( $thesisCount > 3 ) #set ( $tagSize = "110%" )
16 - #elseif( $thesisCount == 3 ) #set ( $tagSize = "105%" )
17 - #elseif( $thesisCount == 2 ) #set ( $tagSize = "100%" )
18 - #else#set ($tagSize = "90%" )
49 + #set( $tagInstanceNo = $tagInstanceNo + $thesisCount )
50 + #set( $tagNo = $tagNo + 1 )
51 + #if( $thesisCount > 40 )#set( $tagSize = "140%" )
52 + #elseif( $thesisCount > 30 )#set( $tagSize = "135%" )
53 + #elseif( $thesisCount > 20 )#set( $tagSize = "130%" )
54 + #elseif( $thesisCount > 10 )#set( $tagSize = "125%" )
55 + #elseif( $thesisCount > 5 )#set( $tagSize = "120%" )
56 + #elseif( $thesisCount > 3 )#set( $tagSize = "110%" )
57 + #elseif( $thesisCount == 3 )#set( $tagSize = "105%" )
58 + #elseif( $thesisCount == 2 )#set( $tagSize = "100%" )
59 + #else#set( $tagSize = "90%" )
19 19   #end
20 - #set( $urlEscapedTag = $escapetool.url($thesisTag) )
21 - #set( $htmlEscapedTag = $escapetool.xml($thesisTag) )
22 -(% style='font-size:$tagSize' %) [[$thesisTag>>Theses.Tags||queryString="tag=$urlEscapedTag"]] (%%)#end
61 + #set($urlEscapedTag = $escapetool.url($thesisTag))
62 + #set($htmlEscapedTag = $escapetool.xml($thesisTag))
63 +(% style='font-size:$tagSize' %) [[$thesisTag>>$doc||queryString='tag=$urlEscapedTag#if( $userSelected )&user=$userName#end']](% style='font-style:normal;color:$theme.textPrimaryColor';font-size:75%' %),,$thesisCount,,(%%) (%%)#end
23 23  )))
65 +(% style="font-style:oblique;font-size:smaller;text-align:right;color:$theme.textSecondaryColor" %)(((
66 + #if( $userSelected )
67 +[ $tagInstanceNo / $tagNo {{stringEngIta eng = "tags" ita = "tag"/}} ]
68 + #else
69 +[ $tagInstanceNo / $tagNo {{stringEngIta eng = "tags" ita = "tag"/}} ]
70 + #end
71 +)))
72 +## END NO TAG specified in the query
24 24  #else
25 -## one tag specified in the query
74 +## START ONE TAG specified in the query
26 26  >Tag “**$request.tag**” / {{stringEngIta eng = "Theses" ita = "Tesi" /}}
27 27  
28 -#set( $from = ", BaseObject as obj0, DBStringListProperty as prop0 join prop0.list item, BaseObject as obj1, DateProperty as prop1" )
29 -#set( $where = "obj0.className='XWiki.TagClass' and obj0.name=doc.fullName and obj0.id=prop0.id.id and prop0.id.name='tags' and lower(item)=lower('$request.tag') and obj1.name=doc.fullName and obj1.className='Theses.ThesisClass' and obj1.name<>'Theses.ThesisClassTemplate' and obj1.name<>'Theses.ThesisTemplate' and prop1.id.id=obj1.id and prop1.name = 'endDate' order by prop1.value desc" )
77 +#set( $from = ", BaseObject as obj0, DBStringListProperty as prop0 join prop0.list item, BaseObject as obj1, DateProperty as prop1, StringProperty as prop2" )
78 +#set( $where = "obj0.className = 'XWiki.TagClass' and obj0.name = doc.fullName and obj0.id = prop0.id.id and prop0.id.name = 'tags' and lower(item) = lower('$request.tag') and obj1.name = doc.fullName and obj1.className = 'Theses.ThesisClass' and obj1.name <> 'Theses.ThesisClassTemplate' and obj1.name <> 'Theses.ThesisTemplate' and prop1.id.id = obj1.id and prop2.id.id = obj1.id and prop1.name = 'endDate' and prop2.name = 'status' and lower(prop2.value) <> 'out-of-date' order by prop1.value desc" )
30 30  #set( $sql = $from + " where " + $where )
31 31  #set( $thesisFound = $xwiki.searchDocuments($sql) )
32 32  ## show tag