Hi devs,

If I write:

{{groovy}}
print 
com.xpn.xwiki.web.Utils.getComponent(org.xwiki.model.ModelContext.class).getCurrentEntityReference();
{{/groovy}}

in a wiki page I get:

name = [xwiki], type = [WIKI], parent = [null]

I was expecting to get a reference to the current page (i.e. the page 
that executes the groovy script). The javadoc of ModelContext interface 
says:

"Allows accessing Model Objects for current objects (current document, 
current wiki, current space, etc) placed in the Execution Context."

Looks like DefaultModelContext ( 
http://svn.xwiki.org/svnroot/xwiki/platform/core/trunk/xwiki-model/src/main/java/org/xwiki/model/internal/DefaultModelContext.java
 
) always returns a WikiReference. What was the rationale behind this?

Thanks,
Marius
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to