public void prepare( Report report ) { assert ( report != null );   ReportDesignHandle handle = report.getReportDesign( ).handle( ); SlotHandle dataSourceSlot = handle.getDataSources( ); for ( int i = 0; i < dataSourceSlot.getCount( ); i++ ) { DataSourceHandle dataSource = (DataSourceHandle) dataSourceSlot.get( i )  ;  try { engine.defineDataSource( ModelDteApiAdapter.getInstance( ) .createDataSourceDesign(dataSource)); } catch ( BirtException e ) { logger.log( Level.SEVERE, e.getMessage( ), e ); context.addException(dataSource,  e ); } }   SlotHandle dataSetSlot = handle.getDataSets( ); for ( int i = 0; i < dataSetSlot.getCount( ); i++ ) { DataSetHandle dataset = (DataSetHandle) dataSetSlot.get( i ) ; try { engine.defineDataSet( ModelDteApiAdapter.getInstance( ) .createDataSetDesign(dataset) ); } catch ( BirtException e ) { logger.log( Level.SEVERE, e.getMessage( ), e ); context.addException( dataset, e ); } }   new ReportQueryBuilder( ).build( report, context );   for ( int i = 0; i < report.getQueries( ).size( ); i++ ) { IQueryDefinition query = (IQueryDefinition) report.getQueries( ) .get( i ); try { IPreparedQuery preparedQuery = engine.prepare( query ); queryMap.put( query, preparedQuery );  } catch ( BirtException e ) { logger.log( Level.SEVERE, e.getMessage( ), e ); context.addException( e ); } }
public void prepare(Report report) { prepare( report, null );
	public void prepare( Report report )	{		assert ( report != null );		// Handle data sources		ReportDesignHandle handle = report.getReportDesign( ).handle( );		SlotHandle dataSourceSlot = handle.getDataSources( );		for ( int i = 0; i < dataSourceSlot.getCount( ); i++ )		{			DataSourceHandle dataSource = (DataSourceHandle) dataSourceSlot.get( i )  ;			try			{				engine.defineDataSource( ModelDteApiAdapter.getInstance( )						.createDataSourceDesign(dataSource));			}			catch ( BirtException e )			{				logger.log( Level.SEVERE, e.getMessage( ), e );				context.addException(dataSource,  e );			}					} // End of data source handling		// Handle data sets		SlotHandle dataSetSlot = handle.getDataSets( );		for ( int i = 0; i < dataSetSlot.getCount( ); i++ )		{			DataSetHandle dataset = (DataSetHandle) dataSetSlot.get( i ) ;			try			{				engine.defineDataSet( ModelDteApiAdapter.getInstance( )						.createDataSetDesign(dataset) );			}			catch ( BirtException e )			{				logger.log( Level.SEVERE, e.getMessage( ), e );				context.addException( dataset, e );			}					} // End of data set handling		// build report queries		new ReportQueryBuilder( ).build( report, context );		// prepare report queries		for ( int i = 0; i < report.getQueries( ).size( ); i++ )		{			IQueryDefinition query = (IQueryDefinition) report.getQueries( )					.get( i );			try			{				IPreparedQuery preparedQuery = engine.prepare( query );				queryMap.put( query, preparedQuery );			}			catch ( BirtException e )			{				logger.log( Level.SEVERE, e.getMessage( ), e );				context.addException( e );			}					} // end of prepare	}