You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Wirz <mi...@abs.de> on 2005/09/14 11:13:23 UTC

Access to SessionContext via ContextManager via Request possible?

Hello Cocoon-Users!

We are currently developing a webapplication using cocoon (2.1).
For the content pages (lists, database stuff) we use xsps and call java
methods from there.
These methods deliver xml. The only argument they get from the xsp is a
cocoon-request
Object.

>From within the java methods I'd like to access the contextManager and
from there sessionContexts.
Is this possible having only a request - object? How is it done? Do I
have a contextManager object
or reference in the xsp?

If it is not possible to retrieve a contextManager from the request, is
there any way to access
the contextManager from within an xsp?
Or do I have to write a generator or inherit from the xsp-generator?

Thanks a lot for hints on that topic,
Michael Wirz



What I'd like to do is the following (found in former posts on this list):

   ContextManager contextManager = (ContextManager)
this.manager.lookup(ContextManager.ROLE);
   SessionContext sessionContext =
contextManager.getContext("authentication");
   String role = sessionContext.getValueOfNode("/authentication/role");
   DocumentFragment documentFragment =
sessionContext.getXML("/authentication/data/mydata");

-- 
abs IT Service GmbH
abs Gruppe
Michael Wirz
Entwicklung

Landsberger Straße 57
82266 Stegen am Ammersee
Telefon: +49 (0)8143 999 43
Telefax: +49 (0)8143 999 49

Michael.Wirz@abs.de
www.eFonds24.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Access to SessionContext via ContextManager via Request possible?

Posted by Antonio Gallardo <ag...@agssa.net>.
Check:

http://wiki.apache.org/cocoon/XspSessionFw

Best Regards,

Antonio Gallardo.

Michael Wirz wrote:

>Hello Cocoon-Users!
>
>We are currently developing a webapplication using cocoon (2.1).
>For the content pages (lists, database stuff) we use xsps and call java
>methods from there.
>These methods deliver xml. The only argument they get from the xsp is a
>cocoon-request
>Object.
>
>>>From within the java methods I'd like to access the contextManager and
>from there sessionContexts.
>Is this possible having only a request - object? How is it done? Do I
>have a contextManager object
>or reference in the xsp?
>
>If it is not possible to retrieve a contextManager from the request, is
>there any way to access
>the contextManager from within an xsp?
>Or do I have to write a generator or inherit from the xsp-generator?
>
>Thanks a lot for hints on that topic,
>Michael Wirz
>
>
>
>What I'd like to do is the following (found in former posts on this list):
>
>   ContextManager contextManager = (ContextManager)
>this.manager.lookup(ContextManager.ROLE);
>   SessionContext sessionContext =
>contextManager.getContext("authentication");
>   String role = sessionContext.getValueOfNode("/authentication/role");
>   DocumentFragment documentFragment =
>sessionContext.getXML("/authentication/data/mydata");
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Access to SessionContext via ContextManager via Request possible?

Posted by Daniele Madama <d....@pronetics.it>.
Hi,
I don't use xsp and I don't known what you have in their API, but you can
try to do a lookup like this:

o.a.c.c.CocoonComponentManager.getSitemapComponentManager().lookup(ContextManager.ROLE);

probably it isn't the best way, but just try it.

Bye,
Daniele

-- 
The box said "Requires Windows 95/98/Me/Nt/2k/XP or better" .... so I
installed Linux !
-o=|=o-

Daniele Madama

Pro-netics s.r.l.
Via Elio Lampridio Cerva 127/c
Roma
Tel. 0651530849
http://www.pronetics.it


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org