Package org.pentaho.reporting.libraries.docbundle

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


  protected DefaultProcessingContext createProcessingContext() throws ReportProcessingException
  {
    final OutputProcessorMetaData metaData = getOutputProcessorMetaData();
    final MasterReport report = getReport();
    final DocumentMetaData documentMetaData;
    final DocumentBundle bundle = report.getBundle();
    if (bundle != null)
    {
      documentMetaData = bundle.getMetaData();
    }
    else
    {
      documentMetaData = new MemoryDocumentMetaData();
    }
View Full Code Here


    final Object dataCacheEnabledRaw =
        report.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.DATA_CACHE);
    final boolean dataCacheEnabled = Boolean.FALSE.equals(dataCacheEnabledRaw) == false;
    this.dataFactory = new CachingDataFactory(report.getDataFactory(), dataCacheEnabled);

    final DocumentBundle bundle = report.getBundle();
    if (bundle != null)
    {
      this.documentMetaData = bundle.getMetaData();
    }
    this.dataFactory.initialize(new DesignTimeDataFactoryContext
        (configuration, resourceManager, contentBase, resourceBundleFactory, dataFactory));

    final ReportEnvironmentDataRow envDataRow = new ReportEnvironmentDataRow(reportEnvironment);
View Full Code Here

    notifyNodePropertiesChanged();
  }

  public String getTitle()
  {
    final DocumentBundle bundle = getBundle();
    if (bundle != null)
    {
      final Object o = bundle.getMetaData().getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE);
      if (o != null)
      {
        return o.toString();
      }
View Full Code Here

      throws IOException
  {
    stream.defaultWriteObject();
    try
    {
      final DocumentBundle bundle = getBundle();
      stream.writeObject(bundle.getMetaData().getBundleType());

      final MemoryDocumentBundle mem = new MemoryDocumentBundle();
      BundleUtilities.copyStickyInto(mem, bundle);
      BundleUtilities.copyInto(mem, bundle, LegacyBundleResourceRegistry.getInstance().getRegisteredFiles(), true);
      BundleUtilities.copyMetaData(mem, bundle);
View Full Code Here

      final String bundleType = (String) stream.readObject();

      final byte[] bundleRawZip = (byte[]) stream.readObject();
      final ResourceManager mgr = getResourceManager();
      final Resource bundleResource = mgr.createDirectly(bundleRawZip, DocumentBundle.class);
      final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource();

      final MemoryDocumentBundle mem = new MemoryDocumentBundle(getContentBase());
      BundleUtilities.copyStickyInto(mem, bundle);
      BundleUtilities.copyInto(mem, bundle, LegacyBundleResourceRegistry.getInstance().getRegisteredFiles(), true);
      BundleUtilities.copyMetaData(mem, bundle);
View Full Code Here

            return;
          }

          // Insert the DocumentBundle's ResourceManager as the MasterReports resource manager
          log.debug("DocumentBundle change detected - changing the ResourceManager for the MasterReport");
          final DocumentBundle newDocumentBundle = (DocumentBundle) value;
          final ResourceManager resourceManager = newDocumentBundle.getResourceManager();
          report.setContentBase(newDocumentBundle.getBundleKey());
          report.setResourceManager(resourceManager);
        }
      }
      else if (event.getParameter() instanceof ResourceManager)
      {
View Full Code Here

  private String computeNameFromMetadata(final ResourceManager resourceManager, final ResourceKey key)
  {
    try
    {
      final Resource res = resourceManager.create(key, null, new Class[]{DocumentBundle.class});
      final DocumentBundle rawResource = (DocumentBundle) res.getResource();
      final Object possibleTitle = rawResource.getMetaData().getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE);
      if (possibleTitle != null)
      {
        return possibleTitle.toString();
      }
View Full Code Here

      try
      {
        // Update the definition source to be the location from which the file is saved
        final ResourceManager resourceManager = report.getResourceManager();
        final Resource bundleResource = resourceManager.createDirectly(target, DocumentBundle.class);
        final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource();
        final ResourceKey bundleKey = bundle.getBundleKey();
        report.setDefinitionSource(bundleKey);
        report.setContentBase(bundleKey);
        report.setResourceManager(bundle.getResourceManager());
        activeContext.resetChangeTracker();
      }
      catch (ResourceException e)
      {
        UncaughtExceptionsModel.getInstance().addException(e);
View Full Code Here

      try
      {
        // Update the definition source to be the location from which the file is saved
        final ResourceManager resourceManager = report.getResourceManager();
        final Resource bundleResource = resourceManager.createDirectly(target, DocumentBundle.class);
        final DocumentBundle bundle = (DocumentBundle) bundleResource.getResource();
        final ResourceKey bundleKey = bundle.getBundleKey();
        report.setDefinitionSource(bundleKey);
        report.setContentBase(bundleKey);
        report.setResourceManager(bundle.getResourceManager());
        activeContext.resetChangeTracker();
      }
      catch (ResourceException e)
      {
        UncaughtExceptionsModel.getInstance().addException(e);
View Full Code Here

  private String computeNameFromMetadata(final ResourceManager resourceManager, final ResourceKey key)
  {
    try
    {
      final Resource res = resourceManager.create(key, null, new Class[]{DocumentBundle.class});
      final DocumentBundle rawResource = (DocumentBundle) res.getResource();
      final Object possibleTitle = rawResource.getMetaData().getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE);
      if (possibleTitle != null)
      {
        return possibleTitle.toString();
      }
View Full Code Here

TOP

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

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.