Modifiche per il documento Per stato
Dalla versione 98.1
modificato da Andrea Omicini
il 25/06/2023 13:49
il 25/06/2023 13:49
Cambia il commento:
Nessun commento per questa versione
Alla versione 90.1
modificato da Andrea Omicini
il 22/06/2023 13:01
il 22/06/2023 13:01
Cambia il commento:
Nessun commento per questa versione
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,9 +1,18 @@ 1 1 {{velocity}} 2 -{{html clean="false" wiki="true"}} 3 -#template('apice_boolean.vm') 4 -## BIBTEX / START 2 +{{html wiki="true" clean="false"}} 3 +## GET PARAMETERS / START 4 +## inline display 5 +#set( $inlinePar = $request.inline.trim().toLowerCase() ) 5 5 ## show BibTeX 6 6 #set( $bibtexPar = $request.bibtex.trim().toLowerCase() ) 8 +## who 9 +#set( $userNamePar = $request.user.trim() ) 10 +#set( $firstNamePar = $request.name.trim() ) 11 +#set( $lastNamePar = $request.surname.trim() ) 12 +## GET PARAMETERS / END 13 +## 14 +#template('apice_boolean.vm') 15 +## HANDLE BIBTEX / START 7 7 ## default: false 8 8 #set( $showBibtex = false ) 9 9 ## check $bibtexPar ... ... @@ -10,11 +10,9 @@ 10 10 #if( $bibtexPar != "" && $trueStringList.contains($bibtexPar.toLowerCase()) ) 11 11 #set( $showBibtex = true ) 12 12 #end 13 -## BIBTEX / END 22 +## HANDLE BIBTEX / END 14 14 ## 15 -## INLINE / START 16 -## inline display 17 -#set( $inlinePar = $request.inline.trim().toLowerCase() ) 24 +## HANDLE INLINE / START 18 18 ## default: true 19 19 #set( $showInline = true ) 20 20 ## check $inlinePar ... ... @@ -21,15 +21,13 @@ 21 21 #if( $inlinePar != "" && $falseStringList.contains($inlinePar) ) 22 22 #set( $showInline = false ) 23 23 #end 24 -## INLINE / END 25 -#template('apice_publications.vm') 26 -#template('apice_user_param.vm') 31 +## HANDLE INLINE / END 27 27 ## 28 -## STATUS / START 33 +## HANDLE STATUS / START 34 +#template('apice_publications.vm') 29 29 ## $oneStatus false gets a list of statuses, true just one 30 30 #set( $oneStatus = false ) 31 31 #set( $showRejected = false ) 32 -#set( $showPublished = false ) 33 33 ## $statusList gets the list of statuses to be shown 34 34 #set( $statusList = $publicationStatuses ) 35 35 ## ... ... @@ -37,42 +37,85 @@ 37 37 #if( $statusPar.toLowerCase() == "all" ) 38 38 ## 'all' value gets all unpublished papers including "Rejected" ones 39 39 #set( $showRejected = true ) 40 -#elseif( $statusPar.toLowerCase() == "published" ) 41 - #set( $oneStatus = true ) 42 - #set( $statusList = ["published"] ) 43 - #set( $showPublished = true ) 44 -#elseif( $statusPar.toLowerCase() == "rejected" ) 45 - #set( $oneStatus = true ) 46 - #set( $statusList = ["rejected"] ) 47 - #set( $showRejected = true ) 48 -#elseif( $publicationStatuses.contains($statusPar) ) 49 -## 'status' parameter is an admissible publication status value 50 - #set( $oneStatus = true ) 51 - #set( $statusList = [$statusPar] ) 45 +#else 46 + #if( $publicationStatuses.contains($statusPar) ) 47 + ## 'status' parameter is an admissible publication status value 48 + #set( $oneStatus = true ) 49 + #set( $statusList = [$statusPar] ) 50 + #end 52 52 #end 53 53 ## 54 -## STATUS / END 53 +## HANDLE STATUS / END 54 +## HANDLE WHO / START 55 +#template('apice_macros.vm') 56 +#isuserspace() 57 +#if( $isUserSpace ) 58 + #userspace() 59 +## from a personal page 60 + #set( $apiceUser = true ) 61 + #set( $oneUser = true ) 62 +#elseif( $userNamePar ) 63 +## from the URL, "user=$userNamePar" parameter 64 + #if( $userNamePar.contains('XWiki.') ) 65 + #set( $userName = "$userNamePar" ) 66 + #else 67 + #set( $userName = "XWiki.$userNamePar" ) 68 + #end 69 + #if( !$xwiki.exists( $userName ) ) 70 + #if( $services.localization.currentLocale == 'it' ) 71 +{{warning}}L'utente “$userNamePar” non esiste{{/warning}} 72 + #else 73 +{{warning}}User “$userNamePar” does not exist{{/warning}} 74 + #end 75 + #stop 76 + #end 77 + #set( $apiceUser = true ) 78 + #set( $oneUser = true) 79 + #set( $userdoc = $xwiki.getDocument($userName) ) 80 + #set( $userFirstName = $userdoc.display("first_name") ) 81 + #set( $userLastName = $userdoc.display("last_name") ) 82 +#elseif( $firstNamePar && $lastNamePar ) 83 +## from the URL, "name=Firstname&surname=Lastname" parameter 84 + #set( $apiceUser = false ) 85 + #set( $oneUser = true ) 86 + #set( $userFirstName = $firstNamePar ) 87 + #set( $userLastName = $lastNamePar ) 88 +#else 89 + #set( $apiceUser = false ) 90 + #set( $oneUser = false ) 91 + #set( $userFirstName = "" ) 92 + #set( $userLastName = "" ) 93 +#end 94 +#if( $oneUser ) 95 + #if( $apiceUser ) 96 + #set( $userString = "%$userName%" ) 97 + #else 98 + #set( $userString = "%$userFirstName $userLastName%" ) 99 + #end 100 +#else 101 + #set( $userString = "%%" ) 102 +#end 103 +## HANDLE WHO / END 55 55 ## 56 -## DATA STRUCTURES / START 105 +### query to structures 106 +## map & counter initialisation 57 57 #set( $itemMap = {} ) 58 58 #set( $itemNo = 0 ) 59 59 ## cycle over statuses 60 60 #foreach( $status in $statusList ) 61 - #if( $status != "published" && $status != "rejected" || $status == "published" && $showPublished || $status == "rejected" && $showRejected ) 62 - #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end 63 - where obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectPool}.${objectTemplate}' #if( $oneUser ) and propAuthor.id.id = obj.id and propEditor.id.id = obj.id and propAuthor.name = 'author' and propEditor.name = 'editor' and ( propAuthor.value like '$userString' or ( propAuthor.value = '' and propEditor.value like '$userString' ) ) #end and propStatus.id.id = obj.id and propStatus.name = 'status' and propStatus.value = '$status' #if( !$hasEdit ) and propAccess.id.id = obj.id and propAccess.name = 'access' and propAccess.value <> 'hidden' #end" ) 64 - #set( $itemFound = $xwiki.searchDocuments($query) ) 111 + #set( $query = ", BaseObject as obj, #if( $oneUser ) LargeStringProperty as propAuthor, LargeStringProperty as propEditor, #end StringProperty as propStatus #if( !$hasEdit ), StringProperty as propAccess #end 112 + where obj.name = doc.fullName and obj.className = '${objectSpace}.${objectClass}' and obj.name <> '${objectPool}.${objectTemplate}' #if( $oneUser ) and propAuthor.id.id = obj.id and propEditor.id.id = obj.id and propAuthor.name = 'author' and propEditor.name = 'editor' and ( propAuthor.value like '$userString' or ( propAuthor.value = '' and propEditor.value like '$userString' ) ) #end and propStatus.id.id = obj.id and propStatus.name = 'status' and propStatus.value = '$status' #if( !$hasEdit ) and propAccess.id.id = obj.id and propAccess.name = 'access' and propAccess.value <> 'hidden' #end" ) 113 + #set( $itemFound = $xwiki.searchDocuments($query) ) 65 65 ## set counters 66 - #set( $itemStatusNo = $itemFound.size() ) 67 - #if( $itemStatusNo > 0 ) 68 - #set( $itemMap[$status] = $itemFound ) 69 - #set( $itemNo = $itemNo + $itemStatusNo ) 70 - #end 115 + #set( $itemStatusNo = $itemFound.size() ) 116 + #if( $itemStatusNo > 0 ) 117 + #set( $itemMap[$status] = $itemFound ) 118 + #set( $itemNo = $itemNo + $itemStatusNo ) 71 71 #end 72 72 #end 73 - ## DATASTRUCTURES / END121 +$itemStatusNo 74 74 ## 75 -## DISPLAY/ START123 +## output results 76 76 ## page subtitle 77 77 <div style="display: flex"> 78 78 <div class="mainheader"> ... ... @@ -79,26 +79,14 @@ 79 79 $itemNo 80 80 #if( $oneStatus ) 81 81 #if( $itemNo == 1 ) 82 - $services.localization.render('work').toLowerCase() 83 - <span class="textsecondary"> / </span> 84 84 $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}").toLowerCase() 85 85 #else 86 - $services.localization.render('works').toLowerCase() 87 - <span class="textsecondary"> / </span> 88 - $services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end 132 +$services.localization.render("${objectSpace}.${objectClass}_status_${statusList[0]}_plural").toLowerCase() #end 89 89 #else 90 90 #if( $itemNo == 1 ) 91 - #if( $showPublished ) 92 - $services.localization.render('work').toLowerCase() 93 - #else 94 - $services.localization.render('yetunpublished_singular').toLowerCase() 95 - #end 135 + $services.localization.render('yetunpublished_singular').toLowerCase() 96 96 #else 97 - #if( $showPublished ) 98 - $services.localization.render('works').toLowerCase() 99 - #else 100 - $services.localization.render('yetunpublished').toLowerCase() 101 - #end 137 + $services.localization.render('yetunpublished').toLowerCase() 102 102 #end 103 103 #end 104 104 #if( $oneUser ) ... ... @@ -108,11 +108,9 @@ 108 108 </div> 109 109 <div style="flex-grow: 1"> 110 110 </div> 111 - <div> 147 + <div"> 112 112 <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","bibtex=$showBibtex&inline=#if( $showInline )false#{else}true#end#if( $oneStatus )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )#if( $showInline )formatted#{else}plain#end#else#if( $showInline )long#{else}short#end#end</a> 113 -#if( $showPublished ) 114 114 <a class="basebutton" style="padding: .5em" href='$doc.getURL("view","inline=$showInline&bibtex=#if( $showBibtex )false#{else}true#end#if( $oneStatus )&status=${statusList[0]}#end#if( $apiceUser )&user=$userName#elseif( $oneUser )&name=$userFirstName&surname=$userLastName#end")'>#if( $showBibtex )text#{else}bib#end</a> 115 -#end 116 116 </div> 117 117 </div> 118 118 ## stop if no pubs are found ... ... @@ -150,11 +150,12 @@ 150 150 #if( $showInline && !$showBibtex ) 151 151 <ul> 152 152 #foreach( $item in $itemMap[$status] ) 153 - <li>#pubperstatus($item)</li> 187 + <li>#publinked($item)</li> 188 +## <li>#pubperstatus($item)</li> 154 154 #end 155 155 </ul> 156 156 #else 157 - #foreach( $item in $itemMap[$st atus] )192 + #foreach( $item in $itemMap[$sort] ) 158 158 #if( $showBibtex) 159 159 #if( $showInline ) 160 160 ((({{{ $xwiki.getDocument($item).getValue('bibtex') }}}))) ... ... @@ -165,7 +165,7 @@ 165 165 <div style="border-style:hidden hidden hidden hidden; font-size:smaller; line-height: 1.25em; margin-bottom: .5em"> 166 166 #pubauthed($item)<br/> 167 167 #pubtitle($item)<br/> 168 - <span class="textsecondary">(#pubs ort($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}}203 + <span class="textsecondary">(#pubstatus($item))</span> {{pubVenue linked="false"}}$item{{/pubVenue}} 169 169 </div> 170 170 #end 171 171 #end ... ... @@ -176,10 +176,9 @@ 176 176 ## status bottom / start 177 177 <div #if( $foreach.last )id="bottom"#end class="mainselectbottom"> 178 178 #set( $itemStatusNo = $itemMap[$status].size() ) 179 -$itemStatusNo #if( $itemStatusNo == 1 )$services.localization.render("${objectSpace}.${objectClass}_status_${status}").toLowerCase()#{else}$services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase()#end • #anchorlinks()214 +$itemStatusNo #if( $itemStatusNo == 1 )$services.localization.render("${objectSpace}.${objectClass}_status_${status}").toLowerCase()#{else}$services.localization.render("${objectSpace}.${objectClass}_status_${status}_plural").toLowerCase()#end • [[{{stringEngIta eng='top' ita='in cima'/}}>>||anchor="top"]] • [[{{stringEngIta eng='index' ita='indice'/}}>>||anchor="index"]] • [[{{stringEngIta eng='bottom' ita='in fondo'/}}>>||anchor="bottom"]] 180 180 </div> 181 181 ## status bottom / end 182 182 #end 183 -## DISPLAY / END 184 184 {{/html}} 185 185 {{/velocity}}{{pageDisplay sort="objectservice"/}}