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 Brian O'Kelley <bo...@cetova.com> on 2002/05/02 21:12:03 UTC

Configuration mods to allow embedded apps to change font base path in userconfig

Hi all,
 
Sorry in advance if I'm not doing this right, it's my first official
contribution (or attempt thereof) to FOP!
 
I ran into issues where my servlet was getting installed and run from a
number of locations, making the relative paths in fop-userconfig.xml not
work, so I made a couple of minor modifications to make this something
the user can configure.
 
1. I added  "getBasePath" and "setBasePath" methods to
configuration/Configuration.java, both in a static context
2. I updated configuration/FontInfo.java to call these methods when
returning font paths
 
I also made a couple of other mods that seemed to make sense.
 
3. I changed Configuration.java to use a singleton pattern instead of
static methods to make future conf migration easier (so that the same
JVM could in theory have multiple Configurations by removing the
singleton - now each Configuration can stand on its own). I added static
helper methods to ensure backwards compatibility.
 
4. In apps/Driver.java, I changed the "ERROR - no logger set" message to
"ERROR - no logger set - using System.out" just for clarity (I was
confused until I saw the source code).
 
I'm attaching a cvs diff of my changes (against the fop-0_20_3 tag). I
think this is the right thing to do, let me know if it's not.
 
If it's useful, I can make these changes work from the command line, or
go ahead and refactor the Options to not be JVM-global - just depends if
folks are interested. I guess this would make sense on the latest dev
branch, not the 0.20.3 branch.
 
Brian