Show last authors
1 = {{stringEngIta eng="Bibliographic Services" ita="Servizi bibliografici"/}} =
2
3 {{include reference="Publications.Environment" excludeFirstHeading="true"/}}{{include reference="Environment" excludeFirstHeading="true"/}}{{velocity}}
4 #### get parameters
5 ## when
6 #set( $yearPar = $request.year )
7 #set( $firstYearPar = $request.from )
8 #set( $lastYearPar = $request.to )
9 ## who
10 #set( $userNamePar = $request.user.trim() )
11 #set( $firstNamePar = $request.name.trim() )
12 #set( $lastNamePar = $request.surname.trim() )
13 #set( $authorNamePar = $request.author.trim() )
14 #set( $editorNamePar = $request.editor.trim() )
15 ## test for presence / absence of service ID
16 ## yes/true no/false
17 #set( $idPar = $request.id.trim().toLowerCase() )
18 ##
19 ## handle test for presence
20 #set( $id = true )#if( $idPar == 'no' || $idPar == 'n' || $idPar == 'false' )#set( $id = false )#else#set( $idPar = 'true' )#end
21 ## service selection
22 #set( $servicePar = $request.service.toLowerCase() )
23 ##
24 #set( $serviceOk = false )
25 #if( $servicePar && $servicePar != "" )
26 #if( $serviceList.contains($servicePar) )
27 #set( $serviceOk = true )
28 #set( $serviceId = ${serviceIdMap.get($servicePar)} )
29 #set( $serviceField = ${serviceFieldMap.get($servicePar)} )
30 #else
31 {{warning}}“$servicePar” {{stringEngIta eng='is not a recognised service; please select one among the following ones' ita='non è un servizio riconosciuto; si può selezionare uno dei seguenti servizi'/}}{{/warning}}
32 #foreach( $service in $serviceList )
33 * $serviceNameMap.get($service) — [[{{code language='url'}}…/Publications/Services?service=$service{{/code}}>>||queryString='service=$service']]
34 #end
35 #end
36 #else
37 #foreach( $service in $serviceList )
38 * $serviceNameMap.get($service) — [[{{code language='url'}}…/Publications/Services?service=$service{{/code}}>>$doc||queryString='service=$service']]
39 #end
40 #end
41 ##
42 ## handle who
43 ## default: all users, all publications
44 #set( $allUsers = true )
45 #set( $selectedUserName = '' )
46 #set( $justAuthor = false )
47 #set( $justEditor = false )
48 #set( $authorSearchName = "" )
49 #set( $editorSearchName = "" )
50 ##
51 #if( $userName && $userName != "" )
52 ## from a personal page, "XWiki.UserName" $userName form
53 #set( $allUsers = false )
54 #set( $userdoc = $xwiki.getDocument($userName) )
55 #set( $selectedUserName = $userName )
56 #set( $displayFirstName = $userdoc.display("first_name") )
57 #set( $displayLastName = $userdoc.display("last_name") )
58 #set( $displayFullName = $displayFirstName + " " + $displayLastName )
59 #set( $authorSearchName = $displayLastName + ", " + $displayFirstName )
60 #set( $editorSearchName = $displayLastName + ", " + $displayFirstName )
61 #elseif( $userNamePar && $userNamePar != "" )
62 ## from the request, "user=UserName" parameter
63 #set( $allUsers = false )
64 #if( $$userNamePar.contains('XWiki.') )
65 #set( $userdoc = $xwiki.getDocument($userNamePar) )
66 #else
67 #set( $userdoc = $xwiki.getDocument("XWiki.$userNamePar") )
68 #end
69 #set( $selectedUserName = $userNamePar )
70 #set( $displayFirstName = $userdoc.display("first_name") )
71 #set( $displayLastName = $userdoc.display("last_name") )
72 #set( $displayFullName = $displayFirstName + " " + $displayLastName )
73 #set( $authorSearchName = $displayLastName + ", " + $displayFirstName )
74 #set( $editorSearchName = $displayLastName + ", " + $displayFirstName )
75 #elseif( $firstNamePar && $firstNamePar!= "" && $lastNamePar && $lastNamePar != "" )
76 ## from the request, "name=Firstname&surname=Lastname" parameter
77 #set( $allUsers = false )
78 #set( $displayFirstName = $firstNamePar )
79 #set( $displayLastName = $lastNamePar )
80 #set( $displayFullName = $displayFirstName + " " + $displayLastName )
81 #set( $authorSearchName = $displayLastName + ", " + $displayFirstName )
82 #set( $editorSearchName = $displayLastName + ", " + $displayFirstName )
83 #elseif( $authorNamePar && $authorNamePar != "" )
84 #set( $allUsers = false )
85 #set( $justAuthor = true )
86 #if( $authorNamePar.contains('XWiki.') )
87 #set( $authordoc = $xwiki.getDocument($authorNamePar) )
88 #else
89 #set( $authordoc = $xwiki.getDocument("XWiki.$authorNamePar") )
90 #end
91 #set( $displayFirstName = $authordoc.display("first_name") )
92 #set( $displayLastName = $authordoc.display("last_name") )
93 #set( $displayFullName = $displayFirstName + " " + $displayLastName )
94 #set( $authorSearchName = $displayLastName + ", " + $displayFirstName )
95 #set( $editorSearchName = "Just author" )
96 #elseif( $editorNamePar && $editorNamePar != "" )
97 #set( $allUsers = false )
98 #set( $justEditor = true )
99 #if( $editorNamePar.contains('XWiki.') )
100 #set( $editordoc = $xwiki.getDocument($editorNamePar) )
101 #else
102 #set( $editordoc = $xwiki.getDocument("XWiki.$editorNamePar") )
103 #end
104 #set( $displayFirstName = $editordoc.display("first_name") )
105 #set( $displayLastName = $editordoc.display("last_name") )
106 #set( $displayFullName = $displayFirstName + " " + $displayLastName )
107 #set( $authorSearchName = "Just editor" )
108 #set( $editorSearchName = $displayLastName + ", " + $displayFirstName )
109 #end
110 ## handle year variables based on author / editor
111 #if( $firstYearPub && $firstYearPub != '' && $lastYearPub && $lastYearPub != '' )#set( $firstYear = $firstYearPub )#set( $lastYear = $lastYearPub )#end
112 #if( $firstYearEd && $firstYearEd != '' && $lastYearEd && $lastYearEd != '' )
113 #if( $justEditor )#set( $firstYear = $firstYearEd )#set( $lastYear = $lastYearEd )#end
114 #elseif( $allUsers )
115 #if( $firstYearEd < $firstYear )#set( $firstYear = $firstYearEd )#end
116 #if( $lastYearEd > $lastYear )#set( $lastYear = $lastYearEd )#end
117 #end
118 ## handle when
119 #if( $yearPar )
120 ## 'year' parameter takes precedence
121 #set( $year = $util.parseInt($yearPar) )
122 #set( $yearList = [$year] )
123 #set( $oneYear = true )
124 #else
125 #set( $oneYear = false )
126 #set( $yearList = [$lastYear..$firstYear] )
127 #if ( $firstYearPar )
128 #set( $yearFirst = $util.parseInt($firstYearPar) )
129 #if ( $yearList.contains($yearFirst) )
130 #set( $firstYear = $yearFirst )
131 #set( $yearList = [$lastYear..$firstYear] )
132 #end
133 #end
134 #if( $lastYearPar )
135 #set( $yearLast = $util.parseInt($lastYearPar) )
136 #if( $yearList.contains($yearLast) )
137 #set( $lastYear = $yearLast )
138 #set( $yearList = [$lastYear..$firstYear] )
139 #end
140 #end
141 #if( $lastYear == $firstYear )
142 #set( $year = $lastYear )
143 #set( $yearList = [$year] )
144 #set( $oneYear = true )
145 #end
146 #end
147 ##
148 #if( !$serviceOk )
149 #stop
150 #end
151 #### output results
152 >{{stringEngIta eng="Publications" ita="Pubblicazioni"/}} **#if( $id ){{stringEngIta eng='with' ita='con'/}}#else{{stringEngIta eng='without' ita='senza'/}}#end $serviceId** / #if( $oneYear )$year#else$firstYear–$lastYear#end#if(!$allUsers) / $displayFullName#if( $justAuthor ) //(author)//#end#if( $justEditor ) //(editor)//#end#end{{id name="top"/}}
153 ##
154 #if(!$oneYear)
155 (% style="font-size: smaller; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach( $year in $yearList)#if($velocityCount > 1) | #end[[$year>>||anchor=$year]]#end)))
156 #end
157 ##
158 ##
159 #set( $autheditedTotal = 0 )
160 ##
161 #foreach( $year in $yearList )
162 #set($sqlid = ", BaseObject as obj, StringProperty as prop, LongProperty as prop1, StringProperty as prop2, LargeStringProperty as prop3, StringProperty as prop4 where obj.name = doc.fullName and obj.className = 'Publications.PublicationClass' and obj.name <> 'Publications.PublicationClassTemplate' and obj.name <> 'Publications.PublicationTemplate' and prop.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop3.id.id = obj.id and prop4.id.id = obj.id and prop.name = 'status' and prop.value = 'Published' and prop1.name = 'year' and prop1.value = $year and prop2.name = '$serviceField' and prop2.value <> '' and prop3.name = 'author' and prop4.name = 'editor' and ( prop3.value like '%$authorSearchName%' or (prop3.value = '' and prop4.value like '%$editorSearchName%') )" )
163 #set($sqlnoid = ", BaseObject as obj, StringProperty as prop, LongProperty as prop1, StringProperty as prop2, LargeStringProperty as prop3, StringProperty as prop4 where obj.name = doc.fullName and obj.className = 'Publications.PublicationClass' and obj.name <> 'Publications.PublicationClassTemplate' and obj.name <> 'Publications.PublicationTemplate' and prop.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop3.id.id = obj.id and prop4.id.id = obj.id and prop.name = 'status' and prop.value = 'Published' and prop1.name = 'year' and prop1.value = $year and prop2.name = '$serviceField' and prop2.value = '' and prop3.name = 'author' and prop4.name = 'editor' and ( prop3.value like '%$authorSearchName%' or (prop3.value = '' and prop4.value like '%$editorSearchName%') )" )
164 ## id parameter
165 #if( $id )
166 #set( $sql = $sqlid )
167 #else
168 #set( $sql = $sqlnoid )
169 #end
170 #set( $pubFound = $xwiki.searchDocuments($sql) )
171 #if( $pubFound.size() > 0 )
172 #set( $autheditedTotal = $autheditedTotal + $pubFound.size())
173 #if(!$oneYear)
174 (% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$year'/}}[[$year>>$doc.name||queryString='year=$year&service=$servicePar#if( $idPar != '' )&id=$idPar#end#if( $justAuthor )&author=$authorNamePar#elseif( $justEditor )&editor=$editorNamePar#elseif( !$allUsers )#if( $selectedUserName != '' )&user=$selectedUserName#else&name=$firstNamePar&surname=$lastNamePar#end#end']]
175 #end
176 #foreach( $pub in $pubFound )
177 #set( $pubDoc = $xwiki.getDocument($pub) )
178 * {{pubLinks year=no all=no $servicePar=yes}}$pubDoc{{/pubLinks}}
179 #end
180 #if(!$oneYear)
181 (% style="border-style:hidden solid solid hidden; border-color:$theme.borderColor; text-align:right; font-style:oblique; font-weight:normal; font-size:smaller; color:$theme.textSecondaryColor" %)|($pubFound.size() #if( $pubFound.size() > 1 ){{stringEngIta ita="pubblicazioni" eng="publications"/}}#else{{stringEngIta ita="pubblicazione" eng="publication"/}}#end #if( $id ){{stringEngIta eng='with' ita='con'/}}#else{{stringEngIta eng='without' ita='senza'/}}#end $serviceId {{stringEngIta ita="nel" eng="in"/}} $year#if(!$allUsers) / $displayFullName#if( $justAuthor ) – author#end#if( $justEditor ) – editor#end#end) [[[top]>>||anchor="top"]] [[[bottom]>>||anchor="bottom"]]
182 #end
183 #end
184 #end
185 (% style="text-align:right; font-style:oblique; font-weight:normal; font-size:smaller; color:$theme.textSecondaryColor" %)|($autheditedTotal #if( $autheditedTotal > 1 ){{stringEngIta ita="pubblicazioni" eng="publications"/}}#else{{stringEngIta ita="pubblicazione" eng="publication"/}}#end #if( $id ){{stringEngIta eng='with' ita='con'/}}#else{{stringEngIta eng='without' ita='senza'/}}#end $serviceId#if( $oneYear ) {{stringEngIta ita="nel" eng="in"/}} $year#end#if(!$allUsers) / $displayFullName#if( $justAuthor ) – author#end#if( $justEditor ) – editor#end#end) [[[top]>>||anchor="top"]] [[[bottom]>>||anchor="bottom"]]
186 {{id name="bottom"/}}
187 {{/velocity}}
Partita IVA: 01131710376 - Copyright © 2008-2022 APICe@DISI Research Group - PRIVACY