Änderungen von Dokument Contributors
Zuletzt geändert von Daniel Herrmann am 2025/11/08 02:47
Von Version
3.1
bearbeitet von Daniel Herrmann
am 2025/06/23 19:53
am 2025/06/23 19:53
Änderungskommentar:
Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.26.19]
Auf Version
6.1
bearbeitet von Daniel Herrmann
am 2025/07/19 16:44
am 2025/07/19 16:44
Änderungskommentar:
Migrated property [order] from class [XWiki.WikiMacroParameterClass]
Zusammenfassung
Details
- XWiki.WikiMacroClass[0]
-
- Makro-Code
-
... ... @@ -1,5 +1,5 @@ 1 1 {{groovy output="false"}} 2 - xcontext.put("sortContributions", (contributions, key, reverse) -> { 2 + xcontext.put("sortContributions", (contributions, key, reverse, limit) -> { 3 3 def c = new ArrayList(contributions) 4 4 Collections.sort(c, new Comparator<HashMap>() { 5 5 @Override ... ... @@ -7,6 +7,10 @@ 7 7 return reverse ? v2.get(key).compareTo(v1.get(key)) : v1.get(key).compareTo(v2.get(key)) 8 8 } 9 9 }) 10 + if (limit != null && limit > 0) { 11 + return c.take(limit) 12 + } 13 + 10 10 return c 11 11 }) 12 12 {{/groovy}} ... ... @@ -121,7 +121,7 @@ 121 121 #set($query = $services.query.xwql("select comment.author, max(comment.date), count(distinct comment) from Document doc, doc.object('XWiki.XWikiComments') comment where doc.fullName in (:d) group by comment.author")) 122 122 #addContributions($query, $pages) 123 123 #end 124 - #set($contributions = $xcontext.get('sortContributions').doCall($contributors.values(), $order, $reverse)) 128 + #set($contributions = $xcontext.get('sortContributions').doCall($contributors.values(), $order, $reverse, $mathtool.toInteger($limit))) 125 125 126 126 {{html clean=false}} 127 127 <div class="confluence-contributors"> ... ... @@ -178,7 +178,7 @@ 178 178 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 179 179 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 180 180 ## don't have view right on those pages. 181 -#if ($services. promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))185 +#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 182 182 #executeMacro 183 183 #else 184 184 {{missingLicenseMessage extensionName="proMacros.extension.name"/}}