-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Vincent Massol Sent: Wednesday, June 03, 2009 11:27 PM To: XWiki Developers Subject: Re: [xwiki-devs] Macros and 1.0 2.0 xwiki syntax
Hi Glenn,
On Jun 4, 2009, at 12:08 AM, <[email protected]> wrote:
I have a java macro which I've written that I'd like to reference from a panel.
Is there a way to use xwiki 2.0 syntax in a panel so I can invoke my macro?
It would appear that panels utilize 1.0 syntax?
The Panels XAR (and thus the default XE XAR which includes the Panels XAR) are still using syntax 1.0 pages.
However you can go to any panels page and edit it in wiki mode and change the syntax to 2.0. The converter will replace the syntax 1.0 #includeForm with a 2.0 {{include document=...}} and convert the panel object to 2.0 syntax. The panel sheet will not be converted (it's another page) and thus the include will perform on the fly conversion from 1.0 syntax to 2.0. That should work most of the time but if you have issues then you'll need to convert the panel sheet to 2.0 syntax.
Also note that in 2.0 syntax the inline mode is triggered automatically only if you add the SheetClass object to the PanelSheet page.
Last and fyi, if you convert a template page to 2.0 then new pages created using that template will be created in 2.0 syntax.
As a workaround I added yet another 2.0 page with just the macro invocation and then included that page in the panel. It seems like a catch22 if I create a component macro I can only use it in 2.0 and if I create a radeox macro I can only use it in 1.0.
Yes and that's normal since each is part of a different rendering system. However as mentioned above you can convert your panel to 2.0 syntax.
How does one write a macro that can be accessable from 1.0 or 2.0 as well as from a panel?
2.0 macros can't be accessed from 1.0 pages (you need to convert these pages to 2.0).
Or, will the 1.0 be jettisoned entirely at some point ?
Yes, it will. The sooner the better. Actually for the XE 2.0 release we'll convert the default XAR to pure 2.0 syntax so that you only use 2.0 syntax in your wiki. Oiur goal is to move all our users to use the 2.0 syntax. Once we consider everyone has moved on (say in a year for ex - no date has been defined yet), we'll remove support for rendering 1.0 syntax (we'll probably keep the 1.0 to 2.0 converter though so 1.0 syntax will probably always be supported but in emulation mode for those late to move to 2.0 syntax).
Hope it helps, -Vincent
Thanks for your very detailed response. It sounds like the best thing for new wiki's at this point is to utilize 2.0 only from the start and avoid 1.0 if possible. -- Glenn
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs