Package org.pentaho.reporting.engine.classic.core.layout.output

Examples of org.pentaho.reporting.engine.classic.core.layout.output.OutputProcessor


  protected boolean performPagination(final LayoutPagebreakHandler handler,
                                      final boolean performOutput)
      throws ContentProcessingException
  {
    final OutputProcessor outputProcessor = getOutputProcessor();
    // next: perform pagination.
    final LogicalPageBox _pageBox = getPageBox();

    final LogicalPageBox clone = (LogicalPageBox) _pageBox.derive(true);
    final PaginationResult pageBreak = paginationStep.performPagebreak(clone);

    debugPrint(clone);
    setPagebreaks(getPagebreaks() + 1);
    clone.setAllVerticalBreaks(pageBreak.getAllBreaks());

    flowCount += 1;

    // A new page has been started. Recover the page-grid, then restart
    // everything from scratch. (We have to recompute, as the pages may
    // be different now, due to changed margins or page definitions)
    final long nextOffset = clone.computePageEnd();
    clone.setPageEnd(nextOffset);
    final long pageOffset = clone.getPageOffset();

    if (outputProcessor.isNeedAlignedPage())
    {
      final LogicalPageBox box = fillPhysicalPagesStep.compute(clone, pageOffset, nextOffset);
      logger.debug("Processing contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);

      outputProcessor.processContent(box);
    }
    else
    {
      logger.debug("Processing fast contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
      outputProcessor.processContent(clone);
    }

    return false;
  }
View Full Code Here


      debugPrint(pageBox);

      // A new page has been started. Recover the page-grid, then restart
      // everything from scratch. (We have to recompute, as the pages may
      // be different now, due to changed margins or page definitions)
      final OutputProcessor outputProcessor = getOutputProcessor();
      final long nextOffset = pageBreak.getLastPosition();
      final long pageOffset = pageBox.getPageOffset();

      if (performOutput)
      {
        if (outputProcessor.isNeedAlignedPage())
        {
          final LogicalPageBox box = fillPhysicalPagesStep.compute(pageBox, pageOffset, nextOffset);
          outputProcessor.processContent(box);
          // DebugLog.log("Processing contents for Page " + pageCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
        }
        else
        {
          // DebugLog.log("Processing fast contents for Page " + pageCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
          outputProcessor.processContent(pageBox);
        }
      }
      else
      {
        // todo: When recomputing the contents, we have to update the page cursor or the whole
        // excercise is next to useless ..
        // DebugLog.log("Recomputing contents for Page " + pageCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
        outputProcessor.processRecomputedContent(pageBox);
      }

      // Now fire the pagebreak. This goes through all layers and informs all
      // components, that a pagebreak has been encountered and possibly a
      // new page has been set. It does not save the state or perform other
      // expensive operations. However, it updates the 'isPagebreakEncountered'
      // flag, which will be active until the input-feed received a new event.
      //      Log.debug ("PageTime " + (currentPageAge - lastPageAge));
      lastPageAge = System.currentTimeMillis();

      final boolean repeat = pageBox.isOpen() || (pageBox.getHeight() > nextOffset);
      if (repeat)
      {
        pageBox.setPageOffset(nextOffset);

        final long shift = cleanPaginatedBoxesStep.compute(pageBox);
        if (shift > 0)
        {
          final InstanceID shiftNode = cleanPaginatedBoxesStep.getShiftNode();
          applyPageShiftValuesStep.compute(pageBox, shift, shiftNode);
        }

        if (pageBreak.isNextPageContainsContent())
        {
          if (layoutPagebreakHandler != null)
          {
            layoutPagebreakHandler.pageStarted();
          }
          return true;
        }
        // No need to try again, we know that the result will not change, as the next page is
        // empty. (We already tested it.)
        pageStartPending = true;
        return false;
      }
      else
      {
        pageBox.setPageOffset(nextOffset);
        outputProcessor.processingFinished();
        return false;
      }
    }
    return false;
  }
View Full Code Here

//      Log.debug ("Not dirty, no update needed.");
      return;
    }
    clearDirty();

    final OutputProcessor outputProcessor = getOutputProcessor();
    if (outputProcessor instanceof IterativeOutputProcessor == false ||
        outputProcessor.getMetaData().isFeatureSupported(OutputProcessorFeature.ITERATIVE_RENDERING) == false)
    {
//      Log.debug ("No incremental system.");
      return;
    }
