Package org.pentaho.reporting.libraries.repository

Examples of org.pentaho.reporting.libraries.repository.DefaultNameGenerator


    processTask.setReport(bodyReport);
    if (processTask instanceof MultiStreamReportProcessTask)
    {
      final MultiStreamReportProcessTask mtask = (MultiStreamReportProcessTask) processTask;
      mtask.setBulkLocation(mtask.getBodyContentLocation());
      mtask.setBulkNameGenerator(new DefaultNameGenerator(mtask.getBodyContentLocation(), "data"));
      mtask.setUrlRewriter(new MailURLRewriter());
    }
    processTask.run();
    if (processTask.isTaskSuccessful() == false)
    {
      if (processTask.isTaskAborted())
      {
        logger.info("EMail Task received interrupt.");
        return null;
      }
      else
      {
        logger.info("EMail Task failed:", processTask.getError());
        throw new ReportProcessingException("EMail Task failed", processTask.getError());
      }
    }

    final EmailRepository repository = new EmailRepository(session);
    final MimeBodyPart messageBodyPart = repository.getBodypart();
    final ByteArrayDataSource dataSource = new ByteArrayDataSource(bout.toByteArray(), processTask.getReportMimeType());
    messageBodyPart.setDataHandler(new DataHandler(dataSource));

    final int attachmentsSize = mailDefinition.getAttachmentCount();
    for (int i = 0; i < attachmentsSize; i++)
    {
      final MasterReport report = mailDefinition.getAttachmentReport(i);
      final String type = mailDefinition.getAttachmentType(i);
      final ContentLocation location = repository.getRoot();
      final ContentLocation bulkLocation = location.createLocation("attachment-" + i);

      final ReportProcessTask attachmentProcessTask = registry.createProcessTask(type);
      attachmentProcessTask.setBodyContentLocation(bulkLocation);
      attachmentProcessTask.setBodyNameGenerator(new DefaultNameGenerator(bulkLocation, "report"));
      attachmentProcessTask.setReport(report);
      if (attachmentProcessTask instanceof MultiStreamReportProcessTask)
      {
        final MultiStreamReportProcessTask mtask = (MultiStreamReportProcessTask) attachmentProcessTask;
        mtask.setBulkLocation(bulkLocation);
        mtask.setBulkNameGenerator(new DefaultNameGenerator(bulkLocation, "data"));
        mtask.setUrlRewriter(new MailURLRewriter());
      }
      attachmentProcessTask.run();

      if (attachmentProcessTask.isTaskSuccessful() == false)
View Full Code Here


      final ReportProcessor sp;
      if ("pageable".equals(exportMethod))//$NON-NLS-1$
      {
        final PageableHtmlOutputProcessor outputProcessor = new PageableHtmlOutputProcessor(report.getConfiguration());
        final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
        printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, filename, suffix));
        printer.setDataWriter(dataRoot, new DefaultNameGenerator(dataRoot, "content")); //$NON-NLS-1$
        printer.setUrlRewriter(new FileSystemURLRewriter());
        outputProcessor.setPrinter(printer);
        sp = new PageableReportProcessor(report, outputProcessor);
      }
      else
      {
        final HtmlOutputProcessor outputProcessor = createOutputProcessor();
        final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
        printer.setContentWriter(targetRoot,
            new DefaultNameGenerator(targetRoot, filename, suffix));
        printer.setDataWriter(dataRoot, new DefaultNameGenerator(dataRoot, "content")); //$NON-NLS-1$
        printer.setUrlRewriter(new FileSystemURLRewriter());
        outputProcessor.setPrinter(printer);
        sp = new FlowReportProcessor(report, outputProcessor);
      }
      if (progressDialog != null)
View Full Code Here

//      final DummyRepository dataRepository = new DummyRepository();
//      final ContentLocation dataRoot = dataRepository.getRoot();

      final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor(report.getConfiguration());
      final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
      printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, filename, suffix));
      printer.setDataWriter(null, null); //$NON-NLS-1$
      printer.setUrlRewriter(new FileSystemURLRewriter());
      outputProcessor.setPrinter(printer);

      final StreamReportProcessor sp = new StreamReportProcessor(report, outputProcessor);
