Changes for page Supervisors
From version 69.4
edited by Andrea Omicini
on 08/11/2021 14:28
on 08/11/2021 14:28
Change comment:
There is no comment for this version
To version 68.1
edited by Andrea Omicini
on 08/11/2021 01:41
on 08/11/2021 01:41
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,0 @@ 1 -#if($xcontext.language=="it")Nuvola dei tag delle tesi#{else}Thesis Tag Cloud#end - Content
-
... ... @@ -1,99 +1,32 @@ 1 -{{include reference='Theses.Environment'/}}{{include reference='Environment'/}}{{velocity}} 2 -## publication page with menus 3 -#set( $thesisMenu = true ) 4 -## 5 -#set( $userSelected = false ) 6 -## 1 +{{include reference = "MacroSheet" /}}{{velocity}} 7 7 #if( !$request.tag ) 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 lower(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 3 +## no tag specified in the query 37 37 >**Tag Cloud** / {{stringEngIta eng="Theses" ita="Tesi" /}} 38 38 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 lower(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() ) 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() ) 48 48 #set( $thesisCount = $tagCount.get($thesisTag) ) 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%" ) 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%" ) 60 60 #end 61 - #set($urlEscapedTag = $escapetool.url($thesisTag)) 62 - #set($htmlEscapedTag = $escapetool.xml($thesisTag)) 63 -(% style='font-size:$tagSize' %) $doc||queryString='tag=$urlEscapedTag#if( $userSelected )&user=$userName#end']](%style='font-style:normal;color:$theme.textPrimaryColor';font-size:75%' %),,$thesisCount,,(%%)(%%)#end20 + #set( $urlEscapedTag = $escapetool.url($thesisTag) ) 21 + #set( $htmlEscapedTag = $escapetool.xml($thesisTag) ) 22 +(% style='font-size:$tagSize' %) [[$thesisTag>>Theses.Tags||queryString="tag=$urlEscapedTag"]] (%%)#end 64 64 ))) 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 73 73 #else 74 -## START ONE TAG specified in the query 75 -## embodied page? 76 - #if( $userName && $userSpace ) 77 - #set( $embodiedPage = true ) 78 - #else 79 - #set( $embodiedPage = false ) 80 - #end 81 - #if( $request.user ) 82 - #set( $from = ", BaseObject as obj0, DBStringListProperty as prop0 join prop0.list item, BaseObject as obj1, StringProperty as prop1, LargeStringProperty as prop2, LargeStringProperty as prop3, LargeStringProperty as prop4, DateProperty as prop5" ) 83 - #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 prop3.id.id = obj1.id and prop4.id.id = obj1.id and prop5.id.id = obj1.id and prop1.name = 'status' and prop2.name = 'supervisors' and prop3.name = 'cosupervisors' and prop4.name = 'contacts' and prop5.name = 'endDate' and lower(prop1.value) = 'completed' and ( prop2.value like '%$request.user%' or prop3.value like '%$request.user%' or prop4.value like '%$request.user%' ) order by prop5.value desc" ) 84 - #else 85 - #set( $from = ", BaseObject as obj0, DBStringListProperty as prop0 join prop0.list item, BaseObject as obj1, DateProperty as prop1, StringProperty as prop2" ) 86 -#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" ) 87 - 88 - 89 - 90 - 91 - 92 - 93 - 94 - 25 +## one tag specified in the query 95 95 >Tag “**$request.tag**” / {{stringEngIta eng = "Theses" ita = "Tesi" /}} 96 96 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" ) 97 97 #set( $sql = $from + " where " + $where ) 98 98 #set( $thesisFound = $xwiki.searchDocuments($sql) ) 99 99 ## show tag