Wiki source code of Authored
Last modified by Andrea Omicini on 2020/10/12 15:48
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | #includeMacros("Main.MacroSheet") | ||
2 | #includeMacros("People.MacroSheet") | ||
3 | #includeMacros("Publications.MacroSheet") | ||
4 | #includeMacros("Publications.GlobalVars") | ||
5 | ## | ||
6 | #set( $yearRange = [$lastYear..$firstYear] ) | ||
7 | #if(!$oneYear)#set( $oneYear = false )#end | ||
8 | |||
9 | #set( $yearPar = $context.getRequest().getParameter("year") ) | ||
10 | #set( $firstYearPar = $context.getRequest().getParameter("from") ) | ||
11 | #set( $lastYearPar = $context.getRequest().getParameter("to") ) | ||
12 | |||
13 | #if($firstYearPar) | ||
14 | #set( $yearFirst = $util.parseInt($firstYearPar) ) | ||
15 | #if ( $yearRange.contains($yearFirst) ) | ||
16 | #set( $firstYear = $yearFirst ) | ||
17 | #set( $yearRange = [$lastYear..$firstYear] ) | ||
18 | #end | ||
19 | #end | ||
20 | |||
21 | #if($lastYearPar) | ||
22 | #set( $yearLast = $util.parseInt($lastYearPar) ) | ||
23 | #if ( $yearRange.contains($yearLast) ) | ||
24 | #set( $lastYear = $yearLast ) | ||
25 | #set( $yearRange = [$lastYear..$firstYear] ) | ||
26 | #end | ||
27 | #end | ||
28 | |||
29 | #set($yearList = $yearRange) | ||
30 | #if($yearPar) | ||
31 | #set($year = $util.parseInt($yearPar)) | ||
32 | #if ($yearRange.contains($year) ) | ||
33 | #set($yearList = [$year]) | ||
34 | #set($oneYear = true) | ||
35 | #end | ||
36 | #end | ||
37 | |||
38 | #if(!$authorFirstName)#set( $authorFirstName = "" )#end | ||
39 | #if(!$authorLastName)#set( $authorLastName = "" )#end | ||
40 | #if(!$oneAuthor)#set( $oneAuthor = false )#end | ||
41 | |||
42 | #set( $userNamePar = $context.getRequest().getParameter("user") ) | ||
43 | #set( $firstNamePar = $context.getRequest().getParameter("name") ) | ||
44 | #set( $lastNamePar = $context.getRequest().getParameter("surname") ) | ||
45 | |||
46 | #set( $userNameFull = "" ) | ||
47 | #if($userName) | ||
48 | #set($userNameFull = "#userXWiki($userName)") | ||
49 | #else | ||
50 | #if($userNamePar) | ||
51 | #set($userNameFull = "#userXWiki($userNamePar)") | ||
52 | #end | ||
53 | #end | ||
54 | |||
55 | #if($userNameFull != "") | ||
56 | #set($userdoc = $xwiki.getDocument("$userNameFull")) | ||
57 | #set($authorFirstName = $userdoc.display("first_name")) | ||
58 | #set($authorLastName = $userdoc.display("last_name")) | ||
59 | #set($oneAuthor = true) | ||
60 | #else | ||
61 | #if($firstNamePar && $lastNamePar) | ||
62 | #set( $authorFirstName = $firstNamePar ) | ||
63 | #set( $authorLastName = $lastNamePar ) | ||
64 | #set( $oneAuthor = true) | ||
65 | #end | ||
66 | #end | ||
67 | |||
68 | #set( $authoredTotal = 0 ) | ||
69 | |||
70 | <a name="top"> </a> | ||
71 | |||
72 | 1 Authored publications with Scopus ID #if($oneAuthor) by $authorFirstName $authorLastName #end in the #apice() Space #if ($oneYear) ($year) #else ($firstYear—$lastYear) #end | ||
73 | |||
74 | #if (!$oneYear) | ||
75 | Below, the authored publications with Scopus ID #if($oneAuthor) by $authorFirstName $authorLastName #end in the #apice() Space between $firstYear and $lastYear, ordered by year of publication. | ||
76 | ---- | ||
77 | <div> | ||
78 | #foreach ($year in $yearList) | ||
79 | #if ($velocityCount > 1) | #end [$year |#$year] | ||
80 | #end | ||
81 | </div> | ||
82 | ---- | ||
83 | #end | ||
84 | |||
85 | #foreach ($year in $yearList) | ||
86 | #set ($sql = ", BaseObject as obj, StringProperty as prop, LongProperty as prop1, StringProperty as prop2, LargeStringProperty as prop3 | ||
87 | where | ||
88 | obj.name=doc.fullName and | ||
89 | obj.className='Publications.PublicationClass' and | ||
90 | obj.name<>'Publications.PublicationClassTemplate' and | ||
91 | prop.id.id=obj.id and | ||
92 | prop1.id.id=obj.id and | ||
93 | prop2.id.id=obj.id and | ||
94 | prop3.id.id=obj.id and | ||
95 | prop.name = 'status' and | ||
96 | prop.value = 'Published' and | ||
97 | prop1.name = 'year' and | ||
98 | prop1.value = " + $year +" and | ||
99 | prop2.name = 'scopusId' and | ||
100 | prop2.value <> '' and | ||
101 | prop3.name='author' and | ||
102 | prop3.value like '%$authorLastName, $authorFirstName%'") | ||
103 | #set($pubFound = $xwiki.searchDocuments($sql)) | ||
104 | #if ($pubFound.size()>0) | ||
105 | #set( $authoredTotal = $authoredTotal + $pubFound.size()) | ||
106 | #if (!$oneYear) | ||
107 | <a name=$year> </a> | ||
108 | 1.1 $year <em>($pubFound.size())</em> | ||
109 | #else | ||
110 | <em>($pubFound.size())</em> | ||
111 | #end | ||
112 | #foreach ($item in $pubFound) | ||
113 | ## #pubATVblock($xwiki.getDocument($item).name) | ||
114 | #set($pubDoc=$xwiki.getDocument($item)) | ||
115 | #set($pubObj=$pubDoc.getObject("Publications.PublicationClass")) | ||
116 | * [ $pubDoc.display("title") | $item ] #if ($context.getUser() != "XWiki.XWikiGuest") <a href="$xwiki.getURL('$item', 'inline')"><img alt="$msg.get('panels.documentInformation.editIncluded', [$page])" src="$xwiki.getSkinFile('icons/silk/page_white_edit.gif')" /></a> [ <img src='#attachmentDocUrl("Publications.Scopus","scopus.jpg")' width='40px' alt='Scopus' /> | #scopusUrl($pubDoc.display('scopusId')) ] | ||
117 | |||
118 | #end | ||
119 | |||
120 | #end | ||
121 | <table width="100%"><tr><th align="right"><a href="#top">{pre}[{/pre}top{pre}]{/pre}</a></th></tr></table> | ||
122 | #end | ||
123 | #end | ||
124 | <div align='right'><em>\[total: $authoredTotal\]</em></div> |