org.eclipse.birt.report.model.api
Class DesignEngine

java.lang.Object
  extended byorg.eclipse.birt.report.model.api.DesignEngine

public final class DesignEngine
extends java.lang.Object

Represents the BIRT design engine as a whole. Used to create new designs or open existing designs.

The design engine uses meta-data defined in an external file. This file is defined by BIRT and should both be available and valid. However, if an application wants to catch and handle errors associated with this file, it can create and register an instance of IMetaLogger before creating or opening the first report design. The logger is most useful for test suites.

See Also:
IMetaLogger, MetaLogManager

Constructor Summary
DesignEngine()
           
 
Method Summary
static IMetaDataDictionary getMetaDataDictionary()
          Gets the meta-data dictionary of the design engine.
static void initialize(java.io.InputStream is)
          Initializes the meta-data system and loads all extensions which implements the extension pointers the model defines.
static void initialize(java.lang.String defnFileName)
          Initializes the meta-data system and loads all extensions which implements the extension pointers the model defines.
static SessionHandle newSession(java.util.Locale locale)
          Creates a new design session handle.
static ReportDesignHandle openDesign(java.lang.String fileName)
          Deprecated.  
static ReportDesignHandle openDesign(java.lang.String fileName, java.io.InputStream is)
          Deprecated.  
static void registerMetaLogger(IMetaLogger newLogger)
          Registers a IMetaLogger to record initialization errors.
static boolean removeMetaLogger(IMetaLogger logger)
          Removes a IMetaLogger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DesignEngine

public DesignEngine()
Method Detail

initialize

public static void initialize(java.lang.String defnFileName)
                       throws MetaDataReaderException
Initializes the meta-data system and loads all extensions which implements the extension pointers the model defines. The application must call this method once (and only once) before opening or creating a design. It is the application's responsibility because the application will choose the location to store the definition file, and that location may differ for different applications.

Parameters:
defnFileName - name and location of the "rom.def" file that provides the meta-data for the system
Throws:
MetaDataReaderException - if error occurs during read the meta-data file.

initialize

public static void initialize(java.io.InputStream is)
                       throws MetaDataReaderException
Initializes the meta-data system and loads all extensions which implements the extension pointers the model defines. The application must call this method once (and only once) before opening or creating a design. It is the application's responsibility because the application will choose the location to store the definition file, and that location may differ for different applications.

Parameters:
is - stream for reading the "rom.def" file that provides the meta-data for the system
Throws:
MetaDataReaderException - if error occurs during read the meta-data file.

newSession

public static SessionHandle newSession(java.util.Locale locale)
Creates a new design session handle. The application uses the handle to open, create and manage designs. The session also represents the user and maintains the user's locale information.

Parameters:
locale - the user's locale. If null, uses the system locale.
Returns:
the design session handle
See Also:
SessionHandle

getMetaDataDictionary

public static IMetaDataDictionary getMetaDataDictionary()
Gets the meta-data dictionary of the design engine.

Returns:
the meta-data dictionary of the design engine

openDesign

public static ReportDesignHandle openDesign(java.lang.String fileName)
                                     throws DesignFileException
Deprecated.  

Opens a design by the given file name.

Parameters:
fileName - the name of the file to open.
Returns:
A handle to the report design.
Throws:
DesignFileException - If the file is not found, or the file contains fatal errors.

openDesign

public static ReportDesignHandle openDesign(java.lang.String fileName,
                                            java.io.InputStream is)
                                     throws DesignFileException
Deprecated.  

Opens a design by a given stream file name of the design. The file name is used for error reporting, and when saving the design.

Parameters:
fileName - the name of the file to open. If null, the design will be treated as a new design, and will be saved to a different file.
is - the stream to read the design
Returns:
a handle to the report design.
Throws:
DesignFileException - If the file is not found, or the file contains fatal errors.

registerMetaLogger

public static void registerMetaLogger(IMetaLogger newLogger)
Registers a IMetaLogger to record initialization errors. The logger will be notified of the errors during meta-data initialization. The meta-data system will be initialized once (and only once). Loggers should be registered before the first time a session is created so that it can be notified of the logging actions.

Parameters:
newLogger - the MetaLogger to be registered.
See Also:
removeMetaLogger(IMetaLogger)

removeMetaLogger

public static boolean removeMetaLogger(IMetaLogger logger)
Removes a IMetaLogger. This method will remove the logger from the list and close the logger if it has already been registered. The logger will no longer be notified of the errors during metadata initialization. Returns true if this logger manager contained the specified logger.

Parameters:
logger - the MetaLogger to be removed.
Returns:
true if this logger manager contained the specified logger.
See Also:
registerMetaLogger(IMetaLogger)


Copyright © 2005 Actuate Corp. All rights reserved.