Codice sorgente Wiki di Per stato
author | version | line-number | content |
---|---|---|---|
![]() |
80.4 | 1 | {{velocity}} |
![]() |
94.1 | 2 | {{html wiki="true" clean="false"}} |
![]() |
93.1 | 3 | #template('apice_macros.vm') |
4 | #setobjectspace("Theses") | ||
![]() |
95.1 | 5 | #template('apice_thesis_macros.vm') |
![]() |
86.1 | 6 | #### SET PARAMETERS / START |
![]() |
84.1 | 7 | #template('apice_user_param.vm') |
![]() |
80.1 | 8 | ## |
9 | #### STATUS / START | ||
10 | ## $statusList gets the list of statuses to be shown | ||
11 | ## $oneStatus true if just one status to be shown | ||
12 | #if( $request.status && $request.status.trim() != "" ) | ||
13 | #set( $statusPar = $request.status.trim().toLowerCase() ) | ||
![]() |
80.4 | 14 | #if( $thesisStatuses.contains($statusPar) ) |
![]() |
80.1 | 15 | ## 'status' parameter is an admissible thesis status value |
16 | #set( $statusList = [$statusPar]) | ||
17 | #set( $oneStatus = true ) | ||
18 | #set( $status = $statusPar ) | ||
![]() |
27.2 | 19 | #else |
![]() |
80.1 | 20 | ## 'status' parameter is not an admissible thesis status value |
21 | {{warning}}$statusPar is not an admissible status for APICe theses{{/warning}} | ||
22 | #stop | ||
![]() |
1.1 | 23 | #end |
![]() |
80.1 | 24 | #else |
25 | ## default: all statuses | ||
![]() |
80.4 | 26 | #set( $statusList = $showcaseThesisStatuses ) |
![]() |
80.1 | 27 | #set( $oneStatus = false ) |
28 | #set( $status = "" ) | ||
![]() |
1.1 | 29 | #end |
![]() |
80.1 | 30 | ## set ordering field |
31 | #if( $status == "available" ) | ||
32 | #set( $orderingDate = "available" ) | ||
33 | #elseif( $status == "ongoing" ) | ||
34 | #set( $orderingDate = "start" ) | ||
![]() |
73.1 | 35 | #else |
![]() |
80.1 | 36 | ## default for no selected status, too |
37 | #set( $orderingDate = "end" ) | ||
![]() |
73.1 | 38 | #end |
![]() |
80.1 | 39 | ## invariant: $oneStatus set, $status, $statusList & $orderingDate set accordingly |
40 | #### STATUS / END | ||
41 | ## | ||
42 | #### ROLE / START | ||
43 | ## $oneRole true if just one role to be shown | ||
![]() |
39.2 | 44 | ## $oneRole has meaning only if $oneUser |
45 | ## if $oneUser, $oneRole false means one user for all roles | ||
46 | ## if $oneUser, $oneRole true means one specific role for one user selected | ||
47 | ## if $oneUser is false, $oneRole means nothing -- so all users, all roles / just status | ||
![]() |
80.1 | 48 | #if( $oneUser && $request.role && $request.role.trim() != "" ) |
49 | #set( $rolePar = $request.role.trim().toLowerCase() ) | ||
![]() |
84.2 | 50 | #if( $thesisRoles.contains($rolePar) ) |
![]() |
80.1 | 51 | ## 'role' parameter is an admissible thesis role value |
52 | #set( $roleList = [$rolePar]) | ||
53 | #set( $oneRole = true ) | ||
54 | #set( $role = $rolePar ) | ||
55 | #else | ||
56 | ## 'role' parameter is not an admissible thesis role value | ||
57 | {{warning}}$rolePar is not an admissible role for APICe theses{{/warning}} | ||
58 | #stop | ||
59 | #end | ||
60 | #else | ||
61 | ## default: all roles | ||
![]() |
84.2 | 62 | #set( $roleList = $thesisRoles ) |
![]() |
80.1 | 63 | #set( $oneRole = false ) |
64 | #set( $role = "" ) | ||
65 | #end | ||
66 | ## $oneUser and $oneRole set properly, other related variables set accordingly | ||
![]() |
86.1 | 67 | #### SET PARAMETERS / END |
![]() |
27.2 | 68 | ## |
![]() |
86.1 | 69 | ## DATA STRUCTURES / START |
![]() |
80.1 | 70 | #set( $itemMap = {} ) |
71 | #set( $itemNo = 0 ) | ||
72 | #foreach( $status in $statusList ) | ||
![]() |
85.1 | 73 | #set( $query = ", BaseObject as objThesis, DateProperty as propDate, StringProperty as propStatus, LargeStringProperty as propSupervisor, LargeStringProperty as propCosupervisor, LargeStringProperty as propContact |
![]() |
95.1 | 74 | where objThesis.name = doc.fullName and objThesis.className = '${mainSpace}.Class' and objThesis.name <> '${objectPool}.Template' and propDate.id.id = objThesis.id and propStatus.id.id = objThesis.id and propSupervisor.id.id = objThesis.id and propCosupervisor.id.id = objThesis.id and propContact.id.id = objThesis.id and propStatus.name = 'status' and propStatus.value = '$status' and propSupervisor.name = 'supervisors' and propCosupervisor.name = 'cosupervisors' and propContact.name = 'contacts' #if( $role == 'supervisor' )and propSupervisor.value like '$userString'#end #if( $role == 'cosupervisor' )and propCosupervisor.value like '$userString'#end #if( $role == 'contact' ) and propContact.value like '$userString'#end #if( $oneUser && !$oneRole ) and ( propSupervisor.value like '$userString' or propCosupervisor.value like '$userString' or propContact.value like '$userString' )#end and propDate.name = '$orderingDate' order by propDate.value desc" ) |
![]() |
80.1 | 75 | ## do query |
76 | #set( $itemFound = $xwiki.searchDocuments($query) ) | ||
77 | ## set counters | ||
78 | #set( $itemStatusNo = $itemFound.size() ) | ||
79 | #if( $itemStatusNo > 0 ) | ||
80 | #set( $itemMap[$status] = $itemFound ) | ||
81 | #set( $itemNo = $itemNo + $itemStatusNo ) | ||
![]() |
19.1 | 82 | #end |
![]() |
1.12 | 83 | #end |
![]() |
86.1 | 84 | ## DATA STRUCTURES / END |
![]() |
80.1 | 85 | ## |
![]() |
86.1 | 86 | ## DISPLAY / START |
![]() |
80.1 | 87 | ## page subtitle |
![]() |
86.1 | 88 | <div class="mainheader"> |
89 | $itemNo | ||
90 | #if( $itemNo == 1 ) | ||
91 | #if( $oneStatus ) | ||
92 | {{thesisStatus plural="false" uppercase="false"}}$status{{/thesisStatus}} | ||
93 | #else | ||
94 | $services.localization.render('thesis').toLowerCase() | ||
95 | #end | ||
96 | #else | ||
97 | #if( $oneStatus ) | ||
98 | {{thesisStatus plural="true" uppercase="false"}}$status{{/thesisStatus}} | ||
99 | #else | ||
100 | $services.localization.render('theses').toLowerCase() | ||
101 | #end | ||
102 | #end | ||
103 | #if( $oneUser ) | ||
104 | #if( $oneRole ) | ||
105 | <span class="textsecondary"> / </span> | ||
![]() |
91.3 | 106 | {{thesisRole short="true" plural="false" uppercase="false" short="true"}}$role{{/thesisRole}} |
![]() |
86.1 | 107 | #end |
108 | <span class="textsecondary"> / </span> | ||
109 | $userFirstName $userLastName | ||
110 | #end | ||
111 | </div> | ||
![]() |
80.1 | 112 | ## stop if no thesis is found |
113 | #if( $itemNo == 0 || $itemMap.keySet().size() == 0 ) | ||
114 | ## redundant double check | ||
115 | #stop | ||
116 | #end | ||
117 | ## some theses found | ||
118 | ## page index | ||
119 | #if( $itemMap.keySet().size() > 1 ) | ||
120 | ## found more than one status | ||
![]() |
86.1 | 121 | <div class="mainselectbar" id="index"> |
122 | #foreach( $status in $itemMap.keySet() ) | ||
123 | #if( !$foreach.first ) | ||
124 |  •  | ||
125 | #end | ||
126 | [[{{thesisStatus plural="true" uppercase="false" short="true"}}$status{{/thesisStatus}}>>||anchor="$status"#if( $oneRole ) queryString="role=$role"#end]] | ||
127 | #end | ||
128 | </div> | ||
![]() |
88.1 | 129 | #end |
![]() |
80.1 | 130 | ## theses displayed per status |
131 | #foreach( $status in $itemMap.keySet() ) | ||
![]() |
88.1 | 132 | ## status top / start |
133 | <div class="mainselectseparator"> | ||
134 | <a class="mainselectseparatorlink" id="$status" href=$xwiki.getURL($doc,"view","status=$status#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end#if( $oneRole )&role=$role#end")> | ||
![]() |
90.1 | 135 | {{thesisStatus plural="true" uppercase="false"}}$status{{/thesisStatus}} |
![]() |
88.1 | 136 | </a> |
137 | </div> | ||
138 | ## status top / end | ||
139 | ## | ||
![]() |
90.2 | 140 | ## thesis display / start |
![]() |
81.1 | 141 | <div style="font-style: normal"><ul> |
![]() |
88.1 | 142 | #foreach( $item in $itemMap[$status] ) |
143 | <li>#thesisyear($item)</li> | ||
144 | #end | ||
![]() |
81.1 | 145 | </ul></div> |
![]() |
90.2 | 146 | ## thesis display / end |
![]() |
88.1 | 147 | ## |
![]() |
90.2 | 148 | ## status bottom / start |
![]() |
88.1 | 149 | <div #if( $foreach.last )id="bottom"#end class="mainselectbottom"> |
![]() |
80.1 | 150 | #set( $itemStatusNo = $itemMap[$status].size() ) |
![]() |
88.1 | 151 | $itemStatusNo |
![]() |
91.4 | 152 | #if( $itemStatusNo == 1 ) |
153 | $services.localization.render('thesis').toLowerCase() | ||
![]() |
88.1 | 154 | #else |
![]() |
91.4 | 155 | $services.localization.render('theses').toLowerCase() |
![]() |
88.1 | 156 | #end |
![]() |
91.4 | 157 | #if( $oneRole ) |
![]() |
92.2 | 158 | $services.localization.render('ascome').toLowerCase() {{thesisRole short="true" plural="false" uppercase="false"}}$role{{/thesisRole}} |
![]() |
91.4 | 159 | #end |
![]() |
88.1 | 160 | <span class="textsecondary"> / </span> |
![]() |
91.2 | 161 | {{thesisStatus short="true" plural="true" uppercase="false"}}$status{{/thesisStatus}} |
![]() |
88.1 | 162 |  •  |
163 | #anchorlinks() | ||
![]() |
89.1 | 164 | </div> |
165 | ## status bottom / end | ||
![]() |
80.1 | 166 | #end |
![]() |
89.1 | 167 | ## DISPLAY / END |
![]() |
86.1 | 168 | {{/html}} |
169 | {{/velocity}}{{pageDisplay sort="objectservice"/}} |