Hi Marius,
2010/10/26 Marius Dumitru Florea<mariusdumitru.florea(a)xwiki.com>om>:
Hi Arnaud,
On 10/26/2010 12:38 PM, Arnaud bourree wrote:
Hello,
I develop a macro which display object attached to the current page.
Here summary of my code:
{{goovy}}
def topic = doc.getObject("ActivityReport.TopicClass",
Integer.valueOf(xcontext.macro.params.id))
println "|"+doc.displayPrettyName("topic",
title)+"|"+topic.get("title")
println "|"+doc.displayPrettyName("topic",
action)+"|"+topic.get("action")
println "|"+doc.displayPrettyName("topic",
status)+"|"+topic.get("status")
{{/groovy}}
In my macro page, I put one instance of my TopicClass for development.
That working fine.
In an other page I put an other instance and call my macro.
It display instance from macro page !!!
Indeed. I just tested a wiki macro with this code:
----------8<----------
{{velocity}}
$doc | $xcontext.doc
{{/velocity}}
{{groovy}}
print doc.toString() + " | " + xcontext.doc.toString()
{{/groovy}}
---------->8----------
and the result is:
----------8<----------
Sandbox.FF | Sandbox.WikiMacroTest