On Saturday, January 05, 2002 , Torsten Curdt wrote: > So I'm +1 for the servlet context dir as basedir
+1
BTW, I asked some days ago on the fop-dev list if this is the only way of
setting this parameter, because
in this mail I read:
----- Original Message -----
From: "Keiron Liddle" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 03, 2002 9:18 AM
Subject: Re: image protocal in Fop on unix
> The example in "docs/examples/fo/images.fo has relative urls for images
> (can't really have absolute urls for cvs and distributions!).
> The images are loaded properly.
>
> Of course if you are embedding fop then you will need to set the basedir
> via the config.
Haven't recieved a reply yet. So I supposed that the config it this static
stuff only.
In fact, looking in the Options class in FOP I found:
// set base directory
String baseDir = Configuration.getStringValue("baseDir");
if (baseDir == null) {
try {
baseDir =
new
File(clOptions.getInputFile().getAbsolutePath()).getParentFile().toURL().toE
xternalForm();
Configuration.put("baseDir", baseDir);
} catch (Exception e) {}
}
if (errorDump) {
//log.debug("base directory: " + baseDir);
}
So yes, it's static. :-/
I'm doing a patch for the current proposal, but I got stuck at a seemingly
trivial point.
How do I get the context path from a Serializer?
Is it
Constants.DEFAULT_CONTEXT_DIR
or
context.get(Constants.DEFAULT_CONTEXT_DIR)
or
((org.apache.cocoon.environment.Context)
context.get
(Constants.CONTEXT_ENVIRONMENT_CONTEXT)
)).getAttribute(Constants.DEFAULT_CONTEXT_DIR)
or
something-more-deeply-nested ;-)
Heck, how many Contexts are there?
Ken
--
Nicola Ken Barozzi [EMAIL PROTECTED]
These are the days of miracle and wonder...
...so don't cry baby, don't cry...
Paul Simon
smime.p7s
Description: application/pkcs7-signature
