You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by DURDINA Michal <du...@asset.sk> on 2003/05/27 19:09:03 UTC
How to access sourceResolver in action configure() method
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
Re: How to access sourceResolver in action configure() method
Posted by Charles Yates <ce...@stanford.edu>.
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
Re: How to access sourceResolver in action configure() method
Posted by Charles Yates <ce...@stanford.edu>.
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
Re: How to access sourceResolver in action configure() method
Posted by David Kavanagh <da...@dotech.com>.
Michal,
The action has access to the SourceResolver in the act() method, but not
the compose() method. In cocoon2.1, I hear you can get access to the
SourceResolver via the ServiceManager (or will it still be the
ComponentManager?).
David
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