You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Pete Allison <ma...@aol.com> on 2008/08/07 19:16:18 UTC

RE: Location of external graphics

This may not be the appropriate forum (may be more of a Java question), so I
asked for your forbearance.

We are struggling with where to keep our image files. Right now we loading
them with absolute file paths. This works for one application that "builds"
the path based on environment information. This allows us to maintain
portability. 

We have another application that does not know anything about its
environment. When the application is moved from a development server to a
production, we must update the stylesheet to reflect the server change. We
would like to avoid this. 

It appears that file references, if not absolute, are relative to the (and
here's the part we are a little fuzzy on) the classpath for our FOP servlet?


If this is the case, I guess we can put them in the WAR file and then
redistribute it as needed. I was hoping for a cleaner solution.

Thanks,
Pete Allison
 


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


RE: Location of external graphics

Posted by Pete Allison <ma...@aol.com>.
Thanks. We will give a go. 

-----Original Message-----
From: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
Sent: Thursday, August 07, 2008 1:29 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Location of external graphics

The Java example from the Wiki page is updated now.

On 07.08.2008 20:16:28 Jeremias Maerki wrote:
> Bundling the stylesheets in the WAR file is one solution that many 
> users seem to be using. Another could be using a XML Catalog (using 
> XML Commons Resolver from the Apache XML project). More information on 
> the resolver here:
> http://xml.apache.org/commons/components/resolver/index.html
> http://wiki.apache.org/xmlgraphics-fop/HowTo/XmlCommonsResolver
> 
> With an XML Catalog you could do things like rewriting URIs like:
> myresources:xslt/mystylesheet.xslt
> to:
> file:/home/user/resources/xslt/mystylesheet.xslt
> 
> The XML Commons Resolver implements both the EntityResolver and 
> URIResolver interfaces. In FOP, you can configure your own URIResolver.
> However, the Java example on the Wiki page above (as I had to notice 
> now) is hopelessly outdated. I'll see to it that it is updated.
> 
> Yet another way is to just set the base URI on the FopFactory to 
> something you define. But then you're still using relative filenames.
> Not that this is bad in any way. But it can be hard to debug.
> 
> HTH
> 
> On 07.08.2008 19:16:18 Pete Allison wrote:
> > This may not be the appropriate forum (may be more of a Java 
> > question), so I asked for your forbearance.
> > 
> > We are struggling with where to keep our image files. Right now we 
> > loading them with absolute file paths. This works for one application
that "builds"
> > the path based on environment information. This allows us to 
> > maintain portability.
> > 
> > We have another application that does not know anything about its 
> > environment. When the application is moved from a development server 
> > to a production, we must update the stylesheet to reflect the server 
> > change. We would like to avoid this.
> > 
> > It appears that file references, if not absolute, are relative to 
> > the (and here's the part we are a little fuzzy on) the classpath for our
FOP servlet?
> > 
> > 
> > If this is the case, I guess we can put them in the WAR file and 
> > then redistribute it as needed. I was hoping for a cleaner solution.
> > 
> > Thanks,
> > Pete Allison
> >  
> 
> 
> 



Jeremias Maerki


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


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


Re: Location of external graphics

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
The Java example from the Wiki page is updated now.

On 07.08.2008 20:16:28 Jeremias Maerki wrote:
> Bundling the stylesheets in the WAR file is one solution that many users
> seem to be using. Another could be using a XML Catalog (using XML
> Commons Resolver from the Apache XML project). More information on the
> resolver here:
> http://xml.apache.org/commons/components/resolver/index.html
> http://wiki.apache.org/xmlgraphics-fop/HowTo/XmlCommonsResolver
> 
> With an XML Catalog you could do things like rewriting URIs like:
> myresources:xslt/mystylesheet.xslt
> to:
> file:/home/user/resources/xslt/mystylesheet.xslt
> 
> The XML Commons Resolver implements both the EntityResolver and
> URIResolver interfaces. In FOP, you can configure your own URIResolver.
> However, the Java example on the Wiki page above (as I had to notice now)
> is hopelessly outdated. I'll see to it that it is updated.
> 
> Yet another way is to just set the base URI on the FopFactory to
> something you define. But then you're still using relative filenames.
> Not that this is bad in any way. But it can be hard to debug.
> 
> HTH
> 
> On 07.08.2008 19:16:18 Pete Allison wrote:
> > This may not be the appropriate forum (may be more of a Java question), so I
> > asked for your forbearance.
> > 
> > We are struggling with where to keep our image files. Right now we loading
> > them with absolute file paths. This works for one application that "builds"
> > the path based on environment information. This allows us to maintain
> > portability. 
> > 
> > We have another application that does not know anything about its
> > environment. When the application is moved from a development server to a
> > production, we must update the stylesheet to reflect the server change. We
> > would like to avoid this. 
> > 
> > It appears that file references, if not absolute, are relative to the (and
> > here's the part we are a little fuzzy on) the classpath for our FOP servlet?
> > 
> > 
> > If this is the case, I guess we can put them in the WAR file and then
> > redistribute it as needed. I was hoping for a cleaner solution.
> > 
> > Thanks,
> > Pete Allison
> >  
> 
> 
> 



Jeremias Maerki


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


Re: Location of external graphics

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Bundling the stylesheets in the WAR file is one solution that many users
seem to be using. Another could be using a XML Catalog (using XML
Commons Resolver from the Apache XML project). More information on the
resolver here:
http://xml.apache.org/commons/components/resolver/index.html
http://wiki.apache.org/xmlgraphics-fop/HowTo/XmlCommonsResolver

With an XML Catalog you could do things like rewriting URIs like:
myresources:xslt/mystylesheet.xslt
to:
file:/home/user/resources/xslt/mystylesheet.xslt

The XML Commons Resolver implements both the EntityResolver and
URIResolver interfaces. In FOP, you can configure your own URIResolver.
However, the Java example on the Wiki page above (as I had to notice now)
is hopelessly outdated. I'll see to it that it is updated.

Yet another way is to just set the base URI on the FopFactory to
something you define. But then you're still using relative filenames.
Not that this is bad in any way. But it can be hard to debug.

HTH

On 07.08.2008 19:16:18 Pete Allison wrote:
> This may not be the appropriate forum (may be more of a Java question), so I
> asked for your forbearance.
> 
> We are struggling with where to keep our image files. Right now we loading
> them with absolute file paths. This works for one application that "builds"
> the path based on environment information. This allows us to maintain
> portability. 
> 
> We have another application that does not know anything about its
> environment. When the application is moved from a development server to a
> production, we must update the stylesheet to reflect the server change. We
> would like to avoid this. 
> 
> It appears that file references, if not absolute, are relative to the (and
> here's the part we are a little fuzzy on) the classpath for our FOP servlet?
> 
> 
> If this is the case, I guess we can put them in the WAR file and then
> redistribute it as needed. I was hoping for a cleaner solution.
> 
> Thanks,
> Pete Allison
>  



Jeremias Maerki


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