[xwiki-devs] Adding space information to the context.
Hello Devs, Is it possible to use $context.put in the following way: $context.put("space","Main") where space is the key and Main is the value of Space and then retrieve it using $context.get("space") on any page in xwiki! I tried using it but did not work and did not throw any exception either. I am trying to simulate login based on spaces in XWiki Enterprise and this information will be very helpful. Also, if I wanted to change the "function" that is called when a login form is submitted (loginsubmit action), where do I do that. Thanks
I just saw Vincent's response to the question on persisting some information entered by the user on one page across a few other pages linked to this page. Regarding saving something in the context, I tried using this before in some templates (.vm files) , but it did not work. I use dthe $context.put and $context.get...and in the put() method, I created my own key and gave it a prticular value. (Is that the right way of doing this) . I have forwarded another msg I posted sometime back regarding the same. Please advice also on how to access the session cookies or how to save the information in the session. Thanks. ---------- Forwarded message ---------- From: Kamna Jain <[email protected]> Date: Wed, Apr 30, 2008 at 1:23 PM Subject: Adding space information to the context. To: XWiki Developers <[email protected]> Hello Devs, Is it possible to use $context.put in the following way: $context.put("space","Main") where space is the key and Main is the value of Space and then retrieve it using $context.get("space") on any page in xwiki! I tried using it but did not work and did not throw any exception either. I am trying to simulate login based on spaces in XWiki Enterprise and this information will be very helpful. Also, if I wanted to change the "function" that is called when a login form is submitted (loginsubmit action), where do I do that. Thanks
Hi, The context is recreated for every request so you can only save request duration information in there. If you need longer scope then you can use the http session or even the application context (the whole duration of the webapp). Last if you need persistent information you'll need to use a class/object in XWiki (best solution) or manually save the data in your own table in the database (not recommended). Hope it helps, -Vincent On May 16, 2008, at 5:09 AM, Kamna Jain wrote:
I just saw Vincent's response to the question on persisting some information entered by the user on one page across a few other pages linked to this page.
Regarding saving something in the context, I tried using this before in some templates (.vm files) , but it did not work. I use dthe $context.put and $context.get...and in the put() method, I created my own key and gave it a prticular value. (Is that the right way of doing this) . I have forwarded another msg I posted sometime back regarding the same.
Please advice also on how to access the session cookies or how to save the information in the session.
Thanks.
---------- Forwarded message ---------- From: Kamna Jain <[email protected]> Date: Wed, Apr 30, 2008 at 1:23 PM Subject: Adding space information to the context. To: XWiki Developers <[email protected]>
Hello Devs, Is it possible to use $context.put in the following way:
$context.put("space","Main") where space is the key and Main is the value of Space and then retrieve it using $context.get("space") on any page in xwiki!
I tried using it but did not work and did not throw any exception either. I am trying to simulate login based on spaces in XWiki Enterprise and this information will be very helpful.
Also, if I wanted to change the "function" that is called when a login form is submitted (loginsubmit action), where do I do that.
Thanks _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
participants (2)
-
Kamna Jain -
Vincent Massol