cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Yates <ceya...@stanford.edu>
Subject Re: How to access sourceResolver in action configure() method
Date Tue, 27 May 2003 18:57:49 GMT
oops, I mean sitemap.xmap, not cocoon.xconf.

Charles Yates wrote:

> Can you put the configuration stuff into cocoon.xconf?  Then it would 
> be available in configure().  If not you could implement 
> Contextualizable and get the HttpContext like this:
>
>    public void contextualize(Context aContext) throws ContextException {
>        myContext =
>            (HttpContext) 
> aContext.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT);
>    }
>
> then you could get the file like this:
>
> myConfigFile = new File(myContext.getRealPath(myConfigFileName));
>
> Charles
>
> (this works in 2.1, should in 2.0.4, though maybe minor differences)
>
>
>
> DURDINA Michal wrote:
>
>> Hello!
>> I am using own ConfigurableComposerAction and I have problem with 
>> loading
>> configuration from external file (from filesystem). In act() method, 
>> I would
>> use SourceResolver parameter passed to this method, but in configure()
>> method I do not know where should I get the source resolver from.
>>
>> I am using Cocoon 2.0.4 with compiled sitemap, thus I cannot use this:
>>     public void compose(ComponentManager manager) throws 
>> ComponentException {
>>        this.manager = manager;
>>        this.resolver = 
>> (SourceResolver)manager.lookup(SourceResolver.ROLE);
>>    }
>>
>> Thank you for your help, Michal
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>>
>>
>>  
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>



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


Mime
View raw message