Package org.pentaho.platform.api.engine

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


public class XactionUtil {
  private static final Log logger = LogFactory.getLog( XactionUtil.class );

  @SuppressWarnings ( "rawtypes" )
  public static void createOutputFileName( RepositoryFile file, IOutputHandler outputHandler ) {
    IPentahoSession userSession = PentahoSessionHolder.getSession();
    ActionSequenceJCRHelper actionHelper = new ActionSequenceJCRHelper( userSession );
    IActionSequence actionSequence =
      actionHelper.getActionSequence( file.getPath(), PentahoSystem.loggingLevel, RepositoryFilePermission.READ );

    String fileName = "content"; //$NON-NLS-1$
View Full Code Here


    //
    // Note - this mapper doesn't need the mondrian catalog for mapping
    // or in fact any of the passed parameters. The roles for this
    // user come out of a session variable.
    //
    IPentahoSession session = PentahoSessionHolder.getSession();
    String[] rtn = null;
    Object sessionObj = session.getAttribute( sessionProperty );
    if ( sessionObj != null ) {
      if ( sessionObj instanceof String[] ) {
        // If it's already a string array, return it
        rtn = ( (String[]) sessionObj );
      } else if ( sessionObj instanceof Collection ) {
View Full Code Here

    assertNull( "session should be null after a remove", PentahoSessionHolder.getSession() );
  }

  @Test
  public void testNullSession() {
    final IPentahoSession mockSession = mockery.mock( IPentahoSession.class );
    PentahoSessionHolder.setSession( mockSession );
    assertSame( mockSession, PentahoSessionHolder.getSession() );
    PentahoSessionHolder.removeSession();
    assertNull( "session should be null", PentahoSessionHolder.getSession() );
  }
View Full Code Here

    assertNull( "session should be null", PentahoSessionHolder.getSession() );
  }

  @Test
  public void testThreadsManageOwnSessions() throws InterruptedException {
    final IPentahoSession mockSession = mockery.mock( IPentahoSession.class );
    final IPentahoSession threadMockSession = mockery.mock( IPentahoSession.class, "threadMockSession" );

    PentahoSessionHolder.setSession( mockSession );
    assertSame( mockSession, PentahoSessionHolder.getSession() );

    Thread t = new Thread( "testThreadsManageOwnSessions-1" ) {
View Full Code Here

    }
  }

  @Test
  public void testThreadedInheritsSession() throws InterruptedException {
    final IPentahoSession mockSession = mockery.mock( IPentahoSession.class );
    PentahoSessionHolder.setSession( mockSession );

    Thread t = new Thread( "testThreadedInheritsSession-1" ) {
      public void run() {
        if ( PentahoSessionHolder.getSession() != mockSession ) {
View Full Code Here

  @Override
  public void contextInitialized( ServletContextEvent servletContextEvent ) {
    IPluginManager pluginManager = PentahoSystem.get( IPluginManager.class );

    IPentahoSession session = PentahoSessionHolder.getSession();
    IPluginProvider pluginProvider = PentahoSystem.get( IPluginProvider.class, "IPluginProvider", session );
    try {
      List<IPlatformPlugin> providedPlugins = pluginProvider.getPlugins( session );
      for ( IPlatformPlugin plugin : providedPlugins ) {
        try {
View Full Code Here

  @POST
  @Path ( "/session-variable" )
  @Facet ( name = "Unsupported" )
  public Response setSessionVariable( @QueryParam ( "key" ) String key, @QueryParam ( "value" ) String value ) {
    if ( setSessionVarWhiteList.contains( key ) ) {
      IPentahoSession session = UserConsoleService.getPentahoSession();
      session.setAttribute( key, value );
      return Response.ok( session.getAttribute( key ) ).build();
    }
    return Response.status( FORBIDDEN ).build();
  }
View Full Code Here

  @Override
  protected void doGet( final HttpServletRequest request, final HttpServletResponse response ) throws ServletException,
    IOException {
    PentahoSystem.systemEntryPoint();
    try {
      IPentahoSession userSession = getPentahoSession( request );
      ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
      String solutionName = request.getParameter( "solution" ); //$NON-NLS-1$
      String actionPath = request.getParameter( "path" ); //$NON-NLS-1$
      String actionName = request.getParameter( "action" ); //$NON-NLS-1$
      IActionSequence actionSequence =
View Full Code Here

            return UUID.randomUUID();
          }
        }
      ).build();

    IPentahoSession s1 = new StandaloneSession( "joe" );
    IPentahoSession s2 = new StandaloneSession( "admin" );

    PentahoSessionHolder.setSession( s1 );
    UUID s1Uuid = sessionRef.getObject();

    PentahoSessionHolder.setSession( s2 );
View Full Code Here

            return UUID.randomUUID();
          }
        }
      ).build();

    IPentahoSession s1 = new StandaloneSession( "joe" );
    IPentahoSession s2 = new StandaloneSession( "admin" );

    PentahoSessionHolder.setSession( s1 );
    UUID s1Uuid = sessionRef.getObject();

    PentahoSessionHolder.setSession( s2 );
View Full Code Here

TOP

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

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.