Changes for page Per Year
From version 17.4
edited by Andrea Omicini
on 25/10/2021 16:33
on 25/10/2021 16:33
Change comment:
There is no comment for this version
To version 1.3
edited by Andrea Omicini
on 16/06/2021 11:03
on 16/06/2021 11:03
Change comment:
There is no comment for this version
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Theses per1 +SelectPerStatus - Syntax
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki 2.11 +XWiki 1.0 - Content
-
... ... @@ -1,35 +1,17 @@ 1 -{{include reference="Theses.Environment"/}}{{include reference="Environment"/}}{{velocity}} 2 -#set( $thesisMenu = true ) 1 +#includeMacros("Main.MacroSheet") 2 +#includeMacros("Theses.MacroSheet") 3 +#includeMacros("Theses.GlobalVars") 4 + 3 3 #### get parameters 4 -## hypothesis: $thesisStatus set, default "Completed" 5 -## status parameter 6 -#set( $statusPar = $request.status.trim().toLowerCase() ) 7 -#if( $statusPar != '' && $allThesisStatuses.contains($statusPar) ) 8 - #set( $selectedStatus = $statusPar ) 9 -#else 10 - #set( $selectedStatus = 'all' ) 11 -#end 12 -##check velocity variable, takes precedence 13 -#if( $thesisStatus && $thesisStatus != '' && $allThesisStatuses.contains($thesisStatus.trim().toLowerCase()) ) 14 - #set( $selectedStatus = $thesisStatus.trim().toLowerCase() ) 15 -#end 16 -## set ordering field 17 -#if( $selectedStatus == "available" ) 18 - #set( $orderingDateFieldName = "availabilityDate" ) 19 -#elseif( $selectedStatus == "ongoing" ) 20 - #set( $orderingDateFieldName = "startDate" ) 21 -#else 22 - #set( $orderingDateFieldName = "endDate" ) 23 -#end 24 -## invariant: $thesisStatus set, $orderingDateFieldName set correspondingly 25 25 ## who 26 -#set( $userNamePar = $request.user ) 27 -#set( $supervisorNamePar = $request.supervisor ) 28 -#set( $cosupervisorNamePar = $request.cosupervisor ) 29 -#set( $contactNamePar = $request.contact ) 7 +#set( $userNamePar = $context.getRequest().getParameter("user") ) 8 +#set( $supervisorNamePar = $context.getRequest().getParameter("supervisor") ) 9 +#set( $cosupervisorNamePar = $context.getRequest().getParameter("cosupervisor") ) 10 +#set( $contactNamePar = $context.getRequest().getParameter("contact") ) 11 + 30 30 #### set default values 31 31 #set( $userSelected = false ) 32 -#set( $roleSelected = false ) 14 +#set( $roleSelected = false ) 33 33 #set( $userFirstName = "" ) 34 34 #set( $userLastName = "" ) 35 35 #set( $supervisorName = "" ) ... ... @@ -41,7 +41,7 @@ 41 41 #set( $contactName = "" ) 42 42 #set( $contactFirstName = "" ) 43 43 #set( $contactLastName = "" ) 44 - ##26 + 45 45 #### handle who & roles 46 46 ## 47 47 #if ( $userName || $userNamePar ) ## a user is specified for all roles ... ... @@ -72,7 +72,7 @@ 72 72 #end 73 73 #end 74 74 #if( $supervisor ) 75 - #set( $roleSelected = true ) 57 + #set( $roleSelected = true ) 76 76 #set( $supervisorName = $userName ) 77 77 #set( $supervisordoc = $xwiki.getDocument($supervisorName) ) 78 78 #set( $supervisorFirstName = $supervisordoc.display("first_name") ) ... ... @@ -92,48 +92,59 @@ 92 92 #set( $contactFirstName = $contactdoc.display("first_name") ) 93 93 #set( $contactLastName = $contactdoc.display("last_name") ) 94 94 #end 95 - ##96 -## $userSelected true and $roleSelected falsemeans one user for all roles77 + 78 +## $userSelected true means one user for all roles 97 97 ## $userSelected true and $roleSelected true for one user with one specific role 98 98 ## if $userSelected false and $roleSelected true mean at least one role with an assigned user 99 99 ## both false means all theses 100 -#if( $userSelected ) 101 - #if( $roleSelected ) 102 ->{{thesisStatus plural='yes' uppercase='yes'}}$thesisStatus{{thesisStatus}} / $userFirstName $userLastName / #if( $supervisor ){{stringEngIta eng="Supervisor" ita="Relatore"/}}#end#if( $cosupervisor ){{stringEngIta eng="Co-supervisor" ita="Correlatore"/}}#end#if( $contact ){{stringEngIta eng="Contact" ita="Contatto"/}}#end 103 - 104 - #else 105 ->{{thesisStatus plural='yes' uppercase='yes'}}$thesisStatus{{thesisStatus}} / $userFirstName $userLastName 106 - 107 - #end 82 +#if ($userSelected) 83 +1 #stringEnIt("Theses with ","Tesi con") $userFirstName $userLastName #if($supervisor)#stringEnIt("as a supervisor","come relatore")#end#if($cosupervisor)#stringEnIt("as a co-supervisor","come correlatore")#end#if($contact)#stringEnIt("as a contact","come contatto")#end #stringEnIt("in the #apice() space","nello spazio #apice()") 84 +#elseif ( $roleSelected ) 85 +1 #stringEnIt("Theses","Tesi") #if($supervisorLastName != "") #stringEnIt("supervised by","con relatore") $supervisorFirstName $supervisorLastName#if($cosupervisorLastName != "" || $contactLastName != ""), #end#end#if($cosupervisorLastName != "") #stringEnIt("co-supervised by","con correlatore") $cosupervisorFirstName $cosupervisorLastName#if($contactLastName != ""), #end#end #if($contactLastName != "") #stringEnIt("with contact","con contatto") $contactFirstName $contactLastName#end #stringEnIt("in the #apice() space","nello spazio #apice()") 108 108 #else 109 - #if( $roleSelected ) 110 ->{{thesisStatus plural='yes' uppercase='yes'}}$thesisStatus{{thesisStatus}}#if( $supervisorLastName != "" ) / $supervisorFirstName $supervisorLastName //({{stringEngIta eng="supervisor" ita="relatore"/}})//#end#if( $cosupervisorLastName != "" ) / $cosupervisorFirstName $cosupervisorLastName //({{stringEngIta eng="co-supervisor" ita="correlatore"/}})//#end#if( $contactLastName != "" ) / $contactFirstName $contactLastName //({{stringEngIta eng="Contact" ita="Contatto"/}})//#end 111 - 112 - #else 113 ->{{thesisStatus plural='yes' uppercase='yes'}}$thesisStatus{{thesisStatus}} 114 - 115 - #end 87 + 1 #stringEnIt("Theses","Tesi") #stringEnIt("in the #apice() space","nello spazio #apice()") 116 116 #end 117 -## 118 -#if( $cosupervisor ) 119 - #set( $roleSelectedFieldName = "coSupervisors" ) 120 -#elseif( $contact ) 121 - #set( $roleSelectedFieldName = "contact" ) 89 + 90 +## hypothesis: $thesisStatus set, default "Completed" 91 +## to do: get from parameter 92 +#if ($thesisStatus == "Available") 93 + #set ($orderingDateFieldName = "availabilityDate") 94 +#elseif ($thesisStatus == "Ongoing") 95 + #set ($orderingDateFieldName = "startDate") 122 122 #else 123 - #set( $roleSelectedFieldName = "supervisor" ) 97 + #set ($thesisStatus = "Completed") 98 + #set ($orderingDateFieldName = "endDate") 124 124 #end 125 -## 126 -#if( $selectedStatus == 'all' ) 127 - ALL STATUSES 100 +## 101 +#if ( $cosupervisor ) 102 + #set ( $roleSelectedFieldName = "coSupervisors" ) 103 +#elseif ( $contact ) 104 + #set ( $roleSelectedFieldName = "contact" ) 128 128 #else 129 - #if( $userSelected ) 130 - #if( $roleSelected ) 131 - #set ($sql = ", BaseObject as obj, StringProperty as prop0, LargeStringProperty as prop1, DateProperty as prop2 132 - 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 prop0.name = 'status' and prop1.name = '$roleSelectedFieldName' and prop2.name = '$orderingDateFieldName' and prop0.value = '$thesisStatus' and prop1.value like '%$userName%' order by prop2.value desc" ) 106 + #set ( $roleSelectedFieldName = "supervisor" ) 107 +#end 108 + 109 +1.1 #ThesisStatusesString($thesisStatus) 110 + 111 +#if ($userSelected) 112 + #if ( $roleSelected ) 113 + #set ($sql = ", BaseObject as obj, StringProperty as prop, LargeStringProperty as prop1, DateProperty as prop2 114 + where obj.name=doc.fullName and 115 + obj.className='Theses.ThesisClass' and 116 + obj.name<>'Theses.ThesisClassTemplate' and 117 + prop.id.id=obj.id and 118 + prop1.id.id=obj.id and 119 + prop2.id.id=obj.id and 120 + prop.name='status' and 121 + prop.value='$thesisStatus' and 122 + prop1.name='$roleSelectedFieldName' and 123 + prop2.name='$orderingDateFieldName' and 124 + prop1.value like '%$userName%' 125 + order by prop2.value desc") 133 133 #else 134 134 #set ($sql = ", BaseObject as obj, StringProperty as prop, LargeStringProperty as prop1, LargeStringProperty as prop2, LargeStringProperty as prop3, DateProperty as prop4 135 135 where obj.name=doc.fullName and 136 - obj.className='Theses.ThesisClass' and 129 + obj.className='Theses.ThesisClass' and 137 137 obj.name<>'Theses.ThesisClassTemplate' and 138 138 prop.id.id=obj.id and 139 139 prop1.id.id=obj.id and ... ... @@ -184,9 +184,8 @@ 184 184 order by prop1.value desc") 185 185 #end 186 186 #set($thesisFound = $xwiki.searchDocuments($sql)) 187 -## 188 -#foreach ($thesis in $thesisFound)#set($thesisDoc = $xwiki.getDocument($thesis)) 189 -* #thesisTitleLink($thesis)#if( $thesisDoc.getValue("studentUserName") != "" || $thesisDoc.getValue("studentName") != "" || ( $thesisDoc.getValue("studentFirstName") != "" && $thesisDoc.getValue("studentLastName") != "" ) ) //(#thesisAuthorLink($thesis)#if( $thesisDoc.display("endDate") != "" ), #thesisYear($thesis)#end)//#end 190 190 181 +#foreach ($thesis in $thesisFound)#set($thesisDoc = $xwiki.getDocument($thesis)) 182 +* [$thesisDoc.getValue('title') | $thesis] 191 191 #end 192 - {{/velocity}}184 +