Examples of DocumentMetadata


Examples of org.pentaho.reporting.libraries.docbundle.DocumentMetaData

    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 );
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.