Show last authors
1 = {{italiano}}Pubblicazioni per tipo e anno{{/italiano}}{{english}}Publications per Sort & Year{{/english}} =
2
3 {{include reference="Publications.Environment" excludeFirstHeading="true"/}}{{include reference="Environment" excludeFirstHeading="true"/}}{{velocity}}
4 #set( $publicationMenu = true )
5 #### get parameters
6 ## which sort
7 #set( $sortPar = $xcontext.request.sort.trim().toLowerCase() )
8 ## when
9 #set( $yearPar = $request.year.trim() )
10 #set( $firstYearPar = $request.from.trim() )
11 #set( $lastYearPar = $request.to.trim() )
12 ## who
13 #set( $userNamePar = $request.user.trim() )
14 #set( $firstNamePar = $request.name.trim() )
15 #set( $lastNamePar = $request.surname.trim() )
16 #### handle sort
17 ## $oneSort false gets a list of sorts, true just one
18 #set( $oneSort = false )
19 ## $sortList gets the list of sorts to be shown
20 ## default: all sorts
21 #set( $sortList = $allSorts )
22 #if( $sortPar != "all" )
23 #if( $allSorts.contains($sortPar) )
24 ## 'sort' parameter is an admissible publication sort value
25 #set( $oneSort = true )
26 #set( $sortList = [$sortPar])
27 #if( $editedSorts.contains($sortPar) )
28 #set( $firstYearPub = $firstYearEd )
29 #set( $lastYearPub = $lastYearEd )
30 #end
31 #end
32 #end
33 #### handle who
34 #if( $firstNamePar && $lastNamePar )
35 ## from the URL, "name=Firstname&surname=Lastname" parameter
36 #set( $oneAuthor = true )
37 #set( $authorFirstName = $firstNamePar )
38 #set( $authorLastName = $lastNamePar )
39 #elseif( $userName )
40 ## from a personal page, "XWiki.$userName" $userName form
41 #set( $oneAuthor = true )
42 #set( $userdoc = $xwiki.getDocument($userName) )
43 #set( $authorFirstName = $userdoc.display("first_name") )
44 #set( $authorLastName = $userdoc.display("last_name") )
45 #elseif( $userNamePar )
46 ## from the URL, "user=$userNamePar" parameter
47 #if( $xwiki.exists("XWiki.$userNamePar") )
48 #set( $oneAuthor = true )
49 #set( $userdoc = $xwiki.getDocument("XWiki.$userNamePar") )
50 #set( $authorFirstName = $userdoc.display("first_name") )
51 #set( $authorLastName = $userdoc.display("last_name") )
52 #else
53 #if( $xcontext.language == 'it' )
54 {{warning}}L'utente “$userNamePar” non esiste{{/warning}}
55 #else
56 {{warning}}User “$userNamePar” does not exist{{/warning}}
57 #end
58 #stop
59 #end
60 #else
61 #set( $oneAuthor = false )
62 #set( $authorFirstName = "" )
63 #set( $authorLastName = "" )
64 #end
65 #### handle when
66 #if( $yearPar )
67 ## 'year' parameter takes precedence
68 #set( $year = $mathtool.toInteger($yearPar) )
69 #set( $yearList = [$year] )
70 #set( $oneYear = true )
71 #else
72 #set( $oneYear = false )
73 #set( $yearList = [$lastYearPub..$firstYearPub] )
74 #if( $firstYearPar )
75 #set( $yearFirst = $util.parseInt($firstYearPar) )
76 #if( $yearList.contains($yearFirst) )
77 #set( $firstYearPub = $yearFirst )
78 #set( $yearList = [$lastYearPub..$firstYearPub] )
79 #end
80 #end
81 #if( $lastYearPar )
82 #set( $yearLast = $util.parseInt($lastYearPar) )
83 #if( $yearList.contains($yearLast) )
84 #set( $lastYearPub = $yearLast )
85 #set( $yearList = [$lastYearPub..$firstYearPub] )
86 #end
87 #end
88 #if( $lastYearPub == $firstYearPub )
89 #set( $year = $lastYearPub )
90 #set( $yearList = [$year] )
91 #set( $oneYear = true )
92 #end
93 #end
94 ## output results
95 >#if( $oneSort ){{pubSort plural="true" uppercase="true"}}$sortPar{{/pubSort}}#else{{stringEngIta eng="Publications" ita="Pubblicazioni"/}}#end / **#if( $oneYear )$year#else$firstYearPub–$lastYearPub#end**#if( $oneAuthor ) / $authorFirstName $authorLastName#end{{id name="top"/}}
96 ##
97 #if( !$oneSort )
98 (% style="font-size: smaller; padding:1em 1.5em 0.25em 1.5em; background-color:$theme.highlightColor" %)(((#foreach( $sort in $sortList )#if ($velocityCount > 1) | #end [[{{pubSort plural="true" uppercase="false"}}$sort{{/pubSort}}>>||anchor="$sort"]]#end)))
99 #elseif( !$oneYear )
100 (% 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)))
101 #end
102 ##
103 #set( $authNo = 0 )
104 #foreach( $sort in $sortList )
105 #set( $authSortNo = 0 )
106 #set( $sortDisplayed = false )
107 #foreach( $year in $yearList )
108 #set( $authSortYearNo = 0 )
109 #set( $sortYearDisplayed = false )
110 #set( $hql1 = ", 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 = 'sort' and prop2.value = '$sort' and prop3.name = 'author' and prop4.name = 'editor' " )
111 #if( $oneAuthor )
112 #if( $editedSorts.contains($sort) )
113 #set( $hql2 = "and prop3.value = '' and prop4.value <> '' and prop4.value like '%$authorLastName, $authorFirstName%' ")
114 #else
115 #set( $hql2 = "and prop3.value <> '' and prop3.value like '%$authorLastName, $authorFirstName%' ")
116 #end
117 #else
118 #if( $editedSorts.contains($sort) )
119 #set( $hql2 = "and prop3.value = '' and prop4.value <> '' ")
120 #else
121 #set( $hql2 = "and prop3.value <> '' ")
122 #end
123 #end
124 #set( $hql = $hql1 + $hql2 )
125 #set( $pubFound = $xwiki.searchDocuments($hql) )
126 ## sort / year looked for
127 ## something found?
128 #if( $pubFound.size() > 0 )
129 ## display some title?
130 #if( $oneSort )
131 #if( !$oneYear )
132 (% 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&sort=$sort']]
133 #end
134 #else
135 #if( !$sortDisplayed )
136 #set( $sortDisplayed = true )
137 (% style="border-style:solid hidden hidden solid; border-color:$theme.borderColor; text-align:left; font-style:oblique" %)|{{id name='$sort'/}}[[{{pubSort plural='true' uppercase='true'}}$sort{{/pubSort}}>>$doc.name||queryString='sort=$sort#if( $oneYear )&year=$year#end']]
138 #end
139 #if( !$oneYear )
140 (% style="border-style:hidden hidden hidden dotted; border-color:$theme.borderColor; text-align:left; font-style:oblique; font-size:smaller" %)|{{id name='$sort-$year'/}}[[$year>>$doc.name||queryString='year=$year&sort=$sort']]
141 #end
142 #end
143 #foreach( $pub in $pubFound )
144 #set( $authNo = $authNo + 1 )
145 #set( $authSortNo = $authSortNo + 1 )
146 #set( $authSortYearNo = $authSortYearNo + 1 )
147 (% style='border-style:hidden hidden hidden hidden' %)|(% style='border-style:hidden hidden hidden hidden; color:$theme.textColor; display:block; line-height:1.25em; margin-top:0; margin-bottom:0em'%){{pub linked=true inline=false}}$pub{{/pub}}
148 ##{{pubAutheditors eds='true'}}$pub{{/pubAutheditors}}
149 ##{{pubTitle}}$pub{{/pubTitle}}
150 ##{{pubVenue}}$pub{{/pubVenue}}(%%)
151 #end
152 #end
153 #if( $authSortYearNo > 0 && !$oneYear )
154 (% style="border-style:#if( $oneSort ) hidden solid solid hidden #else hidden dotted hidden hidden #end ; border-color:$theme.borderColor; text-align:right; font-style:oblique; font-weight:normal; font-size:smaller; color:$theme.textSecondaryColor" %)|($authSortYearNo #if( $authSortYearNo == 1 ){{pubSort plural='false' uppercase='false'}}$sort{{/pubSort}}#else{{pubSort plural='true' uppercase='false'}}$sort{{/pubSort}}#end {{stringEngIta eng='in' ita='nel'/}} $year)#if( $oneSort ) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]]#end{{id name='$sort-$year-bottom'/}}
155 #end
156 #end
157 #if( $authSortNo > 0 )
158 #if( !$oneSort )
159 (% 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" %)|($authSortNo #if( $authSortNo == 1 ){{pubSort plural='false' uppercase='false'}}$sort{{/pubSort}}#else{{pubSort plural='true' uppercase='false'}}$sort{{/pubSort}}#end #if( $oneYear ){{stringEngIta eng='in' ita='nel'/}} $year#else{{stringEngIta eng='from' ita='dal'/}} $firstYearPub {{stringEngIta eng='to' ita='al'/}} $lastYearPub#end) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]]
160 #end
161 #end
162 #end
163 ###if( !$oneYear || !$oneSort )
164 (% style="text-align:right; font-style:oblique; font-weight:normal; font-size:smaller; color:$theme.textSecondaryColor" %)|($authNo #if( $authNo == 1 )#if( $oneSort ){{pubSort plural='false' uppercase='false'}}$sortPar{{/pubSort}}#else{{stringEngIta eng='publication' ita='pubblicazione'/}}#end#else#if( $oneSort ){{pubSort plural='true' uppercase='false'}}$sortPar{{/pubSort}}#else{{stringEngIta eng='publications' ita='pubblicazioni'/}}#end#end #if( $oneYear ){{stringEngIta eng='in' ita='nel'/}} $year#else{{stringEngIta eng='from' ita='dal'/}} $firstYearPub {{stringEngIta eng='to' ita='al'/}} $lastYearPub#end)
165 ###end
166 {{id name='bottom'/}}
167 {{/velocity}}
Partita IVA: 01131710376 - Copyright © 2008-2022 APICe@DISI Research Group - PRIVACY