# Wiki source code of Available Macros

Last modified by Jean Franco on 2022/06/19 21:15
Export
Office Formats
Export as PDF Export as ODT Export as RTF
Other Formats
Export as HTML

Hide last authors

author | version | line-number | content
--- | --- | --- | ---
| 1.1 | 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}}

# Applications

# Tips

If you're a new XWiki user, check out the Getting Started Guide.

Maila Networks
XWiki Debian 14.4.1