cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: How to inject the result of an action into a generator
Date Wed, 26 Mar 2008 04:46:34 GMT
On 25.03.2008 22:45, shai200 wrote:

> Alright, so since you're already in the groove of answering my questions
> (thanks btw), I would need my generator class to also have access to the
> entire Request Map (preferably in the form Map<String,String[]> where the
> String[] key is the set of values in case a value is declared twice, but
> that's not so crucial) as well as the Session object / map... how would I go
> about that?

Generators are SitemapModelComponents [1] and so have access to a map 
that we call object model in the setup(..) method. If you extend from an 
existing generator (ServiceableGenerator [2] is mostly a reasonable 
choice) you only have to override the setup(..) method and the 
generate(..) method. You can access request from the object model using 
the ObjectModelHelper [3]: ObjectModelHelper.getRequest(objectModel);

Disclaimer: What I explained is pretty much the Cocoon 2.1 way. If you 
use 2.2 this will still work but there might be better ways to do that 
like component setup through Spring. But I guess this does not make 
setup(..) obsolete, only additional component configurations.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message