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


  {
  }

  protected MasterReport postProcess(final MasterReport originalReport) throws Exception
  {
    final DocumentMetaData originalMeta = originalReport.getBundle().getMetaData();
    final MemoryByteArrayOutputStream bout = new MemoryByteArrayOutputStream();
    BundleWriter.writeReportToZipStream(originalReport, bout, originalMeta);
    assertTrue(bout.getLength() > 0);

    final ResourceManager mgr = new ResourceManager();
View Full Code Here

  }

  public void run()
  {
    final MasterReport report = reportDesignerContext.getActiveContext().getContextRoot();
    final DocumentMetaData metaData = report.getBundle().getMetaData();

    try
    {
      final String oldName = extractLastFileName(report);
View Full Code Here

  private void storeBundleMetaData(final MasterReport report,
                                   final String selectedReport,
                                   final SelectFileForPublishTask selectFileForPublishTask)
  {
    final DocumentMetaData metaData = report.getBundle().getMetaData();
    report.setAttribute
        (ReportDesignerBoot.DESIGNER_NAMESPACE, ReportDesignerBoot.LAST_FILENAME, selectedReport);

    if (metaData instanceof WriteableDocumentMetaData)
    {
View Full Code Here

  }

  public void run()
  {
    final MasterReport report = reportDesignerContext.getActiveContext().getMasterReportElement();
    final DocumentMetaData metaData = report.getBundle().getMetaData();

    try
    {
      final Object lastFilenameAttr = report.getAttribute
          (ReportDesignerBoot.DESIGNER_NAMESPACE, ReportDesignerBoot.LAST_FILENAME);
      final String oldName ;
      if (lastFilenameAttr != null)
      {
        oldName = (String) lastFilenameAttr;
      }
      else
      {
        oldName = null;
      }
     
      final String oldPublishPassword = loginData.getOption("#publishPassword");

      final String oldDescription = (String) metaData.getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DESCRIPTION);
      final String oldTitle = (String) metaData.getBundleAttribute
          (ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE);

      final boolean oldLockOutput = Boolean.TRUE.equals
          (report.getAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.LOCK_PREFERRED_OUTPUT_TYPE));
      final String oldExportType = (String) report.getAttribute
View Full Code Here

    SwingUtil.centerDialogInParent(dialog);
    try
    {
      final MasterReport report = activeContext.getMasterReportElement();
      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 IOException, PlatformImportException {

    try {
      ResourceManager mgr = new ResourceManager();
      MasterReport report = (MasterReport) mgr.createDirectly( bytes, MasterReport.class ).getResource();
      DocumentMetaData metaData = report.getBundle().getMetaData();
      String description = (String) metaData.getBundleAttribute(ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.DESCRIPTION );
      if ( StringUtils.isEmpty( description, true ) ) {
        // make sure that empty strings and strings with only whitespace are not used as description.
        description = null;
      }
      String title = (String) metaData.getBundleAttribute( ODFMetaAttributeNames.DublinCore.NAMESPACE, ODFMetaAttributeNames.DublinCore.TITLE );
      if ( StringUtils.isEmpty( title, true ) ) {
        // make sure that empty strings and strings with only whitespace are not used as description.
        title = null;
      }
      if ( title != null || description != null ) {
        localeFilesProcessor.createLocaleEntry( filePath, fileName, title, description, rf,
            new ByteArrayInputStream( "".getBytes() ) );
      }
      // we are conservative here. Only if the string matches 'true' with this spelling.
      return "false".equals( metaData.getBundleAttribute( ClassicEngineBoot.METADATA_NAMESPACE, "visible" ) );
    } catch ( ResourceException e ) {
      throw new PlatformImportException( "An unexpected error occurred while parsing a report definition", e );
    }
  }
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.