A small note about the separate groovy page (I made note of this in the page you put in JV): When you create the page, it cannot have "<%" and "%>". If it does, then it won't work (understandable, a lot of other languages work this way when a separate file used as a source, eg Javascript). However, this then results in your class being shown in plain text in the saved document (this occurs in B2 and B4, can't test B3 as it's not running on our test environment anymore) - which I would not like to see user's having any view access to. I'm unsure of what to suggest around this, or if it is even a concern. Naturally, if "parseGroovyFromString" would allow the "<%%>" then the page would be protected by default from the user (being correctly assessed as a Groovy page), BUT this is not quite a good solution. Perhaps it would help if there are some flags for the page that do not break the "parseGroovyFromString" method, but signify to Xwiki that the page is Groovy (and so needs programming rights to modify or save, and does not show content). For example: $doc.isVelocityInclude public class xyz { groovy code } Once the Xwiki engine sees $doc.isVelocityInclude, it treats the page as velocity and won't save without programming rights, and won't display it's content on viewing the document. Not sure if this is even an issue though. Thoughts? -----Original Message----- From: Esbach, Brandon [mailto:[email protected]] Sent: 16 February 2007 09:32 To: [email protected] Subject: RE: [xwiki-users] Accessing Groovy function from velocity Ahh, nice job! Many thanks, it's a lot clearer now! -----Original Message----- From: Vincent Massol [mailto:[email protected]] Sent: 16 February 2007 08:06 To: [email protected] Subject: Re: [xwiki-users] Accessing Groovy function from velocity Hi JV, Very cool. I've linked your tutorial from http://www.xwiki.org/xwiki/ bin/view/DevGuide/Tutorials Thanks -Vincent On Feb 15, 2007, at 10:34 PM, Jean-Vincent Drean wrote:
Hi,
I've taken advantage of your email to write a "tutorial" ( let's call it a beginning ;) on xwiki.org : http://www.xwiki.org/xwiki/bin/view/DevGuide/ GroovyClassHelloWorldTutorial
JV.
2007/2/15, Esbach, Brandon <[email protected]>:
Currently trying to work with both groovy and velocity for a project management class object. What I need to do is to initiate the groovy function from velocity (with a parameter set). Looking at the newsgroup archives it seems the way to do this is by using "parseGroovyFromString", which indeed returns an object - but how do I then take this and run the function (which in turn returns a
result which I need to assess)?
Brandon Esbach Software Engineer M/A-Com Eurotec Operations LoughMahon Technology Park, Skehard Road, Blackrock, Cork, Ireland Tel +353 21 4808305
-- You receive this message as a subscriber of the xwiki- [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http:// www.objectweb.org/wws
-- You receive this message as a subscriber of the xwiki- [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/ wws