Welcome!

Java Authors: Liz McMillan, Elizabeth White, Pat Romanski, Jim Kaskade, Dana Gardner

Related Topics: Eclipse, Java, Open Source

Eclipse: Article

Developing an Eclipse BIRT Report Item Extension

Architecture and framework

The rotated label report item extension implements the following extension points:

  • org.eclipse.birt.report.designer.ui.reportitemUI registers the graphical user interface (GUI) to use for the report item extension
  • org.eclipse.birt.report.model.reportItemModel specifies how to represent and persist the report item extension in the Report Object Model (ROM)
  • org.eclipse.birt.report.engine.reportitemPresentation specifies how to instantiate, process, and render the report item extension
To add an extension point element right-click on an extension point such as org.eclipse.birt.report.designer.ui.reportItemLabelUI. Choose New <extension point element> to add the extension element to the project. Figure 4 shows how to select the extension point element, report-ItemLabelUI, specified by the extension point, org.eclipse.birt.report.designer.ui.reportitemUI.

An XML schema specifies the following properties that identify each extension point in the runtime environment:

  • ID - Optional identifier of the extension instance
  • Name - Optional name of the extension instance
  • Point - Fully qualified identifier of the extension point
On Extensions, these settings appear in Extension Details when an extension point is selected as shown in Figure 4.

The extension point, org.eclipse.birt.report.designer.ui.reportitemUI, specifies the following extension elements:

  • reportItemLabelUI - The fully qualified name of the Java class that gets the display text for the report item component in the BIRT Report Designer
  • model - ROM report item extension name that maps to this UI component
  • palette - Icon to show and the category in which the icon appears in the Palette
  • editor - Flags indicating whether the editor shows in the MasterPage and Designer UI and is resizable in the Editor
  • outline - Icon to show in the Outline View
  • propertyPage - Optional Property Edit Page to use for the report item extension in the Property Edit View

    The extension point org.eclipse.birt.report.model.reportItemModel specifies reportItem and the following extension element properties:

  • extensionName - Internal unique name of the report item extension
  • class - Fully qualified name of the Java class that implements the org.eclipse.birt.report.model.api.extension.IReportItemFactory interface
  • defaultStyle - Predefined style to use for the report item extension
  • isNameRequired - Field indicating whether the report item instance name is required
  • displayNameID - Resource key for the display name

    reportItem also specifies the following property extension elements:

  • rotationAngle
  • displayText

    rotationAngle and displayText each specify the following properties:

  • name - Internal unique name of the property extension element
  • type - Data type, such as integer or string
  • displayNameID - Resource key for the display name
  • canInherit - Flag indicating whether the property extension element can inherit properties
  • detailType - Detail data type such as Boolean or string
  • defaultValue - Default value of the property extension element
  • isEncryptable - Flag indicating whether the property is encrypted
  • defaultDisplayName - Display name to use if no localized I18N display name exists

    The extension point org.eclipse.birt.report.engine.reportitemPresentation specifies the following report Item extension elements:

  • name - Unique name of the report item extension.
  • class - Fully qualified name of the Java class that implements the org.eclipse.birt.report.engine.extension.IReportItemPresentation interface.
  • supportedFormats - Supported rendering formats for this extended item. The value for this attribute is a comma-separated string, such as "HTML, PDF." The string is case-insensitive.
Listing 1 shows the automatically generated manifest file plugin.xml for the rotated label report item extension that describes the plug-in's activation framework to the run-time environment.

After defining the plug-in framework in the Eclipse PDE, the developer makes the code-based extensions required to complete the plug-in development process.

The rotated label report item extension implements the following interfaces and classes:

  • org.eclipse.birt.report.designer.ui.extensions specifies the following interfaces:
    - IPropertyTabUI - Represents a new tab in the Property Editor view, creating the UI, updating property values on request, and notifying the BIRT framework of any UI-based property change. PropertyTabUIAdapter is the adapter class that implements this interface.
    - IReportItemLabelProvider - Defines the interface for the accessor method that provides the label text. ReportItemLabelProvider is the adapter class that implements this interface.
    - IReportItemPropertyEditUI - Provides the interface for defining tabs in the Property Editor.
  • org.eclipse.birt.report.designer.ui.views.attributes.providers.PropertyProcessor provides accessor methods for processing general property information.
  • org.eclipse.birt.report.engine.extension
    - IRowSet - Defines the interface to a row set. Provides metadata, grouping level, and row navigation methods.
    - IReportItemPresentation - Defines the interface for presentation of a report item extension. IReportItem-Presentation sets the locale, resolution, output, and image formats and processes the extended item in the report presentation environment. ReportItemPresentationBase is the adapter class that implements this interface.
  • org.eclipse.birt.report.model.api
    - DesignElementHandle - Functions as the base class for all report elements. DesignElementHandle provides a high-level interface to the BIRT report model. The class provides the generic services for all elements. Derived classes provide specialized methods for each element type. DesignElementHandle implements the interface, org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel.
    - DesignEngine - Provides an interface to the BIRT design engine. DesignEngine instantiates a session handle to use when creating a new design, opening an existing design, and managing design processing. The session handle contains the report design's state. DesignEngine implements the interface, IDesignEngine interface.
    - ExtendedItemHandle - Provides a handle to an extended item that appears in a section of a report. The extended report item can have properties such as size, position, style, visibility rules, or a binding to a data source. ExtendedItemHandle extends ReportItemHandle, an abstract base class that extends DesignElement-Handle.
  • org.eclipse.birt.report.model.elements.Style extends org.eclipse.birt.report.model.core.StyleElement, the base class for report elements with a style, and implements org.eclipse.birt.report.model.elements.interfaces.IStyleModel, the interface for storing style element constants.
  • org.eclipse.birt.report.model.api.extension specifies the following interfaces:
    - IMessages - Defines the interface for getting a localized message from a message file using a resource key.
    - IPropertyDefinition - Defines the interface for the accessor methods that describe a property. PropertyDefinition is the adapter class that implements this interface.
    - IReportItem - Defines the interface for an instance of an extended report element. There is a one-to-one correspondence between the BIRT report item and this implementation. ReportItem is the adapter class that implements this interface.
    - IReportItemFactory - Defines the interface for the factory that creates an instance of the extended element, IReportItem. IReportItem stores the model data and serializes the model state. ReportItemFactory is the adapter class that implements this interface.
  • org.eclipse.birt.report.model.metadata.PropertyType functions as the base class for the metadata of a property type. A property type provides the display name, data validation and conversion methods, XML name, and other processing. PropertyType implements the interface, org.eclipse.birt.re-port.model.api.metadata.IPropertyType.
  • org.eclipse.core.runtime.Plugin defines the basic methods for starting, managing, and stopping the plug-in instance.

More Stories By Jason Weathersby

Jason Weathersby is a member of the extended BIRT development team at Actuate Corporation and has backgrounds in both computer science and technical writing. He has many years experience in technical consulting, training, writing, and publishing about reporting, business intelligence tools, and database technologies.

More Stories By Iana Chatalbasheva

Iana Chatalbasheva is a member of the extended BIRT development team at Actuate Corporation and has backgrounds in both computer science and technical writing. She has many years experience in technical consulting, training, writing, and publishing about reporting, business intelligence tools, and database technologies.

More Stories By Tom Bondur

Tom Bondur is a member of the extended BIRT development team at Actuate Corporation and has backgrounds in both computer science and technical writing. He has many years experience in technical consulting, training, writing, and publishing about reporting, business intelligence tools, and database technologies.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.