Package org.pentaho.reporting.libraries.docbundle

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


    }

    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    if (StringUtils.isEmpty(tabText))
    {
      final DocumentMetaData documentMetaData = rfc.getProcessingContext().getDocumentMetaData();
      tabText = (String) documentMetaData.getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE);
      if (StringUtils.isEmpty(tabText))
      {
        final Object o = rfc.getDataRow().get("report.name");
        if (o != null)
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
View Full Code Here

    final boolean maxLineHeightUsed =
        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();
    }
View Full Code Here

    if (context instanceof ReportFormulaContext == false)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_NA_VALUE);
    }
    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    final DocumentMetaData data = rfc.getProcessingContext().getDocumentMetaData();

    if (parameterCount == 1)
    {
      final String metaName = context.getTypeRegistry().convertToText(parameters.getType(0), parameters.getValue(0));
      final String[] namespaces = data.getMetaDataNamespaces();
      for (int i = 0; i < namespaces.length; i++)
      {
        final String namespace = namespaces[i];
        final Object attribute = data.getBundleAttribute(namespace, metaName);
        if (attribute != null)
        {
          return new TypeValuePair(AnyType.TYPE, attribute);
        }
      }
    }
    else
    {
      final String metaNamespace = context.getTypeRegistry().convertToText(parameters.getType(0), parameters.getValue(0));
      final String metaName = context.getTypeRegistry().convertToText(parameters.getType(1), parameters.getValue(1));
      {
        final Object o = data.getBundleAttribute(metaNamespace, metaName);
        return new TypeValuePair(AnyType.TYPE, o);
      }
    }

    throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_NA_VALUE);
View Full Code Here

    {
      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
    {
      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

    if (context instanceof ReportFormulaContext == false)
    {
      throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_NA_VALUE);
    }
    final ReportFormulaContext rfc = (ReportFormulaContext) context;
    final DocumentMetaData data = rfc.getProcessingContext().getDocumentMetaData();

    if (parameterCount == 1)
    {
      final String metaName = context.getTypeRegistry().convertToText(parameters.getType(0), parameters.getValue(0));
      final String[] namespaces = data.getMetaDataNamespaces();
      for (int i = 0; i < namespaces.length; i++)
      {
        final String namespace = namespaces[i];
        final Object attribute = data.getBundleAttribute(namespace, metaName);
        if (attribute != null)
        {
          return new TypeValuePair(AnyType.TYPE, attribute);
        }
      }
    }
    else
    {
      final String metaNamespace = context.getTypeRegistry().convertToText(parameters.getType(0), parameters.getValue(0));
      final String metaName = context.getTypeRegistry().convertToText(parameters.getType(1), parameters.getValue(1));
      {
        final Object o = data.getBundleAttribute(metaNamespace, metaName);
        return new TypeValuePair(AnyType.TYPE, o);
      }
    }

    throw EvaluationException.getInstance(LibFormulaErrorValue.ERROR_NA_VALUE);
View Full Code Here

        {
          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

  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();
    }
View Full Code Here

    report.setContentBase(null);
  }

  public static void resetDocumentMetaData(final MasterReport report)
  {
    final DocumentMetaData metaData = report.getBundle().getMetaData();
    if (metaData instanceof WriteableDocumentMetaData)
    {
      final WriteableDocumentMetaData wmd = (WriteableDocumentMetaData) metaData;
      wmd.setBundleAttribute(ODFMetaAttributeNames.Meta.NAMESPACE,
          ODFMetaAttributeNames.Meta.INITIAL_CREATOR, wmd.getBundleAttribute
View Full Code Here

TOP

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

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.