Package org.pentaho.reporting.libraries.docbundle

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


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

    final WriteableDocumentMetaData writeableMetaData = bundle.getWriteableDocumentMetaData();
    final String version = ClassicEngineInfo.getInstance().getName() + ' ' +
        ClassicEngineInfo.getInstance().getVersion();

    writeableMetaData.setBundleAttribute
        (ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.GENERATOR,
            version);

    final Date currentDate = new Date();
    if (writeableMetaData.getBundleAttribute
        (ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.CREATION_DATE) == null)
    {
      writeableMetaData.setBundleAttribute
          (ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.CREATION_DATE, currentDate);
    }

    writeableMetaData.setBundleAttribute
        (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DATE, currentDate);
    final Object visibleFlag = state.getMasterReport().getAttribute(AttributeNames.Pentaho.NAMESPACE, "visible");
    if (Boolean.FALSE.equals(visibleFlag))
    {
      writeableMetaData.setBundleAttribute
          (ClassicEngineBoot.METADATA_NAMESPACE, "visible", "false");
    }
    else
    {
      writeableMetaData.setBundleAttribute
          (ClassicEngineBoot.METADATA_NAMESPACE, "visible", "true");
    }

    return null;
  }
View Full Code Here


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

    final WriteableDocumentMetaData data = bundle.getWriteableDocumentMetaData();
    data.setBundleType(ClassicEngineBoot.BUNDLE_TYPE);

    try
    {
      final MasterReport clone = (MasterReport) report.derive();
      final BundleWriterState state = new BundleWriterState(clone, globalBundle, this);
View Full Code Here

  public static void resetDocumentMetaData(final MasterReport masterReport)
  {
    final DocumentMetaData metaData = masterReport.getBundle().getMetaData();
    if (metaData instanceof WriteableDocumentMetaData)
    {
      final WriteableDocumentMetaData wmd = (WriteableDocumentMetaData) metaData;
      wmd.setBundleAttribute(ODFMetaAttributeNames.Meta.NAMESPACE,
          ODFMetaAttributeNames.Meta.INITIAL_CREATOR, wmd.getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.CREATOR));
      try
      {
        wmd.setBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE,
            ODFMetaAttributeNames.DublinCore.CREATOR, System.getProperty("user.name"));
      }
      catch (Exception e)
      {
        // ignore it, not that important ...
      }
      wmd.setBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE,
          ODFMetaAttributeNames.DublinCore.DESCRIPTION, null);
      wmd.setBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE,
          ODFMetaAttributeNames.DublinCore.SUBJECT, null);
      wmd.setBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE,
          ODFMetaAttributeNames.DublinCore.TITLE, null);
      wmd.setBundleAttribute(ODFMetaAttributeNames.Meta.NAMESPACE,
          ODFMetaAttributeNames.Meta.CREATION_DATE, new Date());
      wmd.setBundleAttribute(ODFMetaAttributeNames.Meta.NAMESPACE,
          ODFMetaAttributeNames.Meta.KEYWORDS, null);
    }
  }
View Full Code Here

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

    final WriteableDocumentMetaData data = documentBundle.getWriteableDocumentMetaData();
    data.setBundleType("application/vnd.pentaho.reporting.mailer-definition");

  }
View Full Code Here

    return changed;
  }

  private void refreshBundleList()
  {
    final WriteableDocumentMetaData metaData = bundle.getWriteableDocumentMetaData();
    final ArrayList<String> entries = new ArrayList<String>();
    final String[] manifestEntryNames = metaData.getManifestEntryNames();
    for (int i = 0; i < manifestEntryNames.length; i++)
    {
      final String manifestEntryName = manifestEntryNames[i];

      final String stickyFlag = metaData.getEntryAttribute(manifestEntryName, BundleUtilities.STICKY_FLAG);
      final String hiddenFlag = metaData.getEntryAttribute(manifestEntryName, BundleUtilities.HIDDEN_FLAG);
      if ("true".equals(stickyFlag) && "true".equals(hiddenFlag) == false) // NON-NLS
      {
        entries.add(manifestEntryName);
      }
    }
View Full Code Here

        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);
          w.setBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DESCRIPTION, null);
          w.setBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.SUBJECT, null);
          w.setBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE, null);
        }
      }
      catch (Exception e)
      {
        UncaughtExceptionsModel.getInstance().addException(e);
View Full Code Here

    public void undo(final ReportDocumentContext renderContext)
    {
      final MasterReport report = renderContext.getContextRoot();
      final WriteableDocumentBundle bundle = (WriteableDocumentBundle) report.getBundle();
      final WriteableDocumentMetaData metaData = bundle.getWriteableDocumentMetaData();
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.KEYWORDS,
              oldMetaData.getBundleAttribute(ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.KEYWORDS));
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.CREATOR,
              oldMetaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.CREATOR));
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DESCRIPTION,
              oldMetaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DESCRIPTION));
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.SUBJECT,
              oldMetaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.SUBJECT));
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE,
              oldMetaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE));
      report.notifyNodePropertiesChanged();
    }
View Full Code Here

    public void redo(final ReportDocumentContext renderContext)
    {
      final MasterReport report = renderContext.getContextRoot();
      final WriteableDocumentBundle bundle = (WriteableDocumentBundle) report.getBundle();
      final WriteableDocumentMetaData metaData = bundle.getWriteableDocumentMetaData();
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.KEYWORDS,
              newMetaData.getBundleAttribute(ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.KEYWORDS));
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.CREATOR,
              newMetaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.CREATOR));
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DESCRIPTION,
              newMetaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DESCRIPTION));
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.SUBJECT,
              newMetaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.SUBJECT));
      metaData.setBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE,
              newMetaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE));
      report.notifyNodePropertiesChanged();
    }
View Full Code Here

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

    final WriteableDocumentMetaData data = documentBundle.getWriteableDocumentMetaData();
    data.setBundleType("application/vnd.pentaho.reporting.mailer-definition");

  }
View Full Code Here

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

    final WriteableDocumentMetaData writeableMetaData = bundle.getWriteableDocumentMetaData();
    final String version = ClassicEngineInfo.getInstance().getName() + ' ' +
        ClassicEngineInfo.getInstance().getVersion();

    writeableMetaData.setBundleAttribute
        (ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.GENERATOR, version);

    final Date currentDate = new Date();
    if (writeableMetaData.getBundleAttribute
        (ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.CREATION_DATE) == null)
    {
      writeableMetaData.setBundleAttribute
          (ODFMetaAttributeNames.Meta.NAMESPACE, ODFMetaAttributeNames.Meta.CREATION_DATE, currentDate);
    }

    writeableMetaData.setBundleAttribute
        (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DATE, currentDate);
    final MasterReport masterReport = state.getMasterReport();
    final Object visibleFlag = masterReport.getAttribute(AttributeNames.Pentaho.NAMESPACE, "visible");
    if (Boolean.FALSE.equals(visibleFlag))
    {
      writeableMetaData.setBundleAttribute
          (ClassicEngineBoot.METADATA_NAMESPACE, "visible", "false");
    }
    else
    {
      writeableMetaData.setBundleAttribute
          (ClassicEngineBoot.METADATA_NAMESPACE, "visible", "true");
    }

    writeVersionMarker(writeableMetaData, masterReport);
    return null;
View Full Code Here

TOP

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

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.