You’re not allowed to use APIs requiring Programming Rights in Panels (there’s a dropPermissions() call in the panels template). See http://jira.xwiki.org/browse/XWIKI-6823 Thanks -Vincent On 25 Aug 2014 at 15:44:41, Pascal BASTIEN ([email protected](mailto:[email protected])) wrote:
An example, if I create a new panel"MonPanel" with this code: {{velocity}} #panelheader('MonPanel')
$xcontext.getContext()
#panelfooter() {{/velocity}} and add it on the right panel:
On the right Panel, in edit mode $xcontext. is initialized http://snag.gy/WvwN3.jpg but not in view mode http://snag.gy/BctGK.jpg !?
(I tested with include a page in panel with new||current context without success)
NB: I need to catch $xcontext t o disply my custom stats.
thxs for any help.
Pascal B.
________________________________ De : Pascal BASTIEN À : XWiki Users Envoyé le : Vendredi 22 août 2014 17h23 Objet : [xwiki-users] need help with getContext
Hello
I try to debug my script and I failed on this strange things:
My velocity code working well (in view mode) on a page except on rightpanel (I want to display result page on it)...
I found $xcontext.getContext() return that on a wiki page:
{util=com.xpn.xwiki.util.Util@5071b4c5, vcontext=org.apache.velocity.VelocityContext@59131ac5, com.xpn.xwiki.plugin.skinx.JsSkinFileExt ... cut ... entReferenceStack=[], wiki=xwiki, doc=Stats.TopPageVue, user=XWiki.Admin}
but when the code (or included page) is in rightspanel: $xcontext.getContext() return "$xcontext.getContext()" ... except when a page is "inline" mode ($xcontext.getContext() return correct value in right panel) :-/
Any idea to help me?
(I'm connected with admin account)
Thxs
Pascal B