Package org.pentaho.platform.api.engine

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


        outputStream = responseContentItem.getOutputStream( null );

        response.setContentType( htmlMimeType );
        StringBuffer buffer = new StringBuffer();

        IMessageFormatter formatter = PentahoSystem.get( IMessageFormatter.class, PentahoSessionHolder.getSession() );

        if ( printSuccess ) {
          boolean doWrapper = !( "false".equals( request.getParameter( "wrapper" ) ) ); //$NON-NLS-1$ //$NON-NLS-2$
          formatter.formatSuccessMessage( htmlMimeType, runtime, buffer, debugMessages, doWrapper );
        } else {
          response.resetBuffer();
          formatter.formatFailureMessage( htmlMimeType, runtime, buffer, requestHandler.getMessages() );
        }

        outputStream.write( buffer.toString().getBytes( LocaleHelper.getSystemEncoding() ) );
        responseContentItem.closeOutputStream();
      }
View Full Code Here


    if ( printSuccess || printError ) {
      final String htmlMimeType = "text/html"; //$NON-NLS-1$
      responseContentItem.setMimeType( htmlMimeType );
      response.setContentType( htmlMimeType );
      IMessageFormatter formatter = PentahoSystem.get( IMessageFormatter.class, PentahoSessionHolder.getSession() );

      if ( printSuccess ) {
        formatter.formatSuccessMessage( htmlMimeType, runtime, buffer, debugMessages, doWrapper );
      } else {
        response.resetBuffer();
        formatter.formatFailureMessage( htmlMimeType, runtime, buffer, messages );
      }
    }
    return buffer.toString();
  }
View Full Code Here

    when( runtime.getStatus() ).thenReturn( IRuntimeContext.RUNTIME_STATUS_SUCCESS );
    when( solutionEngine.execute( eq( actionPath ), eq( servlet.getClass().getName() ), eq( false ), eq( true ),
      eq( instanceID ), eq( true ), any( Map.class ), any( IOutputHandler.class ), any( IActionCompleteListener.class ),
      any( IPentahoUrlFactory.class ), any( List.class ) ) ).thenReturn( runtime );
    mp.defineInstance( ISolutionEngine.class, solutionEngine );
    final IMessageFormatter messageFormatter = mock( IMessageFormatter.class );
    mp.defineInstance( IMessageFormatter.class, messageFormatter );

    servlet.service( request, response );

    verify( servlet ).error( matches( ".*ERROR_0001.*" ) );
View Full Code Here

TOP

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

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.