throws IOException, PlatformImportException {
try {
ResourceManager mgr = new ResourceManager();
MasterReport report = (MasterReport) mgr.createDirectly( bytes, MasterReport.class ).getResource();
DocumentMetaData metaData = report.getBundle().getMetaData();
String description = (String) metaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DESCRIPTION );
if ( StringUtils.isEmpty( description, true ) ) {
// make sure that empty strings and strings with only whitespace are not used as description.
description = null;
}
String title = (String) metaData.getBundleAttribute( ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE );
if ( StringUtils.isEmpty( title, true ) ) {
// make sure that empty strings and strings with only whitespace are not used as description.
title = null;
}
if ( title != null || description != null ) {
localeFilesProcessor.createLocaleEntry( filePath, fileName, title, description, rf,
new ByteArrayInputStream( "".getBytes() ) );
}
// we are conservative here. Only if the string matches 'true' with this spelling.
return "false".equals( metaData.getBundleAttribute( ClassicEngineBoot.METADATA_NAMESPACE, "visible" ) );
} catch ( ResourceException e ) {
throw new PlatformImportException( "An unexpected error occurred while parsing a report definition", e );
}
}