Show last authors
1 {{include reference="Talks.Environment" excludeFirstHeading="true"/}}{{include reference="Environment" excludeFirstHeading="true"/}}{{velocity}}
2 #set( $talkMenu = true )
3 #### get parameters
4 ## who
5 #set( $userNamePar = $request.user.trim() )
6 #set( $firstNamePar = $request.name.trim() )
7 #set( $lastNamePar = $request.surname.trim() )
8 ## category
9 #set( $categoryPar = $request.category.trim().toLowerCase() )
10 #### handle who
11 #if( $userName )
12 ## from a personal page, "XWiki.$userName" $userName form
13 #if( !$xwiki.exists( $userName ) )
14 {{warning}}User $userName does not exist{{/warning}}
15 #stop
16 #end
17 #set( $apiceUser = true )
18 #set( $oneUser = true )
19 #set( $userdoc = $xwiki.getDocument($userName) )
20 #set( $userFirstName = $userdoc.display("first_name") )
21 #set( $userLastName = $userdoc.display("last_name") )
22 #elseif( $userNamePar )
23 ## from the URL, "user=$userNamePar" parameter
24 #if( $userNamePar.contains('XWiki.') )
25 #set( $userName = "$userNamePar" )
26 #else
27 #set( $userName = "XWiki.$userNamePar" )
28 #end
29 #if( !$xwiki.exists( $userName ) )
30 {{warning}}User $userNamePar does not exist{{/warning}}
31 #stop
32 #end
33 #set( $apiceUser = true )
34 #set( $oneUser = true)
35 #set( $userdoc = $xwiki.getDocument($userName) )
36 #set( $userFirstName = $userdoc.display("first_name") )
37 #set( $userLastName = $userdoc.display("last_name") )
38 #elseif( $firstNamePar && $lastNamePar )
39 ## from the URL, "name=Firstname&surname=Lastname" parameter
40 #set( $apiceUser = false )
41 #set( $oneUser = true )
42 #set( $userFirstName = $firstNamePar )
43 #set( $userLastName = $lastNamePar )
44 #else
45 #set( $apiceUser = false )
46 #set( $oneUser = false )
47 #set( $userFirstName = "" )
48 #set( $userLastName = "" )
49 #end
50 #### handle category
51 #set( $oneCategory = false )
52 #if( $allCategories.contains($categoryPar) )
53 #set($oneCategory = true)
54 #set($categoryList = [$categoryPar])
55 #else
56 #set( $categoryList = $allCategories )
57 #end
58 #### Preparing page
59 ## Page title
60 >#if( $oneCategory )**{{talkCategory uppercase='true' plural='true'}}$categoryPar{{/talkCategory}}**#else{{stringEngIta eng="Talks" ita="Presentazioni"/}}#end#if( $oneUser ) / $userFirstName $userLastName#end{{id name="top"/}}
61 ##
62 #if (!$oneCategory)
63 (% style="font-size: smaller; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach( $category in $categoryList )#if ($velocityCount > 1) | #end[[{{talkCategory plural='true'}}$category{{/talkCategory}}>>||anchor=$category]]#end)))
64 #end
65 ##
66 #set( $talkNo = 0 )
67 #foreach( $category in $categoryList )
68 #if( $oneUser )
69 #if( $apiceUser )
70 ## one APICe author
71 #set( $sql = ", BaseObject as obj, DateProperty as prop0, StringProperty as prop1, LargeStringProperty as prop2, LargeStringProperty as prop3
72 where
73 obj.name = doc.fullName and
74 obj.className = 'Talks.TalkClass' and
75 obj.name <> 'Talks.TalkClassTemplate' and
76 obj.name <> 'Talks.TalkTemplate' and
77 prop0.id.id = obj.id and
78 prop1.id.id = obj.id and
79 prop2.id.id = obj.id and
80 prop3.id.id = obj.id and
81 prop0.name = 'date' and
82 prop1.name = 'category' and
83 prop2.name = 'authors' and
84 prop3.name = 'speakers' and
85 lower(prop1.value) = '$category' and
86 ( prop2.value like '%$userName%' or
87 prop3.value like '%$userName%' )
88 order by prop0.value desc" )
89 #else
90 ## one non APICe user
91 #set( $sql = ", BaseObject as obj, DateProperty as prop0, StringProperty as prop1, StringProperty as prop2, StringProperty as prop3
92 where
93 obj.name = doc.fullName and
94 obj.className = 'Talks.TalkClass' and
95 obj.name <> 'Talks.TalkClassTemplate' and
96 obj.name <> 'Talks.TalkTemplate' and
97 prop0.id.id = obj.id and
98 prop1.id.id = obj.id and
99 prop2.id.id = obj.id and
100 prop3.id.id = obj.id and
101 prop0.name = 'date' and
102 prop1.name = 'category' and
103 prop2.name = 'externalAuthors' and
104 prop3.name = 'externalSpeakers' and
105 lower(prop1.value) = '$category' and
106 ( lower(prop2.value) like lower('%$userLastName, $userFirstName%') or
107 lower(prop3.value) like lower('%$userLastName, $userFirstName%') )
108 order by prop0.value desc" )
109 #end
110 #else
111 ##all users
112 #set( $sql = ", BaseObject as obj, DateProperty as prop0, StringProperty as prop1
113 where
114 obj.name = doc.fullName and
115 obj.className = 'Talks.TalkClass' and
116 obj.name <> 'Talks.TalkClassTemplate' and
117 obj.name <> 'Talks.TalkTemplate' and
118 prop0.id.id = obj.id and
119 prop1.id.id = obj.id and
120 prop0.name = 'date' and
121 prop1.name = 'category' and
122 lower(prop1.value) = '$category'
123 order by prop0.value desc" )
124 #end
125 ##
126 #set( $talkFound = $xwiki.searchDocuments($sql) )
127 #set( $talkSortNo = $talkFound.size() )
128 #if( $talkSortNo > 0 )
129 #if( !$oneCategory )
130 (% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$category'/}}[[{{talkCategory uppercase='true' plural='true'}}$category{{/talkCategory}}>>$doc.name||queryString='category=$category#if( $oneUser )#if( $apiceUser )&user=$userName#else&name=$userFirstName&surname=$userLastName#end#end']]
131 #end
132 #foreach( $talk in $talkFound )
133 #set( $talkNo = $talkNo + 1 )
134 (% style="border-style:hidden hidden hidden hidden'%)|(% style="border-style:hidden hidden hidden hidden" %){{talk inline='false' linked='title'}}$talk{{/talk}}
135 #end
136 (% style="#if( !$oneCategory )border-style:hidden solid solid hidden; border-color:$theme.borderColor;#end text-align:right; font-style:oblique; font-size:smaller" %)|($talkSortNo {{talkCategory uppercase='false' plural='true'}}$category{{/talkCategory}}) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]]
137 #end
138 #end
139 #if( !$oneCategory )(% style="text-align:right; font-style:oblique; font-size:smaller" %)|($talkNo #if( $talkNo == 1 ){{stringEngIta eng='talk' ita='presentazione'/}}#else{{stringEngIta eng='talks' ita='presentazioni'/}}#end) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]]
140 #end
141 {{/velocity}}
142 {{id name="bottom"/}}
Partita IVA: 01131710376 - Copyright © 2008-2022 APICe@DISI Research Group - PRIVACY