[xwiki-users] Macro works in Groovy code |?
I want to set content of a document with #warning("My message") When code by Velocity: $newdoc.setContent('#warning("My message")') --> the code works but when code by Groovy <% ... newdoc.setContent("#warning(\"My message\")"); %> --> Error number 4001 in 4: Error while parsing velocity page MySpace.MyDocWrapped Exception: Lexical error: How to solve this error ?
You need to know that velocity executes before groovy in the rendering process so what you wrote below is not correct. -Vincent On Mar 1, 2008, at 2:15 PM, Ngo Thi Hong Nga wrote:
I want to set content of a document with #warning("My message") When code by Velocity: $newdoc.setContent('#warning("My message")') --> the code works but when code by Groovy <% ... newdoc.setContent("#warning(\"My message\")"); %> --> Error number 4001 in 4: Error while parsing velocity page MySpace.MyDoc Wrapped Exception: Lexical error:
How to solve this error ?
So,setting document's content with macro using Groovy is impossible and I must use Velocity to do this. Is there another way ?
On Mar 1, 2008, at 2:26 PM, Ngo Thi Hong Nga wrote:
So,setting document's content with macro using Groovy is impossible and I must use Velocity to do this. Is there another way ?
Well you can escape the # char so it's not recognized by velocity and thus not rendered... \#warning(...) should work. -Vincent
Thank you very much. And there's a little problem I want to ask you. I install XE 1.3-rc-1.8082, everything is ok except that once logged in, I cannot log out. Clicking "Log out" may not change anything. I tried clear the cache and internet temp files but doesn't solve this problem. I only can re-log in when restart my computer.
On Mar 1, 2008, at 2:42 PM, Ngo Thi Hong Nga wrote:
Thank you very much. And there's a little problem I want to ask you. I install XE 1.3-rc-1.8082, everything is ok except that once logged in, I cannot log out. Clicking "Log out" may not change anything. I tried clear the cache and internet temp files but doesn't solve this problem. I only can re-log in when restart my computer. _______________________________________________
yes we have a bug on this. It'll be fixed for 1.3 final. Right now you'll need to clear the cookie for xwiki to log out. Thanks -Vincent
participants (2)
-
Ngo Thi Hong Nga -
Vincent Massol