View Full Code Here

      final ReportProcessor sp;
      if ("pageable".equals(exportMethod))//$NON-NLS-1$
      {
        final PageableHtmlOutputProcessor outputProcessor = new PageableHtmlOutputProcessor(report.getConfiguration());
        final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
        printer.setContentWriter(root, new DefaultNameGenerator(root, "report.html")); //$NON-NLS-1$
        printer.setDataWriter(data, new DefaultNameGenerator(data, "content")); //$NON-NLS-1$
        printer.setUrlRewriter(new SingleRepositoryURLRewriter());
        outputProcessor.setPrinter(printer);
        sp = new PageableReportProcessor(report, outputProcessor);
      }
      else
      {
        final HtmlOutputProcessor outputProcessor = createOutputProcessor();
        final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
        printer.setContentWriter(root, new DefaultNameGenerator(root, "report.html")); //$NON-NLS-1$
        printer.setDataWriter(data, new DefaultNameGenerator(data, "content")); //$NON-NLS-1$
        printer.setUrlRewriter(new SingleRepositoryURLRewriter());
        outputProcessor.setPrinter(printer);
        sp = new FlowReportProcessor(report, outputProcessor);
      }
      if (progressDialog != null)
View Full Code Here

    final StreamRepository targetRepository = new StreamRepository(outputStream);
    final ContentLocation targetRoot = targetRepository.getRoot();

    final HtmlOutputProcessor outputProcessor = new StreamHtmlOutputProcessor(report.getConfiguration());
    final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
    printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, "index", "html"));
    printer.setDataWriter(null, null);
    printer.setUrlRewriter(new FileSystemURLRewriter());
    outputProcessor.setPrinter(printer);

    final StreamReportProcessor sp = new StreamReportProcessor(report, outputProcessor);
View Full Code Here

      final String filename = IOUtils.getInstance().stripFileExtension(targetFile.getName());

      final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor(report.getConfiguration());

      final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
      printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, filename, suffix));
      printer.setDataWriter(targetRoot, new DefaultNameGenerator(targetRoot, "content"));
      printer.setUrlRewriter(new FileSystemURLRewriter());
      outputProcessor.setPrinter(printer);

      final FlowReportProcessor sp = new FlowReportProcessor(report, outputProcessor);
      sp.processReport();
View Full Code Here

      final String filename = IOUtils.getInstance().stripFileExtension(targetFile.getName());

      final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor(report.getConfiguration());

      final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
      printer.setContentWriter(targetRoot, new DefaultNameGenerator(targetRoot, filename, suffix));
      printer.setDataWriter(dataRoot, new DefaultNameGenerator(dataRoot, "content"));
      printer.setUrlRewriter(new FileSystemURLRewriter());
      outputProcessor.setPrinter(printer);

      final FlowReportProcessor sp = new FlowReportProcessor(report, outputProcessor);
      sp.processReport();
View Full Code Here

          (zipRepository, RepositoryUtilities.splitPath("data", "/"));

      final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor(report.getConfiguration());

      final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
      printer.setContentWriter(root, new DefaultNameGenerator(root, filename));
      printer.setDataWriter(data, new DefaultNameGenerator(data, "content"));
      printer.setUrlRewriter(new SingleRepositoryURLRewriter());
      outputProcessor.setPrinter(printer);

      final FlowReportProcessor sp = new FlowReportProcessor(report, outputProcessor);
      sp.processReport();
View Full Code Here

    this.printer = new CSVPrinter(config);

    final ContentLocation root = new StreamRepository(outputStream).getRoot();
    this.printer.setContentLocation(root);
    this.printer.setContentNameGenerator(new DefaultNameGenerator(root));
  }
View Full Code Here

              (zipRepository, RepositoryUtilities.splitPath("data", "/"));

          final FlowHtmlOutputProcessor outputProcessor = new FlowHtmlOutputProcessor(report.getConfiguration());

          final HtmlPrinter printer = new AllItemsHtmlPrinter(report.getResourceManager());
          printer.setContentWriter(root, new DefaultNameGenerator(root, "report"));
          printer.setDataWriter(data, new DefaultNameGenerator(data, "content"));
          printer.setUrlRewriter(new SingleRepositoryURLRewriter());
          outputProcessor.setPrinter(printer);

          final FlowReportProcessor sp = new FlowReportProcessor(report, outputProcessor);
          try
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.libraries.repository.DefaultNameGenerator

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.