当前位置: 首页>>代码示例>>Java>>正文


Java EngineConfig类代码示例

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


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

示例1: init

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
@PostConstruct
public void init() {
    EngineConfig engineConfig = new EngineConfig();
    engineConfig.setLogConfig("logs", Level.WARNING);

    try {
        Platform.startup(engineConfig);
    } catch(Exception e) {
        logger.error("Birt platform startup error", e);
        System.exit(2);
    }

    IReportEngineFactory factory =
            (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
    reportEngine = factory.createReportEngine(engineConfig);
}
 
开发者ID:n-at,项目名称:arbirter,代码行数:17,代码来源:BirtEngine.java

示例2: getObject

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
@Override
public IReportEngine getObject() throws Exception {
	try {
		EngineConfig config = getEngineConfig();

		Platform.startup(config);
		IReportEngineFactory factory = (IReportEngineFactory) Platform
				.createFactoryObject(
						IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
		birtEngine = factory.createReportEngine(config);
		return birtEngine;
	} catch (BirtException be) {
		throw new BirtSystemException("Failed to start birt engine.", be);
	}

}
 
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:17,代码来源:BirtEngineFactory.java

示例3: loadOption

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
protected void loadOption( IReportEngine engine )
{
	if ( engine != null )

	{
		EngineConfig config = engine.getConfig( );
		if ( config != null )
		{
			Object locator = config.getResourceLocator( );
			if ( locator != null )
			{
				options.put( ModuleOption.RESOURCE_LOCATOR_KEY, locator );
			}
			Object resourcePath = config.getResourcePath( );
			if ( resourcePath != null )
			{
				options
						.put( ModuleOption.RESOURCE_FOLDER_KEY,
								resourcePath );
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:birt,代码行数:24,代码来源:ReportParser.java

示例4: ReportEngine

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
/**
 * Create a Report Engine using a configuration.
 * 
 * The user must set the BIRT_HOME in the EngineConfig.
 * 
 * @param config
 *            an engine configuration object used to configure the engine
 */
public ReportEngine( EngineConfig config )
{
	if ( config == null )
	{
		throw new NullPointerException( "config is null" );
	}
	this.config = config;
	beans = new HashMap<String, Object>( );
	mergeConfigToAppContext( );

	intializeLogger( );

	logger.log( Level.FINE, "ReportEngine created. EngineConfig: {0} ",
			config );
	this.helper = new ReportEngineHelper( this );
	openedDocuments = new LinkedObjectManager<ReportDocumentReader>( );
	IStatusHandler handler = config.getStatusHandler( );
	if ( handler != null )
	{
		handler.initialize( );
	}
	
	registerCustomFontConfig( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:33,代码来源:ReportEngine.java

示例5: TemplateExecutor

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
public TemplateExecutor( ExecutionContext context )
{
	this.context = context;
	String tmpDir = null;
	if ( context != null )
	{
		IReportEngine engine = context.getEngine( );
		if ( engine != null )
		{
			EngineConfig config = engine.getConfig( );
			if ( config != null )
			{
				tmpDir = config.getTempDir( );
			}
		}
	}
	if ( tmpDir == null )
	{
		tmpDir = FileUtil.getJavaTmpDir( );
	}
	if ( tmpDir == null )
	{
		tmpDir = ".";
	}
	imageFolder = new File( tmpDir );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:TemplateExecutor.java

示例6: createReportEngine

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
public IReportEngine createReportEngine( )
{
	EngineConfig config = new EngineConfig( );
	HashMap map = new HashMap( );
	File jar = new File( JAR );
	map.put( EngineConstants.PROJECT_CLASSPATH_KEY, jar.getAbsolutePath( ));
	config.setAppContext( map );
	// assume we has in the platform
	Object factory = Platform
			.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
	if ( factory instanceof IReportEngineFactory )
	{
		return ( (IReportEngineFactory) factory )
				.createReportEngine( config );
	}
	return null;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:PageScriptHandlerTest.java

示例7: getEngineConfig

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
private EngineConfig getEngineConfig( ModuleHandle handle )
	{
		EngineConfig ec = new EngineConfig( );
		ClassLoader parent = Thread.currentThread( ).getContextClassLoader( );
		if ( parent == null )
		{
			parent = this.getClass( ).getClassLoader( );
		}
		ClassLoader customClassLoader = DataSetProvider.getCustomScriptClassLoader( parent, handle );
		
//		"customerClassLoader" should not be set into engine appContext, which results in using wrong
//		classLoader later in JavascriptEvalUtil class. Comment the following lines can make data
//		preview work correctly.
		
		
//		ec.getAppContext( ).put( EngineConstants.APPCONTEXT_CLASSLOADER_KEY,
//				customClassLoader );
		return ec;
	}
 
开发者ID:eclipse,项目名称:birt,代码行数:20,代码来源:ResultSetPreviewPage.java

示例8: open

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
public void open( Map appContext, EngineConfig config ) throws BirtException
{
	engine = createReportEngine( config );
	if ( mode == PreviewType.RESULTSET )
	{
		task = engine.createDatasetPreviewTask( );
	}
	else
	{
		task = new OutParameterPreviewTask( (ReportEngine) engine );
	}
	task.setMaxRow( maxRow );
	task.setDataSet( dataSetHandle );
	task.setAppContext( appContext );
	ReportParameterUtil.completeParamDefalutValues( task, dataSetHandle.getModuleHandle( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:DataSetPreviewer.java

示例9: getObject

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
public IReportEngine getObject() {

        EngineConfig config = new EngineConfig();

        //This line injects the Spring Context into the BIRT Context
        config.getAppContext().put("spring", this.context);
        config.setLogConfig(null != this._resolvedDirectory ? this._resolvedDirectory.getAbsolutePath() : null, this.logLevel);
        try {
            Platform.startup(config);
        } catch (BirtException e) {
            throw new RuntimeException("Could not start the Birt engine!", e);
        }

        IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
        IReportEngine be = factory.createReportEngine(config);
        this.birtEngine = be;
        return be;
    }
 
开发者ID:rafizanbaharum,项目名称:cfi-gov,代码行数:19,代码来源:BirtEngineFactory.java

示例10: startBirtEngine

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static synchronized void startBirtEngine(IPlatformContext context)
{				
	log.info("Starting BIRT Engine and OSGI Platform using: " + context.getClass().getName());		
			
	HTMLServerImageHandler imageHandler = new HTMLServerImageHandler();
	
	HTMLRenderOption emitterConfig = new HTMLRenderOption();
	emitterConfig.setActionHandler(new HTMLActionHandler());		
	emitterConfig.setImageHandler(imageHandler);

	EngineConfig config = new EngineConfig();
	config.setEngineHome("");
	config.setPlatformContext(context);								
	config.setLogConfig(null, Level.ALL);			
	config.getEmitterConfigs().put("html", emitterConfig);

	try
	{
		Platform.startup(config);
	}
	catch (BirtException e)
	{
		log.error("BirtException", e);
	}

	IReportEngineFactory factory = (IReportEngineFactory) Platform
			.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
	
	birtEngine = factory.createReportEngine(config);
	
	log.info("BIRT Engine Started");
		
	birtEngine.changeLogLevel(Level.SEVERE);	
}
 
开发者ID:mtpettyp,项目名称:openreports,代码行数:36,代码来源:BirtProvider.java

示例11: getEngineConfig

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private EngineConfig getEngineConfig() {
	EngineConfig config = new EngineConfig();
	config.setTempDir(env.getProperty("java.io.tmpdir"));
	config.getAppContext().put(SPRING_KEY, this.applicationContext);

	// config.setLogConfig(".", Level.ALL);
	config.setLogger(logger);
	return config;
}
 
开发者ID:interseroh,项目名称:report-cockpit-birt-web,代码行数:11,代码来源:BirtEngineFactory.java

示例12: getEngine

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
protected IReportEngine getEngine( )
{
	if ( engine == null )
	{
		try
		{
			EngineConfig config = new EngineConfig( );
			// config.setEngineHome( getReportEngineHome( ) );

			// Platform.startup( config );
			// IReportEngineFactory factory = (IReportEngineFactory)
			// Platform.createFactoryObject(
			// IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
			// engine = factory.createReportEngine( config );

			engine = new ReportEngine( config );

			engine.changeLogLevel( Level.WARNING );

			HTMLEmitterConfig hc = new HTMLEmitterConfig( );
			HTMLCompleteImageHandler imageHandler = new HTMLCompleteImageHandler( );
			hc.setImageHandler( imageHandler );
			config.setEmitterConfiguration( HTML_FORMAT, hc );
		}
		catch ( Exception ex )
		{
		}
	}
	return engine;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:31,代码来源:TestEngine.java

示例13: testIEmitterServices

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
/**
 * Test IEmitterServices methods.
 * 
 * @throws BirtException
 */
public void testIEmitterServices( ) throws BirtException
{
	EngineConfig config = new EngineConfig( );
	emitterConfig = new HTMLEmitterConfig( );
	config.setEmitterConfiguration( EMITTER_HTML, emitterConfig );
	emitterConfig = config.getEmitterConfigs( ).get( EMITTER_HTML );
	Platform.startup( config );
	IReportEngineFactory factory = (IReportEngineFactory) Platform
			.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
	IReportEngine reportEngine = factory.createReportEngine( config );
	IReportRunnable reportRunnable = engine.openReportDesign( this
			.genInputFile( report ) );

	IRenderOption options = new HTMLRenderOption( );
	options.setOutputFormat( EMITTER_HTML );
	options.setOutputFileName( this.genOutputFile( "myService.html" ) );
	HTMLRenderContext renderContext = new HTMLRenderContext( );
	renderContext.setImageDirectory( "myImage" ); //$NON-NLS-1$
	HashMap appContext = new HashMap( );
	appContext.put(
			EngineConstants.APPCONTEXT_HTML_RENDER_CONTEXT,
			renderContext );
	appContext.put( "emitter_class", this );

	IRunAndRenderTask rrTask = reportEngine
			.createRunAndRenderTask( reportRunnable );
	rrTask.setRenderOption( options );
	rrTask.setAppContext( appContext );
	rrTask.run( );
	rrTask.close( );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:37,代码来源:IEmitterServicesTest.java

示例14: testGetConfig

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
/**
 * Test getConfig() method
 */
public void testGetConfig( )
{
	EngineConfig config = new EngineConfig( );
	config.setTempDir( "tempdir" );
	ReportEngine engine = new ReportEngine( config );
	EngineConfig configGet = engine.getConfig( );
	assertEquals( "getConfig() fail", config.getTempDir( ), configGet
			.getTempDir( ) );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:13,代码来源:ReportEngineTest.java

示例15: testOpenReportDesign

import org.eclipse.birt.report.engine.api.EngineConfig; //导入依赖的package包/类
/**
 * Test openReportDesign(string)
 * 
 * @throws EngineException
 */
public void testOpenReportDesign( ) throws EngineException
{
	EngineConfig config = new EngineConfig( );
	IReportRunnable reportRunner;
	config.setTempDir( "tempdir" );
	ReportEngine engine = new ReportEngine( config );
	/*
	 * String input =
	 * PLUGIN_PATH+System.getProperty("file.separator")+RESOURCE_BUNDLE
	 * .getString("CASE_INPUT"); input +=
	 * System.getProperty("file.separator") ; String
	 * designName=input+"report_engine.rptdesign";
	 */
	String designName = this.genInputFile( "report_engine.rptdesign" );

	try
	{
		reportRunner = engine.openReportDesign( designName );
		designName = "file:" + designName;
		designName = designName.replace( '/', '\\' );
		String reportName = reportRunner.getReportName( ).replace(
				'/',
				'\\' );
		assertEquals( "openReportDesign(String) fail", designName
				.substring( designName.indexOf( "org" ), designName
						.length( ) ), reportName.substring( reportName
				.indexOf( "org" ), reportName.length( ) ) );
		assertNotNull( "openReportDesign(String) fail", reportRunner
				.getImage( "23.gif" ) );
	}
	catch ( EngineException ee )
	{
		ee.printStackTrace( );
		fail( "openReportDesign(String) fail" );
	}
	engine.destroy( );

}
 
开发者ID:eclipse,项目名称:birt,代码行数:44,代码来源:ReportEngineTest.java


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