Package org.eclipse.birt.report.engine.api

# Class EngineConfig

java.lang.Object
org.eclipse.birt.core.framework.PlatformConfig
org.eclipse.birt.report.engine.api.EngineConfig

All Implemented Interfaces:
  `org.eclipse.birt.core.framework.IPlatformConfig`, `IEngineConfig`

public class EngineConfig extends org.eclipse.birt.core.framework.PlatformConfig implements IEngineConfig
Wraps around configuration settings for report engine. Allows developers to specify where to look for engine plugins, data drivers, and where to write image files. Allows users to customize data-related properties (i.e., data engine). Also allows engine to provide customized implementations for image handling, hyperlink handling and font handling, etc.

## Field Summary

### Fields inherited from class org.eclipse.birt.core.framework.PlatformConfig

`properties`

### Fields inherited from interface org.eclipse.birt.report.engine.api.IEngineConfig

`DEFAULT_RENDER_OPTION, EMITTER_CONFIGS, ENGINE_LOGGER, FONT_CONFIG, LOG_DESTINATION, LOG_FILE, LOG_LEVEL, LOG_MAX_BACKUP_INDEX, LOG_ROLLING_SIZE, MAX_ROWS_PER_QUERY, REPORT_DOCUMENT_LOCK_MANAGER, RESOURCE_LOCATOR, RESOURCE_PATH, SCRIPT_OBJECTS, STATUS_HANDLER`

### Fields inherited from interface org.eclipse.birt.core.framework.IPlatformConfig

`BIRT_HOME, OSGI_ARGUMENTS, OSGI_CONFIGURATION, PLATFORM_CONTEXT, TEMP_DIR`

## Constructor Summary

Constructors
Constructor
Description
`EngineConfig()`
constructor

## Method Summary

Modifier and Type
Method
Description
`void`
`addScriptableJavaObject(String jsName, Object obj)`
Deprecated.
the user need add the object to the appContext directly.
`HashMap`
`getAppContext()`
returns a hash map that contains appContext
`HashMap`
`getConfigMap()`
Deprecated.
use getProperties() instead.
`String`
`getDefaultEmitter(String format)`
Gets default emitter id of an output format.
`HashMap`
`getEmitterConfigs()`
gets a map for emitter configuration objects
`URL`
`getFontConfig()`
`String`
`getLogDirectory()`
Get directory of the log file
`String`
`getLogFile()`
Get the name of the log file.
`Logger`
`getLogger()`
return the user's logger set through setLogger.
`Level`
`getLogLevel()`
Get the level of the log file
`int`
`getLogMaxBackupIndex()`
Returns the value of the MaxBackupIndex option.
`int`
`getLogRollingSize()`
Get the maximum number of bytes that the output file is allowed to reach before being rolled over to backup files.
`int`
`getMaxRowsPerQuery()`
Deprecated.
`IReportDocumentLockManager`
`getReportDocumentLockManager()`
return a lock manager.
`org.eclipse.birt.report.model.api.IResourceLocator`
`getResourceLocator()`
`String`
`getResourcePath()`
`HashMap`
`getScriptObjects()`
Deprecated.
use getAppContext() instead.
`org.eclipse.birt.core.framework.IPlatformContext`
`getServletContext()`
Deprecated.
use getPlatformContext instead
`IStatusHandler`
`getStatusHandler()`
returns the status handler
`void`
`setAppContext(HashMap appContext)`
Set appContext
`void`
`setConfigurationVariable(String name, String value)`
Deprecated.
use setProperty() instead.
`void`
`setDefaultEmitter(String format, String emitterId)`
Sets default emitter for an output format.
`void`
`setEmitterConfiguration(String format, Object emitterConfig)`
sets configuration for a specific extension to engine, i.e., an emitter extension
`void`
`setEngineContext(org.eclipse.birt.core.framework.IPlatformContext context)`
Deprecated.
use setPlatformContext instead.
`void`
`setEngineHome(String birtHome)`
set the BIRT_HOME system property
`void`
`setFontConfig(URL fontConfig)`
`void`
`setLogConfig(String directoryName, Level level)`
set log configuration, i.e., log file name prefix and log level
`void`
`setLogFile(String filename)`
Set the name of the log file.
`void`
`setLogger(Logger logger)`
set the logger used by the report engine.
`void`
`setLogMaxBackupIndex(int maxBackupIndex)`
Set the maximum number of backup files to keep around.
`void`
`setLogRollingSize(int size)`
Set the maximum number of bytes that the output file is allowed to reach before being rolled over to backup files.
`void`
`setMaxRowsPerQuery(int maxRows)`
Deprecated.
`void`
`setReportDocumentLockManager(IReportDocumentLockManager manager)`
Set report document lock manager
`void`
`setResourceLocator(org.eclipse.birt.report.model.api.IResourceLocator resourceLocator)`
`void`
`setResourcePath(String resourcePath)`
`void`
`setStatusHandler(IStatusHandler handler)`
sets the handler for reporting report running status.
`String`
`toString()`
Output properties for debug tracing

