There is plenty of example on the macro syntax in the macro creation document I gave you but here is a more syntax oriented documentation: https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/?syntax=2.1§ion=Macros .
Thomas, Thanks for that pointer, which I’m sure provides some clue to my question. Yet I confess I can’t follow it. Something I’ve learned from years in IT is that even in a firm where half our staff is seriously engaged in programming, people with deep capabilities in one area are still beginners in other. My question quite specifically, which I’d like to find an example for, is how to write a simple Xwiki macro which other staff can easily use as a shortcut to creating links to an arbitrary URL. You say, “See how the filter converts your example” on import, but didn’t you tell me elsewhere that the filter does not convert Mediawiki macros? Indeed, wherever we have Mediawiki macros, importing has inserted “missing macro” messages.
Assuming that the correct translation of our current {{Jira|IT-1234}} macro invocations in Mediawiki is {{Jira param=“IT-1234”}}, how is the variable to be expressed in the macro so included? From the import translation I see them as {{jira}}IT-1234{{/jira}} which I take as equivalent, and which staff should find understandable. If that’s correct, how is the variable that will express the parameter to be specified in the macro? I’m sure it might be obvious if I regularly used Java, but my regular languages are bash, php, python, perl, sql
Your Jira macro looks great for including a table of Jira issues in Xwiki. We look forward to making use of it. But meanwhile we have several hundred pages which rely on direct links to individual Jira issues. Assuming that the construction {{jira}}IT-1234{{/jira}} the conversion made of the links will work, I’m looking for a step-by-step understanding of how to write the macro that will restore the links – not just for Jira, but for other instances were we have similar macros (by other names) cross-referencing to internal sites.
Looking at https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/ nothing there seems to cover this. And when I search on “Macro” I don’t find such a guide to writing them either. What I’m trying to do is a simpler case than those shown on https://www.xwiki.org/xwiki/bin/view/Documentation/DevGuide/Tutorials/WritingMacros/WikiMacroTutorial/. I’m just trying to learn to write an Xwiki macro that will take a single input from the user writing a wiki page, such that {{jira}}IT-1234{{/jira}} will be rendered as a link to
<a href=https://jira.obfuscated.net/browse/IT-1234>IT-1234</a>".
I expect that can be done simply. But in my ignorance of how Xwiki should handle the single variable here (“IT-1234”) I’m still at a loss.
This also is hazy to me: “creating a new wiki page and attaching to it an object of type XWiki.WikiMacroClass”. I’m not an object-oriented programmer. For those of us who are not, it would be useful to have a recipe which demonstrates how to do each step. I have just created a new page. I see nowhere in it’s menus an option to attach an object to it. How is that to be done?
Thanks,
Whit