# Wiki source code of Available Macros

Last modified by Eyes On Home on 2021/01/07 03:59
Export
Office Formats
Export as PDF
Other Formats
Export as HTML

Show last authors

author | version | line-number | content
--- | --- | --- | ---
|  | 1 | {{velocity}}
|  | 2 | ## Find all wiki macros sp that we can find if a registered macro is a wiki macro
|  | 3 | #set ($wikiMacroDocuments = $services.query.xwql("from doc.object(XWiki.WikiMacroClass) as macros").execute())
|  | 4 | #set ($wikiMacroMap = {})
|  | 5 | #foreach($macroDocumentName in $wikiMacroDocuments)
|  | 6 | #set ($macroDocument = $xwiki.getDocument($macroDocumentName))
|  | 7 | #set ($macroObject = $macroDocument.getObject("XWiki.WikiMacroClass"))
|  | 8 | #set ($discard = $wikiMacroMap.put($macroObject.id, [$macroDocument.documentReference.toString(), $macroObject.visibility]))
|  | 9 | #end
|  | 10 | |=$services.localization.render('help.macroList.id')|=$services.localization.render('help.macroList.name')|=$services.localization.render('help.macroList.category')|=$services.localization.render('help.macroList.description')|=$services.localization.render('help.macroList.visibility')
|  | 11 | #foreach ($descriptor in $services.rendering.getMacroDescriptors('xwiki/2.1'))
|  | 12 | #set ($macroId = $macroDescriptor.id)
|  | 13 | #set ($wikiMacroData = $wikiMacroMap.get($descriptor.id.id))
|  | 14 | #if ("$!wikiMacroData" != '')
|  | 15 | #set ($displayId = "[[$descriptor.id>>$wikiMacroData.get(0)]]")
|  | 16 | #set ($displayVisibility = $wikiMacroData.get(1))
|  | 17 | #else
|  | 18 | #set ($displayId = $descriptor.id)
|  | 19 | #set ($displayVisibility = "Global")
|  | 20 | #end
|  | 21 | |$displayId|$descriptor.name|$!descriptor.defaultCategory|$descriptor.description|$displayVisibility
|  | 22 | #end
|  | 23 | {{/velocity}}

EYES ON HOME SECURITY
XWiki Debian 12.10.2