Änderungen von Dokument RecentlyUpdated

Zuletzt geändert von xwikiadmin am 2024/06/24 14:35

Von Version 3.1
bearbeitet von xwikiadmin
am 2023/10/26 09:38
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros/1.12]
Auf Version 4.1
bearbeitet von xwikiadmin
am 2024/06/24 14:35
Änderungskommentar: Install extension [com.xwiki.pro:xwiki-pro-macros-ui/1.19.4]

Zusammenfassung

Details

XWiki.WikiMacroClass[0]
Makro-Code
... ... @@ -8,52 +8,6 @@
8 8  ## Parameter formatting macros
9 9  ## -----------------------------------------------------------------
10 10  
11 -## Format serialized comma-separated list coming from macro parameters
12 -## so that it can be used inside a solr filter query parameter
13 -## * Escape spaces inside values by wrapping them inside quotes,
14 -## making sure "+" and "-" filter modifiers stay outside the quotes
15 -## * Remove commas so that values are separated only by spaces
16 -#macro (formatSerializedList $serializedList $return)
17 - ## Wrap each value around quotes and replace commas by spaces
18 - ## (adds extra quotes / spaces at the beginning and end of the string)
19 - #set ($searchRegex = '(?:^|$|,)\s*([-+]?)')
20 - #set ($replacement = '" $1"')
21 - #if (!$serializedList)
22 - #set($serializedList = "")
23 - #end
24 - #set ($formatted = $serializedList.replace($searchRegex, $replacement))
25 - ## Remove extra quotes / spaces at the beginning and end of the string
26 - #set ($formatted = $!stringtool.substring($formatted, 2, -2))
27 - ## Return
28 - #set ($return = $NULL)
29 - #setVariable("$return" $formatted)
30 -#end
31 -
32 -## Format serialized comma-separated author list coming from macro parameters
33 -## Author format is different between comments and document metadata
34 -## ("xwiki:" wiki prefix is missing from comments author metadata),
35 -## so add both versions in the formatted serialized list
36 -#macro (formatSerializedAuthorList $serializedAuthorList $return)
37 - #set ($authorsList = [])
38 - #set ($splittedAuthorList = $!stringtool.split($serializedAuthorList, ','))
39 - #foreach ($author in $splittedAuthorList)
40 - #set ($author = $!stringtool.strip($author))
41 - #set ($modifier = '')
42 - #if ($author.startsWith('-'))
43 - #set ($modifier = '-')
44 - #set ($author = $author.substring(1))
45 - #end
46 - #set ($resolvedAuthor = $services.model.resolveDocument($author))
47 - #set ($discard = $authorsList.add("${modifier}${author}"))
48 - #set ($discard = $authorsList.add("${modifier}${services.model.serialize($resolvedAuthor, 'default')}"))
49 - #end
50 - #set ($authors = $!stringtool.join($authorsList, ','))
51 - #formatSerializedList($authors, $authors)
52 - ## Return
53 - #set ($return = $NULL)
54 - #setVariable("$return" $authors)
55 -#end
56 -
57 57  ## Format serialized comma-separated types list coming from macro parameters
58 58  ## Return a list containing all the types of results that need to be displayed
59 59  #macro (parseTypes $serializedTypeList $return)
... ... @@ -100,9 +100,7 @@
100 100   #end
101 101  
102 102   ## Authors
103 - #set ($confluenceAuthorsString = "$!stringtool.strip($!wikimacro.parameters.author)")
104 - #formatSerializedAuthorList($confluenceAuthorsString, $authors)
105 - #set ($options.authors = $authors)
57 + #set ($options.authors = "$!stringtool.strip($!wikimacro.parameters.author)")
106 106  
107 107   ## Wiki & Spaces
108 108   #set ($confluenceSpacesString = "$!stringtool.strip($!wikimacro.parameters.spaces)")
... ... @@ -113,6 +113,7 @@
113 113   || $confluenceSpacesString.equals('@self')
114 114   )
115 115   ## Search in current space
68 + ## Newly migrated content don't have @self, see https://jira.xwiki.org/projects/CONFLUENCE/issues/CONFLUENCE-236
116 116   #set ($options.spaces = $doc.space)
117 117   #elseif (
118 118   $confluenceSpacesString.equals('@global')
... ... @@ -132,14 +132,11 @@
132 132   #set ($options.wiki = $NULL)
133 133   #else
134 134   ## Search in specified spaces
135 - #formatSerializedList($confluenceSpacesString, $spaces)
136 - #set ($options.spaces = $spaces)
88 + #set ($options.spaces = $confluenceSpacesString)
137 137   #end
138 138  
139 139   ## Tags
140 - #set ($confluenceLabelString = "$!stringtool.strip($!wikimacro.parameters.labels)")
141 - #formatSerializedList($confluenceLabelString, $tags)
142 - #set ($options.tags = $tags)
92 + #set ($options.tags = "$!stringtool.strip($!wikimacro.parameters.labels)")
143 143  
144 144   ## Types
145 145   #set ($confluenceTypesString = "$!stringtool.strip($!wikimacro.parameters.types)")
... ... @@ -202,18 +202,14 @@
202 202  #end
203 203  {{/velocity}}
204 204  
205 -{{include reference="Licenses.Code.VelocityMacros"/}}
206 -
207 207  {{velocity}}
208 208  ## We need to check if there is a valid license because the macro is registered even if the user doesn't have view right
209 209  ## on the macro definition page. See XWIKI-14828: Rendering macros defined in wiki pages are available to users that
210 210  ## don't have view right on those pages.
211 -#if ($services.licensing.licensor.hasLicensureForEntity($xcontext.macro.doc.documentReference))
159 +#if ($services.promacrolicensing.hasLicensureForEntity($xcontext.macro.doc.documentReference))
212 212   #executeMacro
213 213  #else
214 - {{error}}
215 - #getMissingLicenseMessage('proMacros.extension.name')
216 - {{/error}}
162 + {{missingLicenseMessage extensionName="proMacros.extension.name"/}}
217 217  #end
218 218  {{/velocity}}
219 219  
Standardkategorie
... ... @@ -1,1 +1,0 @@
1 -confluence
XWiki.WikiMacroParameterClass[2]
Parameter-Beschreibung
... ... @@ -1,1 +1,1 @@
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.
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.