* @param source the AsciiDoc source sent by the client
* @return the DocumentHeader
*/
private DocumentHeader checkHeader (String source){
//Check if document header is present
DocumentHeader docHeader = null;
try {
logger.info("[RENDER] processing DocumentHeader");
docHeader = processor.renderDocumentHeader(source);
for (Map.Entry<String, Object> h : docHeader.getAttributes().entrySet()){
logger.log(Level.FINER, h.getKey() + " : " + h.getValue());
}
//FIXME : check which headers are mandatory
Map<String, Object> headers = docHeader.getAttributes();
if (docHeader.getAuthors().size() == 0) {
logger.info("DocHeader add author");
headers.put("author", "the Author");
headers.put("email", "test@test.fr");
}
docHeader = DocumentHeader.createDocumentHeader("Doc title", "page title", headers);