Re: [xwiki-users] Executing a macro in the standalone XWiki Rendering Framework
Hello Eduard and Thomas, Thanks for pointing me in the right direction, I got my little example macro working. Kind Regards, Thomas On 20 April 2016 at 15:54, Eduard Moraru wrote: > Hi, > > You could look at a very simple "userAvatar" macro for inspiration: > > https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-useravatar > > Normally, you should: > - extend org.xwiki.rendering.macro.AbstractMacro, > - mark your implementation as an XWiki component (@Component) and give it a > name (@Named("colour")), > - register your component in your module's > main/resources/META-INF/components.txt, > - build and install your jar in your app's classpath, > - execute your macro ( > > http://rendering.xwiki.org/xwiki/bin/view/Main/GettingStarted#HExecuteMacros > ). > > Hope this helps, > Eduard > > On Wed, Apr 20, 2016 at 10:51 AM, Thomas Wendel > wrote: > > > Hi, > > > > I am evaluating the XWiki Rendering Framework for a project of ours. > > > > It was no problem to create a little POC to render some sample XWiki > syntax > > into HTML. Next I tried to write a little colour macro that simply > renders > > some text in a colour which is specified as a macro parameter. However, I > > did not manage to get the macro executed. In the resulting HTML output I > > get the error message: > > > > Unknown macro: colour.The "colour" macro is not in the list of registered > > macros. Verify the spelling or contact your administrator. > > > > Now I have the following questions: > > > > Is it possible at all to render a macro and execute it standalone with > the > > rendering framework (as opposed to running it in the XWiki Platform)? > > > > As mentioned above, I implemented a little POC application that simply > > renders XWiki syntax. The macro itself I implemented as a standalone > jar. I > > put the macro jar in the class path and the macro's package to the > > context.txt of the POC application. Is that correct so far? > > > > Am I missing something totally altogether? > > > > Thanks for your help in advance. > > Regards, > > Thomas > > ___ > > users mailing list > > users@xwiki.org > > http://lists.xwiki.org/mailman/listinfo/users > > > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Executing a macro in the standalone XWiki Rendering Framework
You can also look at http://rendering.xwiki.org/xwiki/bin/view/Main/ExtendingMacro for more details. On Wed, Apr 20, 2016 at 3:54 PM, Eduard Moraru wrote: > Hi, > > You could look at a very simple "userAvatar" macro for inspiration: > https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-useravatar > > Normally, you should: > - extend org.xwiki.rendering.macro.AbstractMacro, > - mark your implementation as an XWiki component (@Component) and give it a > name (@Named("colour")), > - register your component in your module's > main/resources/META-INF/components.txt, > - build and install your jar in your app's classpath, > - execute your macro ( > http://rendering.xwiki.org/xwiki/bin/view/Main/GettingStarted#HExecuteMacros > ). > > Hope this helps, > Eduard > > On Wed, Apr 20, 2016 at 10:51 AM, Thomas Wendel > wrote: > >> Hi, >> >> I am evaluating the XWiki Rendering Framework for a project of ours. >> >> It was no problem to create a little POC to render some sample XWiki syntax >> into HTML. Next I tried to write a little colour macro that simply renders >> some text in a colour which is specified as a macro parameter. However, I >> did not manage to get the macro executed. In the resulting HTML output I >> get the error message: >> >> Unknown macro: colour.The "colour" macro is not in the list of registered >> macros. Verify the spelling or contact your administrator. >> >> Now I have the following questions: >> >> Is it possible at all to render a macro and execute it standalone with the >> rendering framework (as opposed to running it in the XWiki Platform)? >> >> As mentioned above, I implemented a little POC application that simply >> renders XWiki syntax. The macro itself I implemented as a standalone jar. I >> put the macro jar in the class path and the macro's package to the >> context.txt of the POC application. Is that correct so far? >> >> Am I missing something totally altogether? >> >> Thanks for your help in advance. >> Regards, >> Thomas >> ___ >> users mailing list >> users@xwiki.org >> http://lists.xwiki.org/mailman/listinfo/users >> > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users -- Thomas Mortagne ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Executing a macro in the standalone XWiki Rendering Framework
Hi, You could look at a very simple "userAvatar" macro for inspiration: https://github.com/xwiki/xwiki-platform/tree/master/xwiki-platform-core/xwiki-platform-rendering/xwiki-platform-rendering-macros/xwiki-platform-rendering-macro-useravatar Normally, you should: - extend org.xwiki.rendering.macro.AbstractMacro, - mark your implementation as an XWiki component (@Component) and give it a name (@Named("colour")), - register your component in your module's main/resources/META-INF/components.txt, - build and install your jar in your app's classpath, - execute your macro ( http://rendering.xwiki.org/xwiki/bin/view/Main/GettingStarted#HExecuteMacros ). Hope this helps, Eduard On Wed, Apr 20, 2016 at 10:51 AM, Thomas Wendel wrote: > Hi, > > I am evaluating the XWiki Rendering Framework for a project of ours. > > It was no problem to create a little POC to render some sample XWiki syntax > into HTML. Next I tried to write a little colour macro that simply renders > some text in a colour which is specified as a macro parameter. However, I > did not manage to get the macro executed. In the resulting HTML output I > get the error message: > > Unknown macro: colour.The "colour" macro is not in the list of registered > macros. Verify the spelling or contact your administrator. > > Now I have the following questions: > > Is it possible at all to render a macro and execute it standalone with the > rendering framework (as opposed to running it in the XWiki Platform)? > > As mentioned above, I implemented a little POC application that simply > renders XWiki syntax. The macro itself I implemented as a standalone jar. I > put the macro jar in the class path and the macro's package to the > context.txt of the POC application. Is that correct so far? > > Am I missing something totally altogether? > > Thanks for your help in advance. > Regards, > Thomas > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users > ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
Re: [xwiki-users] Executing a macro in the standalone XWiki Rendering Framework
On Wed, Apr 20, 2016 at 9:51 AM, Thomas Wendel wrote: > Hi, > > I am evaluating the XWiki Rendering Framework for a project of ours. > > It was no problem to create a little POC to render some sample XWiki syntax > into HTML. Next I tried to write a little colour macro that simply renders > some text in a colour which is specified as a macro parameter. However, I > did not manage to get the macro executed. In the resulting HTML output I > get the error message: > > Unknown macro: colour.The "colour" macro is not in the list of registered > macros. Verify the spelling or contact your administrator. > > Now I have the following questions: > > Is it possible at all to render a macro and execute it standalone with the > rendering framework (as opposed to running it in the XWiki Platform)? Definitely. > > As mentioned above, I implemented a little POC application that simply > renders XWiki syntax. The macro itself I implemented as a standalone jar. I > put the macro jar in the class path and the macro's package to the > context.txt of the POC application. Is that correct so far? No idea what context.txt file is. The error you get ("The "colour" macro is not in the list of registered macros") means that it did try to execute macros but your macro handler could not be found. Here are a few causes I can think of: * you don't have your macro's jar in your classpath * Java macros being components you need to make sure your macro is listed in WEB-INF/component.txt file in your macro's jar > > Am I missing something totally altogether? > > Thanks for your help in advance. > Regards, > Thomas > ___ > users mailing list > users@xwiki.org > http://lists.xwiki.org/mailman/listinfo/users -- Thomas Mortagne ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
[xwiki-users] Executing a macro in the standalone XWiki Rendering Framework
Hi, I am evaluating the XWiki Rendering Framework for a project of ours. It was no problem to create a little POC to render some sample XWiki syntax into HTML. Next I tried to write a little colour macro that simply renders some text in a colour which is specified as a macro parameter. However, I did not manage to get the macro executed. In the resulting HTML output I get the error message: Unknown macro: colour.The "colour" macro is not in the list of registered macros. Verify the spelling or contact your administrator. Now I have the following questions: Is it possible at all to render a macro and execute it standalone with the rendering framework (as opposed to running it in the XWiki Platform)? As mentioned above, I implemented a little POC application that simply renders XWiki syntax. The macro itself I implemented as a standalone jar. I put the macro jar in the class path and the macro's package to the context.txt of the POC application. Is that correct so far? Am I missing something totally altogether? Thanks for your help in advance. Regards, Thomas ___ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users