View Full Code Here

    if (performOutput == false)
    {
      return false;
    }

    final OutputProcessor outputProcessor = getOutputProcessor();
    final LogicalPageBox pageBox = getPageBox();

    // This is fixed: The streaming renderers always use the whole page area ..
    pageBox.setPageOffset(0);
    pageBox.setPageEnd(pageBox.getHeight());

    if (pageBox.isOpen())
    {
      // Not finished and the output target is non-iterative, so we have to wait until everything is done..
      return false;
    }

    // the reporting finally came to an end. Lets process the content.
    // shiftBox(pageBox, false);
    applyAutoCommitPageHeaderStep.commitAll(pageBox);
    outputProcessor.processContent(pageBox);
    cleanBoxesStep.compute(pageBox);
    debugPrint(pageBox);
    outputProcessor.processingFinished();

    setPagebreaks(1);
    return false;
  }
View Full Code Here

//      Log.debug ("Not dirty, no update needed.");
      return;
    }
    clearDirty();

    final OutputProcessor outputProcessor = getOutputProcessor();
    if (outputProcessor instanceof IterativeOutputProcessor == false ||
        outputProcessor.getMetaData().isFeatureSupported(OutputProcessorFeature.ITERATIVE_RENDERING) == false)
    {
//      Log.debug ("No incremental system.");
      return;
    }
