You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matt Walter <Ma...@usi.net> on 2004/05/25 15:58:35 UTC

Obtaining the Session in a Transformer

Hi,

I'm new to Cocoon; so far I like it quite a bit. Currently I'm writing
my own Transformer and want to know if there was a way I can access the
user's Session within the Transformer. Can it be done? If so, how?

 

Thanks in advance,

Matt


Re: Obtaining the Session in a Transformer

Posted by Tony Butterfield <bu...@users.sourceforge.net>.
On Tue, 2004-05-25 at 14:58, Matt Walter wrote:
> Hi,
> 
> I’m new to Cocoon; so far I like it quite a bit. Currently I’m writing
> my own Transformer and want to know if there was a way I can access
> the user’s Session within the Transformer. Can it be done? If so, how?
> 
Yes it can, take a look at the source for:
org.apache.cocoon.transformation.ReadDOMSessionTransformer




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


Re: Obtaining the Session in a Transformer

Posted by Jorg Heymans <jh...@domek.be>.
1) Override setup() in your transformer

     public void setup(
         SourceResolver resolver,
         Map objectModel,
         String src,
         Parameters par)
         throws ProcessingException, SAXException, IOException {

2) Then something like

Request request = ObjectModelHelper.getRequest(objectModel);
Session session=request.getSession();


Matt Walter wrote:

> Hi,
> 
> I’m new to Cocoon; so far I like it quite a bit. Currently I’m writing 
> my own Transformer and want to know if there was a way I can access the 
> user’s Session within the Transformer. Can it be done? If so, how?
> 
>  
> 
> Thanks in advance,
> 
> Matt
> 


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