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 !!!

I suppose that I should not used doc to find current document in macro.
But I don't find in
http://platform.xwiki.org/xwiki/bin/view/DevGuide/WikiMacroTutorial
how to retrieved current document.
I also test xcontext.doc, but it is same as doc.

So how can find current document (the document which call my macro)?

Regards,

Arnaud.
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to