Package org.pentaho.reporting.engine.classic.core.function

Examples of org.pentaho.reporting.engine.classic.core.function.OutputFunction


      return true;
    }

    if (safeToStore == null)
    {
      final OutputFunction outputFunction = reportState.getLayoutProcess().getOutputFunction();
      if (outputFunction instanceof DefaultOutputFunction)
      {
        final DefaultOutputFunction defaultOutputFunction = (DefaultOutputFunction) outputFunction;
        safeToStore = defaultOutputFunction.getRenderer().isSafeToStore();
      }
View Full Code Here


      inlineDataRowRuntime = new InlineDataRowRuntime();
    }
    inlineDataRowRuntime.setState(state);

    final ExpressionRuntime oldRuntime;
    final OutputFunction outputFunction = getOutputFunction();
    if (outputFunction != null)
    {
      oldRuntime = outputFunction.getRuntime();
      outputFunction.setRuntime(inlineDataRowRuntime);
    }
    else
    {
      oldRuntime = null;
    }

    try
    {
      if (outputFunction != null)
      {
        outputFunction.restart(state);
      }
    }
    finally
    {
      if (outputFunction != null)
      {
        outputFunction.setRuntime(oldRuntime);
      }
    }
  }
View Full Code Here

      inlineDataRowRuntime = new InlineDataRowRuntime();
    }
    inlineDataRowRuntime.setState(event.getState());

    final ExpressionRuntime oldRuntime;
    final OutputFunction outputFunction = getOutputFunction();
    if (outputFunction != null)
    {
      oldRuntime = outputFunction.getRuntime();
      outputFunction.setRuntime(inlineDataRowRuntime);
    }
    else
    {
      oldRuntime = null;
    }

    try
    {
      // first check the flagged events: Prepare, Page-Start, -end, cancel and rollback
      // before heading for the unflagged events ..

      if ((type & ReportEvent.PAGE_STARTED) == ReportEvent.PAGE_STARTED)
      {
        firePageStartedEvent(event);
      }
      else if ((type & ReportEvent.PAGE_FINISHED) == ReportEvent.PAGE_FINISHED)
      {
        firePageFinishedEvent(event);
      }
      else if ((type & ReportEvent.ITEMS_ADVANCED) == ReportEvent.ITEMS_ADVANCED)
      {
        fireItemsAdvancedEvent(event);
      }
      else if ((type & ReportEvent.ITEMS_FINISHED) == ReportEvent.ITEMS_FINISHED)
      {
        fireItemsFinishedEvent(event);
      }
      else if ((type & ReportEvent.ITEMS_STARTED) == ReportEvent.ITEMS_STARTED)
      {
        fireItemsStartedEvent(event);
      }
      else if ((type & ReportEvent.GROUP_FINISHED) == ReportEvent.GROUP_FINISHED)
      {
        fireGroupFinishedEvent(event);
      }
      else if ((type & ReportEvent.GROUP_STARTED) == ReportEvent.GROUP_STARTED)
      {
        fireGroupStartedEvent(event);
      }
      else if ((type & ReportEvent.REPORT_INITIALIZED) == ReportEvent.REPORT_INITIALIZED)
      {
        fireReportInitializedEvent(event);
      }
      else if ((type & ReportEvent.REPORT_DONE) == ReportEvent.REPORT_DONE)
      {
        fireReportDoneEvent(event);
      }
      else if ((type & ReportEvent.REPORT_FINISHED) == ReportEvent.REPORT_FINISHED)
      {
        fireReportFinishedEvent(event);
      }
      else if ((type & ReportEvent.REPORT_STARTED) == ReportEvent.REPORT_STARTED)
      {
        fireReportStartedEvent(event);
      }
      else
      {
        throw new IllegalArgumentException();
      }
    }
    finally
    {
      if (outputFunction != null)
      {
        outputFunction.setRuntime(oldRuntime);
      }
    }
  }
