Changes for page Per Status
From version 86.6
edited by Andrea Omicini
on 22/06/2023 12:15
on 22/06/2023 12:15
Change comment:
There is no comment for this version
To version 86.3
edited by Andrea Omicini
on 18/03/2023 09:35
on 18/03/2023 09:35
Change comment:
There is no comment for this version
Summary
-
Page properties (2 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,0 @@ 1 -$services.localization.render('perstatus') - Content
-
... ... @@ -1,65 +1,29 @@ 1 -{{velocity}} 2 -{{html wiki="true" clean="false"}} 3 -## GET PARAMETERS / START 4 -## inline display 5 -#set( $inlinePar = $request.inline.trim().toLowerCase() ) 6 -## show BibTeX 7 -#set( $bibtexPar = $request.bibtex.trim().toLowerCase() ) 1 += {{italiano}}Per stato{{/italiano}}{{english}}Per Status{{/english}} = 2 + 3 +{{include reference="Publications.Environment" excludeFirstHeading="true"/}}{{velocity}} 4 +## a Publications page 5 +#set( $publicationMenu = true ) 6 +#### get parameters 8 8 ## who 9 9 #set( $userNamePar = $request.user.trim() ) 10 10 #set( $firstNamePar = $request.name.trim() ) 11 11 #set( $lastNamePar = $request.surname.trim() ) 12 -## GET PARAMETERS / END 13 -## 14 -#template('apice_boolean.vm') 15 -## HANDLE BIBTEX / START 16 -## default: false 17 -#set( $showBibtex = false ) 18 -## check $bibtexPar 19 -#if( $bibtexPar != "" && $trueStringList.contains($bibtexPar.toLowerCase()) ) 20 - #set( $showBibtex = true ) 21 -#end 22 -## HANDLE BIBTEX / END 23 -## 24 -## HANDLE INLINE / START 25 -## default: true 26 -#set( $showInline = true ) 27 -## check $inlinePar 28 -#if( $inlinePar != "" && $falseStringList.contains($inlinePar) ) 29 - #set( $showInline = false ) 30 -#end 31 -## HANDLE INLINE / END 32 -## 33 -## HANDLE STATUS / START 34 -## $oneStatus false gets a list of statuses, true just one 35 -#set( $oneStatus = false ) 36 -#set( $showRejected = false ) 37 -## $statusList gets the list of statuses to be shown 38 -#set( $statusList = $publicationStatuses ) 39 -## 11 +## which status 40 40 #set( $statusPar = $request.status.trim() ) 41 -#if( $statusPar.toLowerCase() == "all" ) 42 -## 'all' value gets all unpublished papers including "Rejected" ones 43 - #set( $showRejected = true ) 44 -#else 45 - #if( $publicationStatuses.contains($statusPar) ) 46 - ## 'status' parameter is an admissible publication status value 47 - #set( $oneStatus = true ) 48 - #set( $statusList = [$statusPar] ) 49 - #end 50 -#end 51 51 ## 52 -## HANDLESTATUS / END53 -# #HANDLEWHO / START54 -# template('apice_macros.vm')55 -#isuser space()56 - #if($isUserSpace)57 - # userspace()58 - ##froma personal page14 +#### handle who 15 +#if( $userName ) 16 +## from a personal page, "XWiki.$userName" $userName form 17 + #if( !$xwiki.exists( $userName ) ) 18 +{{warning}}User $userName does not exist{{/warning}} 19 + #stop 20 + #end 59 59 #set( $apiceUser = true ) 60 60 #set( $oneUser = true ) 61 -#elseif( $userNamePar ) 62 -## from the URL, "user=$userNamePar" parameter 23 + #set( $userdoc = $xwiki.getDocument($userName) ) 24 + #set( $userFirstName = $userdoc.display("first_name") ) 25 + #set( $userLastName = $userdoc.display("last_name") ) 26 +#elseif( $userNamePar ) ## from the URL, "user=$userNamePar" parameter 63 63 #if( $userNamePar.contains('XWiki.') ) 64 64 #set( $userName = "$userNamePar" ) 65 65 #else ... ... @@ -99,16 +99,31 @@ 99 99 #else 100 100 #set( $userString = "%%" ) 101 101 #end 102 -## HANDLE WHO / END 103 103 ## 104 -### query to structures 105 -## map & counter initialisation 106 -#set( $itemMap = {} ) 107 -#set( $itemNo = 0 ) 108 -## cycle over sorts 67 +#### handle status 68 +## $oneStatus false gets a list of statuses, true just one 69 +#set( $oneStatus = false ) 70 +## $statusList gets the list of statuses to be shown 71 +#set( $statusList = [] ) 72 +## default: all unpublished papers except Rejected ones 73 +#set( $discard = $statusList.addAll($unpublishedStatuses) ) 74 +#if( $statusPar.toLowerCase() == "all" ) 75 +## 'all' value gets all unpublished papers including "Rejected" ones 76 + #set( $discard = $statusList.add("rejected") ) 77 +#else 78 + #if( $allStatusesPlus.contains($statusPar) ) 79 + ## 'status' parameter is an admissible publication status value 80 + #set( $oneStatus = true ) 81 + #set( $statusList = [$statusPar] ) 82 + #end 83 +#end 84 +## 85 +## query to structures 86 +#set( $pubMap = {} ) 87 +#set( $pubNo = 0 ) 109 109 #foreach( $status in $statusList ) 110 110 #set( $from = ", BaseObject as obj, LargeStringProperty as prop0, LargeStringProperty as prop1, StringProperty as prop2, StringProperty as prop3" ) 111 - #set( $where = "obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectSpace}.${objectTemplate}' and prop0.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop3.id.id = obj.id and prop0.name = 'author' and prop1.name = 'editor' and ( prop0.value like '$userString' or ( prop0.value = '' and prop1.value like '$userString' ) ) and prop2.name = 'status' and prop2.value = '$status' and prop3.name = 'access' #if(!$hasEdit ) and prop3.value<>'hidden'#end" )90 + #set( $where = "obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectSpace}.${objectTemplate}' and prop0.id.id = obj.id and prop1.id.id = obj.id and prop2.id.id = obj.id and prop3.id.id = obj.id and prop0.name = 'author' and prop1.name = 'editor' and ( prop0.value like '$userString' or ( prop0.value = '' and prop1.value like '$userString' ) ) and prop2.name = 'status' and prop2.value = '$status' and prop3.name = 'access' and prop3.value = 'visible'" ) 112 112 #set( $sql = $from + " where " + $where ) 113 113 #set( $pubFound = $xwiki.searchDocuments($sql) ) 114 114 #set( $pubStatusNo = $pubFound.size() ) ... ... @@ -141,7 +141,5 @@ 141 141 #end 142 142 #set( $pubStatusNo = $pubMap[$status].size() ) 143 143 (% style="border-style:hidden solid solid hidden; border-color:$theme.borderColor; text-align:right; font-style:oblique; font-size:smaller" %)|($pubStatusNo #if( $pubStatusNo == 1 ){{stringEngIta eng='publication' ita='pubblicazione'/}} {{pubStatus uppercase='false' plural='false'}}$status{{/pubStatus}}#{else}{{stringEngIta eng='publications' ita='pubblicazioni'/}} {{pubStatus uppercase='false' plural='true'}}$status{{/pubStatus}}#end) [[[{{stringEngIta eng='top' ita='in cima'/}}]>>||anchor="top"]] [[[{{stringEngIta eng='bottom' ita='in fondo'/}}]>>||anchor="bottom"]] 144 -## status bottom / end 145 145 #end 146 -{{/html}} 147 -{{/velocity}}{{pageDisplay sort="objectservice"/}} 124 +{{/velocity}}