Changes for page Livetable Macro

Last modified by Manuel Leduc on 2024/01/04 15:56

<
From version < 98.2 >
edited by Tobias Maier
on 2017/11/23 15:16
To version < 99.1 >
edited by Vincent Massol
on 2017/11/24 11:32
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.ZD14
1 +xwiki:XWiki.VincentMassol
ExtensionCode.ExtensionClass[0]
Description
... ... @@ -279,6 +279,28 @@
279 279  }
280 280  {{/code}}
281 281  
282 +=== Documents with date range ===
283 +
284 +The following code will display a Livetable listing all documents that have been modified in the last 2 days. {{info}}Requires XWiki 9.5RC1+{{/info}}
285 +
286 +{{code}}
287 +{{velocity}}
288 +#set ($columns = ['doc.title', 'doc.location', 'doc.date', 'doc.author'])
289 +#set ($columnsProperties = {
290 + 'doc.title': {'link': 'view'},
291 + 'doc.location': {'html': true},
292 + 'doc.author': {'link': 'author'}
293 +})
294 +#set ($start = $xwiki.jodatime.dateTime.minusDays(2).millis)
295 +#set ($end = $xwiki.jodatime.dateTime.millis)
296 +#set ($options = {
297 + 'translationPrefix' : 'platform.index.',
298 + 'extraParams': "&doc.date=${start}-${end}"
299 +})
300 +#livetable('pages' $columns $columnsProperties $options)
301 +{{/velocity}}
302 +{{/code}}
303 +
282 282  == Custom JSON ==
283 283  
284 284  Here's a minimal working example, displaying two fields ("user" and "message"). A slightly more elaborate example can be found in the {{scm path="xwiki-platform-core/xwiki-platform-linkchecker/xwiki-platform-linkchecker-ui/src/main/resources/XWiki/ExternalLinksJSON.xml"}}code of the Link Checker extension{{/scm}}.
XWiki.XWikiComments[2]
Date
... ... @@ -1,1 +1,1 @@
1 -2017-11-23 15:16:37.629
1 +2017-11-23 15:16:37.0

Get Connected