Package org.pentaho.platform.api.engine

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


    this.exportHandlerList = new ArrayList<ExportHandler>();

    this.exportManifest = new ExportManifest();

    // set created by and create date in manifest information
    IPentahoSession session = PentahoSessionHolder.getSession();

    Date todaysDate = new Date();
    SimpleDateFormat dateFormat = new SimpleDateFormat( EXPORT_INFO_DATE_FORMAT );
    SimpleDateFormat timeFormat = new SimpleDateFormat( EXPORT_INFO_TIME_FORMAT );

    exportManifest.getManifestInformation().setExportBy( session.getName() );
    exportManifest.getManifestInformation().setExportDate(
        dateFormat.format( todaysDate ) + " " + timeFormat.format( todaysDate ) );
    exportManifest.getManifestInformation().setManifestVersion( "2" );
  }
View Full Code Here


      }
    }
  }

  private static String getUsername() {
    IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
    Assert.state( pentahoSession != null );
    return pentahoSession.getName();
  }
View Full Code Here

        IOUtils.closeQuietly( tmpOut );
        throw new RuntimeException( e );
      }
      final ZipOutputStream out = tmpOut;
      // stash existing session
      IPentahoSession origPentahoSession = PentahoSessionHolder.getSession();
      // run as repo super user
      PentahoSessionHolder.setSession( createRepositoryAdminPentahoSession( repositoryAdminUsername ) );
      try {
        txnTemplate.execute( new TransactionCallbackWithoutResult() {
          public void doInTransactionWithoutResult( final TransactionStatus status ) {
View Full Code Here

        IOUtils.closeQuietly( tmpOut );
        throw new RuntimeException( e );
      }
      final ZipOutputStream out = tmpOut;
      // stash existing session
      IPentahoSession origPentahoSession = PentahoSessionHolder.getSession();
      // run as repo super user
      PentahoSessionHolder.setSession( createRepositoryAdminPentahoSession( repositoryAdminUsername ) );
      try {
        txnTemplate.execute( new TransactionCallbackWithoutResult() {
          public void doInTransactionWithoutResult( final TransactionStatus status ) {
View Full Code Here

    creds.setAttribute( ATTR_PRE_AUTHENTICATION_TOKEN, preAuthenticationToken );
    return creds;
  }

  private String getUserId() {
    IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
    Assert.state( pentahoSession != null, "this method cannot be called with a null IPentahoSession" );
    return JcrTenantUtils.getTenantedUser( pentahoSession.getName() );
  }
View Full Code Here

      final Authentication authentication ) {
    if ( PentahoLogoutHandler.logger.isDebugEnabled() ) {
      PentahoLogoutHandler.logger
          .debug( Messages.getInstance().getString( "PentahoLogoutHandler.DEBUG_HANDLE_LOGOUT" ) ); //$NON-NLS-1$
    }
    IPentahoSession userSession = PentahoSessionHolder.getSession();
    PentahoSystem.invokeLogoutListeners( userSession );
    // removeSession call here is analogous to clearContext call in SecurityContextLogoutHandler
    PentahoSessionHolder.removeSession();
  }
View Full Code Here

  /**
   * @return Returns the userSession.
   */
  public static IPentahoSession getUserSession() {
    IPentahoSession userSession = (IPentahoSession) RuntimeRepository.threadSession.get();
    return userSession;
  }
View Full Code Here

      outputHandler = getOutputHandler( (OutputStream) null );
    }
    String instanceId = null;
    StandaloneSession initialSession =
        new StandaloneSession( Messages.getInstance().getString( "BaseTest.DEBUG_JUNIT_SESSION" ) ); //$NON-NLS-1$
    IPentahoSession session = sessionStartup( initialSession );
    if ( outputHandler != null ) {
      outputHandler.setSession( session );
    }

    return run( actionPath, instanceId, false, parameterProvider, outputHandler, session );
View Full Code Here

    String actionPath = buildActionPath( subAction.getSolution().getStringValue(),
        subAction.getPath().getStringValue(),
        subAction.getAction().getStringValue() );

    // see if we are supposed to proxy the session
    IPentahoSession session = getSession();
    if ( subAction.getSessionProxy() != ActionInputConstant.NULL_INPUT ) {
      String sessionName = subAction.getSessionProxy().getStringValue();
      // TODO support user-by-user locales
      PentahoSessionParameterProvider params = new PentahoSessionParameterProvider( session );
      session = new UserSession( sessionName, LocaleHelper.getLocale(), params );
View Full Code Here

  }

  private static class ThreadLocalScope implements Scope {

    public Object get( String name, ObjectFactory objectFactory ) {
      IPentahoSession session = SpringScopeSessionHolder.SESSION.get();
      if ( session == null ) {
        return null;
      }
      Object object = session.getAttribute( name );
      if ( object == null ) {
        object = objectFactory.getObject();
        session.setAttribute( name, object );
      }
      return object;
    }
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.