[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
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 <[email protected]> À : XWiki Users <[email protected]> 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 _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
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
Thxs a lot (I was on it, during 3 days) Then I will probably modify my templates/rightpanels.vm #if($paneldoc && $!xwiki.hasAccessLevel('view', $paneldoc)) If my NiceSpace then: my nice stats on right panel include myNicePageOfStat #else $services.rendering.render($panelUix.execute(), "xhtml/1.0") #end #end Pascal ________________________________ De : "[email protected]" <[email protected]> À : XWiki Users <[email protected]> Envoyé le : Lundi 25 août 2014 15h56 Objet : Re: [xwiki-users] need help with getContext 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
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Silly on me: of course include fix doesn't work. it doesn't matter I will find another fix later. Thxs. ________________________________ De : Pascal BASTIEN <[email protected]> À : XWiki Users <[email protected]> Envoyé le : Lundi 25 août 2014 16h10 Objet : Re: [xwiki-users] need help with getContext Thxs a lot (I was on it, during 3 days) Then I will probably modify my templates/rightpanels.vm #if($paneldoc && $!xwiki.hasAccessLevel('view', $paneldoc)) If my NiceSpace then: my nice stats on right panel include myNicePageOfStat #else $services.rendering.render($panelUix.execute(), "xhtml/1.0") #end #end Pascal ________________________________ De : "[email protected]" <[email protected]> À : XWiki Users <[email protected]> Envoyé le : Lundi 25 août 2014 15h56 Objet : Re: [xwiki-users] need help with getContext 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
users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
participants (2)
-
Pascal BASTIEN -
vincent@massol.net