Show last authors
1 {{include reference="Events.MacroSheet"/}}{{include reference="Events.GlobalVars"/}}{{velocity}}
2 #### Setting year variables
3 ## set from caller page: $firstYearEv, $lastYearEv
4 #set( $firstYear = $firstYearEv )
5 #set( $lastYear = $lastYearEv )
6 #### get parameters
7 ## when
8 #set( $yearPar = $context.getRequest().getParameter("year") )
9 #set( $firstYearPar = $context.getRequest().getParameter("from") )
10 #set( $lastYearPar = $context.getRequest().getParameter("to") )
11 ## who
12 #set( $userNamePar = $context.getRequest().getParameter("user") )
13 #set( $firstNamePar = $context.getRequest().getParameter("name") )
14 #set( $lastNamePar = $context.getRequest().getParameter("surname") )
15 #### handle who
16 #if ( $userName )
17 ## from a personal page, "XWiki.PersonalSpace" $userName form
18 #set( $onePerson = true )
19 #set( $userdoc = $xwiki.getDocument($userName) )
20 #set( $personFirstName = $userdoc.display("first_name") )
21 #set( $personLastName = $userdoc.display("last_name") )
22 #elseif ( $userNamePar )
23 ## from the URL, "user=PersonalSpace" parameter
24 #set( $userName = "XWiki.$userNamePar" )
25 #set( $onePerson = true)
26 #set( $userdoc = $xwiki.getDocument($userName) )
27 #set( $personFirstName = $userdoc.display("first_name") )
28 #set( $personLastName = $userdoc.display("last_name") )
29 #elseif ( $firstNamePar && $lastNamePar )
30 ## from the URL, "name=Firstname&surname=Lastname" parameter
31 #set( $onePerson = true )
32 #set( $personFirstName = $firstNamePar )
33 #set( $personLastName = $lastNamePar )
34 #else
35 #set( $oneAuthor = false )
36 #set( $personFirstName = "" )
37 #set( $personLastName = "" )
38 #end
39 #### handle when
40 #if ( $yearPar )
41 ## 'year' parameter takes precedence
42 #set( $year = $util.parseInt($yearPar) )
43 #set( $yearList = [$year] )
44 #set( $oneYear = true )
45 #else
46 #set( $oneYear = false )
47 #set( $yearList = [$lastYear..$firstYear] )
48 #if ( $firstYearPar )
49 #set( $yearFirst = $util.parseInt($firstYearPar) )
50 #if ( $yearList.contains($yearFirst) )
51 #set( $firstYear = $yearFirst )
52 #set( $yearList = [$lastYear..$firstYear] )
53 #end
54 #end
55 #if( $lastYearPar )
56 #set( $yearLast = $util.parseInt($lastYearPar) )
57 #if ( $yearList.contains($yearLast) )
58 #set( $lastYear = $yearLast )
59 #set( $yearList = [$lastYear..$firstYear] )
60 #end
61 #end
62 #if( $lastYear == $firstYear )
63 #set( $year = $lastYear )
64 #set( $yearList = [$year] )
65 #set( $oneYear = true )
66 #end
67 #end
68 #### Preparing the web page
69 ##
70 ## top anchor
71 ##{{id='top'/}}
72 ##
73 ## Page title
74 ##
75 >{{stringEngIta eng='Events' ita='Eventi'/}} / #if( $oneYear )$year#else$firstYear–$lastYear#end#if( $onePerson ) / $personFirstName $personLastName#end
76 {{id name="top"/}}
77 (((#if( !$oneYear )
78 #foreach( $year in $yearList )
79 #if( $velocityCount > 1 ) | #end[[$year>>||anchor=$year]]#end
80 #end)))
81 #set( $totalEvents = 0 )
82 #foreach( $year in $yearList )
83 #if( $onePerson )
84 #set ($sql = ", BaseObject as obj, DateProperty as prop, LargeStringProperty as prop1, LargeStringProperty as prop2, LargeStringProperty as prop3, LargeStringProperty as prop4, LargeStringProperty as prop5, LargeStringProperty as prop6, LargeStringProperty as prop7
85 where
86 obj.name=doc.fullName and
87 obj.className='Events.EventClass' and
88 obj.name<>'Events.EventClassTemplate' and
89 prop.id.id=obj.id and
90 prop1.id.id=obj.id and
91 prop2.id.id=obj.id and
92 prop3.id.id=obj.id and
93 prop4.id.id=obj.id and
94 prop5.id.id=obj.id and
95 prop6.id.id=obj.id and
96 prop7.id.id=obj.id and
97 prop.name='year' and
98 prop1.name='general_chair' and
99 prop2.name='program_chair' and
100 prop2.name='program_chair' and
101 prop3.name='organising_chair' and
102 prop4.name='pc_member' and
103 prop5.name='organiser' and
104 prop6.name='lecturer' and
105 prop7.name='other_role_player_1' and
106 year(prop.value) = $year and
107 ( prop1.value like '%$userName%' or
108 prop2.value like '%$userName%' or
109 prop3.value like '%$userName%' or
110 prop4.value like '%$userName%' or
111 prop5.value like '%$userName%' or
112 prop6.value like '%$userName%' or
113 prop7.value like '%$userName%' )
114 order by prop.value desc")
115 #else
116 #set ($sql = ", BaseObject as obj, DateProperty as prop
117 where
118 obj.name=doc.fullName and
119 obj.className='Events.EventClass' and
120 obj.name<>'Events.EventClassTemplate' and
121 prop.id.id=obj.id and
122 prop.name='year' and
123 year(prop.value) = $year
124 order by prop.value desc")
125 #end
126 ##
127 #set($eventsFound = $xwiki.searchDocuments($sql))
128 #if( $eventsFound.size() > 0 )
129 #set( $totalEvents = $totalEvents + $eventsFound.size() )
130 #if( !$oneYear )
131 {{id name="$year"/}}
132 == $year ==
133
134 #end
135 #foreach( $event in $eventsFound )
136 #if( $velocityCount > 1 ) | #end#eventAcrolink($event)#end
137 #if( !$oneYear )(% style='font-style:oblique;font-size:smaller;text-align:right;color:gray;margin-top:-0.5em;margin-bottom:-1,5em' %)((( ($eventsFound.size() #if( $eventsFound.size() > 1 ){{stringEngIta ita="eventi" eng="events"/}}#else{{stringEngIta ita="evento" eng="event"/}}#end / $year) [[[top]>>||anchor="top"]] [[[bottom]>>||anchor="bottom"]])))(%%)#end
138 #end
139 #end
140
141 >$totalEvents #if( $totalEvents > 1 ){{stringEngIta eng='events' ita='eventi'/}}#else{{stringEngIta eng='event' ita='evento'/}}#end / #if( $oneYear )$year#else$firstYear–$lastYear#end#if( $onePerson ) / $personFirstName $personLastName#end
142 {{id name="bottom"/}}
143 {{/velocity}}

Partita IVA: 01131710376 - Copyright © 2008-2021 APICe@DISI Research Group - PRIVACY