Show last authors
1 {{include document="Talks.MacroSheet"/}}{{include document="Talks.GlobalVars"/}}{{velocity}}#set( $talkMenu = true )##
2 #### get parameters
3 ## who
4 #set( $userNamePar = $context.getRequest().getParameter("user") )
5 #set( $firstNamePar = $context.getRequest().getParameter("name") )
6 #set( $lastNamePar = $context.getRequest().getParameter("surname") )
7 ## category
8 #set($categoryPar = $context.getRequest().getParameter("category"))
9 #### handle who
10 #if( $userName )
11 ## from a personal page, "XWiki.UserName" $userName form
12 #set( $apiceAuthor = true )
13 #set( $oneAuthor = true )
14 #set( $userdoc = $xwiki.getDocument($userName) )
15 #set( $authorFirstName = $userdoc.display("first_name") )
16 #set( $authorLastName = $userdoc.display("last_name") )
17 #elseif( $userNamePar )
18 ## from the URL, "user=UserName" parameter
19 #set( $userName = "XWiki.$userNamePar" )
20 #set( $apiceAuthor = true )
21 #set( $oneAuthor = true)
22 #set( $userdoc = $xwiki.getDocument($userName) )
23 #set( $authorFirstName = $userdoc.display("first_name") )
24 #set( $authorLastName = $userdoc.display("last_name") )
25 #elseif( $firstNamePar && $lastNamePar )
26 ## from the URL, "name=Firstname&surname=Lastname" parameter
27 #set( $apiceAuthor = false )
28 #set( $oneAuthor = true )
29 #set( $authorFirstName = $firstNamePar )
30 #set( $authorLastName = $lastNamePar )
31 #else
32 #set( $apiceAuthor = false )
33 #set( $oneAuthor = false )
34 #set( $authorFirstName = "" )
35 #set( $authorLastName = "" )
36 #end
37 #### handle category
38 #set($categoryRange = ['Talk','Invited','Seminar','Lecture','Tutorial','Project','Informal','Internal','PhD','Poster','Other'])
39 #set($oneCategory = false)
40 #if( !$categoryPar || $categoryPar.toLowerCase() =="all" )
41 #set($categoryList = $categoryRange)
42 #elseif( $categoryRange.contains($categoryPar) )
43 #set($categoryList = [$categoryPar])
44 #set($oneCategory = true)
45 #end
46 #### Preparing page
47 ## Page title
48
49 >{{stringEngIta eng="Talks" ita="Presentazioni"/}}#if( $oneCategory ) / #talkCategoriesString($categoryPar)#end#if($oneAuthor) / $authorFirstName $authorLastName#end
50 {{id name="top"/}}
51 ## Page text
52 #if (!$oneCategory)
53
54 (% style="font-size:smaller" %)#foreach($category in $categoryList)#if ($velocityCount > 1) | #end[[#talkCategoriesString($category)>>||anchor=$category]]#end(%%)#end
55 ##
56 ## Document queries, one for each category
57 ##
58 #foreach ($category in $categoryList)
59 #if($oneAuthor)
60 #if($apiceAuthor) ## one APICe author
61 #set ($sql = ", BaseObject as obj, DateProperty as prop, LargeStringProperty as prop1, StringProperty as prop2
62 where
63 obj.name=doc.fullName and
64 obj.className='Talks.TalkClass' and
65 obj.name<>'Talks.TalkClassTemplate' and
66 prop.id.id=obj.id and
67 prop1.id.id=obj.id and
68 prop2.id.id=obj.id and
69 prop.name='date' and
70 prop1.name='authors' and
71 prop1.value like '%$userName%' and
72 prop2.name='category' and
73 prop2.value='$category'
74 order by prop.value desc")
75 #else ## one non APICe author
76 #set ($sql = ", BaseObject as obj, DateProperty as prop, StringProperty as prop1, StringProperty as prop2
77 where
78 obj.name=doc.fullName and
79 obj.className='Talks.TalkClass' and
80 obj.name<>'Talks.TalkClassTemplate' and
81 prop.id.id=obj.id and
82 prop1.id.id=obj.id and
83 prop2.id.id=obj.id and
84 prop.name='date' and
85 prop1.name='externalAuthors' and
86 prop1.value like '%$authorLastName, $authorFirstName%' and
87 prop2.name='category' and
88 prop2.value='$category'
89 order by prop.value desc")
90 #end
91 #else ##all authors
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 prop.id.id=obj.id and
98 prop1.id.id=obj.id and
99 prop.name='date' and
100 prop1.name='category' and
101 prop1.value='$category'
102 order by prop.value desc")
103 #end
104 ##
105 #set($talkFound = $xwiki.searchDocuments($sql))
106 #if ($talkFound.size() > 0)
107 #if( !$oneCategory ){{id name=$category/}}
108 === #talkCategoriesString($category) ===
109 #end
110 #foreach ($talk in $talkFound)
111 * #talkTDASInline($talk) // //
112 #end
113
114 (% style="font-style:oblique;font-size:smaller;text-align:right;color:gray;margin-top:-.5em;margin-bottom:-2em" %)(((($talkFound.size() #talkcategoriesstring($category)) [[[top]>>||anchor="top"]])))(%%)
115
116 #end
117 #end
118 {{/velocity}}

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