public void renderBook()

in src/main/java/org/apache/maven/doxia/book/DefaultBookDoxia.java [82:137]


    public void renderBook( BookModel book, String bookRendererId, List<File> files, File outputDirectory,
                            Locale locale, String inputEncoding, String outputEncoding )
        throws BookDoxiaException
    {
        // ----------------------------------------------------------------------
        //
        // ----------------------------------------------------------------------

        ValidationResult validationResult = bookValidator.validateBook( book );

        if ( !validationResult.isAllOk() )
        {
            throw new InvalidBookDescriptorException( validationResult );
        }

        // ----------------------------------------------------------------------
        // Create and initialize the context
        // ----------------------------------------------------------------------

        BookContext context = new BookContext();

        context.setBook( book );

        context.setOutputDirectory( outputDirectory );

        context.setLocale( locale );

        context.setInputEncoding( inputEncoding );

        context.setOutputEncoding( outputEncoding );

        // -----------------------------------------------------------------------
        //
        // -----------------------------------------------------------------------

        bookIo.loadFiles( context, files );

        // ----------------------------------------------------------------------
        // Generate indexes
        // ----------------------------------------------------------------------

        bookIndexer.indexBook( book, context );

        // ----------------------------------------------------------------------
        // Render the book
        // ----------------------------------------------------------------------

        BookRenderer bookRenderer = bookRenderers.get( bookRendererId );

        if ( bookRenderer == null )
        {
            throw new BookDoxiaException( "No such book renderer '" + bookRendererId + "'." );
        }

        bookRenderer.renderBook( context );
    }