in src/main/java/org/apache/maven/doxia/book/services/validation/DefaultBookValidator.java [44:73]
public ValidationResult validateBook( BookModel book )
{
ValidationResult result = new ValidationResult();
if ( StringUtils.isEmpty( book.getId() ) )
{
result.getErrors().add( "Book is missing id." );
}
if ( StringUtils.isEmpty( book.getTitle() ) )
{
result.getErrors().add( "Book is missing title." );
}
if ( book.getChapters().size() == 0 )
{
result.getErrors().add( "The book must have at least one chaper" );
}
else
{
for ( Chapter chapter : book.getChapters() )
{
validateChapter( result, chapter );
// TODO: Validate the chapter id
}
}
return result;
}