Package org.pentaho.reporting.libraries.docbundle

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


    report.getNoDataBand().setAttribute(ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE);
    report.getWatermark().setAttribute(ReportDesignerParserModule.NAMESPACE, ReportDesignerParserModule.HIDE_IN_LAYOUT_GUI_ATTRIBUTE, Boolean.TRUE);

    try
    {
      final MemoryDocumentBundle bundle = (MemoryDocumentBundle) report.getBundle();
      if (bundle.isEntryExists(TRANSLATIONS_PROPERTIES) == false)
      {
        final String defaultMessage = ActionMessages.getString("Translations.DefaultContent");
        final OutputStream outputStream = bundle.createEntry(TRANSLATIONS_PROPERTIES, "text/plain");// NON-NLS
        outputStream.write(defaultMessage.getBytes("ISO-8859-1"));// NON-NLS
        outputStream.close();
        bundle.getWriteableDocumentMetaData().setEntryAttribute(TRANSLATIONS_PROPERTIES, BundleUtilities.STICKY_FLAG, "true");// NON-NLS
      }
    }
    catch (Exception ex)
    {
      // ignore, its not that important ..
View Full Code Here


    final MasterReport resource = (MasterReport) directly.getResource();
    final DocumentBundle bundle = resource.getBundle();
    if (bundle == null)
    {
      // Ok, that should not happen if we work with the engine's parsers, but better safe than sorry.
      final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle(resource.getContentBase());
      documentBundle.getWriteableDocumentMetaData().setBundleType(ClassicEngineBoot.BUNDLE_TYPE);
      resource.setBundle(documentBundle);
      resource.setContentBase(documentBundle.getBundleMainKey());
    }
    else
    {
      final MemoryDocumentBundle mem = new MemoryDocumentBundle(resource.getContentBase());
      BundleUtilities.copyStickyInto(mem, bundle);
      BundleUtilities.copyMetaData(mem, bundle);
      resource.setBundle(mem);
      resource.setContentBase(mem.getBundleMainKey());
    }

    final Object visible =
        resource.getBundle().getMetaData().getBundleAttribute(ClassicEngineBoot.METADATA_NAMESPACE, "visible");//NON-NLS
    if ("true".equals(visible))//NON-NLS
View Full Code Here

    final ResourceManager resourceManager = report.getResourceManager();
    final Resource bundleResource = resourceManager.createDirectly(file, DocumentBundle.class);
    final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource();
    final ResourceKey bundleKey = bundle.getBundleKey();

    final MemoryDocumentBundle mem = new MemoryDocumentBundle();
    BundleUtilities.copyStickyInto(mem, bundle);
    BundleUtilities.copyMetaData(mem, bundle);
    report.setBundle(mem);
    report.setContentBase(mem.getBundleMainKey());
    report.setDefinitionSource(bundleKey);
  }
View Full Code Here

    final ResourceManager resourceManager = report.getResourceManager();
    final Resource bundleResource = resourceManager.createDirectly(file, DocumentBundle.class);
    final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource();
    final ResourceKey bundleKey = bundle.getBundleKey();

    final MemoryDocumentBundle mem = new MemoryDocumentBundle();
    BundleUtilities.copyStickyInto(mem, bundle);
    BundleUtilities.copyMetaData(mem, bundle);
    report.setBundle(mem);
    report.setContentBase(mem.getBundleMainKey());
    report.setDefinitionSource(bundleKey);
  }
View Full Code Here

    if (file == null)
    {
      throw new NullPointerException();
    }

    final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle();
    final MailDefinitionBundleWriter writer = new MailDefinitionBundleWriter();
    writer.writeMailDefinition(documentBundle, report ,null);
    BundleUtilities.writeAsZip(file, documentBundle);
  }
View Full Code Here

    }
    if (out == null)
    {
      throw new NullPointerException();
    }
    final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle();
    final MailDefinitionBundleWriter writer = new MailDefinitionBundleWriter();
    writer.writeMailDefinition(documentBundle, report, null);
    BundleUtilities.writeAsZip(out, documentBundle);
  }
View Full Code Here

    }
    if (file == null)
    {
      throw new NullPointerException();
    }
    final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle();
    final MailDefinitionBundleWriter writer = new MailDefinitionBundleWriter();
    writer.writeMailDefinition(documentBundle, report, null);
    BundleUtilities.writeToDirectory(file, documentBundle);
  }
View Full Code Here

    final ResourceManager resourceManager = report.getResourceManager();
    final Resource bundleResource = resourceManager.createDirectly(file, DocumentBundle.class);
    final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource();
    final ResourceKey bundleKey = bundle.getBundleKey();

    final MemoryDocumentBundle mem = new MemoryDocumentBundle();
    BundleUtilities.copyStickyInto(mem, bundle);
    BundleUtilities.copyMetaData(mem, bundle);
    report.setBundle(mem);
    report.setContentBase(mem.getBundleMainKey());
    report.setDefinitionSource(bundleKey);
  }
View Full Code Here

      final MasterReport resource = (MasterReport) directly.getResource();
      final DocumentBundle bundle = resource.getBundle();
      if (bundle == null)
      {
        // Ok, that should not happen if we work with the engine's parsers, but better safe than sorry.
        final MemoryDocumentBundle documentBundle = new MemoryDocumentBundle(resource.getContentBase());
        documentBundle.getWriteableDocumentMetaData().setBundleType(ClassicEngineBoot.BUNDLE_TYPE);
        resource.setBundle(documentBundle);
        resource.setContentBase(documentBundle.getBundleMainKey());
      }
      else
      {
        final MemoryDocumentBundle mem = new MemoryDocumentBundle(resource.getContentBase());
        BundleUtilities.copyStickyInto(mem, bundle);
        BundleUtilities.copyMetaData(mem, bundle);
        resource.setBundle(mem);
        resource.setContentBase(mem.getBundleMainKey());
      }

      return (AbstractReportDefinition) resource.derive();
    }
    catch (Exception ex)
View Full Code Here


    final DocumentBundle reportBundle = report.getBundle();
    if (reportBundle == null)
    {
      this.writeReport(bundle, report, new MemoryDocumentBundle());
    }
    else
    {
      this.writeReport(bundle, report, reportBundle);
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.docbundle.MemoryDocumentBundle

Copyright © 2018 www.massapicom. 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.