本文整理汇总了Java中org.eclipse.birt.report.engine.api.EngineConfig.setEngineHome方法的典型用法代码示例。如果您正苦于以下问题:Java EngineConfig.setEngineHome方法的具体用法?Java EngineConfig.setEngineHome怎么用?Java EngineConfig.setEngineHome使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.birt.report.engine.api.EngineConfig
的用法示例。
在下文中一共展示了EngineConfig.setEngineHome方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: getInstance
import org.eclipse.birt.report.engine.api.EngineConfig; //导入方法依赖的package包/类
/**
* Get engine instance.
*
* @return engine instance
*/
synchronized public static ReportEngine getInstance( )
{
if ( engine == null )
{
System.setProperty( "RUN_UNDER_ECLIPSE", "false" ); //$NON-NLS-1$ //$NON-NLS-2$
EngineConfig config = new EngineConfig( );
String t = Platform.getLocation( ).toFile( ).getAbsolutePath( );
config.setEngineHome( t ); //$NON-NLS-1$
engine = new ReportEngine( config );
}
return engine;
}
示例3: init
import org.eclipse.birt.report.engine.api.EngineConfig; //导入方法依赖的package包/类
public boolean init(StepMetaInterface smi, StepDataInterface sdi){
// Boot the BIRT reporting engine.
try {
String birtHomeStr = System.getProperty("user.dir") + System.getProperty("file.separator") + "plugins/BIRTOutput/";
EngineConfig config = new EngineConfig();
birtStream = getClass().getClassLoader().getResourceAsStream("plugins/BIRTOutput/birt.properties");
birtProps.load(birtStream);
String logDir = birtProps.getProperty("logging.dir");
String logLevel = birtProps.getProperty("logging.level");
System.out.println("logging dir: " + logDir);
System.out.println("logging dir: " + logLevel);
// config.setLogConfig("/tmp", Level.ALL);
config.setLogConfig(logDir, Level.parse(logLevel));
Platform.startup(config);
config.setEngineHome("");
IPlatformContext context = new PlatformFileContext();
config.setPlatformContext( context );
IReportEngineFactory factory = (IReportEngineFactory)Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
engine = factory.createReportEngine(config);
return super.init(smi, sdi);
}catch(IOException ioe){
ioe.printStackTrace();
return false;
}catch (BirtException be) {
be.printStackTrace();
return false;
}
}