Thanks Philipp
I can manage with velocity, I just needed to instantiate a SimpleDateFormat,
which I can do from a small groovy class loaded with parseGroovyFromPage.
thanks
Vito
On Thu, Dec 23, 2010 at 2:27 PM, tapaya <philipp_roessler(a)freenet.de> wrote:
vimpagliazzo wrote:
I have then modified the Document Sheet code, and I have tried to use
groovy
scripting instead of velocity. However when creating a new object, I get
the
error
Failed to execute the [groovy] macro
org.xwiki.rendering.macro.MacroExecutionException: You don't have the
right
to execute this script
Rule of thumb: you can't use groovy in class sheets.
A newly created document using a sheet (i.e. including a document) with
groovy code in it can't be saved without programming rights. Velocity code
-
even the privileged API - will work as long as the sheet has been saved by
a
user with programming rights; afaik this is due to differences in the
permissions evaluation (cp.
http://markmail.org/message/aaxf5g34knxdvvoh).
Solution:
1. re-write your code in velocity or
2. use velocity in the sheet to include your groovy code through
<code>parseGroovyFromPage</code> (cp.
http://platform.xwiki.org/xwiki/bin/view/DevGuide/GroovyNotificationTutorial
)
Philipp
--
View this message in context:
http://xwiki.475771.n2.nabble.com/object-template-and-groovy-tp5859642p5862…
Sent from the XWiki- Users mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
--
Vito Impagliazzo
---
Please consider the environment before printing this email.