Package org.pentaho.platform.engine.core.system.objfac

Examples of org.pentaho.platform.engine.core.system.objfac.StandaloneSpringPentahoObjectFactory


    StandaloneSession session = new StandaloneSession( "test" );

    StandaloneApplicationContext appContext = new StandaloneApplicationContext( "test-res/solution", "" );

    StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();
    factory.init( "test-res/solution/system/pentahoObjects.GlobalListPublisherTest.spring.xml", null );

    PentahoSystem.init( appContext );
    PentahoSystem.registerObjectFactory( factory );
    PentahoSystem.setSystemSettingsService( factory.get( ISystemSettings.class, "systemSettingsService", session ) );

    List<ISessionStartupAction> actions = new ArrayList<ISessionStartupAction>();

    SessionStartupAction startupAction1 = new SessionStartupAction();
    startupAction1.setSessionType( PentahoSystem.SCOPE_GLOBAL );
View Full Code Here


  public void testAuditConnection_cannot_establish_connection() {
    startTest();

    try {
      // Load mock object factory with mock datasource service that produces null datasources
      StandaloneSpringPentahoObjectFactory factory = new StandaloneSpringPentahoObjectFactory();
      factory.init( "test-res/solution/system/pentahoObjects.datasourceservice.null.spring.xml", null );
      PentahoSystem.registerObjectFactory( factory );

      AuditConnection auditConnection = new AuditConnection();
      auditConnection.setUseNewDatasourceService( true ); // make sure we get a datasource from the object factory
      auditConnection.initialize();
View Full Code Here

  @Test
  public void testGetMimeTypeList() throws Exception {
    MicroPlatform microPlatform = new MicroPlatform();

    StandaloneSpringPentahoObjectFactory objectFactory = new StandaloneSpringPentahoObjectFactory();
    objectFactory.init( "test-res/MimeTypeFactoryTest/MimeTypeFactoryTest.spring.xml", null );
    PentahoSystem.registerObjectFactory( objectFactory );

    MimeTypeListFactory factory =
        new MimeTypeListFactory( "test-res/MimeTypeFactoryTest/ImportHandlerMimeTypeDefinitions.xml" );
View Full Code Here

        System.setProperty( "org.osjava.sj.root", getSolutionPath() + "/system/simple-jndi" ); //$NON-NLS-1$ //$NON-NLS-2$
        System.setProperty( "org.osjava.sj.delimiter", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
      }
      ApplicationContext springApplicationContext = getSpringApplicationContext();

      IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
      pentahoObjectFactory.init( null, springApplicationContext );
      PentahoSystem.registerObjectFactory( pentahoObjectFactory );

      // force Spring to inject PentahoSystem, there has got to be a better way than this, perhaps an alternate way
      // of
      // initting spring's app context
View Full Code Here

public class ApplicationContextPentahoSystemRegisterer implements ApplicationContextAware, BeanFactoryPostProcessor,
  PriorityOrdered {

  @Override
  public void setApplicationContext( ApplicationContext applicationContext ) throws BeansException {
    StandaloneSpringPentahoObjectFactory objFact = StandaloneSpringPentahoObjectFactory.getInstance(
      applicationContext );

    PentahoSystem.registerObjectFactory( objFact );
    PublishedBeanRegistry.registerFactory( applicationContext );
  }
View Full Code Here

        System.setProperty( "org.osjava.sj.root", getSolutionPath() + "/system/simple-jndi" ); //$NON-NLS-1$ //$NON-NLS-2$
        System.setProperty( "org.osjava.sj.delimiter", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
      }
      ApplicationContext springApplicationContext = getSpringApplicationContext();

      IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
      pentahoObjectFactory.init( null, springApplicationContext );
      PentahoSystem.registerObjectFactory( pentahoObjectFactory );

      // force Spring to populate PentahoSystem
      springApplicationContext.getBean( "pentahoSystemProxy" ); //$NON-NLS-1$
      initOk = PentahoSystem.init( applicationContext );
View Full Code Here

      System.setProperty( "org.osjava.sj.root", getSolutionPath() + "/system/simple-jndi" ); //$NON-NLS-1$ //$NON-NLS-2$
      System.setProperty( "org.osjava.sj.delimiter", "/" ); //$NON-NLS-1$ //$NON-NLS-2$
    }
    String objectFactoryCreatorCfgFile = getSolutionPath() + SYSTEM_FOLDER + "/" + DEFAULT_SPRING_CONFIG_FILE_NAME; //$NON-NLS-1$

    IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
    pentahoObjectFactory.init( objectFactoryCreatorCfgFile, null );
    PentahoSystem.registerObjectFactory( pentahoObjectFactory );
    PentahoSystem.init( applicationContext );
    session = new StandaloneSession( "system" ); //$NON-NLS-1$
  }
View Full Code Here

   * Sets the StandaloneSpringPentahoObjectFactory for the Pentaho platform by xml path
   *
   * @return
   */
  public void setSpringConfig( String cfgFile ) {
    IPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
    pentahoObjectFactory.init( cfgFile, null );
    setFactory( pentahoObjectFactory );
  }
View Full Code Here

    // parent folder must match jcrRepository.homeDir bean property in repository-test-override.spring.xml
    FileUtils.deleteDirectory( new File( "/tmp/jackrabbit-test-TRUNK" ) );
    PentahoSessionHolder.setStrategyName( PentahoSessionHolder.MODE_GLOBAL );

    // register repository spring context for correct work of <pen:list>
    final StandaloneSpringPentahoObjectFactory pentahoObjectFactory = new StandaloneSpringPentahoObjectFactory();
    GenericApplicationContext appCtx = new GenericApplicationContext();
    XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader( appCtx );
    xmlReader.loadBeanDefinitions( new ClassPathResource( "repository.spring.xml" ) );
    xmlReader.loadBeanDefinitions( new ClassPathResource( "repository-test-override.spring.xml" ) );
    pentahoObjectFactory.init( null, appCtx );
    PentahoSystem.registerObjectFactory( pentahoObjectFactory );
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.engine.core.system.objfac.StandaloneSpringPentahoObjectFactory

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.