2 – Page Picker

doc: $doc
doc.space: $doc.space
doc.parent: $doc.parent
doc.name: $doc.name
doc.fullName: $doc.fullName
doc.title: $doc.title
doc.plainTitle: $doc.plainTitle
#if( $doc ==  $doc.fullName )
doc == doc.fullName
#else
doc !=  doc.fullName
#end
#if( $doc ==  $doc.name )
doc == doc.name
#else
doc !=  doc.name
#end
#if( $doc ==  "$doc.space.$doc.name" )
doc ==  doc.space.doc.name
#else
doc !=  doc.space.doc.name
#end
#set( $definedTrue = true )
#set( $definedFalse = false )
#if( ${definedTrue} != true )DT #else DF#end
#if( ${definedFalse} != true )DF #else DT#end
#if( ${undefined} != true )DF #else DT#end
#if( ${undefined} != false )DT #else DF#end
#set ($sql = ", BaseObject as obj, StringProperty as prop0, DateProperty as prop1, StringProperty as prop2, LargeStringProperty as prop3, LargeStringProperty as prop4, LargeStringProperty as prop5
where obj.name = doc.fullName and obj.className = 'Theses.ThesisClass' and obj.name <> 'Theses.ThesisClassTemplate' and obj.name <> 'Theses.ThesisTemplate' and prop0.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop3.id.id = obj.id and prop4.id.id = obj.id and prop5.id.id = obj.id and prop0.name = 'cycle' and prop1.name = 'endDate' and prop2.name = 'status' and prop3.name = 'supervisors' and prop4.name = 'cosupervisors' and prop5.name = 'contacts' and prop0.value = 'L' and year(prop1.value) = '2021' and prop2.value = 'Completed' and ( prop3.value like '%XWiki.AndreaOmicini%' or prop4.value like '%XWiki.AndreaOmicini%' or prop5.value like '%XWiki.AndreaOmicini%' ) order by prop1.value desc" )
#set ($sql = ", BaseObject as obj, StringProperty as prop0, DateProperty as prop1, StringProperty as prop2, LargeStringProperty as prop3, LargeStringProperty as prop4, LargeStringProperty as prop5
where obj.name = doc.fullName and obj.className = 'Theses.ThesisClass' and obj.name <> 'Theses.ThesisClassTemplate' and obj.name <> 'Theses.ThesisTemplate' and prop0.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop3.id.id = obj.id and prop4.id.id = obj.id and prop5.id.id = obj.id and prop0.name = 'cycle' and prop1.name = 'endDate' and prop2.name = 'status' and prop3.name = 'supervisors' and prop4.name = 'cosupervisors' and prop5.name = 'contacts' and prop0.value = 'L' and year(prop1.value) = '2021' and prop2.value = 'Completed' and prop5.value <> '' and prop5.value like '%XWiki.AndreaOmicini%' order by prop1.value desc" )

#set( $thesisFound = $xwiki.searchDocuments($sql) )
#set( $thesisFoundNo = $thesisFound.size() )
$thesisFound
#foreach( $thesis in $thesisFound )
  #set( $thesisDoc = $xwiki.getDocument($thesis) )
  #set( $thesisObj = $thesisDoc.getObject('Theses.ThesisClass') )
  $thesisDoc.getValue('contacts')
#end