RE: Relative resource paths for external graphics where uri resolution is affected by every render request context

"Simon Steiner" <[email protected]>
Newsgroups gmane.text.xml.fop.user
Message-ID <[email protected]>
Hi,

 

The custom resource resolver can be modified at runtime such as
myresourceresolver.useX() to affect its operation.

 

Thanks

 

From: Mark Gibson [mailto:[email protected]] 
Sent: 02 July 2019 19:31
To: [email protected]
Subject: Relative resource paths for external graphics where uri resolution
is affected by every render request context

 

Hi,

 

We have a Java application with embedded FOP using XSLT transformations to
drive the document rendering.  I'm trying to see if it's possible to specify
external graphics URIs in the XML with a relative path that is only
indirectly related to the baseURI.  I'm finding it hard to put in to words,
so some examples may help .

 

baseURI = /base/path/

 

Relative URI in XML = images/myImage.png

 

Say we have two requests to render a document, the first associated with
account X, and the second associated with account Y.  The full URIs for each
request should resolve to .

 

X: /base/path/X/images/myImage.png

Y: /base/path/Y/images/myImage.png

 

I've looked through the documentation and found that I can override resource
resolving by supplying a custom ResourceResolver when creating a new
FopFactoryBuilder.  However, based on best practices, the FopFactory
instance should be reused for successive renders.  So I cannot apply a
render specific context (in this case, X or Y). 

 

Does anyone know of a way or either supplying extra context to be used by a
custom resolver for each individual render, or apply a different resource
resolver per render?

 

Thanks

Mark
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.