if ( access.fileExists( dashboard ) ) {
// Check for access permissions
if ( !access.hasAccess( dashboard, FileAccess.EXECUTE ) ) {
throw new InvalidCdfOperationException( "Access denied" );
}
try {
Document doc = XmlDom4JUtils.getDocumentFromFile( access.fetchFile( dashboard ) );
if ( doc.selectSingleNode( NODE_TEMPLATE ) != null ) {
template = XmlDom4JUtils.getNodeText( NODE_TEMPLATE, doc, "" );
}else{
template = defaultTemplate;
}
// Get message file base name if any
if ( doc.selectSingleNode( NODE_MESSAGES ) != null ) {
messagesBaseFilename = XmlDom4JUtils.getNodeText( NODE_MESSAGES, doc );
}
// If a "style" tag exists, use that one
if ( doc.selectSingleNode( NODE_STYLES ) != null ) {
style = XmlDom4JUtils.getNodeText( NODE_STYLES, doc );
} else {
style = CdfConstants.DEFAULT_DASHBOARD_STYLE;
}
success = true;
} catch ( IOException e ) {
logger.error( e );
throw new InvalidCdfOperationException( e );
}
}
return success;
}