Wiki source code of Edited
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(!$editorFirstName)#set( $editorFirstName = "" )#end | ||
39 | #if(!$editorLastName)#set( $editorLastName = "" )#end | ||
40 | #if(!$oneEditor)#set( $oneEditor = 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( $editorFirstName = $userdoc.display("first_name") ) | ||
58 | #set( $editorLastName = $userdoc.display("last_name")) | ||
59 | #set( $oneEditor = true) | ||
60 | #else | ||
61 | #if($firstNamePar && $lastNamePar) | ||
62 | #set( $editorFirstName = $firstNamePar ) | ||
63 | #set( $editorLastName = $lastNamePar ) | ||
64 | #set( $oneEditor = true) | ||
65 | #end | ||
66 | #end | ||
67 | |||
68 | #set( $editedTotal = 0 ) | ||
69 | |||
70 | <a name="top"> </a> | ||
71 | |||
72 | 1 Edited volumes with Scopus ID #if($oneEditor) by $editorFirstName $editorLastName #end in the #apice() Space #if ($oneYear) ($year) #else ($firstYear—$lastYear) #end | ||
73 | |||
74 | #if (!$oneYear) | ||
75 | Below, the edited volumes with Scopus ID #if($oneEditor) edited by $editorFirstName $editorLastName #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, StringProperty as prop4 | ||
87 | where obj.name=doc.fullName and | ||
88 | obj.className='Publications.PublicationClass' and | ||
89 | obj.name<>'Publications.PublicationClassTemplate' and | ||
90 | 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 | ||
91 | prop.name = 'status' and | ||
92 | prop.value = 'Published' and | ||
93 | prop1.name = 'year' and | ||
94 | prop1.value = " + $year +" and | ||
95 | prop2.name = 'scopusId' and | ||
96 | prop2.value <> '' and | ||
97 | prop3.name = 'author' and | ||
98 | prop3.value = '' and | ||
99 | prop4.name='editor' and | ||
100 | prop4.value like '%$editorLastName, $editorFirstName%'") | ||
101 | #set($pubFound = $xwiki.searchDocuments($sql)) | ||
102 | #if ($pubFound.size()>0) | ||
103 | #set( $editedTotal = $editedTotal + $pubFound.size()) | ||
104 | #if (!$oneYear) | ||
105 | <a name=$year> </a> | ||
106 | 1.1 $year <em>($pubFound.size())</em> | ||
107 | #else | ||
108 | <em>($pubFound.size())</em> | ||
109 | #end | ||
110 | #foreach ($item in $pubFound) | ||
111 | ## #pubETVblock($xwiki.getDocument($item).name) | ||
112 | #set($pubDoc=$xwiki.getDocument($item)) | ||
113 | #set($pubObj=$pubDoc.getObject("Publications.PublicationClass")) | ||
114 | * [ $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')) ] | ||
115 | |||
116 | #end | ||
117 | |||
118 | #end | ||
119 | <table width="100%"><tr><th align="right"><a href="#top">{pre}[{/pre}top{pre}]{/pre}</a></th></tr></table> | ||
120 | #end | ||
121 | #end | ||
122 | <div align='right'><em>\[total: $editedTotal\]</em></div> |