Package org.pentaho.platform.api.engine

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


      tenant = tenantManager.getTenant( tenantId );
      if ( tenant == null ) {
        throw new NotFoundException( "Tenant not found." );
      }
    } else {
      IPentahoSession session = PentahoSessionHolder.getSession();
      String tenantPath = (String) session.getAttribute( IPentahoSession.TENANT_ID_KEY );
      if ( tenantPath != null ) {
        tenant = new Tenant( tenantPath, true );
      }
    }
    return tenant;
View Full Code Here


    sessionResource = null;
  }

  @Test
  public void testDoGetCurrentUserDir() {
    IPentahoSession mockPentahoSession = mock( IPentahoSession.class );
    doReturn( mockPentahoSession ).when( sessionResource ).getSession();

    String username = "username";
    doReturn( username ).when( mockPentahoSession ).getName();
View Full Code Here

    return reload();
  }

  @Override
  public final boolean reload() {
    IPentahoSession session = PentahoSessionHolder.getSession();
    boolean anyErrors = false;
    IPluginProvider pluginProvider = PentahoSystem.get( IPluginProvider.class, "IPluginProvider", session );
    List<IPlatformPlugin> providedPlugins = null;
    try {
      synchronized ( registeredPlugins ) {
View Full Code Here

    doReturn( repositoryPath ).when( mockRepositoryFile ).getPath();

    String encodedPath = "encodedPath";
    doReturn( encodedPath ).when( fileResource ).encode( repositoryPath );

    IPentahoSession mockPentahoSession = mock( IPentahoSession.class );
    doReturn( mockPentahoSession ).when( fileResource ).getSession();

    ByteArrayOutputStream mockByteArrayOutputStream = mock( ByteArrayOutputStream.class );
    doReturn( mockByteArrayOutputStream ).when( fileResource ).getByteArrayOutputStream();
View Full Code Here

  public void sessionDestroyed( final HttpSessionEvent event ) {
    HttpSession session = event.getSession();
    Object obj = session.getAttribute( PentahoSystem.PENTAHO_SESSION_KEY ); //$NON-NLS-1$
    if ( obj != null ) {
      IPentahoSession userSession = (IPentahoSession) obj;
      ICacheManager cacheManager = PentahoSystem.getCacheManager( userSession );
      if ( null != cacheManager ) {
        IPentahoSession pentahoSession = (IPentahoSession) obj;
        if ( pentahoSession != null ) {
          cacheManager.removeRegionCache( pentahoSession.getId() );
        }

      }
    }
  }
View Full Code Here

public class PentahoSessionFactory {

  public static IPentahoSession getSession( final String userName, final HttpSession session,
      final HttpServletRequest request ) {

    IPentahoSession userSession = (IPentahoSession) session.getAttribute( PentahoSystem.PENTAHO_SESSION_KEY );
    if ( userSession != null ) {
      return userSession;
    }
    userSession = new PentahoHttpSession( userName, session, request.getLocale(), userSession );
    ITempFileDeleter deleter = PentahoSystem.get( ITempFileDeleter.class, userSession );
    if ( deleter != null ) {
      userSession.setAttribute( ITempFileDeleter.DELETER_SESSION_VARIABLE, deleter );
    }
    return userSession;

  }
View Full Code Here

  @GET
  @Path( "/globalActions" )
  @Facet ( name = "Unsupported" )
  @Produces( TEXT_PLAIN )
  public Response executeGlobalActions() {
    IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
    if ( SecurityHelper.getInstance().isPentahoAdministrator( pentahoSession ) ) {
      PentahoSystem.publish( pentahoSession, org.pentaho.platform.engine.core.system.GlobalListsPublisher.class
        .getName() );
    }
    return Response.ok().type( MediaType.TEXT_PLAIN ).build();
View Full Code Here

  @Path( "/metadata" )
  @Facet ( name = "Unsupported" )
  @Produces( TEXT_PLAIN )
  public String refreshMetadata() {
    String result = null;
    IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
    if ( SecurityHelper.getInstance().isPentahoAdministrator( pentahoSession ) ) {
      result =
          PentahoSystem.publish( pentahoSession, org.pentaho.platform.engine.services.metadata.MetadataPublisher.class
            .getName() );
    }
View Full Code Here

  @GET
  @Path( "/systemSettings" )
  @Facet ( name = "Unsupported" )
  @Produces( TEXT_PLAIN )
  public Response refreshSystemSettings() {
    IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
    if ( SecurityHelper.getInstance().isPentahoAdministrator( pentahoSession ) ) {
      PentahoSystem.publish( pentahoSession, org.pentaho.platform.engine.core.system
        .SettingsPublisher.class.getName() );
    }
    return Response.ok().type( MediaType.TEXT_PLAIN ).build();
View Full Code Here

  @Path( "/mondrianSchemaCache" )
  @Produces( { MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON } )
  @Facet ( name = "Unsupported" )
  public Response flushMondrianSchemaCache() {
    if ( canAdminister() ) {
      IPentahoSession pentahoSession = PentahoSessionHolder.getSession();
      if ( SecurityHelper.getInstance().isPentahoAdministrator( pentahoSession ) ) {
        // Flush the catalog helper (legacy)
        IMondrianCatalogService mondrianCatalogService =
            PentahoSystem.get( IMondrianCatalogService.class, "IMondrianCatalogService", pentahoSession ); //$NON-NLS-1$
        mondrianCatalogService.reInit( pentahoSession );
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.