Index: wiki/src/main/resources/Main/Dashboard.xml
===================================================================
--- wiki/src/main/resources/Main/Dashboard.xml (revision 32680)
+++ wiki/src/main/resources/Main/Dashboard.xml (working copy)
@@ -218,11 +218,10 @@
#else
= $msg.get("xe.dashboard.space.recentactivity", [$doc.space]) =
## Set variables to limit recent activity to the current space and 15 items.
- #set ($rcSpace = $doc.space)
- #set ($rcChangesNb = 15)
+ #set ($aSpace = $doc.space)
#end
- {{recentactivity space="$!rcSpace" changesNb="$!rcChangesNb" /}}
+ {{activity spaces="$!aSpace" /}}
)))
)))
Index: wiki/src/main/resources/Main/RecentActivity.xml
===================================================================
--- wiki/src/main/resources/Main/RecentActivity.xml (revision 32680)
+++ wiki/src/main/resources/Main/RecentActivity.xml (working copy)
@@ -652,49 +652,75 @@
##
## Get values from request/macro param
##--------------------------------------------------------------
-## Authors
-#setVariableFromRequest($rcAuthor "rcAuthor" [])
-#if($rcAuthor.size() == 0)
- #set($rcAuthorString = $context.macro.params.get('author'))
- #asList($rcAuthor $rcAuthorString)
+## Number of entries to display
+#setVariableFromRequest($aEntries "entries" 20)
+#if($aEntries == 20 && $context.macro.params.get('entries'))
+ #set($aEntries = $util.parseInt($context.macro.params.get('entries')))
#end
+## Number of activities to display for each entry
+#setVariableFromRequest($aSubEntries "subentries" 10)
+#if($aSubEntries == 10 && $context.macro.params.get('subentries'))
+ #set($aSubEntries = $util.parseInt($context.macro.params.get('subentries')))
+#end
+## Wikis
+#setVariableFromRequest($aWikis "wikis" [])
+#if($aWikis.size() == 0)
+ #set($aWikisString = $context.macro.params.get('wikis'))
+ #asList($aWikis $aWikisString)
+#end
## Spaces
-#setVariableFromRequest($rcSpace "rcSpace" [])
-#if($rcSpace.size() == 0)
- #set($rcSpaceString = $context.macro.params.get('space'))
- #asList($rcSpace $rcSpaceString)
+#setVariableFromRequest($aSpaces "spaces" [])
+#if($aSpaces.size() == 0)
+ #set($aSpacesString = $context.macro.params.get('spaces'))
+ #asList($aSpaces $aSpacesString)
#end
+## Authors
+#setVariableFromRequest($aAuthors "authors" [])
+#if($aAuthors.size() == 0)
+ #set($aAuthorsString = $context.macro.params.get('authors'))
+ #asList($aAuthors $aAuthorsString)
+#end
## Tags
-#setVariableFromRequest($rcTag "rcTag" [])
-#if($rcTag.size() == 0)
- #set($rcTagString = $context.macro.params.get('tag'))
- #asList($rcTag $rcTagString)
+#setVariableFromRequest($aTags "tags" [])
+#if($aTags.size() == 0)
+ #set($aTagsString = $context.macro.params.get('tags'))
+ #asList($aTags $aTagsString)
#end
-## RSS links
-#setVariableFromRequest($rcShowRss "rcShowRss" false)
-## Number of pages to display
-#setVariableFromRequest($rcChangesNb "rcChangesNb" 20)
-## Number of events for each page
-#setVariableFromRequest($rcEventsNo "rcEventsNo" 10)
+## Minor versions
+#setVariableFromRequest($aMinor "minor" false)
+#if(!$aMinor && $context.macro.params.get('minor'))
+ #set($aMinor = $context.macro.params.get('minor'))
+#end
+## RSS link
+#setVariableFromRequest($aRSS "rss" false)
+#if(!$aRSS && $context.macro.params.get('rss'))
+ #set($aRSS = $context.macro.params.get('rss'))
+#end
##
## Filter by
## ------------------------------------------------------------
-## AUTHOR
-#updateFilterClause('user' $rcAuthor false)
-## SPACE
-#updateFilterClause('space' $rcSpace false)
+## Authors
+#updateFilterClause('user' $aAuthors false)
+## Spaces
+#updateFilterClause('space' $aSpaces false)
## BLACKLISTED SPACES - exclude them
#if($blacklistedSpaces)
#updateFilterClause('space' $blacklistedSpaces true)
#end
-## TAGS
-#if("$!xwiki.getPlugin('tag')" != "" && $rcTag.size() > 0)
+## Wikis
+#updateFilterClause('wiki' $aWikis false)
+## Tags
+#if("$!xwiki.getPlugin('tag')" != '' && $aTags.size() > 0)
#set($docsWithTag = $util.getArrayList())
- #foreach($item in $rcTag)
+ #foreach($item in $aTags)
#set($discard = $docsWithTag.addAll($xwiki.tag.getDocumentsWithTag($item)))
#end
#updateFilterClause('page' $docsWithTag false)
#end
+## Minor versions
+#if("$!aMinor" == 'false')
+ #set($filterClause = $filterClause + " and version like '%.1'")
+#end
##
## Macros
## -------------------------------------------------------------
@@ -886,7 +912,7 @@
##
## Build the clean event list
## ---------------------------------------------------------------
- #if(!$isConsecutiveUpdateEvent && !($event.type == 'updateAnnotation') && !$isUpdateOrAddAttachmentRelatedEvent && $newList.size() < $rcEventsNo)
+ #if(!$isConsecutiveUpdateEvent && !($event.type == 'updateAnnotation') && !$isUpdateOrAddAttachmentRelatedEvent && $newList.size() < $aSubEntries)
#set($discard = $newList.add($event))
#set($previousEventInNewList = $event)
#end
@@ -929,11 +955,11 @@
#macro(displayRSSURL)
#set($rssURL = "")
#set($parameters = 'xpage=plain&outputSyntax=plain')
- #if($rcTag.size() > 0)
- #set($parameters = "${parameters}&tag=$listtool.get($rcTag, 0)")
+ #if($aTags.size() > 0)
+ #set($parameters = "${parameters}&tag=$listtool.get($aTags, 0)")
#end
- #if($rcSpace.size() > 0)
- #set($parameters = "${parameters}&space=$listtool.get($rcSpace, 0)")
+ #if($aSpaces.size() > 0)
+ #set($parameters = "${parameters}&space=$listtool.get($aSpaces, 0)")
#end
#set($rssURL = $xwiki.getURL('Main.WebRss', 'view', $parameters))
<div class="rssURL">
@@ -1144,7 +1170,7 @@
## Get distinct pages with recent activity
## -------------------------------------------------------------------
#set($activitiesQuery = "select page, max(date) from ActivityEventImpl where $!filterClause group by page order by max(date) desc")
- #set($pages = $xwiki.search($activitiesQuery, $rcChangesNb, 0))
+ #set($pages = $xwiki.search($activitiesQuery, $aEntries, 0))
#if ($pages.size() > 0)
#foreach($page in $pages)
##
@@ -1178,7 +1204,7 @@
##
## Display RSS URL
## -------------------------------------------------------------------
- #if($rcShowRss)
+ #if("$!aRSS" == 'true')
#displayRSSURL()
#end
#end
@@ -1200,13 +1226,13 @@
Content
-Displays the recent activity in this wiki or in the passed space, if any.
+The Activity Macro provides information about recent activities done by the users inside the XWiki instance. Activity Macro listens the: create, edit, delete events for pages, comments, attachments and annotations.
-recentactivity
+activity
-Recent Activity
+Activity
0
@@ -1267,18 +1293,18 @@
Main.RecentActivity
0
XWiki.WikiMacroParameterClass
-822b7323-43ba-4878-8209-7537c9a7c395
+76922370-d2c4-4a50-98f3-2967415e0b73
-false
+20
-Whether to show modifications that create minor versions or not.
+Number of entries to display the activity for.
0
-showMinor
+entries
+
{{velocity}}
##
## Recent Activity
@@ -1686,46 +1778,16 @@
## Parameters which can be set in velocity before including this page or can be passed as HTTP parameters.
## Note that HTTP parameters supercede velocity set variables.
##
-## - rcShowRss (String set to "true" or "false"): show RSS at the bottom of the list.
-## - rcSpace (List of string[s]): restrict recent activity retrieval to pages within the given space.
-## - rcTag (List of string[s]): restrict recent activity retrieval to pages with the given tag.
-## - rcAuthor (List of string[s]): restrict recent activity retrieval to pages with the given author.
-## - rcChangesNb (String set to a numerical value): number of pages to display recent activity.
-## - rcPagercPageEventsNo (String set to a numerical value): number of activity events displayed for each page.
+## - entries (String set to a numerical value): number of entries to display the activity for.
+## - subentries (String set to a numerical value): number of activities to show for each entry.
+## - wikis (List of string[s]): comma separated list of wikis to display activity for.
+## - spaces (List of string[s]): comma separated list of spaces to display the activity for.
+## - authors (List of string[s]): comma separated list of authors whose modifications to show.
+## - tags (List of string[s]): comma separated list of tags to display activity for.
+## - minor (String set to "true" or "false"): whether to show modifications that create minor versions or not.
+## - rss (String set to "true" or "false"): whether to show activity rss link or not.
##
-#if($rcTag)
- #set($rcTagString = "")
- #foreach($rcTagValue in $rcTag)
- #if($velocityCount > 1)
- #set($rcTagString = "${rcTagString}, ")
- #end
- #set($rcTagString = "${rcTagString} ${rcTagValue}")
- #end
-#end
-#if($rcSpace)
- #set($rcSpaceString = "")
- #foreach($rcSpaceValue in $rcSpace)
- #if($velocityCount > 1)
- #set($rcSpaceString = "${rcSpaceString}, ")
- #end
- #set($rcSpaceString = "${rcSpaceString} ${rcSpaceValue}")
- #end
-#end
-#if($rcAuthor)
- #set($rcAuthorString = "")
- #foreach($rcAuthorValue in $rcAuthor)
- #if($velocityCount > 1)
- #set($rcAuthorString = "${rcAuthorString}, ")
- #end
- #set($rcAuthorString = "${rcAuthorString} ${rcAuthorValue}")
- #end
-#end
-## pass the variables from the velocity context
-{{recentactivity #if($rcShowRss) showRss="$rcShowRss" #end
- #if($rcChangesNb) changesNb="$rcChangesNb" #end
- #if($rcPagercPageEventsNb) changesNb="$rcPagercPageEventsNb" #end
- #if($rcSpaceString) space="$rcSpaceString" #end
- #if($rcTagString) tag="$rcTagString" #end
- #if($rcAuthorString) author="$rcAuthorString" #end /}}
-{{/velocity}}
+{{/velocity}}
+
+{{activity /}}