Změny dokumentu Documents Macro
Naposledy změněno Martin Výlet 23.08.2024 08:37
Od verze 4.1
změnil(a) Martin Výlet
k 23.08.2024 08:37
k 23.08.2024 08:37
Změnit komentář:
Install extension [org.xwiki.platform:xwiki-platform-index-ui/16.6.0]
Na verzi 1.1
změnil(a) XWiki Admin
k 26.05.2017 08:17
k 26.05.2017 08:17
Změnit komentář:
Install extension [org.xwiki.platform:xwiki-platform-index-ui-9.3.1]
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Objects (3 modified, 0 added, 1 removed)
Details
- Page properties
-
- Autor dokumentu
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. vyl00221 +XWiki.Admin
- XWiki.WikiMacroClass[0]
-
- Macro code
-
... ... @@ -1,59 +1,47 @@ 1 1 {{velocity}} 2 -#if ("$!xcontext.macro.params.columns" != "") 3 - #set ($ properties = [])2 +#if ("$!xcontext.macro.params.columns" != "") 3 + #set ($collist = []) 4 4 #foreach ($colname in $xcontext.macro.params.columns.split(',')) 5 - #set ($discard = $ properties.add($colname.trim()))5 + #set ($discard = $collist.add($colname.trim())) 6 6 #end 7 7 #else 8 - #set properties = ['doc.title', 'doc.location', 'doc.date', 'doc.author'])8 + #set($collist = ['doc.title', 'doc.location', 'doc.date', 'doc.author']) 9 9 #end 10 -#set ($sourceParameters = { 11 - 'translationPrefix' : 'platform.index.' 10 +#set($colprops = { 11 + 'doc.title' : { 'type' : 'text' , 'size' : 30, 'link' : 'view', 'filterable': false, 'sortable': false }, 12 + 'doc.location' : { 'type': 'text', 'filterable': true, 'html': true}, 13 + 'doc.fullName' : { 'type' : 'text' , 'size' : 30, 'link' : 'view' }, 14 + 'doc.name' : { 'type' : 'text' , 'size' : 30, 'link' : 'view' }, 15 + 'doc.space' : { 'type' : 'text', 'link' : 'space' }, 16 + 'doc.date' : { 'type' : 'date' }, 17 + 'doc.author' : { 'type' : 'text', 'link' : 'author' } 12 12 }) 13 -#if ("$!xcontext.macro.params.space" != "") 14 - #set ($discard = $sourceParameters.put('space', $xcontext.macro.params.space)) 19 +#set($options = { 20 + 'translationPrefix' : 'platform.index.', 21 + 'rowCount' : $xcontext.macro.params.count, 22 + 'description' : 'This table lists documents found on this wiki based on passed criteria. The columns can be sorted and some can be filtered.' 23 +}) 24 +#if ("$!xcontext.macro.params.space" != "") 25 + #set ($extraParams = "&space=$escapetool.url($xcontext.macro.params.space)") 15 15 #end 16 -#if ("$!xcontext.macro.params.location" != "") 17 - #set ($ discard= $sourceParameters.put('location',$xcontext.macro.params.location))27 +#if ("$!xcontext.macro.params.location" != "") 28 + #set ($extraParams = "$!{extraParams}&location=$escapetool.url($xcontext.macro.params.location)") 18 18 #end 19 -#if ("$!xcontext.macro.params.parent" != "") 20 - #set ($ discard= $sourceParameters.put('parent',$xcontext.macro.params.parent))30 +#if ("$!xcontext.macro.params.parent" != "") 31 + #set ($extraParams = "$!{extraParams}&parent=$escapetool.url($xcontext.macro.params.parent)") 21 21 #end 22 -#set ($propertyDescriptors = []) 23 -#if ("$!services.like" != "") 24 - ## We can't make it sortable or filterable right now since it's not stored in DB. 25 - #set ($discard = $propertyDescriptors.add({ 'id': '_likes', 'sortable': false, 'filterable': false })) 26 - #set ($discard = $properties.add('_likes')) 33 +#if ("$!extraParams" != "") 34 + #set($discard = $options.put('extraParams', $extraParams)) 27 27 #end 28 28 #if(!$isGuest && $xcontext.macro.params.actions == "true") 29 - #set propertyDescriptors.add({'id': '_actions', 'displayer': { 'id': 'actions', 'actions': ['copy', 'rename', 'rights', 'delete'] }}))30 - #set erties.add('_actions'))37 + #set($discard = $collist.add('_actions')) 38 + #set($discard = $colprops.put('_actions', { 'actions' : ['copy', 'rename', 'rights', 'delete'] })) 31 31 #end 32 -#set ($liveDataConfig = {'meta': {'propertyDescriptors': $propertyDescriptors}}) 33 33 #if ("$!xcontext.macro.params.id" != "") 34 - #set ($live dataId = $xcontext.macro.params.id)41 + #set ($livetableId = $xcontext.macro.params.id) 35 35 #else 36 36 ## TODO: Improve this since we could have several livetables on the same page with same ids 37 - #set ($live dataId = "documents-$mathtool.random(1, 1000)")44 + #set ($livetableId = "documents-$mathtool.random(1, 1000)") 38 38 #end 39 - 40 -#set ($livedataId = $services.rendering.escape($livedataId, 'xwiki/2.1')) 41 -#set ($description = '') 42 -#if ("$!xcontext.macro.params.description" != '') 43 - #set ($description = $services.rendering.escape($xcontext.macro.params.description, 'xwiki/2.1')) 44 -#end 45 -#set ($limit = '') 46 -#if ("$!xcontext.macro.params.count" != '') 47 - #set ($limit = $services.rendering.escape($xcontext.macro.params.count, 'xwiki/2.1')) 48 -#end 49 -#set ($propertiesStr = $services.rendering.escape($stringtool.join($properties, ','), 'xwiki/2.1')) 50 -{{liveData 51 - id="$livedataId" 52 - properties="$propertiesStr" 53 - source="liveTable" 54 - sourceParameters="$escapetool.url($sourceParameters)" 55 - #if ($description != '')description="$description"#end 56 - #if ($properties.contains('doc.location'))sort="doc.location"#end 57 - #if ($limit != '')limit="$limit"#end 58 -}}$jsontool.serialize($liveDataConfig){{/liveData}} 46 +#livetable($livetableId $collist $colprops $options) 59 59 {{/velocity}} - Default category
-
... ... @@ -1,0 +1,1 @@ 1 +Content - Macro description
-
... ... @@ -1,1 +1,1 @@ 1 -Displays a list of documents in a Live Data1 +Displays a list of documents in a Livetable - Cached
-
... ... @@ -1,1 +1,0 @@ 1 -Ne - Asynchronous rendering
-
... ... @@ -1,1 +1,0 @@ 1 -Ne - Default categories
-
... ... @@ -1,1 +1,0 @@ 1 -Content
- XWiki.WikiMacroParameterClass[3]
-
- Parameter description
-
... ... @@ -1,1 +1,1 @@ 1 -Live Data id1 +Livetable id
- XWiki.WikiMacroParameterClass[5]
-
- Parameter description
-
... ... @@ -1,1 +1,1 @@ 1 -Specifies the list of properties (e.g.,"doc.name,doc.space"). If not specified then the defaultpropertieslistisused ("doc.name,doc.space,doc.date,doc.author")1 +Specifies the list of columns to display (e.g. "doc.name,doc.space"). If not specified then the default column list of used ("doc.name,doc.space,doc.date,doc.author")
- XWiki.WikiMacroParameterClass[7]
-
- Parameter name
-
... ... @@ -1,1 +1,0 @@ 1 -description - Parameter description
-
... ... @@ -1,1 +1,0 @@ 1 -Provide a description of the list of documents - Parameter mandatory
-
... ... @@ -1,1 +1,0 @@ 1 -Ne