### Methods inherited from class org.eclipse.birt.core.framework.PlatformConfig

`getBIRTHome, getOSGiArguments, getOSGiConfig, getPlatformContext, getProperties, getProperty, getTempDir, setBIRTHome, setOSGiArguments, setOSGiConfig, setPlatformContext, setProperty, setTempDir`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### EngineConfig

public EngineConfig()
constructor

## Method Details

### setEngineHome

public void setEngineHome(String birtHome)
set the BIRT_HOME system property

Parameters:
  `birtHome` - the value for the BIRT_HOMT configuration variable @deprecated, use setBIRTHome instead.

### setConfigurationVariable

@Deprecated public void setConfigurationVariable(String name, String value)
Deprecated.
use setProperty() instead.
sets a configuration variable that is available through scripting in engine

Parameters:
  `name` - configuration variable name
  `value` - configuration variable value

### getConfigMap

@Deprecated public HashMap getConfigMap()
Deprecated.
use getProperties() instead.
returns a hash map that contains all the configuration objects

Returns:
  the configuration object map

### setLogConfig

public void setLogConfig(String directoryName, Level level)
set log configuration, i.e., log file name prefix and log level

Parameters:
  `directoryName` - - the directory name of the log file(e.g C:\Log). Engine appends a file name with date and time to the directory name (e.g. C:\Log\BIRT_Engine_2005_02_26_11_26_56.log).
  `level` - the engine log level

### setLogger

public void setLogger(Logger logger)
set the logger used by the report engine. the logger will overides the setLogConfig().

Parameters:
  `logger` -

### getLogger

public Logger getLogger()
return the user's logger set through setLogger.

Returns:
  the logger setted by user. NULL if the user doesn't set it.

### getScriptObjects

@Deprecated public HashMap getScriptObjects()
Deprecated.
use getAppContext() instead.
returns a hash map that contains all the app-specific, app-wide scriptable Java objects

Returns:
  a hash map with all the app-specific, app-wide scriptable Java objects

### addScriptableJavaObject

@Deprecated public void addScriptableJavaObject(String jsName, Object obj)
Deprecated.
the user need add the object to the appContext directly.
defines an additional Java object that is exposed to BIRT scripting

Parameters:
  `jsName` - the name that the object is referenced in JavaScript
  `obj` - the Java object that is wrapped and scripted

### getAppContext

public HashMap getAppContext()
returns a hash map that contains appContext

Returns:

### setAppContext

public void setAppContext(HashMap appContext)
Set appContext

Parameters:
  `appContext` -

### setEmitterConfiguration

public void setEmitterConfiguration(String format, Object emitterConfig)
sets configuration for a specific extension to engine, i.e., an emitter extension

Parameters:
  `extensionID` - identifier for the emitter
  `extensionConfig` - configuration object for the emitter, which must be an instance of HashMap or IRenderOption

