Hi devs,
Before I start documenting that in a more official fashion here is a summary of a new extension index feature I just committed in master
.
The extension API and the extension index now contains metadata related to components you can find in an extension. This allows various uses cases generally related to discoverability (list remote macros right in the WYSIWYG macro picker, propose some extensions to install in the missing macro error, etc.).
The metadata is pretty simple: an Extension expose a list of role type/hint couples provided by the extension.
The extension index have dynamic fields to associate a role type to a list of hints. It also has a (currently hardcoded) list of aliases for some well known components (just added a few and more will come before 13.3 final to have at least a set of very common user oriented components provided by the contrib extensions) allowing to put things like component_macro:map
directly in the search input of the EM UI.
Since we need this metadata to be part of the extension descriptor (we don’t want to download the extension file just to know if its worth downloading the extension) and that this new feature would be unusable without a way for contrib extensions to start listing components they want to make public right away I came up with the following to start playing with it: XWiki now understand a new custom property that you can define through a Maven <xwiki.extension.components>
property where you list components role/hint couples. For example in the pom.xml file of the Map Macro contrib extension you would have:
<propertie>
<xwiki.extension.component>
org.xwiki.rendering.macro.Macro/map
</xwiki.extension.components>
</properties>
Extensions located on https://extensions.xwiki.org but which are not built with Maven can also set the same property through the field Properties
in the xobject ExtensionCode.ExtensionClass
.