You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Gary Larsen <ga...@envisn.com> on 2008/07/21 22:59:07 UTC

FW: Accessing Cocoon context from class (2.1)

I'm sorry for my impatient developer posting.

 

Still not grasping Avalon and Excalibur stuff in 2.1, but it would seem like
it's possible to create a class which could access the Cocoon context
(org.apache.cocoon.environment.Context).

 

I've tried Serviceable, Contextualizable and Component interfaces and
registering the component in cocoon.xconf - but no luck yet.

 

Could someone suggest some pointers or samples to help me out?

 

Thanks,

gary

 

  _____  

From: Gary Larsen [mailto:gary.larsen@envisn.com] 
Sent: Monday, July 21, 2008 2:31 PM
To: users@cocoon.apache.org
Subject: Accessing Cocoon context from class (2.1)

 

I'm running Cocoon 2.1.9.  Could someone tell me how to access the Cocoon
context from a class?

 

I've built generators which have the ObjectModel passed to it, but in this
case the class is isolated (it also implements HttpSessionBindingListener).

 

Does this class need to implement an interface and/or be registered as a
Cocoon component somehow?

 

Thanks for any assistance.

gary 


Re: FW: Accessing Cocoon context from class (2.1)

Posted by Joerg Heinicke <jo...@gmx.de>.
You need to retrieve a component from the ServiceManager, just 
instantiating doesn't work.

Joerg

On 21.07.2008 22:59, Gary Larsen wrote:

> I'm sorry for my impatient developer posting.
> 
> Still not grasping Avalon and Excalibur stuff in 2.1, but it would seem like
> it's possible to create a class which could access the Cocoon context
> (org.apache.cocoon.environment.Context).
> 
> I've tried Serviceable, Contextualizable and Component interfaces and
> registering the component in cocoon.xconf - but no luck yet.
> 
> Could someone suggest some pointers or samples to help me out?
> 
> Thanks,
> 
> gary
> 
>   _____  
> 
> From: Gary Larsen [mailto:gary.larsen@envisn.com] 
> Sent: Monday, July 21, 2008 2:31 PM
> To: users@cocoon.apache.org
> Subject: Accessing Cocoon context from class (2.1)
> 
> I'm running Cocoon 2.1.9.  Could someone tell me how to access the Cocoon
> context from a class?
> 
> I've built generators which have the ObjectModel passed to it, but in this
> case the class is isolated (it also implements HttpSessionBindingListener).
> 
> Does this class need to implement an interface and/or be registered as a
> Cocoon component somehow?
> 
> Thanks for any assistance.
> 
> gary