Tobia wrote:
> Jeroen Reijn wrote:
>> after listing all the AttributeNames attached to the context you could
>> try to use the following line:
>>
>> print("workDir: " + 
>> cocoon.context.getAttribute("javax.servlet.context.tempdir"));
> 
> Thank you.  
> It turns out CONTEXT_WORK_DIR in the Avalon context is equivalent to:
> 
> cocoon.context.getAttribute('javax.servlet.context.tempdir') + 
> '/cocoon-files'
> 
> And that's where the various Lucene components create and look for
> indices by default.
> 
This is only true if you use the default configuration for the working
directory. However, it's possible to store the directory somewhere else.
The only way to get the Avalon Context in Flow is to write a Java class
that implements Contextualizable. You can now instantiate an object of
this class from flow through "cocoon.createObject("CLASSNAME");"
Cocoon calls the contextualize methods and passes in the Context object.
Store this in an instance variable and add a getter method to the
object, for example getAvalonContext(), then you get the context like
cocoon.createObject("CLASSNAME").getAvalonContext().

Now, this is rather complicated, I admit, but it should always work.

Carsten
-- 
Carsten Ziegeler
http://www.osoco.org/weblogs/rael/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to