// TODO: need to define the IDBDatasourceService.class
microPlatform.define( IDBDatasourceService.class, JndiDatasourceService.class, Scope.GLOBAL );
try {
KettleEnvironment.init( false );
IMetadataDomainRepository repo = PentahoSystem.get( IMetadataDomainRepository.class, null );
Domain domain = getBasicDomain();
Domain domain2 = getJdbcDomain();
// System.out.println(new SerializationService().serializeDomain(domain));
Domain domain3 = getJdbcDomain();
domain3.setId( "JDBCDOMAIN2" );
domain3.getLogicalModels().get( 0 ).setProperty( "max_rows", new BigDecimal( 10 ) );
Domain domain4 = getBasicDomain();
( (SqlPhysicalModel) domain4.getPhysicalModels().get( 0 ) ).getDatasource().setDialectType( "MYSQL" );
Map<String, String> attributes = new HashMap<String, String>();
attributes.put( "QUOTE_ALL_FIELDS", "Y" );
( (SqlPhysicalModel) domain4.getPhysicalModels().get( 0 ) ).getDatasource().setAttributes( attributes );
domain4.setId( "MYSQL_DOMAIN" );
repo.storeDomain( domain, true );
repo.storeDomain( domain2, true );
repo.storeDomain( domain3, true );
repo.storeDomain( domain4, true );
} catch ( Exception e ) {
e.printStackTrace();
}
// JNDI