Package org.pentaho.platform.api.engine

Examples of org.pentaho.platform.api.engine.IOutputHandler


  public void setInputStream( InputStream arg0 ) {
    xactionDefInputStream = arg0;
  }

  public void execute() throws Exception {
    IOutputHandler outputHandler = null;
    if ( xactionResultsOutputStream instanceof RepositoryFileOutputStream ) {
      outputHandler = new RepositoryFileOutputHandler( ( (RepositoryFileOutputStream) xactionResultsOutputStream ) );
    } else {
      outputHandler = new SimpleOutputHandler( xactionResultsOutputStream, false );
    }
    IRuntimeContext rt = null;
    try {
      ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, null );
      solutionEngine.setCreateFeedbackParameterCallback( null );
      solutionEngine.setLoggingLevel( ILogger.DEBUG );
      solutionEngine.setForcePrompt( false );

      ArrayList messages = new ArrayList();

      HashMap<String, Object> parameterProviders = new HashMap<String, Object>();
      parameterProviders.put( IParameterProvider.SCOPE_REQUEST, new SimpleParameterProvider( xActionInputParams ) );
      parameterProviders.put( IParameterProvider.SCOPE_SESSION, new PentahoSessionParameterProvider(
          PentahoSessionHolder.getSession() ) );
      String xactionPath = null;
      if ( xactionDefInputStream instanceof RepositoryFileInputStream ) {
        xactionPath = ( (RepositoryFileInputStream) xactionDefInputStream ).getFile().getPath();
      }
      rt =
          solutionEngine.execute( xactionPath, this.getClass().getName(), false, true, null, true, parameterProviders,
            outputHandler, null, null, messages );

      if ( !outputHandler.contentDone() ) {
        if ( ( rt != null ) && ( rt.getStatus() == IRuntimeContext.RUNTIME_STATUS_SUCCESS ) ) {
          boolean isFlushed = false;
          boolean isEmpty;
          if ( xactionResultsOutputStream instanceof RepositoryFileOutputStream ) {
            RepositoryFileOutputStream repositoryFileOutputStream =
View Full Code Here


    assertNotNull( "contentGenerator is null", contentGenerator ); //$NON-NLS-1$
    assertNotNull( "Logger is null", contentGenerator.getLogger() ); //$NON-NLS-1$

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    IOutputHandler outputHandler = new SimpleOutputHandler( out, false );

    String baseUrl = "http://testhost:testport/testcontent"; //$NON-NLS-1$
    Map<String, IParameterProvider> parameterProviders = new HashMap<String, IParameterProvider>();
    SimpleParameterProvider requestParams = new SimpleParameterProvider();
    parameterProviders.put( IParameterProvider.SCOPE_REQUEST, requestParams );
    SimpleUrlFactory urlFactory = new SimpleUrlFactory( baseUrl + "?" ); //$NON-NLS-1$
    List<String> messages = new ArrayList<String>();
    contentGenerator.setOutputHandler( outputHandler );
    MimeTypeListener mimeTypeListener = new MimeTypeListener();
    outputHandler.setMimeTypeListener( mimeTypeListener );
    contentGenerator.setMessagesList( messages );
    contentGenerator.setParameterProviders( parameterProviders );
    contentGenerator.setSession( session );
    contentGenerator.setUrlFactory( urlFactory );
    contentGenerator.createContent();
View Full Code Here

    AxisWebServiceManager.currentAxisConfiguration = axisCfg;
    AxisWebServiceManager.currentAxisConfigContext = configContext;

    out = new ByteArrayOutputStream();
    IOutputHandler outputHandler = new SimpleOutputHandler( out, false );
    outputHandler.setMimeTypeListener( new MimeTypeListener() );

    contentGenerator = new AxisServiceExecutor();

    contentGenerator.setOutputHandler( outputHandler );
    contentGenerator.setMessagesList( new ArrayList<String>() );
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.IOutputHandler

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.