Package org.pentaho.platform.api.engine

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


      PentahoSystem.init( applicationContext );
      assertTrue( "PentahoSystem did not initialize", PentahoSystem.getInitializedOK() ); //$NON-NLS-1$
    }

    IPentahoSession session = new StandaloneSession( "system" ); //$NON-NLS-1$
    ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session );
    assertNotNull( "SolutionEngine is null", solutionEngine ); //$NON-NLS-1$
    solutionEngine.setLoggingLevel( ILogger.ERROR );
    solutionEngine.init( session );

    try {
      solutionEngine.setSession( session );
      return solutionEngine;
    } catch ( Exception e ) {
      // we should not get here
      e.printStackTrace();
      assertTrue( e.getMessage(), false );
View Full Code Here


        SimpleOutputHandler outputHandler = null;

        String instanceId = null;

        ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session );
        solutionEngine.setLoggingLevel( PentahoSystem.loggingLevel );
        solutionEngine.init( session );

        String baseUrl = ""; //$NON-NLS-1$
        HashMap parameterProviderMap = new HashMap();
        if ( sessionParameters == null ) {
          sessionParameters = new PentahoSessionParameterProvider( session );
        }

        parameterProviderMap.put( SCOPE_SESSION, sessionParameters );

        IPentahoUrlFactory urlFactory = new SimpleUrlFactory( baseUrl );

        ArrayList messages = new ArrayList();

        IRuntimeContext context = null;
        try {
          context =
              solutionEngine.execute( sessionStartupAction.getActionPath(), "Session startup actions", false, true,
                  instanceId, false, parameterProviderMap, outputHandler, null, urlFactory, messages ); //$NON-NLS-1$

          // if context is null, then we cannot check the status
          if ( null == context ) {
            return;
View Full Code Here

        SimpleOutputHandler outputHandler = null;

        String instanceId = null;

        ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session );
        solutionEngine.setLoggingLevel( PentahoSystem.loggingLevel );
        solutionEngine.init( session );

        String baseUrl = ""; //$NON-NLS-1$
        HashMap parameterProviderMap = new HashMap();
        IPentahoUrlFactory urlFactory = new SimpleUrlFactory( baseUrl );

        ArrayList messages = new ArrayList();

        IRuntimeContext context = null;
        try {
          context =
              solutionEngine.execute( globalStartupAction.getActionPath(), "Global startup actions", false, true,
                  instanceId, false, parameterProviderMap, outputHandler, null, urlFactory, messages ); //$NON-NLS-1$

          // if context is null, then we cannot check the status
          if ( null == context ) {
            return;
View Full Code Here


    final ServletOutputStream outputStream = mock( ServletOutputStream.class );
    when( response.getOutputStream() ).thenReturn( outputStream );

    final ISolutionEngine solutionEngine = mock( ISolutionEngine.class );
    final IRuntimeContext runtime = mock( IRuntimeContext.class );
    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 );
View Full Code Here

   */
  public IPentahoResultSet getActionData() {
    // create an instance of the solution engine to execute the specified
    // action

    ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, getSession() );
    solutionEngine.setLoggingLevel( ILogger.DEBUG );
    solutionEngine.init( getSession() );

    HashMap parameterProviders = getParameterProviders();

    OutputStream outputStream = null;
    SimpleOutputHandler outputHandler = null;
    outputHandler = new SimpleOutputHandler( outputStream, false );

    ArrayList messages = new ArrayList();
    String processId = this.getClass().getName();
    context = solutionEngine.execute( actionPath, processId, false, true, instanceId, false, //$NON-NLS-1$ //$NON-NLS-2$
        parameterProviders, outputHandler, null, urlFactory, messages );

    if ( context == null ) {
      // this went badly wrong
      return null;
View Full Code Here

    while ( keys.hasNext() ) {
      String key = keys.next();
      parameters.put( key, requestParams.getStringParameter( key, null ) );
    }

    ISolutionEngine engine =
        SolutionHelper.execute( "executeAction", userSession, solutionName + actionPath + actionName, parameters, out );
    int status = engine.getExecutionContext().getStatus();

    return status == IRuntimeContext.RUNTIME_STATUS_SUCCESS;
  }
View Full Code Here

  }

  @Deprecated
  public boolean executeAction( String resource, IPentahoSession userSession, OutputStream out,
      HashMap<String, String> params ) {
    ISolutionEngine engine = SolutionHelper.execute( "executeAction", userSession, resource, params, out );
    int status = engine.getExecutionContext().getStatus();

    return status == IRuntimeContext.RUNTIME_STATUS_SUCCESS;
  }
View Full Code Here

      while(keys.hasNext()){
        String key = keys.next();
        parameters.put(key, requestParams.getStringParameter(key,null));
      }
     
      ISolutionEngine engine = SolutionHelper.execute("executeAction", userSession, solutionName + actionPath + actionName, parameters, out);
      int status = engine.getExecutionContext().getStatus();
     
      return status == IRuntimeContext.RUNTIME_STATUS_SUCCESS;
       
  }
View Full Code Here

TOP

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

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.