Package org.pentaho.reporting.libraries.docbundle

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


  public static MasterReport loadReport(final Object selectedFile, final ResourceManager resourceManager)
      throws ResourceException, IOException
  {
    final Resource directly = resourceManager.createDirectly(selectedFile, 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


    }

    try
    {
      final MasterReport report = activeContext.getContextRoot();
      final DocumentBundle bundle = report.getBundle();
      final DocumentMetaData oldMetaData = (DocumentMetaData) bundle.getMetaData().clone();
      final DocumentMetaData result = dialog.performEdit(oldMetaData,
          report.getResourceManager(),
          report.getDefinitionSource());

      if (result == null)
View Full Code Here

      throws Exception
  {
    BundleWriter.writeReportToZipFile(report, file);
    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);
View Full Code Here

      throws Exception
  {
    BundleWriter.writeReportToZipFile(report, file);
    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);
View Full Code Here

      throws Exception
  {
    BundleWriter.writeReportToZipFile(report, file);
    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);
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
    {
      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

      {
        final ResourceManager resourceManager = getRootHandler().getResourceManager();
        try
        {
          final Resource bundleData = resourceManager.create(key.getParent(), null, DocumentBundle.class);
          final DocumentBundle documentBundle = (DocumentBundle) bundleData.getResource();
          report.setBundle(documentBundle);

          final DocumentMetaData metaData = documentBundle.getMetaData();
          final int versionMajorRaw = getBundleAttribute(metaData, "prpt-spec.version.major");
          final int versionMinorRaw = getBundleAttribute(metaData, "prpt-spec.version.minor");
          final int versionPatchRaw = getBundleAttribute(metaData, "prpt-spec.version.patch");

          if (versionMajorRaw == -1 || versionMinorRaw == -1 || versionPatchRaw == -1 ||
View Full Code Here

    {
      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

  public static MasterReport loadReport(final Object selectedFile, final ResourceManager resourceManager)
      throws ResourceException, IOException
  {
    final Resource directly = resourceManager.createDirectly(selectedFile, 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

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.