public static ISolutionEngine getSolutionEngine( IPentahoSession session ) { ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session ); solutionEngine.setLoggingLevel( ILogger.ERROR ); solutionEngine.init( session ); return solutionEngine; } }
solutionEngine.init( session ); solutionEngine.setlistener( execListener );
solutionEngine.init( session );
solutionEngine.init( getSession() );
public int execute() { PentahoSystem.systemEntryPoint(); try { // create a generic session object StandaloneSession session = new StandaloneSession( userId ); solutionEngine = PentahoSystem.get( SolutionEngine.class, session ); solutionEngine.init( session ); SimpleParameterProvider parameterProvider = new SimpleParameterProvider( parameters ); HashMap<String, IParameterProvider> parameterProviderMap = new HashMap<String, IParameterProvider>(); parameterProviderMap.put( IParameterProvider.SCOPE_REQUEST, parameterProvider ); IPentahoRequestContext requestContext = PentahoRequestContextHolder.getRequestContext(); IPentahoUrlFactory urlFactory = new SimpleUrlFactory( requestContext.getContextPath() ); //$NON-NLS-1$ String processName = description; boolean persisted = false; List messages = new ArrayList(); outputStream = new ByteArrayOutputStream( 0 ); SimpleOutputHandler outputHandler = null; if ( outputStream != null ) { outputHandler = new SimpleOutputHandler( outputStream, false ); outputHandler.setOutputPreference( IOutputHandler.OUTPUT_TYPE_DEFAULT ); } solutionEngine.execute( actionSequence, processName, false, true, null, persisted, parameterProviderMap, outputHandler, null, urlFactory, messages ); } finally { PentahoSystem.systemExitPoint(); } return solutionEngine.getStatus(); }
ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session ); solutionEngine.setLoggingLevel( ILogger.ERROR ); solutionEngine.init( session ); HashMap parameterProviderMap = new HashMap(); IPentahoUrlFactory urlFactory = new SimpleUrlFactory( "" );
solutionEngine.init( session );
solutionEngine.init( getSession() );
solutionEngine.init( session );
ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session ); solutionEngine.setLoggingLevel( ILogger.ERROR ); solutionEngine.init( session ); Map<Object, Object> parameterProviderMap = new HashMap<Object, Object>(); IPentahoUrlFactory urlFactory = new SimpleUrlFactory( "" );
public IRuntimeContext run( String actionPath, String instanceId, boolean persisted, IParameterProvider parameterProvider, IOutputHandler outputHandler, IPentahoSession session ) { assertTrue( initOk ); ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session ); solutionEngine.setLoggingLevel( getLoggingLevel() ); solutionEngine.init( session ); return run( solutionEngine, actionPath, instanceId, persisted, parameterProvider, outputHandler ); }
protected ByteArrayOutputStream getContentAsStream( final String mimeType ) { IPentahoSession userSession = getSession(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); SimpleOutputHandler outputHandler = new SimpleOutputHandler( outputStream, true ); outputHandler.setOutputPreference( outputPreference ); ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, getSession() ); solutionEngine.setLoggingLevel( getLoggingLevel() ); solutionEngine.init( userSession ); IRuntimeContext context = null; try { String actionSeqPath = ActionInfo.buildSolutionPath( solutionName, actionPath, actionName ); context = solutionEngine .execute( actionSeqPath, Messages.getInstance().getString( "BaseTest.DEBUG_JUNIT_TEST" ), false, true, instanceId, false, getParameterProviders(), outputHandler, null, urlFactory, getMessages() ); //$NON-NLS-1$ } finally { if ( context != null ) { context.dispose(); } } return outputStream; }
public IRuntimeContext handleActionRequest( final int timeout, final int timeoutType ) { // Get the solution engine ISolutionEngine solutionEngine = PentahoSystem.get( ISolutionEngine.class, session ); if ( solutionEngine == null ) { Logger.error( this, Messages.getInstance().getErrorString( "BaseRequestHandler.ERROR_0001_NO_SOLUTION_ENGINE" ) ); //$NON-NLS-1$ return null; } solutionEngine.setCreateFeedbackParameterCallback( createFeedbackParameterCallback ); solutionEngine.setLoggingLevel( ILogger.DEBUG ); solutionEngine.init( session ); solutionEngine.setForcePrompt( forcePrompt ); if ( parameterXsl != null ) { solutionEngine.setParameterXsl( parameterXsl ); } dispose(); runtime = solutionEngine.execute( actionPath, processId, false, instanceEnds, instanceId, true, parameterProviders, outputHandler, this, urlFactory, messages ); // need to wait until this is complete // TODO // if this times out check the timeoutType before cancelling or // returning and leaving the component running return runtime; }
public ISolutionEngine getSolutionEngine( String path ) { StandaloneApplicationContext applicationContext = new StandaloneApplicationContext( path, "" ); //$NON-NLS-1$ if ( !PentahoSystem.getInitializedOK() ) { 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 ); } return null; }