Show last authors
1 {{include document="Talks.MacroSheet"/}}{{include document="Talks.GlobalVars"/}}{{velocity filter="none"}}#set( $talkMenu = true )##
2 #### get parameters
3 ## when
4 #set( $yearPar = $context.getRequest().getParameter("year") )
5 #set( $firstYearPar = $context.getRequest().getParameter("from") )
6 #set( $lastYearPar = $context.getRequest().getParameter("to") )
7 ## who
8 #set( $userNamePar = $context.getRequest().getParameter("user") )
9 #set( $firstNamePar = $context.getRequest().getParameter("name") )
10 #set( $lastNamePar = $context.getRequest().getParameter("surname") )
11 #### handle who
12 #if( $userName )
13 ## from a personal page, "XWiki.PersonalSpace" $userName form
14 #set( $apiceAuthor = true )
15 #set( $oneAuthor = true )
16 #set( $userdoc = $xwiki.getDocument($userName) )
17 #set( $authorFirstName = $userdoc.display("first_name") )
18 #set( $authorLastName = $userdoc.display("last_name") )
19 #elseif( $userNamePar )
20 ## from the URL, "user=PersonalSpace" parameter
21 #set( $userName = "XWiki.$userNamePar" )
22 #set( $apiceAuthor = true )
23 #set( $oneAuthor = true)
24 #set( $userdoc = $xwiki.getDocument($userName) )
25 #set( $authorFirstName = $userdoc.display("first_name") )
26 #set( $authorLastName = $userdoc.display("last_name") )
27 #elseif( $firstNamePar && $lastNamePar )
28 ## from the URL, "name=Firstname&surname=Lastname" parameter
29 #set( $apiceAuthor = false )
30 #set( $oneAuthor = true )
31 #set( $authorFirstName = $firstNamePar )
32 #set( $authorLastName = $lastNamePar )
33 #else
34 #set( $apiceAuthor = false )
35 #set( $oneAuthor = false )
36 #set( $authorFirstName = "" )
37 #set( $authorLastName = "" )
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 page
69 ## top anchor
70 ## Page title
71 == {{stringEngIta eng="Talks" ita="Presentazioni"/}} / #if( $oneYear )$year#else$firstYear–$lastYear#end#if($oneAuthor) / $authorFirstName $authorLastName#end ==
72 {{id name="top"/}}
73 ## Page text
74 #if( !$oneYear )
75 >(% style="font-size:smaller" %)#foreach( $year in $yearList )#if( $velocityCount > 1 ) | #end[[$year>>||anchor=$year]]#end(%%)#end
76 #foreach( $year in $yearList )
77 #if( $oneAuthor )
78 #if( $apiceAuthor ) ## one APICe author
79 #set ($sql = ", BaseObject as obj, DateProperty as prop, LargeStringProperty as prop1
80 where
81 obj.name=doc.fullName and
82 obj.className='Talks.TalkClass' and
83 obj.name<>'Talks.TalkClassTemplate' and
84 prop.id.id=obj.id and
85 prop1.id.id=obj.id and
86 prop.name='date' and
87 year(prop.value) = $year and
88 prop1.name='authors' and
89 prop1.value like '%$userName%'
90 order by prop.value desc")
91 #else ## one non APICe author
92 #set( $sql = ", BaseObject as obj, DateProperty as prop, StringProperty as prop1
93 where
94 obj.name=doc.fullName and
95 obj.className='Talks.TalkClass' and
96 obj.name<>'Talks.TalkClassTemplate' and
97 obj.name<>'Talks.TalkTemplate' and
98 prop.id.id=obj.id and
99 prop1.id.id=obj.id and
100 prop.name='date' and
101 year(prop.value) = $year and
102 prop1.name='externalAuthors' and
103 prop1.value like '%$authorLastName, $authorFirstName%'
104 order by prop.value desc" )
105 #end
106 #else ##all authors
107 #set( $sql = ", BaseObject as obj, DateProperty as prop
108 where
109 obj.name=doc.fullName and
110 obj.className='Talks.TalkClass' and
111 obj.name<>'Talks.TalkClassTemplate' and
112 obj.name<>'Talks.TalkTemplate' and
113 prop.id.id=obj.id and
114 prop.name='date' and
115 year(prop.value) = $year
116 order by prop.value desc" )
117 #end
118 #set( $talkFound = $xwiki.searchDocuments($sql) )
119 #if( $talkFound.size()>0 )
120 #if( !$oneYear )
121 {{id name="$year"/}}
122 === $year ===
123 #end
124 #foreach( $talkDoc in $talkFound )
125 * #talkTDASInline($talkDoc) // //
126 #end
127 (% style="display:block;font-style:oblique;font-size:smaller;text-align:right;color:gray;margin-top:-1.5em;margin-bottom:-2.5em" %)($talkFound.size() {{stringEngIta ita="presentazioni nel" eng="talks in"/}} $year) [[[back to top]>>||anchor="top"]](%%)#end#end{{/velocity}}

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