Changes for page Supervisors

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

Summary

Details

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