@Unstable
@Role
public interface MacroRefactoring
Modifier and Type | Method and Description |
---|---|
default Set<org.xwiki.rendering.listener.reference.ResourceReference> |
extractReferences(org.xwiki.rendering.block.MacroBlock macroBlock)
Extract references used in the macro so that they can be used for example for creating backlinks.
|
Optional<org.xwiki.rendering.block.MacroBlock> |
replaceReference(org.xwiki.rendering.block.MacroBlock macroBlock,
org.xwiki.model.reference.DocumentReference currentDocumentReference,
org.xwiki.model.reference.DocumentReference sourceReference,
org.xwiki.model.reference.DocumentReference targetReference,
boolean relative)
Replace the given source reference by the given entity reference in the macro block.
|
Optional<org.xwiki.rendering.block.MacroBlock> replaceReference(org.xwiki.rendering.block.MacroBlock macroBlock, org.xwiki.model.reference.DocumentReference currentDocumentReference, org.xwiki.model.reference.DocumentReference sourceReference, org.xwiki.model.reference.DocumentReference targetReference, boolean relative) throws MacroRefactoringException
macroBlock
- the macro block in which to replace the reference.currentDocumentReference
- the reference of the document in which the block is locatedsourceReference
- the reference to replace.targetReference
- the reference to use as replacement.relative
- if true
indicate that the reference should be resolved relatively to the current documentMacroRefactoringException
- in case of problem to parse or render the macro content.default Set<org.xwiki.rendering.listener.reference.ResourceReference> extractReferences(org.xwiki.rendering.block.MacroBlock macroBlock) throws MacroRefactoringException
macroBlock
- the macro block in which to look for references.MacroRefactoringException
- in case of problem to parse the macro content.Copyright © 2004–2022 XWiki. All rights reserved.