Wiki source code of Livetable Exporter Macro
Last modified by CULTURATI E.U on 2024/06/10 16:45
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | == Usage == |
| 2 | |||
| 3 | {{code}} | ||
| 4 | {{livetableExporter livetable="my-livetable" /}} | ||
| 5 | {{/code}} | ||
| 6 | |||
| 7 | Where "{{code}}my-livetable{{/code}}" is your livetable's name. | ||
| 8 | |||
| 9 | == Parameters == | ||
| 10 | |||
| 11 | {{velocity}} | ||
| 12 | #set ($parameters = $doc.getObjects('XWiki.WikiMacroParameterClass')) | ||
| 13 | #set ($tableHeaders = '|=Name|=Description|=Mandatory|=Default') | ||
| 14 | #set ($tableBody = '') | ||
| 15 | #foreach ($parameter in $parameters) | ||
| 16 | #set ($isMandatory = ${parameter.getProperty('mandatory').value}) | ||
| 17 | #if ($isMandatory == 1) #set ($isMandatory = "Yes") #else #set ($isMandatory = "No") #end | ||
| 18 | #set ($tableBody = "$tableBody|${parameter.getProperty('name').value}|(((${parameter.getProperty('description').value})))|$isMandatory|$parameter.getProperty('defaultValue').value | ||
| 19 | ") | ||
| 20 | #end | ||
| 21 | ## This option is handy for generating the code to be pasted to the online extension.xwiki.org page for documenting the parameters statically. | ||
| 22 | #if ($request.debug) | ||
| 23 | {{code}} | ||
| 24 | $tableHeaders | ||
| 25 | $tableBody | ||
| 26 | {{/code}} | ||
| 27 | #end | ||
| 28 | |||
| 29 | $tableHeaders | ||
| 30 | $tableBody | ||
| 31 | {{/velocity}} | ||
| 32 | |||
| 33 | |||
| 34 | == Credits == | ||
| 35 | |||
| 36 | * For this macro, see [[the page on XWiki Extensions site>>http://extensions.xwiki.org/xwiki/bin/view/Extension/LivetableExporter Macro]]. | ||
| 37 | * This macro is based on [[a patch by Ludovic Dubost>>http://jira.xwiki.org/browse/XWIKI-5458]]. | ||
| 38 |