### getEmitterConfigs

public HashMap getEmitterConfigs()
gets a map for emitter configuration objects

Returns:
  emitter configuration

### getStatusHandler

public IStatusHandler getStatusHandler()
returns the status handler

Returns:
  the status handler

### setStatusHandler

public void setStatusHandler(IStatusHandler handler)
sets the handler for reporting report running status.

Parameters:
  `handler` - status handler

### getLogLevel

public Level getLogLevel()
Get the level of the log file

Returns:
  level

### getLogDirectory

public String getLogDirectory()
Get directory of the log file

Returns:
  log directory

### getLogFile

public String getLogFile()
Get the name of the log file.

Returns:
  log file name

### setLogFile

public void setLogFile(String filename)
Set the name of the log file.

Parameters:
  `filename` -

### getLogRollingSize

public int getLogRollingSize()
Get the maximum number of bytes that the output file is allowed to reach before being rolled over to backup files.

Returns:

### setLogRollingSize

public void setLogRollingSize(int size)
Set the maximum number of bytes that the output file is allowed to reach before being rolled over to backup files.

Parameters:
  `size` -

### getLogMaxBackupIndex

public int getLogMaxBackupIndex()
Returns the value of the MaxBackupIndex option.

Returns:

### setLogMaxBackupIndex

public void setLogMaxBackupIndex(int maxBackupIndex)
Set the maximum number of backup files to keep around.

Parameters:
  `maxBackupIndex` -

### getReportDocumentLockManager

public IReportDocumentLockManager getReportDocumentLockManager()
return a lock manager. The lock manager is used to lock the report document opened by this engine.

Returns:
  lock manager, NULL if not set.

### setReportDocumentLockManager

public void setReportDocumentLockManager(IReportDocumentLockManager manager)
Set report document lock manager

Parameters:
  `manager` - lock manager

### setEngineContext

@Deprecated public void setEngineContext(org.eclipse.birt.core.framework.IPlatformContext context)
Deprecated.
use setPlatformContext instead.
set the framework context

Parameters:
  `context` - the platform context

### getServletContext

@Deprecated public org.eclipse.birt.core.framework.IPlatformContext getServletContext()
Deprecated.
use getPlatformContext instead
set the framework context

Returns:
  context, the framework context

### getResourceLocator

public org.eclipse.birt.report.model.api.IResourceLocator getResourceLocator()

Returns:
  the resourceLocator

### setResourceLocator

public void setResourceLocator(org.eclipse.birt.report.model.api.IResourceLocator resourceLocator)

Parameters:
  `resourceLocator` - the resourceLocator to set

### getResourcePath

public String getResourcePath()

Returns:
  the resourcePath

### setResourcePath

public void setResourcePath(String resourcePath)

Parameters:
  `resourcePath` - the resourcePath to set

### getFontConfig

public URL getFontConfig()

Returns:
  the custom font configuration file path.

### setFontConfig

public void setFontConfig(URL fontConfig)

Parameters:
  `fontConfig` - the font configuration file path.

### setMaxRowsPerQuery

@Deprecated public void setMaxRowsPerQuery(int maxRows)
Deprecated.
Set the max rows per query

Parameters:
  `maxRows` - : max rows

### getMaxRowsPerQuery

@Deprecated public int getMaxRowsPerQuery()
Deprecated.
Get the max rows per query

Returns:
  the max rows per query

### setDefaultEmitter

public void setDefaultEmitter(String format, String emitterId)
Sets default emitter for an output format.

Parameters:
  `format` - the format.
  `emitterId` - the id of the default emitter.

### getDefaultEmitter

public String getDefaultEmitter(String format)
Gets default emitter id of an output format.

Parameters:
  `format` - the format.
Returns:
  the id of the default emitter of this output format, "null" is returned if default emitter is not set for this format.

### toString

public String toString()
Output properties for debug tracing

Overrides:
  `toString` in class `Object`
See Also:
  - `Object.toString()`