You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by ro...@citicorp.com on 2002/12/13 20:55:49 UTC

Setting baseDir in a servlet environment.

I'm building a class to output a dynamic PDF on a web site.  Using Websphere.

According to the FAQ I can call:

org.apache.fop.configuration.Configuration.put("baseDir","c:\my\base\dir").

or since I'm using a servlet I should call:

org.apache.fop.apps.Options options = new Options( new FIle("userconfig.xml") );

How is this going to be thread safe?  Especially if I have more than one 
conversion running at a time that needs different baseDirs?  The faq does not 
show how the driver loads or obtains this config once I load it.  In 
userconfig.xml how would I say baseDir="c:\mybasedir"?

I also noticed that org.apache.fop.render.pdf.PDFRenderer has a set options 
method.  Can I create one of these, set options and the pass it to 
driver.setRenderer(Renderer renderer) instead of 
setRenderer(Driver.RENDER_PDF).  Does calling setOptions override or add to 
settings that are set in userConfig and config

I don't think I have the option of putting my code in a synchronized block 
because I don't want to cause a deadlock.

Any help would be appreciated. 

Thanks,


Robert Wynkoop






---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Setting baseDir in a servlet environment.

Posted by Oleg Tkachenko <ol...@multiconn.com>.
robert.wynkoop@citicorp.com wrote:

> org.apache.fop.configuration.Configuration.put("baseDir","c:\my\base\dir").
> 
> or since I'm using a servlet I should call:
> 
> org.apache.fop.apps.Options options = new Options( new FIle("userconfig.xml") )
> How is this going to be thread safe?
afaik it's not thread safe. Configuration subsystem uses static fields and 
methods, that's well-known problem, which is addressed by the redesign under way.

> In 
> userconfig.xml how would I say baseDir="c:\mybasedir"?
There is commented out example in userconfig.xml.

> I also noticed that org.apache.fop.render.pdf.PDFRenderer has a set options 
> method.  Can I create one of these, set options and the pass it to 
> driver.setRenderer(Renderer renderer) instead of 
> setRenderer(Driver.RENDER_PDF).  Does calling setOptions override or add to 
> settings that are set in userConfig and config
I don't think so.

-- 
Oleg Tkachenko
eXperanto team
Multiconn Technologies, Israel


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org