Modifications pour le document RecentlyUpdated
Modifié par superadmin le 21/07/2025 - 08:55
Résumé
-
Propriétés de la Page (1 modifications, 0 ajouts, 0 suppressions)
-
Objets (8 modifications, 4 ajouts, 0 suppressions)
- XWiki.WikiMacroClass[0]
- XWiki.WikiMacroParameterClass[0]
- XWiki.WikiMacroParameterClass[1]
- XWiki.WikiMacroParameterClass[2]
- XWiki.WikiMacroParameterClass[4]
- XWiki.WikiMacroParameterClass[6]
- XWiki.WikiMacroParameterClass[7]
- XWiki.WikiMacroParameterClass[8]
- XWiki.WikiMacroParameterClass[9]
- XWiki.WikiMacroParameterClass[10]
- XWiki.WikiMacroParameterClass[11]
- XWiki.WikiMacroParameterClass[12]
Détails
- Propriétés de la Page
-
- Contenu
-
... ... @@ -6,17 +6,20 @@ 6 6 = Parameters = 7 7 8 8 |=Parameter|=Description|=Required|=Default 9 -|**types**|Comma-separated list of types ({{{ page }}}, {{{ blogpost }}}, {{{ comment }}} or {{{ attachment }}}), possibly prefixed with "-".|No|//all types// 10 -|**spaces**|Comma-separated list of spaces, possibly prefixed with "+" or "-", or special value like {{{ @self }}}, {{{ @global }}} or {{{ @all }}}.|No|{{{ @self }}} 11 -|**author**|Comma-separated list of authors.|No| 12 -|**labels**|Comma-separated list of tags, possibly prefixed with "+" or "-".|No| 9 +|**types**|Select one or multiple content types. The macro will display only the content of the type you specify here.|No|//all types// 10 +|**spaces**|Select one or multiple spaces. The macro will display only the documents present in the selected spaces.|No|{{{@self}}} 11 +|**author**|Comma-separated list of authors.|No| 12 +|**labels**|Comma-separated list of tags.|No| 13 +|**excludedLabels**|Comma-separated list of tags.|No| 13 13 |**max**|Maximum number of results.|No| {{{ 15 }}} 14 14 |**theme**|Appearance of the macro ({{{ concise }}}, {{{ social }}}, {{{ sidebar }}}).|No| {{{ concise }}} 15 15 |**width**|Width of the macro in percentage.|No| {{{ 100% }}} 16 16 |**hideHeading**|Whether to hide the text "Recently Updated" as title|No| {{{ false }}} 17 17 |**showProfilePic**|Whether to show the profile picture of users|No| {{{ false }}} 19 +|**currentWiki**|If this parameter is selected then the spaces & excluded spaces parameters are ignored and the macro will display the documents from the current wiki.|No| {{{ false}}} 20 +|**excludedSpaces**|Select one or multiple spaces. The macro will not display the documents present in the selected spaces.|No| 21 +|**global**|If this parameter is selected then spaces, excluded spaces and the current wiki parameters are ignored and the macro will display the documents from the current wiki and subwikis. |No| {{{ false}}} 18 18 19 - 20 20 = Example Usage = 21 21 22 22 {{code}}
- XWiki.WikiMacroClass[0]
-
- Code de la macro
-
... ... @@ -43,6 +43,60 @@ 43 43 #setVariable("$return" $types) 44 44 #end 45 45 46 +## Creates the final space parameter. ConfluenceSpaces comes from migreations and is a mix of prefixed(+/-) spaces and excludedSpaces comes 47 +## from XWiki and are the spaces that should be excluded when doing the solr query. 48 +#macro (constructSpaceParameter $confluenceSpaces, $excludedSpaces) 49 + #set ($exclude = "") 50 + #foreach ($excludedSpace in $excludedSpaces.split(",")) 51 + #if (!$excludedSpace.trim().isBlank()) 52 + #if ($foreach.first) 53 + #set ($exclude = "-$excludedSpace") 54 + #else 55 + #set ($exclude = "$exclude,-$excludedSpace") 56 + #end 57 + #end 58 + #end 59 + #if (!$confluenceSpaces.trim().isEmpty() && !$exclude.trim().isEmpty()) 60 + #set ($finalSpace = "${confluenceSpaces},${exclude}") 61 + #elseif(!$confluenceSpaces.trim().isEmpty()) 62 + #set ($finalSpace = $confluenceSpaces) 63 + #else 64 + #set ($finalSpace = $exclude) 65 + #end 66 +#end 67 + 68 +## Determine if the search should be done in the currentWiki, globally or only on specific spaces. 69 +#macro (determinateSpaceScope $confluenceSpacesString) 70 + ## If the global parameter is marked then we set the search to everywhere, if the currentWiki is marked then we select the current wiki 71 + ## otherwise we just the actual space selected. 72 + #if ($xcontext.macro.params.global == "true") 73 + #set ($confluenceSpacesString = '@all') 74 + #elseif ($xcontext.macro.params.currentWiki == "true") 75 + #set ($confluenceSpacesString = '@global') 76 + #end 77 +#end 78 + 79 +## Handles the construction of the tags parameter. 80 +#macro (constructTagsParameter $confluenceTags, $excludedTags) 81 + #set ($exclude = "") 82 + #foreach ($excludedSpace in $excludedTags.split(",")) 83 + #if (!$excludedSpace.trim().isBlank()) 84 + #if ($foreach.first) 85 + #set ($exclude = "-$excludedSpace") 86 + #else 87 + #set ($exclude = "$exclude,-$excludedSpace") 88 + #end 89 + #end 90 + #end 91 + #if (!$confluenceTags.trim().isEmpty() && !$exclude.trim().isEmpty()) 92 + #set ($finalTags = "${confluenceTags},${exclude}") 93 + #elseif (!$confluenceTags.trim().isEmpty()) 94 + #set ($finalTags = $confluenceTags) 95 + #else 96 + #set ($finalTags = $exclude) 97 + #end 98 +#end 99 + 46 46 ## Init options from macro parameters 47 47 #macro (initOptionsFromParameters $return) 48 48 ## Gather every parameter in an option object that will be returned ... ... @@ -54,12 +54,13 @@ 54 54 #end 55 55 56 56 ## Authors 57 - #set ($options.authors = "$!stringtool.strip($!wikimacro.parameters.author)") 58 - 111 + #set ($options.authors = "$!stringtool.strip($!stringtool.join($!wikimacro.parameters.author, ','))") 59 59 ## Wiki & Spaces 60 - #set ($confluenceSpacesString = "$!stringtool.strip($!wikimacro.parameters.spaces)") 113 + #set ($excludedSpaces = "$!xcontext.macro.params.excludedSpaces") 114 + #set ($confluenceSpacesString = "$!stringtool.strip($!xcontext.macro.params.spaces)") 61 61 #set ($options.spaces = $NULL) 62 62 #set ($options.wiki = $doc.wiki) 117 + #determinateSpaceScope($confluenceSpacesString) 63 63 #if ( 64 64 $confluenceSpacesString.equals('') 65 65 || $confluenceSpacesString.equals('@self') ... ... @@ -85,14 +85,16 @@ 85 85 #set ($options.wiki = $NULL) 86 86 #else 87 87 ## Search in specified spaces 88 - #set ($options.spaces = $confluenceSpacesString) 143 + #constructSpaceParameter($confluenceSpacesString, $excludedSpaces) 144 + #set ($options.spaces = $finalSpace) 89 89 #end 90 90 91 91 ## Tags 92 - #set ($options.tags = "$!stringtool.strip($!wikimacro.parameters.labels)") 148 + #constructTagsParameter("$!stringtool.strip($!xcontext.macro.params.labels)", "$!stringtool.strip($!xcontext.macro.params.excludedLabels)") 149 + #set ($options.tags = $finalTags) 93 93 94 94 ## Types 95 - #set ($confluenceTypesString = "$!stringtool.strip($! wikimacro.parameters.types)")152 + #set ($confluenceTypesString = "$!stringtool.strip($!xcontext.macro.params.types)") 96 96 #parseTypes($confluenceTypesString, $types) 97 97 #set ($options.types = $types) 98 98 ... ... @@ -156,7 +156,7 @@ 156 156 ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right 157 157 ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that 158 158 ## don't have view right on those pages. 159 -#if ($services.licensing. licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))216 +#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference)) 160 160 #executeMacro 161 161 #else 162 162 {{missingLicenseMessage extensionName="proMacros.extension.name"/}} - Default categories
-
... ... @@ -1,0 +1,1 @@ 1 +Content
- XWiki.WikiMacroParameterClass[0]
-
- Type du paramètre
-
... ... @@ -1,1 +1,1 @@ 1 - java.lang.String1 +com.xwiki.macros.internal.userlist.UserReferenceList
- XWiki.WikiMacroParameterClass[1]
-
- Type du paramètre
-
... ... @@ -1,1 +1,1 @@ 1 - java.lang.String1 +com.xwiki.pickers.SuggestSpacesReference
- XWiki.WikiMacroParameterClass[2]
-
- Description du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -Filter the results by label. The macro will display only the pages etc which are tagged with the label(s) you specify here. You can specify one or more label values, separated by a comma or a space. To exclude content which matches a given label, put a minus sign (-) immediately in front of that label value. For example: If you specify a label value of -badpage you will get only content which is not labeled with 'badpage'. To indicate that the results** **must match a given label value, put a plus sign (+) immediately in front of that label value. For example: If you specify a label value of +superpage,+goodpage you will get only content which has at least two labels, being 'superpage' and 'goodpage'. The labels parameter only applies to the page and blog content types. - Type du paramètre
-
... ... @@ -1,1 +1,1 @@ 1 - java.lang.String1 +com.xwiki.pickers.TagsReference
- XWiki.WikiMacroParameterClass[4]
-
- Description du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -This parameter allows you to filter content by content type. The macro will display only the content of the type you specify here. You can specify one or more types, separated by a comma or a space. To exclude content of a given content type, put a minus sign (-) immediately in front of that content type. For example: If you specify a content type of -blogpost you will get pages and all other content except for blog posts. Available values: "page" - documents, "blogpost" or "news" - blogpost documents, "comment" - comments on documents, "attachment" - attachments - Type du paramètre
-
... ... @@ -1,1 +1,1 @@ 1 - java.lang.String1 +com.xwiki.pickers.recentlyupdated.RecentlyUpdateType
- XWiki.WikiMacroParameterClass[6]
-
- Description du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -Choose the appearance of this macro: "concise" - the default list, showing the names of pages which were updated or commented on, the users who made the page modifications and time when the modifications occurred. "social" - lists recent modifications in reverse chronological order, but groups them by user into short time segments. A 'sub' list appears within each user's time segment, showing the names of pages which they updated or commented on and time when these modifications occurred. "sidebar" - lists recent updates in reverse chronological order, showing the names of pages which were updated or commented on and time when the page modifications occurred. This theme does not show authorship. - Type du paramètre
-
... ... @@ -1,1 +1,1 @@ 1 - java.lang.String1 +com.xwiki.macros.internal.recentlyupdated.RecentlyUpdatedThemeEnum
- XWiki.WikiMacroParameterClass[7]
-
- Description du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -Specify "showProfilePic=true" to display the profile pictures of the users who updated the content.
- XWiki.WikiMacroParameterClass[8]
-
- Description du paramètre
-
... ... @@ -1,1 +1,0 @@ 1 -Determines whether the macro hides or displays the text 'Recently Updated' as a title above the list of content. Only available in wikimarkup and storage format. Accepted values: "true" - Title is hidden, "false" - Title is shown.
- XWiki.WikiMacroParameterClass[9]
-
- Nom du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +excludedLabels - Type du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +com.xwiki.pickers.TagsReference
- XWiki.WikiMacroParameterClass[10]
-
- Valeur par défaut du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +false - Paramètre obligatoire
-
... ... @@ -1,0 +1,1 @@ 1 +Non - Nom du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +global - Type du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +java.lang.Boolean
- XWiki.WikiMacroParameterClass[11]
-
- Valeur par défaut du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +false - Paramètre obligatoire
-
... ... @@ -1,0 +1,1 @@ 1 +Non - Nom du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +currentWiki - Type du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +java.lang.Boolean
- XWiki.WikiMacroParameterClass[12]
-
- Nom du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +excludedSpaces - Type du paramètre
-
... ... @@ -1,0 +1,1 @@ 1 +com.xwiki.pickers.SuggestSpacesReference