Changes for page Users

From version 7.1
edited by Andrea Omicini
on 2026/08/29 00:56
Change comment: There is no comment for this version
To version 2.1
edited by Andrea Omicini
on 2026/05/19 21:03
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,80 +1,83 @@
1 1  {{velocity}}
2 -################################################################################
3 -## People — built from the `status` field of XWiki.XWikiUsers.
4 -##
5 -## Nothing is hand-maintained here: the groups are the values declared by
6 -## XWiki.XWikiUsers.status, in the class's own order, and every user carrying a
7 -## status appears in exactly one of them. Add a status to the class and it shows
8 -## up here; change someone's status and they move.
9 -##
10 -## Headings use the translation keys XWiki.XWikiUsers_status_<value>, so the page
11 -## is bilingual without a single string of its own.
12 -################################################################################
13 -##
14 -## the groups, in class order, and the people, from the users themselves
15 -#set( $statusList = $xwiki.getDocument('XWiki.XWikiUsers').getxWikiClass().get('status').getListValues() )
16 -#set( $people = {} )
17 -#foreach( $s in $statusList )
18 - #set( $discard = $people.put($s, []) )
2 +#### Set Users Lists
3 +#set($almamaterList = ['AntonioNatali'])
4 +#set($tenuredList = ['RobertaCalegari','RobyCasadei','GiovanniCiatto','EnricoDenti','SaraMontagna','GianlucaMoro','AndreaOmicini','DaniloPianini','NazzarenoPompei','ARicci','AndreaRoli','MirkoViroli'])
5 +#set($researchfellowList = [])
6 +#set($postdocList = ['AndreaAgiollo','MartinaBaiardi4','MatteoMagnini','GPisano','AndreaRafanelli'])
7 +#set($phdList = ['MattiaMatteini'])
8 +#set($grantList = ['FSabbatini'])
9 +#set($collaboratorList = ['ClaudiaCevenini','PierluigiContucci','MCasadei','SMariani','ACroatti','AmbraMolesini'])
10 +#set($guestList = [])
11 +#set($goneList = ['MarcoAlberti3','MattiaBargellini','StefanoBenedettini','StefanoBromuri', 'PietroBrunetti2','MicheleCabano','AlbertoCastori','MaurizioCimadamore','GiacomoDomeniconi','MarcoFabbri','PedroPabloGonzalezPerez','CesareMonti','GabrieleMonti4','ElenaNardini','EnricoOliva','AlexcarmineOlivieri','EmanuelePanzavolta','RobertoPasolini','GiulioPiancastelli','TommasoPirini','MichelePiunti','ASanti','MarcoSbaraglia','JoseSantiagoPerezSotelo','VisaraUrovi'])
12 +
13 +>{{stringEngIta eng="Alma Mater Honorary Professors" ita="Professori Alma Mater"/}}
14 +
15 +#foreach ($tipolosco in $almamaterList)
16 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
17 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
19 19  #end
20 -## distinct: a user page with a translation (XWiki.AntonioNatali.it) returns one row per locale
21 -#set( $rows = $services.query.xwql("select distinct doc.fullName from Document doc, doc.object(XWiki.XWikiUsers) as u where u.status <> ''").execute() )
22 -#set( $seen = [] )
23 -#foreach( $ref in $rows )
24 - #set( $uDoc = $xwiki.getDocument($ref) )
25 - #set( $uObj = $uDoc.getObject('XWiki.XWikiUsers') )
26 - #set( $st = "$!uObj.getValue('status')" )
27 - #if( $people.containsKey($st) && !$seen.contains($ref) )
28 - #set( $discard = $seen.add($ref) )
29 - ## sort key: surname, then given name, then the reference
30 - #set( $last = "$!uObj.getValue('last_name')" )
31 - #set( $first = "$!uObj.getValue('first_name')" )
32 - #set( $discard = $people.get($st).add("${last}|${first}|${ref}") )
33 - #end
19 +
20 +>{{stringEngIta eng="Tenured" ita="Strutturati"/}}
21 +
22 +#foreach ($tipolosco in $tenuredList)
23 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
24 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
34 34  #end
35 -##
36 -## one person: given name + bold surname, linked to their XWiki user page
37 -#macro( apicePerson $entry )
38 - #set( $bits = $entry.split('\|') )
39 -[[${bits[1]} **${bits[0]}**>>${bits[2]}]]##
26 +
27 +>{{stringEngIta eng="Research Fellows" ita="Ricercatori"/}}
28 +
29 +#foreach ($tipolosco in $researchfellowList)
30 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
31 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
40 40  #end
41 -##
42 -## a section, printed only when somebody is in it
43 -#macro( apiceGroup $status )
44 - #set( $group = $people.get($status) )
45 - #if( $group && !$group.isEmpty() )
46 - #set( $group = $collectiontool.sort($group) )
47 47  
48 ->$services.localization.render("XWiki.XWikiUsers_status_${status}") (%%)//($group.size())//
34 +#if( $postdocList != [] )
35 +>{{stringEngIta eng="Post-Doc" ita="Post-dottorato"/}}
49 49  
50 - #foreach( $entry in $group )#if( !$foreach.first ) • #end#apicePerson($entry)#end
37 +#foreach ($tipolosco in $postdocList)
38 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
39 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
40 +#end
41 +#end
51 51  
52 - #end
43 +>{{stringEngIta eng="PhD Students" ita="Studenti di dottorato"/}}
44 +
45 +#foreach ($tipolosco in $phdList)
46 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
47 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
53 53  #end
54 -##
55 -#### CURRENT PEOPLE — every status except students and past members
56 -#foreach( $s in $statusList )
57 - #if( $s != 'Student' && $s != 'Gone' )
58 - #apiceGroup($s)
59 - #end
49 +
50 +#if( $grantList != [] )
51 +>{{stringEngIta eng="Grants" ita="Assegnisti e borsisti"/}}
52 +
53 +#foreach ($tipolosco in $grantList)
54 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
55 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
60 60  #end
61 -##
62 -#### PAST MEMBERS
63 -#apiceGroup('Gone')
64 -##
65 -#### anyone whose status is not among those declared by the class — should be empty
66 -#set( $strays = [] )
67 -#foreach( $ref in $rows )
68 - #set( $uObj = $xwiki.getDocument($ref).getObject('XWiki.XWikiUsers') )
69 - #set( $st = "$!uObj.getValue('status')" )
70 - #if( !$people.containsKey($st) )#set( $discard = $strays.add("${ref} (${st})") )#end
71 71  #end
72 -#if( !$strays.isEmpty() )
73 73  
74 ->{{stringEngIta eng="Unrecognised status" ita="Stato non riconosciuto"/}}
59 +>{{stringEngIta eng="Collaborators" ita="Collaboratori"/}}
75 75  
76 - #foreach( $stray in $strays )$stray#if( !$foreach.last ) • #end#end
61 +#foreach ($tipolosco in $collaboratorList)
62 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
63 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
64 +#end
77 77  
66 +#if( $guestList != [] )
67 +>{{stringEngIta eng="Guests, Visitors & External Collaborators" ita="Ospiti, visitatori e collaboratori esterni"/}}
68 +
69 +#foreach ($tipolosco in $guestList)
70 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
71 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
72 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
78 78  #end
79 -{{/velocity}}
74 +#end
80 80  
76 +>{{stringEngIta eng="Gone" ita="Passati"/}}
77 +
78 +#foreach($tipolosco in $goneList)
79 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
80 +#set($xwikiUserName = "XWiki." + $tipolosco)#set( $xwikiUserDoc = $xwiki.getDocument($xwikiUserName) )
81 +[[$xwikiUserDoc.display('first_name') **$xwikiUserDoc.display('last_name')**>>$xwikiUserName]]#if( !$foreach.last ) • #end
82 +#end
83 +{{/velocity}}