View Full Code Here

  protected boolean performPagination(final LayoutPagebreakHandler layoutPagebreakHandler,
                                      final boolean performOutput)
      throws ContentProcessingException
  {
    final OutputProcessor outputProcessor = getOutputProcessor();
    // next: perform pagination.
    final LogicalPageBox pageBox = getPageBox();
//    final long sizeBeforePagination = pageBox.getHeight();
    //final LogicalPageBox clone = (LogicalPageBox) pageBox.deriveForAdvance(true);
    final PaginationResult pageBreak = paginationStep.performPagebreak(pageBox);
    if (pageBreak.isOverflow() || pageBox.isOpen() == false)
    {
      setLastStateKey(pageBreak.getLastVisibleState());
//      final long sizeAfterPagination = pageBox.getHeight();
      setPagebreaks(getPagebreaks() + 1);
      pageBox.setAllVerticalBreaks(pageBreak.getAllBreaks());

      flowCount += 1;
      debugPrint(pageBox);

      // A new page has been started. Recover the page-grid, then restart
      // everything from scratch. (We have to recompute, as the pages may
      // be different now, due to changed margins or page definitions)
      final long nextOffset = pageBox.computePageEnd();
      pageBox.setPageEnd(nextOffset);
      final long pageOffset = pageBox.getPageOffset();

      if (performOutput)
      {
        if (outputProcessor.isNeedAlignedPage())
        {
          final LogicalPageBox box = fillPhysicalPagesStep.compute(pageBox, pageOffset, nextOffset);
//          DebugLog.log("Processing contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);

          outputProcessor.processContent(box);
        }
        else
        {
//          DebugLog.log("Processing fast contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
          outputProcessor.processContent(pageBox);
        }
      }
      else
      {
//        DebugLog.log("Recomputing contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
        outputProcessor.processRecomputedContent(pageBox);
      }

      // Now fire the pagebreak. This goes through all layers and informs all
      // components, that a pagebreak has been encountered and possibly a
      // new page has been set. It does not save the state or perform other
      // expensive operations. However, it updates the 'isPagebreakEncountered'
      // flag, which will be active until the input-feed received a new event.
      //      Log.debug("PageTime " + (currentPageAge - lastPageAge));
      lastPageAge = System.currentTimeMillis();

      final boolean repeat = pageBox.isOpen() || pageBreak.isOverflow();
      if (repeat)
      {
        // pageBox.setAllVerticalBreaks(pageBreak.getAllBreaks());
        // First clean all boxes that have been marked as finished. This reduces the overall complexity of the
        // pagebox and improves performance on huge reports.
        cleanFlowBoxesStep.compute(pageBox);

        final long l = cleanPaginatedBoxesStep.compute(pageBox);
        if (l > 0)
        {
//          Log.debug ("Apply shift afterwards " + l);
          final InstanceID shiftNode = cleanPaginatedBoxesStep.getShiftNode();
          applyPageShiftValuesStep.compute(pageBox, l, shiftNode);
          debugPrint(pageBox);
        }

        pageBox.setPageOffset(nextOffset);
        if (pageBreak.isNextPageContainsContent())
        {
          if (layoutPagebreakHandler != null)
          {
            layoutPagebreakHandler.pageStarted();
          }
          return true;
        }
        // No need to try again, we know that the result will not change, as the next page is
        // empty. (We already tested it.)
        pageStartPending = true;
        return false;
      }
      else
      {
        outputProcessor.processingFinished();
        pageBox.setPageOffset(nextOffset);
        return false;
      }
    }
    else if (outputProcessor instanceof IterativeOutputProcessor &&
        outputProcessor.getMetaData().isFeatureSupported(OutputProcessorFeature.ITERATIVE_RENDERING))
    {
      processIncrementalUpdate(performOutput);
//      final IterativeOutputProcessor io = (IterativeOutputProcessor) outputProcessor;
//      io.processIterativeContent(pageBox, performOutput);
//      cleanFlowBoxesStep.compute(pageBox);
View Full Code Here

    {
      return;
    }
    clearDirty();

    final OutputProcessor outputProcessor = getOutputProcessor();
    if (outputProcessor instanceof IterativeOutputProcessor == false ||
        outputProcessor.getMetaData().isFeatureSupported(OutputProcessorFeature.ITERATIVE_RENDERING) == false)
    {
      return;
    }

View Full Code Here

  protected boolean performPagination(final LayoutPagebreakHandler layoutPagebreakHandler,
                                      final boolean performOutput)
      throws ContentProcessingException
  {
    final OutputProcessor outputProcessor = getOutputProcessor();
    // next: perform pagination.
    final LogicalPageBox pageBox = getPageBox();
    final PaginationResult pageBreak = paginationStep.performPagebreak(pageBox);
    if (pageBreak.isOverflow() || pageBox.isOpen() == false)
    {
      setLastStateKey(pageBreak.getLastVisibleState());
      setPagebreaks(getPagebreaks() + 1);
      pageBox.setAllVerticalBreaks(pageBreak.getAllBreaks());

      flowCount += 1;
      debugPrint(pageBox);

      // A new page has been started. Recover the page-grid, then restart
      // everything from scratch. (We have to recompute, as the pages may
      // be different now, due to changed margins or page definitions)
      final long nextOffset = pageBox.computePageEnd();
      pageBox.setPageEnd(nextOffset);
      final long pageOffset = pageBox.getPageOffset();

      if (performOutput)
      {
        if (outputProcessor.isNeedAlignedPage())
        {
          final LogicalPageBox box = fillPhysicalPagesStep.compute(pageBox, pageOffset, nextOffset);
          outputProcessor.processContent(box);
        }
        else
        {
          outputProcessor.processContent(pageBox);
        }
      }
      else
      {
        outputProcessor.processRecomputedContent(pageBox);
      }

      // Now fire the pagebreak. This goes through all layers and informs all
      // components, that a pagebreak has been encountered and possibly a
      // new page has been set. It does not save the state or perform other
      // expensive operations. However, it updates the 'isPagebreakEncountered'
      // flag, which will be active until the input-feed received a new event.
      final boolean repeat = pageBox.isOpen() || pageBreak.isOverflow();
      if (repeat)
      {
        // pageBox.setAllVerticalBreaks(pageBreak.getAllBreaks());
        // First clean all boxes that have been marked as finished. This reduces the overall complexity of the
        // pagebox and improves performance on huge reports.

        cleanPaginatedBoxesStep.compute(pageBox);

        pageBox.setPageOffset(nextOffset);
        if (pageBreak.isNextPageContainsContent())
        {
          if (layoutPagebreakHandler != null)
          {
            layoutPagebreakHandler.pageStarted();
          }
          return true;
        }
        // No need to try again, we know that the result will not change, as the next page is
        // empty. (We already tested it.)
        pageStartPending = true;
        return false;
      }
      else
      {
        outputProcessor.processingFinished();
        pageBox.setPageOffset(nextOffset);
        return false;
      }
    }
    else if (outputProcessor instanceof IterativeOutputProcessor &&
        outputProcessor.getMetaData().isFeatureSupported(OutputProcessorFeature.ITERATIVE_RENDERING))
    {
      processIncrementalUpdate(performOutput);
    }
    return false;
  }
View Full Code Here

    {
      return;
    }
    floodPrevention = 0;

    final OutputProcessor outputProcessor = getOutputProcessor();
    if (outputProcessor instanceof IterativeOutputProcessor == false ||
        outputProcessor.getMetaData().isFeatureSupported(OutputProcessorFeature.ITERATIVE_RENDERING) == false)
    {
      logger.debug("No incremental system.");
      return;
    }
View Full Code Here

  protected boolean performPagination(final LayoutPagebreakHandler layoutPagebreakHandler,
                                      final boolean performOutput)
      throws ContentProcessingException
  {
    final OutputProcessor outputProcessor = getOutputProcessor();
    // next: perform pagination.
    final LogicalPageBox pageBox = getPageBox();
//    final long sizeBeforePagination = pageBox.getHeight();
    //final LogicalPageBox clone = (LogicalPageBox) pageBox.deriveForAdvance(true);
    final PaginationResult pageBreak = paginationStep.performPagebreak(pageBox);
    if (pageBreak.isOverflow() == false && pageBox.isOpen())
    {
      return false;
    }

    setLastStateKey(pageBreak.getLastVisibleState());
//      final long sizeAfterPagination = pageBox.getHeight();
    setPagebreaks(getPagebreaks() + 1);
    pageBox.setAllVerticalBreaks(pageBreak.getAllBreaks());

    flowCount += 1;
    debugPrint(pageBox);

    // A new page has been started. Recover the page-grid, then restart
    // everything from scratch. (We have to recompute, as the pages may
    // be different now, due to changed margins or page definitions)
    final long nextOffset = pageBox.computePageEnd();
    pageBox.setPageEnd(nextOffset);
    final long pageOffset = pageBox.getPageOffset();

    if (performOutput)
    {
      if (outputProcessor.isNeedAlignedPage())
      {
        final LogicalPageBox box = fillPhysicalPagesStep.compute(pageBox, pageOffset, nextOffset);
        logger.debug("Processing contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);

        outputProcessor.processContent(box);
      }
      else
      {
        logger.debug("Processing fast contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
        outputProcessor.processContent(pageBox);
      }
    }
    else
    {
      logger.debug("Recomputing contents for Page " + flowCount + " Page-Offset: " + pageOffset + " -> " + nextOffset);
      outputProcessor.processRecomputedContent(pageBox);
    }

    // Now fire the pagebreak. This goes through all layers and informs all
    // components, that a pagebreak has been encountered and possibly a
    // new page has been set. It does not save the state or perform other
    // expensive operations. However, it updates the 'isPagebreakEncountered'
    // flag, which will be active until the input-feed received a new event.
    //      Log.debug("PageTime " + (currentPageAge - lastPageAge));

    final boolean repeat = pageBox.isOpen() || pageBreak.isOverflow();
    if (repeat)
    {
      // pageBox.setAllVerticalBreaks(pageBreak.getAllBreaks());
      // First clean all boxes that have been marked as finished. This reduces the overall complexity of the
      // pagebox and improves performance on huge reports.
      countBoxesStep.process(pageBox);
      cleanFlowBoxesStep.compute(pageBox);

      //cleanPaginatedBoxesStep.compute(pageBox);
      pageBox.setPageOffset(nextOffset);
      // todo PRD-4606
      pageBox.resetCacheState(true);

      if (pageBreak.isNextPageContainsContent())
      {
        if (layoutPagebreakHandler != null)
        {
          layoutPagebreakHandler.pageStarted();
        }
        return true;
      }
      // No need to try again, we know that the result will not change, as the next page is
      // empty. (We already tested it.)
      pageStartPending = true;
      return false;
    }
    else
    {
      outputProcessor.processingFinished();
      pageBox.setPageOffset(nextOffset);
// todo PRD-4606
//      pageBox.resetCacheState(true);
      return false;
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.layout.output.OutputProcessor

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.