Wiki source code of Stats per date

Last modified by Vincent Massol on 2014/07/22 11:09

Show last authors
1 Shows how many extensions have been created between 2 dates.
2
3 Supported parameters:
4 * Use ##confirm=1## to execute.
5 * Pass ##start## and ##end## parameters to specify the dates.
6 * Pass ##nocommitters=1## to exclude extensions created by the XWiki Dev Team
7
8 For example: ##confirm=1&start=2013-06-30&end=2014-06-30&nocommitters=1##.
9
10 {{groovy}}
11 if (request.confirm == '1') {
12 def total = 0
13 def xwql = "from doc.object(ExtensionCode.ExtensionClass) as extension where doc.space = 'Extension' and doc.creationDate >= :start and doc.creationDate < :end"
14 if (request.nocommitters == '1') {
15 xwql = "${xwql} and extension.authors not in ('xwiki:XWiki.XWikiTeam')"
16 }
17 services.query.xwql(xwql).bindValue('start', Date.parse('yyyy-MM-dd', request.start)).bindValue('end', Date.parse('yyyy-MM-dd', request.end)).execute().each() {
18 println "* ${it}"
19 total++
20 }
21 println ""
22 println "total: ${total}"
23 }
24 {{/groovy}}

Get Connected