xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremias Maerki <...@jeremias-maerki.ch>
Subject Re: Question on FOP extension automatic detection
Date Wed, 13 Feb 2008 15:43:45 GMT

On 13.02.2008 14:18:25 Andrejus Chaliapinas wrote:
> Hi All,
> 
> I'm trying to develop my own FOP extension, but while running my
> transformation I always get that "Unknown formatting object" warning from
> ElementMappingRegistry class.
> 
> When I do manual mapping registration via fopFactory.addElementMapping(new
> MyElementMapping()) before transformation start - everything works correctly
> later.
> 
> Should I stay with such fopFactory manual registration or did I miss
> anything in those my custom files to implement/extend?

Have you seen this page? http://xmlgraphics.apache.org/fop/dev/extensions.html

It contains the missing piece to auto-register your extension
(/META-INF/services/org.apache.fop.fo.ElementMapping).

> And another question related to FOP extensions - suppose from inside my
> extension I'd like to open an InputStream. But that stream opening procedure
> requires me some additional information to pass (let say name, password,
> etc.). Is it possible somehow to pass from my Java program some sort of
> external Session/Context object to my extension by some mean? Or the only
> way is to extend some default Renderer with additional member variable and
> then analyze that variable inside extension logic?

You should go through the FOUserAgent (getUserAgent().resolveURI() on
your extension element) to resolve a URI and obtain an InputStream. If
you do that you can use the following information on the Wiki to
use authentication when opening network streams:
http://wiki.apache.org/xmlgraphics-fop/HowTo/BasicHttpAuthentication

> Questions here are related to FOP Trunk version.
> 
> Thank you,
> Andrejus

May I ask what kind of extension you are developing? Just curious.

HTH

Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message