Changes for page Supervisors

From version 2.1
edited by Andrea Omicini
on 2026/08/31 20:25
Change comment: There is no comment for this version
To version 1.1
edited by Andrea Omicini
on 2026/02/17 15:05
Change comment: Imported from XAR

Summary

Details

Page properties
Content
... ... @@ -7,19 +7,18 @@
7 7  #if( !$request.tag )
8 8  ## no tag parameter --> just the cloud
9 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
10 + #set( $query = ", BaseObject as objThesis, LargeStringProperty as propSupervisors, StringProperty as propStatus, DateProperty as propEnddate
12 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 13  ## execute query
14 - #set( $itemFound = $xwiki.search("select doc.fullName, propSupervisors.value from XWikiDocument as doc${queryTail}") )
13 + #set( $itemFound = $xwiki.searchDocuments($query) )
15 15   #set( $itemFoundNo = $itemFound.size() )
16 16  ## name-item map
17 17   #set( $nameMap = {} )
18 18  ## START EACH ITEM IN MAP
19 - #foreach( $row in $itemFound )
18 + #foreach( $item in $itemFound )
20 20  ## set $doc & $obj
21 - #set( $item = $row[0] )
22 - #set( $nameList = $row[1].split(",") )
20 + #set( $itemDoc = $xwiki.getDocument($item) )
21 + #set( $nameList = $itemDoc.getValue("supervisors").split(",") )
23 23  ## set user-item map
24 24   #foreach( $name in $nameList )
25 25  #### build name lists