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 @@ -1333,18 +1359,18 @@ Main.RecentActivity 1 XWiki.WikiMacroParameterClass -c9d7f9c0-5fe8-49e9-86c9-ba04148576d7 +dac693ae-b800-4ffc-874f-dbc59db5f32d -true +10 -Whether to show differences for the items in the activity list or not. +Number of activities to show for each entry. 0 -showDiff +subentries @@ -1399,18 +1425,18 @@ Main.RecentActivity 2 XWiki.WikiMacroParameterClass -a50d0bbe-21f8-444d-b42f-5d521372d79e +d5daa5b3-4105-45ca-999d-7dc678073243 -true + -Whether to show activity rss links or not. +Comma separated list of wikis to display activity for. 0 -showRss +wikis @@ -1465,18 +1491,18 @@ Main.RecentActivity 3 XWiki.WikiMacroParameterClass -d5e380c7-3554-48e4-9c4d-c2ec4ca1fe7d +f96d717f-6bc7-465d-ae9e-36cda81cd99b -30 + -Number of activity to show. +Comma separated list of spaces to display the activity for. 0 -changesNb +spaces @@ -1531,18 +1557,18 @@ Main.RecentActivity 4 XWiki.WikiMacroParameterClass -9d0af90f-f2c0-4f22-b555-c20b596bb70e +71dc6bff-7a23-477b-a8a6-bf2bb47596e1 -Comma separated list of tags to display activity for. +Comma separated list of authors whose modifications to show. 0 -tag +authors @@ -1597,18 +1623,18 @@ Main.RecentActivity 5 XWiki.WikiMacroParameterClass -cd7504db-2ea0-4969-9c80-bd5d31fc9410 +f5d8e941-1410-413a-a489-e5f2df8912c3 -Comma separated list of spaces to display the recent activity for. +Comma separated list of tags to display activity for. 0 -space +tags @@ -1663,20 +1689,86 @@ Main.RecentActivity 6 XWiki.WikiMacroParameterClass -c0c73914-3f1a-45e2-a88a-cc8481c66abb +128cca0e-87a2-407a-92fc-5afa6239bdb2 - +false -Comma separated list of authors whose modifications to show. +Whether to show modifications that create minor versions or not. 0 -author +minor + + +XWiki.WikiMacroParameterClass + + + + + + + + +0 +defaultValue +4 +Parameter default value +30 +0 +com.xpn.xwiki.objects.classes.StringClass + + +0 +description +2 +Parameter description +5 +40 +0 +com.xpn.xwiki.objects.classes.TextAreaClass + + +0 +select +yesno +mandatory +3 +Parameter mandatory +0 +com.xpn.xwiki.objects.classes.BooleanClass + + +0 +name +1 +Parameter name +30 +0 +com.xpn.xwiki.objects.classes.StringClass + + +Main.RecentActivity +7 +XWiki.WikiMacroParameterClass +baa8452c-003a-4189-8268-6cd570f7f152 + +false + + +Whether to show activity rss link or not. + + +0 + + +rss + + {{velocity}} ## ## Recent Activity @@ -1686,46 +1778,14 @@ ## 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}} +{{activity /}}