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