@Role
public interface WikiMacroManager
Modifier and Type | Method and Description |
---|---|
boolean |
hasWikiMacro(org.xwiki.model.reference.DocumentReference documentReference)
Utility method for querying
WikiMacroManager to see if there is a WikiMacro already registered
for the given document. |
void |
registerWikiMacro(org.xwiki.model.reference.DocumentReference documentReference,
WikiMacro wikiMacro)
Registers the given
WikiMacro against the ComponentManager matching the Wiki Macro visibility defined
(Current User, Current Wiki, Global). |
void |
unregisterWikiMacro(org.xwiki.model.reference.DocumentReference documentReference)
Unregisters the wiki macro defined on the given document (if there is one).
|
void registerWikiMacro(org.xwiki.model.reference.DocumentReference documentReference, WikiMacro wikiMacro) throws InsufficientPrivilegesException, WikiMacroException
WikiMacro
against the ComponentManager matching the Wiki Macro visibility defined
(Current User, Current Wiki, Global). For example Macros defined with a "Current User" visibility are
registered against the User Component Manager so that they are only visible from that Component Manager and not
from other Component Manager.
Note that the Execution Context must be set properly (the current user or the current wiki must be set) prior to calling this API.
documentReference
- the name of the document which contains the wiki macrowikiMacro
- the WikiMacro
instanceInsufficientPrivilegesException
- if asked visibility is not allowedWikiMacroException
- if a problem happened when registering the macro (document doesn't exist, etc.)void unregisterWikiMacro(org.xwiki.model.reference.DocumentReference documentReference) throws WikiMacroException
documentReference
- the name of the document which contains the wiki macroWikiMacroException
- if a problem happened when registering the macro (document doesn't exist, etc)boolean hasWikiMacro(org.xwiki.model.reference.DocumentReference documentReference)
WikiMacroManager
to see if there is a WikiMacro
already registered
for the given document.documentReference
- the name of the document which contains the wiki macroCopyright © 2004–2021 XWiki. All rights reserved.