How to add XWiki.WikiMacroClass object to xwiki page

I am using the following documentation to create a xwiki macro however I not sure how I get to the form that specifies the attributes of the macro such as “XWiki.WikiMacroClass” in the drop down box.

https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingMacros/WikiMacroTutorial/

How does the form get instantiated? I am using version 13.10.
Thank you for any insight!

I just added info on how to access the object editor on Writing XWiki Rendering Macros in wiki pages (XWiki.org), would be great if you could tell me if you feel it’s enough.

Thank you for putting me in the right direction. I was able to create a macro.
We are in the process of migrating from Confluence and therefore creating the missing corresponding macros. The challenge I have right now is passing parameters from the exported Confluence Macros to my new Xwiki macros. Is there any documentation or examples to help with understanding how the parameters can be passed?
Thanks again!

I’m not entirely sure what is exactly your question, actually. There are two different levels when talking about Confluence macros import:

  • during the import: implement a org.xwiki.contrib.confluence.filter.MacroConverter component which is called by the importer to convert a Confluence macro into whatever you want (not necessarily an XWiki macro, can be simple wiki content)
  • after the import: when no MacroConverter can be found, the importer generate XWiki macro calls which needs an implementation (the part you are currently doing from what I understand)

In both cases, the names of the parameters received by your converter/macro should have the same names as on Confluences side.

Do you have a specific example in mind ?

Site note: XWiki SAS started working on that, so you might be interested in the (paying) https://store.xwiki.com/xwiki/bin/view/Extension/ProMacros/.

Hi Thomas,

Thank you for staying with me while I try to understand this Macro conversion process.

To clarify , the Filter Streams Converter/Confluence XML Extensions import process is as follows:

  1. If the Confluence Macro name is found on XWIKI, the XWIKI macro is used.
  2. If the Confluence Macro name is found on a customized https://github.com/xwiki-contrib/confluence application, the application directs how the macro is converted.
  3. If the Confluence Macro name is not found on XWIKI , a error message is generated and you must do one of the following:
    a. Create the macro by using Java and Maven.
    b. Create the Macro using the tools on XWIKI.

Also is it possible if there is no matching XWIKI macro, the conversion process could add the actual Confluence macro to XWIKI? This Macro could then be reused.
Thanks again!

You need to keep in mind that there is two totally different contexts: the concept of “Confluence Macro” only exist during the execution of the confluence filter, after that there is only XWiki macros calls (and some of them are missing an implementation).

So as I said in the previous message there is only two things you can do:

  • change the way the Confluence Macro is converted (by implementing a converter) during the import (so this converter has to be there before you execute the filter and it’s only used once)
  • provide an implementation for missing XWiki macros (which happen to have similar name and parameters than the Confluence macro that was in the source content) which ended up in your wiki pages after the import

You cannot magically “add the actual Confluence macro to XWIKI”. First because that macro is not in the content you give in input (you only have calls to those macros) and anyway in XWiki you only have XWiki macros so someone has to implement an XWiki macro which behave like the Confluence macro you want to use which can be a lot of work for some macros (that’s what https://store.xwiki.com/xwiki/bin/view/Extension/ProMacros/ is about).