File | Line |
---|
org\apache\maven\doxia\book\services\renderer\AbstractITextBookRenderer.java | 230 |
org\apache\maven\doxia\book\services\renderer\DocbookBookRenderer.java | 183 |
private void renderSection( Section section, BookContext context, Sink sink )
throws BookDoxiaException
{
BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
if ( bookFile == null )
{
throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
}
Reader reader = null;
try
{
reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
doxia.parse( reader, bookFile.getParserId(), sink );
}
catch ( ParserNotFoundException e )
{
throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
}
catch ( ParseException e )
{
throw new BookDoxiaException(
"Error while parsing document: " + bookFile.getFile().getAbsolutePath() + ".",
e );
}
catch ( FileNotFoundException e )
{
throw new BookDoxiaException( "Could not find document: " + bookFile.getFile().getAbsolutePath() + ".", e );
}
catch ( IOException e )
{
throw new BookDoxiaException( "Error while rendering book: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
}
finally
{
IOUtil.close( reader );
}
} |
File | Line |
---|
org\apache\maven\doxia\book\services\renderer\LatexBookRenderer.java | 200 |
org\apache\maven\doxia\book\services\renderer\XdocBookRenderer.java | 402 |
SectionXdocBookSink sink = new SectionXdocBookSink( writer, sectionIndex, i18n, context.getLocale() );
BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
if ( bookFile == null )
{
throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
}
Reader reader = null;
try
{
reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
doxia.parse( reader, bookFile.getParserId(), sink );
}
catch ( ParserNotFoundException e )
{
throw new BookDoxiaException( "Parser not found: " + bookFile.getParserId() + ".", e );
}
catch ( ParseException e )
{
throw new BookDoxiaException( "Error while parsing document: " + bookFile.getFile().getAbsolutePath()
+ ".", e );
}
catch ( FileNotFoundException e )
{
throw new BookDoxiaException( "Could not find document: " + bookFile.getFile().getAbsolutePath() + ".",
e );
}
finally
{
sink.flush();
sink.close();
IOUtil.close( reader );
IOUtil.close( writer );
} |
File | Line |
---|
org\apache\maven\doxia\book\services\renderer\AbstractITextBookRenderer.java | 239 |
org\apache\maven\doxia\book\services\renderer\XHtmlBookRenderer.java | 168 |
BookContext.BookFile bookFile = context.getFiles().get( section.getId() );
if ( bookFile == null )
{
throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
}
Reader reader = null;
try
{
reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
doxia.parse( reader, bookFile.getParserId(), sink );
}
catch ( ParserNotFoundException e )
{
throw new BookDoxiaException( "Parser not found: "
+ bookFile.getParserId() + ".", e );
}
catch ( ParseException e )
{
throw new BookDoxiaException( "Error while parsing document: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
}
catch ( FileNotFoundException e )
{
throw new BookDoxiaException( "Could not find document: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
}
catch ( IOException e )
{
throw new BookDoxiaException( "Error while rendering book: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
}
finally
{
IOUtil.close( reader );
} |
File | Line |
---|
org\apache\maven\doxia\book\services\renderer\AbstractITextBookRenderer.java | 239 |
org\apache\maven\doxia\book\services\renderer\XdocBookRenderer.java | 404 |
BookContext.BookFile bookFile = (BookContext.BookFile) context.getFiles().get( section.getId() );
if ( bookFile == null )
{
throw new BookDoxiaException( "No document that matches section with id="
+ section.getId() + "." );
}
Reader reader = null;
try
{
reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
doxia.parse( reader, bookFile.getParserId(), sink );
}
catch ( ParserNotFoundException e )
{
throw new BookDoxiaException( "Parser not found: "
+ bookFile.getParserId() + ".", e );
}
catch ( ParseException e )
{
throw new BookDoxiaException( "Error while parsing document: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
}
catch ( FileNotFoundException e )
{
throw new BookDoxiaException( "Could not find document: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
} |
File | Line |
---|
org\apache\maven\doxia\book\services\renderer\LatexBookRenderer.java | 202 |
org\apache\maven\doxia\book\services\renderer\XHtmlBookRenderer.java | 168 |
BookContext.BookFile bookFile = context.getFiles().get( section.getId() );
if ( bookFile == null )
{
throw new BookDoxiaException( "No document that matches section with id=" + section.getId() + "." );
}
Reader reader = null;
try
{
reader = ReaderFactory.newReader( bookFile.getFile(), context.getInputEncoding() );
doxia.parse( reader, bookFile.getParserId(), sink );
}
catch ( ParserNotFoundException e )
{
throw new BookDoxiaException( "Parser not found: "
+ bookFile.getParserId() + ".", e );
}
catch ( ParseException e )
{
throw new BookDoxiaException( "Error while parsing document: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
}
catch ( FileNotFoundException e )
{
throw new BookDoxiaException( "Could not find document: "
+ bookFile.getFile().getAbsolutePath() + ".", e );
} |
File | Line |
---|
org\apache\maven\doxia\book\services\renderer\AbstractITextBookRenderer.java | 55 |
org\apache\maven\doxia\book\services\renderer\DocbookBookRenderer.java | 52 |
extends AbstractLogEnabled
implements BookRenderer
{
/**
* @plexus.requirement
*/
private Doxia doxia;
// ----------------------------------------------------------------------
// BookRenderer Implementation
// ----------------------------------------------------------------------
/** {@inheritDoc} */
public void renderBook( BookContext context )
throws BookDoxiaException
{
BookModel book = context.getBook();
if ( !context.getOutputDirectory().exists() )
{
if ( !context.getOutputDirectory().mkdirs() )
{
throw new BookDoxiaException( "Could not make directory: "
+ context.getOutputDirectory().getAbsolutePath() + "." );
}
}
File bookFile = new File( context.getOutputDirectory(), book.getId() + ".xml" );
Writer fileWriter;
try
{
fileWriter = WriterFactory.newXmlWriter( bookFile );
}
catch ( IOException e )
{
throw new BookDoxiaException( "Error while opening file.", e );
} |