View Full Code Here

    final long start = System.currentTimeMillis();

    // every report processing starts with an StartState.
    final DefaultProcessingContext processingContext = createProcessingContext();
    final MasterReport report = getReport();
    final OutputFunction lm = createLayoutManager();

    final ProcessState startState = new ProcessState();
    try
    {
      startState.initializeForMasterReport
          (report, processingContext, new InitialLayoutProcess((OutputFunction) lm.getInstance()));
    }
    finally
    {
      activeDataFactory = startState.getProcessHandle();
    }
View Full Code Here

          restoreState = fallBackState;
          if (isInRollBackMode == false)
          {
            if (pageEventCount >= AbstractReportProcessor.COMMIT_RATE)
            {
              final OutputFunction outputFunction = state.getLayoutProcess().getOutputFunction();
              if (outputFunction.createRollbackInformation())
              {
                realFallbackState = state.deriveForPagebreak();
                if (AbstractReportProcessor.SHOW_ROLLBACKS)
                {
                  logger.debug("Paginate: Try to generate new fallback state after commit count reached: " + state.getProcessKey());
                }
                validate(state);
              }
              else
              {
                realFallbackState = null;
              }
            }
          }
        }
        else
        {
          restoreState = null;
        }

        final ProcessState nextState = state.advance();
        state.setErrorHandler(IgnoreEverythingReportErrorHandler.INSTANCE);
        state = nextState;
        validate(state);

        final ReportStateKey nextStateKey = state.getProcessKey();

        if (errorHandler.isErrorOccured() == true)
        {
          final List childExceptions = Arrays.asList(errorHandler.getErrors());
          errorHandler.clearErrors();
          final ReportEventException exception =
              new ReportEventException("Failed to dispatch an event.", childExceptions);
          if (failOnError)
          {
            throw exception;
          }
          else
          {
            AbstractReportProcessor.logger.error("Failed to dispatch an event.", exception);
          }
        }

        if (state.isArtifcialState())
        {
          if (AbstractReportProcessor.SHOW_ROLLBACKS)
          {
            logger.debug("Paginate: Silent commit as we are in an artificial state: " + state.getProcessKey());
          }
          state = state.commit();
          if (AbstractReportProcessor.SHOW_ROLLBACKS)
          {
            logger.debug("Paginate: Post Silent commit as we are in an artificial state: " + state.getProcessKey());
          }
          continue;
        }

        final OutputFunction outputFunction = state.getLayoutProcess().getOutputFunction();
        if (outputFunction instanceof DefaultOutputFunction == false)
        {
          state = state.commit();
          if (state.isFinish() && pageStates.size() == 1)
          {
View Full Code Here

  private void validate(final ProcessState state)
  {
    if (paranoidChecks)
    {
      final OutputFunction outputFunction = state.getLayoutProcess().getOutputFunction();
      if (outputFunction instanceof DefaultOutputFunction == false)
      {
        return;
      }
View Full Code Here

          restoreState = fallBackState;
          if (isInRollBackMode == false)
          {
            if (pageEventCount >= AbstractReportProcessor.COMMIT_RATE)
            {
              final OutputFunction outputFunction = state.getLayoutProcess().getOutputFunction();
              if (outputFunction.createRollbackInformation())
              {
                if (AbstractReportProcessor.SHOW_ROLLBACKS)
                {
                  logger.debug("Print: Try to generate new fallback state after commit count reached: " + state.getProcessKey());
                }
                realFallbackState = state.deriveForPagebreak();
              }
              else
              {
                realFallbackState = null;
              }
            }
          }
        }
        else
        {
          restoreState = null;
        }

        final ProcessState nextState = state.advance();
        state.setErrorHandler(IgnoreEverythingReportErrorHandler.INSTANCE);
        state = nextState;

        final ReportStateKey nextStateKey = state.getProcessKey();

        if (errorHandler.isErrorOccured() == true)
        {
          final List childExceptions = Arrays.asList(errorHandler.getErrors());
          errorHandler.clearErrors();
          if (failOnError)
          {
            throw new ReportEventException("Failed to dispatch an event.", childExceptions);
          }
          else
          {
            final ReportEventException exception =
                new ReportEventException("Failed to dispatch an event.", childExceptions);
            AbstractReportProcessor.logger.error("Failed to dispatch an event.", exception);
          }
        }

        if (state.isArtifcialState())
        {
          if (AbstractReportProcessor.SHOW_ROLLBACKS)
          {
            logger.debug("Print: Silent commit as we are in an artificial state: " + state.getProcessKey());
          }
          state = state.commit();
          continue;
        }

        final OutputFunction outputFunction = state.getLayoutProcess().getOutputFunction();
        if (outputFunction instanceof DefaultOutputFunction == false)
        {
          if (AbstractReportProcessor.SHOW_ROLLBACKS)
          {
            logger.debug("Print: Silent commit as we are have no access to the renderer: " + state.getProcessKey());
View Full Code Here

    {
      sw.start();
      // every report processing starts with an StartState.
      final DefaultProcessingContext processingContext = createProcessingContext();
      final MasterReport report = getReport();
      final OutputFunction lm = createLayoutManager();

      final ProcessState startState = new ProcessState();
      try
      {
        startState.initializeForMasterReport
            (report, processingContext, (OutputFunction) lm.getInstance());
      }
      finally
      {
        activeDataFactory = startState.getProcessHandle();
      }
View Full Code Here

          restoreState = fallBackState;
          if (isInRollBackMode == false)
          {
            if (pageEventCount >= AbstractReportProcessor.COMMIT_RATE)
            {
              final OutputFunction outputFunction = state.getLayoutProcess().getOutputFunction();
              if (outputFunction.createRollbackInformation())
              {
                realFallbackState = state.deriveForPagebreak();
                if (AbstractReportProcessor.SHOW_ROLLBACKS)
                {
                  logger.debug("Paginate: Try to generate new fallback state after commit count reached: " + state.getProcessKey());
                }
                validate(state);
              }
              else
              {
                realFallbackState = null;
              }
            }
          }
        }
        else
        {
          restoreState = null;
        }

        final ProcessState nextState = state.advance();
        state.setErrorHandler(IgnoreEverythingReportErrorHandler.INSTANCE);
        state = nextState;
        validate(state);

        final ReportStateKey nextStateKey = state.getProcessKey();

        if (errorHandler.isErrorOccured() == true)
        {
          final List childExceptions = Arrays.asList(errorHandler.getErrors());
          errorHandler.clearErrors();
          final ReportEventException exception =
              new ReportEventException("Failed to dispatch an event.", childExceptions);
          if (failOnError)
          {
            throw exception;
          }
          else
          {
            AbstractReportProcessor.logger.error("Failed to dispatch an event.", exception);
          }
        }

        if (state.isArtifcialState())
        {
          if (AbstractReportProcessor.SHOW_ROLLBACKS)
          {
            logger.debug("Paginate: Silent commit as we are in an artificial state: " + state.getProcessKey());
          }
          state = state.commit();
          if (AbstractReportProcessor.SHOW_ROLLBACKS)
          {
            logger.debug("Paginate: Post Silent commit as we are in an artificial state: " + state.getProcessKey());
          }
          continue;
        }

        final OutputFunction outputFunction = state.getLayoutProcess().getOutputFunction();
        if (outputFunction instanceof DefaultOutputFunction == false)
        {
          state = state.commit();
          if (state.isFinish() && pageStates.size() == 1)
          {
View Full Code Here

  }


  protected int calculatePageCount(final ProcessState state)
  {
    final OutputFunction outputFunction = state.getLayoutProcess().getOutputFunction();
    if (outputFunction instanceof DefaultOutputFunction == false)
    {
      return 0;
    }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.function.OutputFunction

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.