• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PentahoSessionHolder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.pentaho.platform.engine.core.system.PentahoSessionHolder的典型用法代码示例。如果您正苦于以下问题:Java PentahoSessionHolder类的具体用法?Java PentahoSessionHolder怎么用?Java PentahoSessionHolder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PentahoSessionHolder类属于org.pentaho.platform.engine.core.system包,在下文中一共展示了PentahoSessionHolder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: filter

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Override
public String filter(String schemaUrl, Util.PropertyList connectInfo, InputStream stream)
	throws Exception {
		String schema = super.filter(schemaUrl, connectInfo, stream);
		System.out.println("[CUSTOM.DSP] *********** Started DSP Custom ***********");
		IPentahoSession session = PentahoSessionHolder.getSession();
		// if you need only the default Pentaho username session var, not a specific one,
		// you can change the code with: String usercode = session.getName().toString();
		// this avoid to use a startup kettle job
		String usercode = (String) session.getAttribute("USERNAME");
		try {
			System.out.println("[CUSTOM.DSP] Trying to replace '%USER_NAME%' with session value: "+usercode);
			LOG.info("Trying to replace '%USER_NAME%' with session value: "+usercode);
			schema = schema.replaceAll("%USER_NAME%", usercode);
		}
		catch (PatternSyntaxException pse) {
			System.out.println("[CUSTOM.DSP] Some error during custom schema processing: "+usercode);
			LOG.error("Some error during custom schema processing. " , pse);
			pse.printStackTrace();
		}
	LOG.info("DSP Ended correctly for "+usercode);
	System.out.println("[CUSTOM.DSP] *********** DSP Ended correctly for "+usercode+" ***********");
	return schema;
}
 
开发者ID:gioma68,项目名称:mondrian-dsp,代码行数:25,代码来源:DynamicSchemaProcessor.java


示例2: logout

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Override public void logout( HttpServletRequest request, HttpServletResponse response, Authentication auth ) {

    if( request != null && request.getAttribute( SPRING_SECURITY_CONTEXT_KEY ) != null ){
      logger.info( "Removing SPRING_SECURITY_CONTEXT_KEY from HttpServletRequest" );
      request.removeAttribute( SPRING_SECURITY_CONTEXT_KEY );
    }

    IPentahoSession pentahoSession = PentahoSessionHolder.getSession();

    if( pentahoSession != null ) {

      if( pentahoSession.getAttribute( IPentahoSession.SESSION_ROLES ) != null ) {
        logger.info( "Removing IPentahoSession.SESSION_ROLES from IPentahoSession" );
        pentahoSession.removeAttribute( IPentahoSession.SESSION_ROLES );
      }

      logger.info( "Marking IPentahoSession as *not* authenticated" );
      pentahoSession.setNotAuthenticated();
    }
  }
 
开发者ID:pentaho,项目名称:pentaho-engineering-samples,代码行数:21,代码来源:PentahoSamlSingleLogoutHandler.java


示例3: init

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Before
public void init() throws PlatformInitializationException {
  System.setProperty( "java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory" );
  System.setProperty( "org.osjava.sj.root", "test-src/simple-jndi" );
  System.setProperty( "org.osjava.sj.delimiter", "/" );
  System.setProperty( "PENTAHO_SYS_CFG_PATH", new File( SOLUTION_REPOSITORY + "/pentaho.xml" ).getAbsolutePath() );

  IPentahoSession session = new StandaloneSession();
  PentahoSessionHolder.setSession( session );

  mp.define( IUserRoleListService.class, StubUserRoleListService.class );
  mp.define( UserDetailsService.class, StubUserDetailService.class );
  mp.defineInstance( IAuthorizationPolicy.class, new TestAuthorizationPolicy() );
  mp.setSettingsProvider( new PathBasedSystemSettings() );
  mp.define( ISolutionEngine.class, SolutionEngine.class );
  FileSystemBackedUnifiedRepository repo =  new FileSystemBackedUnifiedRepository( SOLUTION_REPOSITORY );
  mp.defineInstance(  IUnifiedRepository.class, repo );

  mp.start();

  SecurityHelper.getInstance().becomeUser( TEST_USER );
}
 
