throws DocumentRendererException, IOException
{
for ( Map.Entry<String, SiteModule> entry : filesToProcess.entrySet() )
{
String key = entry.getKey();
SiteModule module = entry.getValue();
File fullDoc = new File( getBaseDir(), module.getSourceDirectory() + File.separator + key );
String output = key;
String lowerCaseExtension = module.getExtension().toLowerCase( Locale.ENGLISH );
if ( output.toLowerCase( Locale.ENGLISH ).indexOf( "." + lowerCaseExtension ) != -1 )
{
output =
output.substring( 0, output.toLowerCase( Locale.ENGLISH ).indexOf( "." + lowerCaseExtension ) );
}
File outputFOFile = new File( outputDirectory, output + ".fo" );
if ( !outputFOFile.getParentFile().exists() )
{
outputFOFile.getParentFile().mkdirs();
}
File pdfOutputFile = new File( outputDirectory, output + ".pdf" );
if ( !pdfOutputFile.getParentFile().exists() )
{
pdfOutputFile.getParentFile().mkdirs();
}
FoSink sink =
(FoSink) new FoSinkFactory().createSink( outputFOFile.getParentFile(), outputFOFile.getName() );
sink.beginDocument();
parse( fullDoc.getAbsolutePath(), module.getParserId(), sink, context );
sink.endDocument();
generatePdf( outputFOFile, pdfOutputFile, null );
}
}