use of org.xwiki.rendering.macro.MacroId in project xwiki-platform by xwiki.
the class DefaultWikiMacroTest method registerWikiMacro.
private void registerWikiMacro(String macroId, String macroContent, List<WikiMacroParameterDescriptor> parameterDescriptors) throws Exception {
WikiMacroDescriptor descriptor = new WikiMacroDescriptor(new MacroId(macroId), "Wiki Macro", "Description", "Test", WikiMacroVisibility.GLOBAL, new DefaultContentDescriptor(false), parameterDescriptors);
DefaultWikiMacro wikiMacro = new DefaultWikiMacro(wikiMacroDocumentReference, this.user.getDocumentReference(), true, descriptor, this.xwiki20Parser.parse(new StringReader(macroContent)), Syntax.XWIKI_2_0, getComponentManager());
this.wikiMacroManager.registerWikiMacro(wikiMacroDocumentReference, wikiMacro);
}
use of org.xwiki.rendering.macro.MacroId in project xwiki-platform by xwiki.
the class DefaultWikiMacroManagerTest method generateWikiMacro.
private DefaultWikiMacro generateWikiMacro(WikiMacroVisibility visibility) throws Exception {
DocumentReference wikiMacroDocReference = new DocumentReference("wiki", Arrays.asList("space"), "space");
WikiMacroDescriptor descriptor = new WikiMacroDescriptor(new MacroId("testwikimacro"), "Test Wiki Macro", "Description", "Test", visibility, new DefaultContentDescriptor(), Collections.<WikiMacroParameterDescriptor>emptyList());
XDOM xdom = new XDOM(Arrays.asList(new ParagraphBlock(Arrays.<Block>asList(new WordBlock("test")))));
DefaultWikiMacro wikiMacro = new DefaultWikiMacro(wikiMacroDocReference, authorReference, true, descriptor, xdom, Syntax.XWIKI_2_0, this.mocker);
return wikiMacro;
}
Aggregations