Index: xwiki-platform-applications/statistics/pom.xml
===================================================================
--- xwiki-platform-applications/statistics/pom.xml (revision 0)
+++ xwiki-platform-applications/statistics/pom.xml (revision 0)
@@ -0,0 +1,45 @@
+
+
+
+
+
+ 4.0.0
+
+ com.xpn.xwiki.platform.applications
+ xwiki-applications
+ 8-SNAPSHOT
+
+ xwiki-application-statistics
+ XWiki Platform - Applications - Statistics
+ 1.0-SNAPSHOT
+ xar
+ Panels and pages providing XWiki statistics
+
+
+ com.xpn.xwiki.platform.applications
+ xwiki-application-panels
+ 1.2-SNAPSHOT
+ xar
+
+
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/Activity
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/Activity (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/Activity (revision 0)
@@ -0,0 +1,54 @@
+
+
+
+Stats
+Activity
+
+en
+0
+Stats.WebHome
+
+Activity Statistics
+
+
+
+
+true
+
+1 Activity Statistics
+
+#set($chartWidth = 380)
+#displayPanelLayout(2 ["Stats.CurrentWeekActivity", "Stats.CurrentMonthActivity", "Stats.CurrentYearActivity", "Stats.AllTimeActivity"])
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/ActivityData
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/ActivityData (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/ActivityData (revision 0)
@@ -0,0 +1,106 @@
+
+
+
+Stats
+ActivityData
+
+en
+0
+Stats.Activity
+
+Activity Data
+
+
+
+
+true
+
+1 Current week activity
+
+#set($scope = $xwiki.statsService.scopeFactory.ALL)
+#set($period = $xwiki.statsService.periodFactory.currentWeek)
+#set($step = $xwiki.statsService.durationFactory.DAY)
+#set($myviews = $xwiki.statsService.getActionStatistics('view', $scope, $period, $step))
+#set($myedits = $xwiki.statsService.getActionStatistics('save', $scope, $period, $step))
+#set($dtf = $xwiki.jodatime.getDateTimeFormatterForPattern('yyyy.MM.dd'))
+{table}
+| Views | Edits
+#foreach($item in $myviews.entrySet())
+$dtf.print($item.key) | $item.value | $myedits.get($item.key)
+#end
+{table}
+
+1 Current month activity
+
+#set($period = $xwiki.statsService.periodFactory.currentMonth)
+#set($step = $xwiki.statsService.durationFactory.DAY)
+#set($myviews = $xwiki.statsService.getActionStatistics('view', $scope, $period, $step))
+#set($myedits = $xwiki.statsService.getActionStatistics('save', $scope, $period, $step))
+#set($dtf = $xwiki.jodatime.getDateTimeFormatterForPattern('yyyy.MM.dd'))
+{table}
+| Views | Edits
+#foreach($item in $myviews.entrySet())
+$dtf.print($item.key) | $item.value | $myedits.get($item.key)
+#end
+{table}
+
+1 Current year activity
+
+#set($period = $xwiki.statsService.periodFactory.currentYear)
+#set($step = $xwiki.statsService.durationFactory.MONTH)
+#set($myviews = $xwiki.statsService.getActionStatistics('view', $scope, $period, $step))
+#set($myedits = $xwiki.statsService.getActionStatistics('save', $scope, $period, $step))
+#set($dtf = $xwiki.jodatime.getDateTimeFormatterForPattern('yyyy.MM'))
+{table}
+| Views | Edits
+#foreach($item in $myviews.entrySet())
+$dtf.print($item.key) | $item.value | $myedits.get($item.key)
+#end
+{table}
+
+1 All time activity
+
+#set($period = $xwiki.statsService.periodFactory.createPeriod('20060101', '20090101'))
+#set($step = $xwiki.statsService.durationFactory.YEAR)
+#set($myviews = $xwiki.statsService.getActionStatistics('view', $scope, $period, $step))
+#set($myedits = $xwiki.statsService.getActionStatistics('save', $scope, $period, $step))
+#set($dtf = $xwiki.jodatime.getDateTimeFormatterForPattern('yyyy'))
+{table}
+| Views | Edits
+#foreach($item in $myviews.entrySet())
+$dtf.print($item.key) | $item.value | $myedits.get($item.key)
+#end
+{table}
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/AllTimeActivity
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/AllTimeActivity (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/AllTimeActivity (revision 0)
@@ -0,0 +1,152 @@
+
+
+
+Stats
+AllTimeActivity
+
+en
+0
+Stats.Activity
+
+All Time Activity
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/BestReferrers
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/BestReferrers (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/BestReferrers (revision 0)
@@ -0,0 +1,146 @@
+
+
+
+Stats
+BestReferrers
+
+en
+0
+Stats.Referrer
+
+Best Referrers
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentMonthActivity
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentMonthActivity (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentMonthActivity (revision 0)
@@ -0,0 +1,152 @@
+
+
+
+Stats
+CurrentMonthActivity
+
+en
+0
+Stats.Activity
+
+Current Month Activity
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentWeekActivity
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentWeekActivity (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentWeekActivity (revision 0)
@@ -0,0 +1,152 @@
+
+
+
+Stats
+CurrentWeekActivity
+
+en
+0
+Stats.Activity
+
+Current Week Activity
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentYearActivity
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentYearActivity (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/CurrentYearActivity (revision 0)
@@ -0,0 +1,152 @@
+
+
+
+Stats
+CurrentYearActivity
+
+en
+0
+Stats.Activity
+
+Current Year Activity
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/Document
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/Document (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/Document (revision 0)
@@ -0,0 +1,53 @@
+
+
+
+Stats
+Document
+
+en
+0
+Stats.WebHome
+
+Document Statistics
+
+
+
+
+true
+
+1 Document Statistics
+
+#displayPanelLayout(2 ["Stats.MostViewedPages", "Stats.MostEditedPages", "Stats.MostViewedSpaces", "Stats.MostEditedSpaces"])
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/LeastActiveContributors
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/LeastActiveContributors (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/LeastActiveContributors (revision 0)
@@ -0,0 +1,145 @@
+
+
+
+Stats
+LeastActiveContributors
+
+en
+0
+Stats.Visit
+
+Least Active Contributors
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/Macros
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/Macros (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/Macros (revision 0)
@@ -0,0 +1,149 @@
+
+
+
+Stats
+Macros
+
+en
+0
+Stats.WebHome
+
+Statistics Macros
+
+
+
+
+true
+
+<style type="text/css">
+table.stats{
+width:100%;
+}
+table.stats th{
+font-weight:normal;
+color:#333333;
+border-bottom:1px solid #DDDDDD;
+border-top:1px solid #DDDDDD;
+padding-bottom:2px;
+}
+table.stats td{
+color:#888888;
+}
+table.stats th.numeric, table.stats td.numeric{
+text-align:right;
+padding-right:6px;
+width:70px;
+}
+</style>
+#macro(printPageStats $stats)
+<table class="stats" cellspacing="0" cellpadding="0">
+<thead>
+<tr>
+<th class="numeric">Hits</th>
+<th>Page</th>
+</tr>
+</thead>
+<tbody>
+#foreach($item in $stats)
+#set($docStats = $xwiki.getDocument($item.name))
+#if ($docStats)
+#set($title = $docStats.displayTitle)
+<tr>
+<td class="numeric">$item.pageViews</td>
+<td>[$docStats.name>${docStats.web}.$docStats.name.replaceAll("@","%40")]#if ($title != $docStats.name) - <em>$title</em>#end
+</td>
+</tr>
+#end
+#end
+</tbody>
+</table>
+#end
+#macro(printSpaceStats $stats)
+<table class="stats" cellspacing="0" cellpadding="0">
+<thead>
+<tr>
+<th class="numeric">Hits</th>
+<th>Space</th>
+</tr></thead>
+<tbody>
+#foreach($item in $stats)
+<tr>
+<td class="numeric">$item.pageViews</td>
+<td>[$item.name>${item.name}.WebHome]</td>
+</tr>
+#end
+</tbody>
+</table>
+#end
+#macro(printContributorStats $stats)
+<table class="stats" cellspacing="0" cellpadding="0">
+<thead>
+<tr>
+<th class="numeric">Changes</th>
+<th>User</th>
+</tr>
+</thead>
+<tbody>
+#foreach($item in $stats)
+#set($userName = $xwiki.getUserName($item.name))
+#if($userName)
+<tr>
+<td class="numeric">$item.pageSaves</td>
+<td>$userName</td>
+</tr>
+#end
+#end
+</tbody>
+</table>
+#end
+#macro(printRefererStats $stats)
+<table class="stats" cellspacing="0" cellpadding="0">
+<thead>
+<tr>
+<th class="numeric">Sources</th>
+<th>Referrer</th>
+</tr>
+</thead>
+<tbody>
+#foreach($item in $stats)
+<tr>
+<td class="numeric">$item.pageViews</td>
+<td><a href="$item.referer" title="$item.URL.host">$item.URL.host</td>
+</tr>
+#end
+</tbody>
+</table>
+#end
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/MostActiveContributors
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/MostActiveContributors (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/MostActiveContributors (revision 0)
@@ -0,0 +1,145 @@
+
+
+
+Stats
+MostActiveContributors
+
+en
+0
+Stats.Visit
+
+Most Active Contributors
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/MostEditedPages
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/MostEditedPages (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/MostEditedPages (revision 0)
@@ -0,0 +1,146 @@
+
+
+
+Stats
+MostEditedPages
+
+en
+0
+Stats.Document
+
+Most Edited Pages
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/MostEditedSpaces
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/MostEditedSpaces (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/MostEditedSpaces (revision 0)
@@ -0,0 +1,146 @@
+
+
+
+Stats
+MostEditedSpaces
+
+en
+0
+Stats.Document
+
+Most Edited Spaces
+
+
+
+
+false
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/MostReferredPages
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/MostReferredPages (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/MostReferredPages (revision 0)
@@ -0,0 +1,146 @@
+
+
+
+Stats
+MostReferredPages
+
+en
+0
+Stats.Referrer
+
+Most Referred pages
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/MostViewedPages
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/MostViewedPages (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/MostViewedPages (revision 0)
@@ -0,0 +1,146 @@
+
+
+
+Stats
+MostViewedPages
+
+en
+1
+Stats.Document
+
+Most Viewed Pages
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/MostViewedSpaces
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/MostViewedSpaces (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/MostViewedSpaces (revision 0)
@@ -0,0 +1,146 @@
+
+
+
+Stats
+MostViewedSpaces
+
+en
+0
+Stats.Document
+
+Most Viewed Spaces
+
+
+
+
+true
+
+
+#includeForm("Panels.PanelSheet")
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/Referrer
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/Referrer (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/Referrer (revision 0)
@@ -0,0 +1,53 @@
+
+
+
+Stats
+Referrer
+
+en
+0
+Stats.WebHome
+
+Referrer Statistics
+
+
+
+
+true
+
+1 Referrer Statistics
+
+#displayPanelLayout(2 ["Stats.BestReferrers", "Stats.MostReferredPages"])
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/Visit
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/Visit (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/Visit (revision 0)
@@ -0,0 +1,53 @@
+
+
+
+Stats
+Visit
+
+en
+0
+Stats.WebHome
+
+Visit Statistics
+
+
+
+
+true
+
+1 Visit Statistics
+
+#displayPanelLayout(2 ["Stats.MostActiveContributors", "Stats.LeastActiveContributors"])
+
Index: xwiki-platform-applications/statistics/src/main/resources/Stats/WebHome
===================================================================
--- xwiki-platform-applications/statistics/src/main/resources/Stats/WebHome (revision 0)
+++ xwiki-platform-applications/statistics/src/main/resources/Stats/WebHome (revision 0)
@@ -0,0 +1,69 @@
+
+
+
+Stats
+WebHome
+
+en
+0
+
+
+Statistics Home
+
+
+
+
+true
+
+1 Statistics
+
+#if($xwiki.statsService.enabled)
+#set($chartWidth = 380)
+#displayPanelLayout(2 ["Stats.MostViewedPages", "Stats.MostActiveContributors", "Stats.CurrentMonthActivity", "Stats.MostReferredPages"])
+#info("For more statistics see [Document Statistics>Stats.Document], [Visit Statistics>Stats.Visit], [Activity Statistics>Stats.Activity] and [Referrer Statistics>Stats.Referrer].")
+#else
+#warning("
+The statistics module is disabled by default for improved performances. It can be globally activated by setting the value of *<tt>xwiki.stats</tt>* to *<tt>1</tt>* in the *<tt>xwiki.cfg</tt>* configuration file. For more details, see [xwiki.org>http://www.xwiki.org].
+
+Activating the statistics module makes the following information available to you:
+
+* Most edited pages
+* Most active users
+* Current month activity
+* Most referred pages
+* and much more!
+")
+#end
+