use of org.apache.fop.apps.FopConfParser in project pcgen by PCGen.
the class FopTask method createFopFactory.
private static FopFactory createFopFactory() {
// Allow optional customization with configuration file
String configPath = ConfigurationSettings.getOutputSheetsDir() + File.separator + "fop.xconf";
Logging.log(Logging.INFO, "FoPTask checking for config file at " + configPath);
File userConfigFile = new File(configPath);
FopFactoryBuilder builder;
if (userConfigFile.exists()) {
Logging.log(Logging.INFO, "FoPTask using config file " + configPath);
FopConfParser parser;
try {
parser = new FopConfParser(userConfigFile);
} catch (Exception e) {
Logging.errorPrint("FoPTask encountered a problem with FOP configuration " + configPath + ": ", e);
return null;
}
builder = parser.getFopFactoryBuilder();
} else {
Logging.log(Logging.INFO, "FoPTask using default config");
builder = new FopFactoryBuilder(new File(".").toURI());
builder.setStrictFOValidation(false);
}
return builder.build();
}
Aggregations