cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Klotz" <>
Subject Getting context and work directory in SourceFactory or Action
Date Thu, 03 Apr 2003 11:03:03 GMT

it looks like a Action or SourceFactory cannot be Contextualizable?
I want to get the context directory of the webapp or the Cocoon work
directory. I though that in order to get that I let the Action and the
SourceFactory implement Contextualizable and then with

 workDir = (File)context.get(Constants.CONTEXT_WORK_DIR)
 contextDir = (File)context.get(Constants.DEFAULT_CONTEXT_DIR)

But I'm not sure with the second one whether that is really the right
constant. In a SourceFactory I get a error with this. A Source cannot be
contextualizable at least it never gets called it seems.

I saw in another mail that for actions there is a possibility to get the
context directory (is equal to "real path"???) from the object model. But
in a SoureFactory I don't have that.

Context context = ObjectModelHelper.getContext(objectModel);
String fileName = context.getRealPath("/myfile.xsd");

So how is it supposed to work?
Must be something everybody needs in order to access files from a source
or action, so please share your knowledge.

BTW, using Cocoon 2.0.4.

Thanks, Peter

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

View raw message