xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Steiner" <simonsteiner1...@gmail.com>
Subject RE: Relative resource paths for external graphics where uri resolution is affected by every render request context
Date Tue, 02 Jul 2019 18:59:38 GMT
Hi,

 

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

 

Thanks

 

From: Mark Gibson [mailto:mark.gibson@staff.bluematrix.com] 
Sent: 02 July 2019 19:31
To: fop-users@xmlgraphics.apache.org
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


Mime
View raw message