Skip to content

Commit

Permalink
XWIKI-19041: Replace the Livetable from DocumentsMacro with a Live Da…
Browse files Browse the repository at this point in the history
…ta macro
  • Loading branch information
manuelleduc committed Jan 30, 2024
1 parent f86896c commit c821d6f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@
## Since we display the space index, we do not display page titles and locations, but the old columns name and space
## (old behavior consistent with this old macro)...

#set ($description = $services.localization.render('platform.index.spaceIndexDescription', [$space]))
#set ($description = $services.rendering.escape($description, 'xwiki/2.1'))
{{documents
space="$space.replaceAll('["~]', '~$0')"
space="$services.rendering.escape($space, 'xwiki/2.1')"
id="spaceindex"
columns="doc.name,doc.space,doc.date,doc.author"
description="$services.localization.render('platform.index.spaceIndexDescription', [$space])"
description="$description"
/}}
#set($docextras=[])
{{/velocity}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,23 @@ Generates:
#set ($livedataId = "documents-$mathtool.random(1, 1000)")
#end

#set ($livedataId = $services.rendering.escape($livedataId, 'xwiki/2.1'))
#set ($description = '')
#if ("$!xcontext.macro.params.description" != '')
#set ($description = $services.rendering.escape($xcontext.macro.params.description, 'xwiki/2.1'))
#end
#set ($limit = '')
#if ("$!xcontext.macro.params.count" != '')
#set ($limit = $services.rendering.escape($xcontext.macro.params.count, 'xwiki/2.1'))
#end
{{liveData
id="$livedataId"
properties="$stringtool.join($properties, ',')"
source="liveTable"
sourceParameters="$escapetool.url($sourceParameters)"
description="$!xcontext.macro.params.description"
#if ($description != '')description="$description"#end
#if ($properties.contains('doc.location'))sort="doc.location"#end
#if ("$!xcontext.macro.params.count" != '')limit="$xcontext.macro.params.count"#end
#if ($limit != '')limit="$limit"#end
}}$jsontool.serialize($liveDataConfig){{/liveData}}
{{/velocity}}</code>
</property>
Expand Down Expand Up @@ -869,7 +878,7 @@ Generates:
<defaultValue/>
</property>
<property>
<description>Specifies the list of properties (e.g., "doc.name,doc.space"). If not specified then the default properties list of used ("doc.name,doc.space,doc.date,doc.author")</description>
<description>Specifies the list of properties (e.g., "doc.name,doc.space"). If not specified then the default properties list is used ("doc.name,doc.space,doc.date,doc.author")</description>
</property>
<property>
<mandatory>0</mandatory>
Expand Down

0 comments on commit c821d6f

Please sign in to comment.