Package org.pentaho.reporting.libraries.docbundle

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


  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
    {
      final ResourceKey selectedFile = resourceManager.createKey(filename);
      final Resource directly = resourceManager.create(selectedFile, null, new Class[]{MasterReport.class});
      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);
View Full Code Here

    if (bundle == report.getBundle())
    {
      throw new IllegalArgumentException("Cannot write to the originating bundle.");
    }

    final DocumentBundle reportBundle = report.getBundle();
    if (reportBundle == null)
    {
      this.writeReport(bundle, report, new MemoryDocumentBundle());
    }
    else
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

        if (event.getElement() instanceof MasterReport)
        {
          // Insert the DocumentBundle's ResourceManager as the MasterReports resource manager
          log.debug("DocumentBundle change detected - changing the ResourceManager for the MasterReport");
          final MasterReport report = (MasterReport) event.getElement();
          final DocumentBundle newDocumentBundle = (DocumentBundle) value;
          final ResourceManager resourceManager = newDocumentBundle.getResourceManager();
          report.setResourceManager(resourceManager);
        }
        else
        {
          log.warn("Could not replace the ResourceKey on a DocumentBundle change - the element is not a MasterReport");
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(configuration, resourceManager, contentBase, resourceBundleFactory);

    final ReportEnvironmentDataRow envDataRow = new ReportEnvironmentDataRow(reportEnvironment);
    this.parameterValues = new CompoundDataRow(envDataRow, parameterValues);
View Full Code Here

        metaData.isFeatureSupported(OutputProcessorFeature.LEGACY_LINEHEIGHT_CALC) == false;
    final boolean imageResolutionMapping =
        metaData.isFeatureSupported(OutputProcessorFeature.IMAGE_RESOLUTION_MAPPING) == false;
    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

    public void run()
    {
      try
      {
        super.inspect(report);
        final DocumentBundle bundle = report.getBundle();
        final DocumentMetaData metaData = bundle.getMetaData();
        if (metaData instanceof WriteableDocumentMetaData)
        {
          WriteableDocumentMetaData w = (WriteableDocumentMetaData) metaData;
          w.setBundleAttribute(ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.KEYWORDS, null);
          w.setBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.CREATOR, null);
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.setBundle(bundle);
        report.setResourceManager(bundle.getResourceManager());
        activeContext.resetChangeTracker();
      }
      catch (ResourceException e)
      {
        UncaughtExceptionsModel.getInstance().addException(e);
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.