开发者ID:pentaho,项目名称:pdi-platform-plugin,代码行数:23,代码来源:UserParametersTest.java


示例4: connect

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Override
public Repository connect( String repositoryName ) throws KettleException {

  IPentahoSession session = PentahoSessionHolder.getSession();
  if ( session == null ) {
    logger.debug( "No active Pentaho Session, attempting to load PDI repository unauthenticated." );
    throw new KettleException( "Attempting to create PDI Repository with no Active PentahoSession. "
        + "This is not allowed." );
  }
  ICacheManager cacheManager = PentahoSystem.getCacheManager( session );

  String sessionName = session.getName();
  Repository repository = (Repository) cacheManager.getFromRegionCache( REGION, sessionName );
  if ( repository == null ) {
    logger.debug( "Repository not cached for user: " + sessionName + ". Creating new Repository." );
    repository = delegate.connect( repositoryName );
    if ( !cacheManager.cacheEnabled( REGION ) ) {
      cacheManager.addCacheRegion( REGION );
    }
    cacheManager.putInRegionCache( REGION, sessionName, repository );
  } else {
    logger.debug( "Repository was cached for user: " + sessionName );
  }
  return repository;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:IRepositoryFactory.java


示例5: testCachingFactoryConnect

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Test
public void testCachingFactoryConnect() throws Exception {
  ICacheManager cacheManager = mock( ICacheManager.class );
  PentahoSystem.registerObject( cacheManager );
  IPentahoSession session = new StandaloneSession( "joe" );
  PentahoSessionHolder.setSession( session );

  // Delegate is just a mock. connect will be a cache miss
  IRepositoryFactory mockFactory = mock( IRepositoryFactory.class );
  IRepositoryFactory.CachingRepositoryFactory cachingRepositoryFactory =
      new IRepositoryFactory.CachingRepositoryFactory( mockFactory );

  cachingRepositoryFactory.connect( "foo" );

  verify( mockFactory, times( 1 ) ).connect( "foo" );

  // Test with Cache Hit
  Repository mockRepository = mock( Repository.class );
  when( cacheManager.cacheEnabled( IRepositoryFactory.CachingRepositoryFactory.REGION ) ).thenReturn( true );
  when( cacheManager.getFromRegionCache( IRepositoryFactory.CachingRepositoryFactory.REGION, "joe" ) ).thenReturn(
      mockRepository );

  Repository repo = cachingRepositoryFactory.connect( "foo" );
  assertThat( repo, sameInstance( mockRepository ) );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:26,代码来源:RepositoryFactoryTest.java


示例6: setUp

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  this.testContextManager = new TestContextManager( getClass() );
  this.testContextManager.prepareTestInstance( this );

  KettleEnvironment.init();
  PentahoSessionHolder.setStrategyName( PentahoSessionHolder.MODE_GLOBAL );

  mockVersionManager();
  removePentahoRootFolder();
  startMicroPlatform();

  createSystemUser();
  createTester();

  createPurRepository();
  loginAsTester();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:PurRepositoryTestBase.java


示例7: createUserHomeFolder

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
private void createUserHomeFolder( final ITenant theTenant, final String theUsername ) {
  IPentahoSession origPentahoSession = PentahoSessionHolder.getSession();
  Authentication origAuthentication = SecurityContextHolder.getContext().getAuthentication();

  String principleId = userNameUtils.getPrincipleId( theTenant, theUsername );
  String authenticatedRoleId = roleNameUtils.getPrincipleId( theTenant, tenantAuthenticatedRole );
  TransactionCallbackWithoutResult callback =
      PurRepositoryTestingUtils.createUserHomeDirCallback( theTenant, theUsername, principleId, authenticatedRoleId,
          repositoryFileDao );
  try {
    loginAsRepositoryAdmin();
    txnTemplate.execute( callback );
  } finally {
    PurRepositoryTestingUtils.setSession( origPentahoSession, origAuthentication );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:PurRepositoryTestBase.java


示例8: tearDown

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@After
public void tearDown() throws Exception {
  cleanupUserAndRoles( testingTenant );
  cleanupUserAndRoles( systemTenant );

  unifiedRepository = null;
  purRepository = null;
  superAdminRole = repositoryAdmin = systemAdmin = tenantAdminRole = tenantAuthenticatedRole = null;
  tenantManager = null;
  userRoleDao = null;
  authorizationPolicy = null;
  roleBindingDaoTarget = null;
  testJcrTemplate = null;
  repositoryFileDao = null;
  txnTemplate = null;
  systemTenant = testingTenant = null;

  mp.stop();
  mp = null;

  JcrRepositoryFileUtils.setRepositoryVersionManager( existingVersionManager );
  PentahoSessionHolder.setStrategyName( PentahoSessionHolder.MODE_INHERITABLETHREADLOCAL );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:24,代码来源:PurRepositoryTestBase.java


示例9: loginAsTenantAdmin

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
protected void loginAsTenantAdmin() {
  StandaloneSession pentahoSession = new StandaloneSession( "joe" );
  pentahoSession.setAuthenticated( "joe" );
  pentahoSession.setAttribute( IPentahoSession.TENANT_ID_KEY, "acme" );
  final String password = "password";
  List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>( 3 );
  authorities.add( new SimpleGrantedAuthority( "Authenticated" ) );
  authorities.add( new SimpleGrantedAuthority( "acme_Authenticated" ) );
  authorities.add( new SimpleGrantedAuthority( "acme_Admin" ) );
  UserDetails userDetails = new User( "joe", password, true, true, true, true, authorities );
  Authentication auth = new UsernamePasswordAuthenticationToken( userDetails, password, authorities );
  PentahoSessionHolder.setSession( pentahoSession );
  // this line necessary for Spring Security's MethodSecurityInterceptor
  SecurityContextHolder.getContext().setAuthentication( auth );
  repositoryLifecyleManager.newTenant();
  repositoryLifecyleManager.newUser();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:PurRepositoryIT.java


示例10: createUserHomeFolder

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
protected void createUserHomeFolder( final ITenant theTenant, final String theUsername ) {
  IPentahoSession origPentahoSession = PentahoSessionHolder.getSession();
  Authentication origAuthentication = SecurityContextHolder.getContext().getAuthentication();
  StandaloneSession pentahoSession = new StandaloneSession( repositoryAdminUsername );
  pentahoSession.setAuthenticated( null, repositoryAdminUsername );
  PentahoSessionHolder.setSession( pentahoSession );

  String principleId = userNameUtils.getPrincipleId( theTenant, theUsername );
  String authenticatedRoleId = roleNameUtils.getPrincipleId( theTenant, tenantAuthenticatedRoleName );
  TransactionCallbackWithoutResult callback =
      PurRepositoryTestingUtils.createUserHomeDirCallback( theTenant, theUsername, principleId, authenticatedRoleId,
          repositoryFileDao );
  try {
    txnTemplate.execute( callback );
  } finally {
    // Switch our identity back to the original user.
    PurRepositoryTestingUtils.setSession( origPentahoSession, origAuthentication );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:PurRepositoryIT.java


示例11: setUpUser

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
private void setUpUser() {
  StandaloneSession pentahoSession = new StandaloneSession( userInfo.getLogin() );
  pentahoSession.setAuthenticated( userInfo.getLogin() );
  pentahoSession.setAttribute( IPentahoSession.TENANT_ID_KEY, "/pentaho/" + EXP_TENANT );
  List<GrantedAuthority> authorities = new ArrayList<>( 2 );
  authorities.add( new SimpleGrantedAuthority( "Authenticated" ) );
  authorities.add( new SimpleGrantedAuthority( "acme_Authenticated" ) );
  final String password = "ignored"; //$NON-NLS-1$
  UserDetails userDetails = new User( userInfo.getLogin(), password, true, true, true, true, authorities );
  Authentication authentication = new UsernamePasswordAuthenticationToken( userDetails, password, authorities );
  // next line is copy of SecurityHelper.setPrincipal
  pentahoSession.setAttribute( "SECURITY_PRINCIPAL", authentication );
  PentahoSessionHolder.setSession( pentahoSession );
  SecurityContextHolder.setStrategyName( SecurityContextHolder.MODE_GLOBAL );
  SecurityContextHolder.getContext().setAuthentication( authentication );
  repositoryLifecyleManager.newTenant();
  repositoryLifecyleManager.newUser();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:UIEERepositoryDirectoryIT.java


示例12: login

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
/**
 * Logs in with given username.
 * 
 * @param username
 *          username of user
 * @param tenantId
 *          tenant to which this user belongs
 * @tenantAdmin true to add the tenant admin authority to the user's roles
 */
private void login( final String username, final ITenant tenant, String[] roles ) {
  StandaloneSession pentahoSession = new StandaloneSession( username );
  pentahoSession.setAuthenticated( tenant.getId(), username );
  PentahoSessionHolder.setSession( pentahoSession );
  pentahoSession.setAttribute( IPentahoSession.TENANT_ID_KEY, tenant.getId() );
  final String password = "password";

  List<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();

  if ( roles != null ) {
    for ( String roleName : roles ) {
      authorities.add( new SimpleGrantedAuthority( roleName ) );
    }
  }
  UserDetails userDetails = new User( username, password, true, true, true, true, authorities );
  Authentication auth = new UsernamePasswordAuthenticationToken( userDetails, password, authorities );
  PentahoSessionHolder.setSession( pentahoSession );
  // this line necessary for Spring Security's MethodSecurityInterceptor
  SecurityContextHolder.getContext().setAuthentication( auth );

  createUserHomeFolder( tenant, username );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:32,代码来源:UIEERepositoryDirectoryIT.java


示例13: clearMondrianCache

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
private boolean clearMondrianCache() {

    try {
      // @see org.pentaho.platform.web.http.api.resources.SystemRefreshResource.flushMondrianSchemaCache();

      IPentahoSession session = PentahoSessionHolder.getSession();

      // Flush the catalog helper (legacy)
      IMondrianCatalogService
          mondrianCatalogService =
          PentahoSystem.get( IMondrianCatalogService.class, "IMondrianCatalogService", session ); //$NON-NLS-1$
      mondrianCatalogService.reInit( session );

      // Flush the IOlapService
      IOlapService olapService = PentahoSystem.get( IOlapService.class, IOlapService.class.getSimpleName(), session );
      olapService.flushAll( session );

    } catch ( Throwable t ) {
      logger.error( t.getMessage(), t );
        /* Do nothing.
         * <p/>
         * This is a simple 'nice-to-have' feature, where we actually clear mondrian cache after the user
         * makes a successful mondrian file change, so that he can immediately see its changes applied.
         * <p/>
         * In some off-chance this doesn't work, user can always do it via PUC > Tools > Refresh > Mondrian Cache.
        */
    }

    return true;
  }
 
开发者ID:webdetails,项目名称:cte,代码行数:31,代码来源:MondrianSchemaProvider.java


示例14: service

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Override protected void service( HttpServletRequest req, HttpServletResponse resp )
    throws ServletException, IOException {

  // We are anonymous for now
  PentahoSessionHolder.setSession( new StandaloneSession( "bob" ) );

  IContentGenerator contentGenerator = (IContentGenerator) applicationContext.getBean( beanId );
  Thread.currentThread().setContextClassLoader( applicationContext.getClassLoader() );

  GeneratorStreamingOutput generatorStreamingOutput = new GeneratorStreamingOutput( contentGenerator,
      new ContentGeneratorDescriptor() {
        @Override public String getContentGeneratorId() {
          return null;
        }

        @Override public String getServicingFileType() {
          return null;
        }

        @Override public String getPluginId() {
          String requestURI = req.getRequestURI();
          if ( requestURI.contains( "/content" ) ) {
            return requestURI.substring( requestURI.indexOf( "/", 1 ) );
          }
          return null;
        }
      },
      req,
      resp,
      Collections.emptyList(),
      null,
      req.getPathInfo() != null ? req.getPathInfo().substring( 1 ) : beanId.substring( beanId.lastIndexOf( "." ) + 1 )
  );

  generatorStreamingOutput.write( resp.getOutputStream(), null );
}
 
开发者ID:pentaho,项目名称:pentaho-osgi-bundles,代码行数:37,代码来源:ContentGeneratorServlet.java


示例15: getSessionVariable

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
public static Object getSessionVariable( String varName ) {
  IPentahoSession session = PentahoSessionHolder.getSession();
  if ( session != null ) {
    return session.getAttribute( varName );
  }
  return null;
}
 
开发者ID:pentaho,项目名称:pdi-platform-utils-plugin,代码行数:8,代码来源:SessionHelper.java


示例16: setUpPowerMocks

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Before
public void setUpPowerMocks() {
  PowerMockito.mockStatic( Inspector.class );
  PowerMockito.mockStatic( HttpConnectionHelper.class );
  PowerMockito.mockStatic( PentahoSessionHolder.class );
  PowerMockito.when( Inspector.getInstance() ).thenReturn( inspector );
  PowerMockito.when( HttpConnectionHelper.getInstance() ).thenReturn( httpConnectionHelper );
  PowerMockito.when( PentahoSessionHolder.getSession() ).thenReturn( session );
}
 
开发者ID:pentaho,项目名称:pdi-platform-utils-plugin,代码行数:10,代码来源:CallEndpointStepTest.java


示例17: processSchema

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
public String processSchema( String schemaUrl, Util.PropertyList connectInfo ) throws Exception
{
    if( LOGGER.getLevel() == null )
    {            LOGGER.setLevel( Level.ERROR );
    }

    boolean cacheEnabled = BooleanUtils.toBoolean( connectInfo.get( "cacheEnabled", "Y" ) );

    String schemaValue = null;

    IPentahoSession session = PentahoSessionHolder.getSession();
    String schemaCacheKey = CacheUtils.KeyBuilder.buildSessionSchemaKey(session, schemaUrl);

    if( cacheEnabled ) {

        schemaValue = (String) CacheUtils.get(CacheUtils.Region.SCHEMA_REGION, schemaCacheKey);
    }

    if( schemaValue == null ) {
        LOGGER.info("Starting schema processing " + schemaUrl);
        schemaValue = getSchema( schemaUrl, connectInfo, cacheEnabled );
        if( cacheEnabled ) {
            CacheUtils.put(CacheUtils.Region.SCHEMA_REGION, schemaCacheKey, schemaValue);
        }
    } else {
        LOGGER.info("Got schema from cache " + schemaUrl );
    }

    if( schemaValue == null )
    {
        LOGGER.error( schemaUrl + " Schema returned from transformation is null!");
        throw new KettleException( schemaUrl + " Schema returned from transformation is null!" );
    }

    LOGGER.debug( "Outputting schema\n" + schemaValue );
    return schemaValue;
}
 
开发者ID:inquidia,项目名称:KettleDynamicSchemaProcessor,代码行数:38,代码来源:KettleDynamicSchemaProcessor.java


示例18: initializeRequest

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
/**
 *  Set up local variables to process the request.
 */
protected boolean initializeRequest() throws Exception {
  setInstanceId(UUIDUtil.getUUIDAsString());
  pathParameters = parameterProviders.get("path");
  response = (HttpServletResponse)pathParameters.getParameter("httpresponse");
  session = PentahoSessionHolder.getSession();
  checkPermissions();
  pathString = pathParameters.getStringParameter("path", "");
  if (pathString.length() > 0 && pathString.charAt(0) == '/') {
    pathString = pathString.substring(1);
  }
  if (pathString.length() > 0 && pathString.charAt(pathString.length() - 1) == '/') {
    pathString = pathString.substring(0, pathString.length() - 1);
  }
  path = pathString.split("/");
  request = (HttpServletRequest)pathParameters.getParameter("httprequest");
  method = request.getMethod();
  if (!initContentType()) return false;
  requestParameters = parameterProviders.get(IParameterProvider.SCOPE_REQUEST);
  debugEnabled = Boolean.TRUE.toString().equals(
    requestParameters.getStringParameter(
      PARAM_DEBUG,
      PedisLifecycleListener.isDebugEnabled()
    )
  );
  return true;
}
 
开发者ID:rpbouman,项目名称:pedis,代码行数:30,代码来源:PedisContentGenerator.java


示例19: setUp

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
  System.setProperty( "java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory" ); //$NON-NLS-1$ //$NON-NLS-2$
  System.setProperty( "org.osjava.sj.root", SOLUTION_REPOSITORY ); //$NON-NLS-1$ //$NON-NLS-2$
  System.setProperty( "org.osjava.sj.delimiter", "/" ); //$NON-NLS-1$ //$NON-NLS-2$

  System.setProperty( "PENTAHO_SYS_CFG_PATH", new File( SOLUTION_REPOSITORY + "/pentaho.xml" ).getAbsolutePath() ); //$NON-NLS-2$

  IPentahoSession session = new StandaloneSession();
  PentahoSessionHolder.setSession( session );

  pdiContentGenerator = new PdiContentGenerator();

  pdiAction = new PdiAction();
  pdiAction.setRepositoryName( KettleFileRepositoryMeta.REPOSITORY_TYPE_ID );
  pdiContentGenerator.setPdiAction( pdiAction );

  outputStream = mock( OutputStream.class );
  repositoryFile = mock( RepositoryFile.class );
  pdiContentGenerator.setOutputStream( outputStream );
  pdiContentGenerator.setRepositoryFile( repositoryFile );

  scheduler = new QuartzScheduler();
  scheduler.start();

  mp.define( IUserRoleListService.class, StubUserRoleListService.class );
  mp.define( UserDetailsService.class, StubUserDetailService.class );
  mp.defineInstance( IAuthorizationPolicy.class, new TestAuthorizationPolicy() );
  mp.defineInstance( IScheduler.class, scheduler );

  mp.define( ISolutionEngine.class, SolutionEngine.class );
  FileSystemBackedUnifiedRepository repo =  new FileSystemBackedUnifiedRepository( SOLUTION_REPOSITORY );
  mp.defineInstance(  IUnifiedRepository.class, repo );

  mp.start();
}
 
开发者ID:pentaho,项目名称:pdi-platform-plugin,代码行数:37,代码来源:PdiContentGeneratorTest.java


示例20: init

import org.pentaho.platform.engine.core.system.PentahoSessionHolder; //导入依赖的package包/类
@Before
public void init() throws SchedulerException, PlatformInitializationException {
  System.setProperty( "java.naming.factory.initial", "org.osjava.sj.SimpleContextFactory" ); //$NON-NLS-1$ //$NON-NLS-2$
  System.setProperty( "org.osjava.sj.root", SOLUTION_REPOSITORY ); //$NON-NLS-1$ //$NON-NLS-2$
  System.setProperty( "org.osjava.sj.delimiter", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
  System.setProperty( "PENTAHO_SYS_CFG_PATH", new File( SOLUTION_REPOSITORY + "/pentaho.xml" ).getAbsolutePath() ); //$NON-NLS-2$

  IPentahoSession session = new StandaloneSession();
  PentahoSessionHolder.setSession( session );

  scheduler = new QuartzScheduler();
  scheduler.start();

  mp.define( IUserRoleListService.class, StubUserRoleListService.class );
  mp.define( UserDetailsService.class, StubUserDetailService.class );
  mp.defineInstance( IAuthorizationPolicy.class, new TestAuthorizationPolicy() );
  mp.setSettingsProvider( new PathBasedSystemSettings() );
  mp.defineInstance( IScheduler.class, scheduler );

  mp.define( ISolutionEngine.class, SolutionEngine.class );
  FileSystemBackedUnifiedRepository repo =  new FileSystemBackedUnifiedRepository( SOLUTION_REPOSITORY );
  mp.defineInstance(  IUnifiedRepository.class, repo );

  mp.start();

  SecurityHelper.getInstance().becomeUser( TEST_USER );
}
 
开发者ID:pentaho,项目名称:pdi-platform-plugin,代码行数:28,代码来源:PdiActionTest.java



注:本文中的org.pentaho.platform.engine.core.system.PentahoSessionHolder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FakeSplit类代码示例发布时间:2022-05-22
下一篇:
Java RestApiException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap