Chapter 17. Extending BIRT

This chapter provides an overview of the BIRT extension framework and shows how to create and deploy a BIRT extension using the Eclipse Plug-in Development Environment (PDE).

Overview of the extension framework

BIRT is a set of plug-in extensions that support adding reporting functionality to an application. The BIRT APIs define extension points that support a developer adding custom functionality to this framework. Report developers find the BIRT source code in the Eclipse CVS repository.

In the Eclipse installation, the name of a plug-in directory has an appended version number. For simplicity, this book does not show the version number in the names of the plug-in directories. For example, the book abbreviates the name of the plug-in directory, org.eclipse.birt.report.viewer_2.6.0.v20100605, to org.eclipse.birt.report.viewer.

The following sections provide a general description of how to make an extension to a defined extension point in the BIRT release 2.6 framework.

Understanding the structure of a BIRT plug-in

An Eclipse plug-in implements the following components:

• Extension point schema definition

An XML document specifying a grammar to follow when defining the elements of a plug-in extension in the Eclipse PDE

• Plug-in manifest

An XML document describing the plug-in activation framework to the Eclipse run-time environment

• Plug-in run-time class

A Java class defining the methods to use when starting, managing, and stopping a plug-in instance

The following sections provide detailed descriptions of these Eclipse plug-in components.

Understanding an extension point schema definition file

A plug-in directory typically contains an XML extension point schema definition (.exsd) file in a schema subdirectory. The XML schema documents the elements, attributes, and types used by the extension point. The Eclipse PDE uses this information to describe the elements and attributes in the property editors and other facilities available in the Eclipse platform.

To develop the plug-in content, test, and deploy a plug-in, use the Eclipse PDE. The Eclipse PDE generates the plugin.xml, build.properties, and run-time archive files.

The file, $INSTALL_DIReclipsepluginsorg.eclipse.birt.report.designer.uischema eportitemUI.exsd, documents the settings for a report item extension to the BIRT Report Designer user interface. This XML schema file has the following structure:

• <schema> is the root element that sets the target namespace and contains all other elements and their attributes.

• <annotation> contains the following attributes:

• <appinfo> provides machine-readable metadata that Eclipse uses to identify the plug-in. <appinfo> also provides textual information that appears in the PDE Extensions page and HTML extension point description.

• <documentation> provides user information that appears in the PDE HTML extension point description.

• <element> declares a reference for the model and optional user interface extensions, such as builder, palette, editor, outline, and description. Each extension element is a complex type containing attributes and annotations, as described below:

• model is an extension element that specifies the Report Object Model (ROM) name for the report item extension.

• Each user interface extension element specifies the extension element name and the fully qualified name of the Java class implementing the interface specified for the extension element. For example, builder implements the interface, org.eclipse.birt.report.designer.ui.extensions.IReportItemBuilderUI.

Listing 17-1 is a partial schema example showing reportitemUI.exsd. The ellipses (...) mark the places in the code where lines are omitted.

Listing 17-1 Partial example schema for Report Item UI


<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.birt.report.designer.ui"
   xmlns="http://www.w3.org/2001/XMLSchema">
   <annotation>
      <appInfo>
         <meta.schema
            plugin="org.eclipse.birt.report.designer.ui"
            id="reportitemUI"
            name="Report Item UI Extension Point"/>
      </appInfo>
      <documentation>
         This extension point is used in conjunction with the
         Report Item extension point defined in the model. It
         is used to register the GUI to be used for the
         Extended report item.
      </documentation>
   </annotation>
   <element name="extension">
      ...
      <complexType>
         <sequence>
            ...
            <element ref="model"/>
            <element ref="builder" minOccurs="0" maxOccurs="1"/>
            <element ref="palette" minOccurs="0" maxOccurs="1"/>
            <element ref="editor" minOccurs="0" maxOccurs="1"/>
            <element ref="outline" minOccurs="0" maxOccurs="1"/>
            <element ref="description" minOccurs="0"
               maxOccurs="1"/>
         </sequence>
         <attribute name="point" type="string" use="required">
            ...
         </attribute>
      </complexType>
   </element>
   <element name="model">
      <complexType>
         <attribute name="extensionName" type="string"
            use="required">
            <annotation>
               <documentation>
                  The ROM Report Item Extension name that maps
                  to this UI
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>
   ...
   <element name="builder">
      <annotation>
         <documentation>
            Optional Builder for the element inside the Editor.
            Instantiated when a new item is dragged from the
            palette inside the editor.
         </documentation>
      </annotation>
      <complexType>
         <attribute name="class" type="string">
            <annotation>
               <documentation>
                  a fully qualified name of the Java class
                  implementing org.eclipse.birt.report
                  .designer.ui.extensions.IReportItemBuilderUI
               </documentation>
               <appInfo>
                  <meta.attribute kind="java"/>
               </appInfo>
            </annotation>
         </attribute>
      </complexType>
   </element>
   ...
</schema>

Understanding a plug-in manifest file

Install an Eclipse plug-in in a subdirectory of the $INSTALL_DIR/eclipse/plugins directory. The plug-in manifest file, plugin.xml, describes the plug-in activation framework to the Eclipse run-time environment.

At run time, Eclipse scans the subdirectories in $INSTALL_DIR/eclipse/plugins, parses the contents of each plug-in manifest file, and caches the information in the plug-in registry. If the Eclipse run time requires an extension, Eclipse lazily loads the plug-in, using the registry information to instantiate the plug-in objects. The run-time environment for the BIRT Report Engine functions in a similar way.

The plug-in manifest file declares the required plug-in code and extension points to the plug-in registry. The plug-in run-time class provides the code segment. By lazily loading this code segment, the run-time environment minimizes start-up time and conserves memory resources.

The plug-in manifest file, plugin.xml, has the following structure:

• <plugin> is the root element.

• <extension> specifies extension points, related elements, and attributes that define the processing capabilities of the plug-in component.

Listing 17-2 shows the contents of the plug-in manifest file, org.eclipse.birt.sample.reportitem.rotatedlabel/plugin.xml. This file describes the required classes and extension points for the BIRT report item extension sample, rotated label.

Listing 17-2 Sample plug-in manifest file


<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
   <extension
      id="rotatedLabel"
      name="Rotated Label Extension"
      point="org.eclipse.birt.report.designer.ui
         .reportitemUI">
      <reportItemLabelUI
         class="org.eclipse.birt.sample.reportitem
            .rotatedlabel.RotatedLabelUI"/>
      <model extensionName="RotatedLabel"/>
      <palette icon="icons/rotatedlabel.jpg"/>
      <editor
         canResize="true"
         showInDesigner="true"
         showInMasterPage="true"/>
      <outline icon="icons/rotatedlabel.jpg"/>
   </extension>
   <extension
      id="rotatedLabel"
      name="Rotated Label Extension"
      point="org.eclipse.birt.report.model.reportItemModel">
      <reportItem
         class="org.eclipse.birt.sample.reportitem
            .rotatedlabel.RotatedLabelItemFactoryImpl"
         extensionName="RotatedLabel">
         <property
            defaultDisplayName="Display Text"
            defaultValue="Rotated Label"
            name="displayText"
            type="string"/>
         <property
            defaultDisplayName="Rotation Angle"
            defaultValue="-45"
            name="rotationAngle"
            type="string"/>
      </reportItem>
   </extension>
   <extension
      id="rotatedLabel"
      name="Rotated Label Extension
      point="org.eclipse.birt.report.engine.reportitem
         Presentation">
      <reportItem
         class="org.eclipse.birt.sample.reportitem.rotated
            label.RotatedLabelPresentationImpl"
         name="RotatedLabel"/>
   </extension>
   <extension
      point="org.eclipse.birt.report.designer.ui
         .elementAdapters">
         <adaptable
            class="org.eclipse.birt.report.model.api
               .ExtendedItemHandle">
            <adapter
               factory="org.eclipse.birt.sample.reportitem
                  .rotatedlabel.views
                  .RotatedLabelPageGeneratorFactory"
               id="ReportDesign.AttributeView
                  .RotatedLabelPageGenerator"
               priority="1"
               singleton="false"
               type="org.eclipse.birt.report.designer.ui
                  .views.IPageGenerator">
               <enablement>
                  <test
                     forcePluginActivation="true"
                     property="ExtendItemHandle.extensionName"
                     value="RotatedLabel">
                  </test>
               </enablement>
            </adapter>
         </adaptable>
   </extension>
   </plugin>

Understanding a plug-in run-time class

A plug-in runs within an instance of a plug-in run-time class. A plug-in run-time class extends org.eclipse.core.runtime.Plugin, the abstract superclass for all plug-in run-time class implementations. The Plugin run-time class defines the methods for starting, managing, and stopping a plug-in instance.

The Plugin run-time class typically contains a reference to an Open Services Gateway Initiative (OSGi) resource bundle that manages the execution context. Plugin implements the interface, org.osgi.framework.BundleActivator, which installs, starts, stops, and uninstalls the OSGi resource bundle. The OSGi resource bundle implements a service registry to support the following services:

• Installing and uninstalling the resource bundle

• Subscribing to an event

• Registering a service object

• Retrieving a service reference

The OSGi platform provides a secure, managed, extensible Java framework for downloading, deploying, and managing service applications. For more information about the OSGi platform, visit the OSGi Alliance web site at http://www.osgi.org/.

Listing 17-3 is a code example showing the life cycle and resource bundle methods for the report item plug-in, rotated label.

Listing 17-3 Sample code for the rotated label report item plug-in


package org.eclipse.birt.sample.reportitem.rotatedlabel;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
 * The activator class controls the plug-in life cycle
 */
public class RotatedLabelPlugin extends Plugin {
   // The Plugin ID
   public final static String PLUGIN_ID =
      "org.eclipse.birt.sample.reportitem.rotatedlabel";
   //The shared instance.
   private static RotatedLabelPlugin plugin;
   /**
    * The constructor.
    */
   public RotatedLabelPlugin( ) {
   }
   /**
    * This method is called upon plug-in activation
    */
   public void start(BundleContext context) throws Exception {
      super.start(context);
      plugin = this;
   }
   /**
    * This method is called when the plug-in is stopped
    */
   public void stop(BundleContext context) throws Exception {
      plugin = null;
      super.stop(context);
   }
   /**
    * Returns the shared instance.
    */
   public static RotatedLabelPlugin getDefault() {
      return plugin;
   }
}

Working with the Eclipse PDE

The Eclipse PDE is an integrated design tool used to create, develop, test, debug, and deploy a plug-in. The PDE provides wizards, editors, views, and launchers to assist in developing a plug-in.

The Eclipse PDE provides a wizard, the New Plug-in Project wizard, to assist in setting up a plug-in project and creating the framework for a plug-in extension. The PDE wizard generates the plug-in manifest file, plugin.xml, and optionally, the Java plug-in run-time class.

How to choose the Plug-in Development perspective

To access the PDE, choose the Plug-in Development perspective. To open the Plug-in Development perspective, perform the following tasks:

1 From the Eclipse menu, choose Window→Open Perspective→Other. Open Perspective appears.

2 Select Plug-in Development, as shown in Figure 17-1.

Figure 17-1 Selecting a perspective

image

Choose OK. The Plug-in Development perspective appears.

How to set up a new plug-in project

To access the New Plug-in Project wizard and create a project, perform the following tasks:

1 From the PDE menu, choose File→New→Project. New Project appears.

2 In Wizards, expand Plug-in Development, and select Plug-in Project, as shown in Figure 17-2.

Figure 17-2 Creating a plug-in project

image

Choose Next. New Plug-in Project appears, as shown in Figure 17-3.

Figure 17-3 Specifying a plug-in project

image

Understanding plug-in project properties

The New Plug-in Project wizard defines the following properties for the plug-in:

• Project settings

• Name

• Location

• Source and output folders

• Target platform, specifying the Eclipse version or OSGi framework

• Plug-in content

• Properties such as ID, version, name, provider, and the run-time library classpath

• Generation of an activator, a Java class that controls the plug-in’s life cycle

Specifying the OSGi framework creates an OSGi bundle manifest, META-INF/ MANIFEST.MF, which contains a set of manifest headers that provide descriptive information about the bundle.

Understanding the Eclipse PDE Workbench

The Eclipse PDE supports host and run-time instances of the workbench project. The host instance provides the development environment. The run-time instance supports launching a plug-in to test it.

Figure 17-4 shows the project for the report item extension sample, rotated label, in the host instance of the PDE Workbench.

Figure 17-4 Viewing the host instance of the PDE Workbench

image

In the host instance, the PDE Workbench provides the following view and editor components:

• Package Explorer provides an expandable view of the plug-in package.

• Outline provides an expandable view of the project settings.

• PDE Manifest Editor displays a page containing the project settings for the currently selected item in Outline.

In PDE Manifest Editor, specify project settings and edit related files to create the plug-in framework on the following pages:

• Overview

List general information such as the plug-in ID, version, name, provider, platform filter, and activator class. This page also contains sections that link to the plug-in content pages, extensions, launchers for testing and debugging, deployment wizards, and the settings for the execution environment.

• Dependencies

List the plug-ins that must be on the classpath to compile and run.

• Runtime

Declare the packages the plug-in exposes to clients. Identifies the package visibility to other plug-ins and the libraries and folders in the plug-in classpath.

• Extensions

Declare the extensions the plug-in makes to the platform and provides extension details, such as the extension point ID, name, description, and schema.

• Extension Points

Declare the new extension points the plug-in adds to the platform.

• Build

Displays the build configuration settings. A change to a setting on this page updates the file, build.properties.

• MANIFEST.MF

Displays an editable page containing the header settings for the manifest file, MANIFEST.MF, that provides descriptive information about an OSGi bundle.

• Plug-in.xml

Displays an editable page containing settings for the plug-in manifest file, plugin.xml.

• Build.properties

Displays an editable page containing settings for the file, build.properties.

A modification to a setting in a PDE Manifest Editor page automatically updates the corresponding plug-in manifest or build properties file.

Creating the structure of a plug-in extension

Use the host instance of the PDE Workbench to create the basic structure of a plug-in extension by performing the following tasks:

• Specify the plug-in dependencies

• Verify the plug-in run-time archive

• Specify the plug-in extension

How to specify the plug-in dependencies

1 On PDE Manifest Editor, choose Overview.

2 In Plug-in Content, choose Dependencies.

3 In Required Plug-ins, choose Add.

4 In Plug-in Selection, select a plug-in, such as the following example, as shown in Figure 17-5:

Figure 17-5 Specifying a plug-in dependency

image

Choose OK.

5 Repeat steps 2 and 3 to add more plug-ins to the list of required plug-ins in the Dependencies page.

In Required Plug-ins, the order of the list determines the sequence in which a plug-in loads at run time. Use Up and Down to change the loading order.

Figure 17-6 shows an example of a list of dependencies for a plug-in extension.

Figure 17-6 Viewing plug-in dependencies

image

How to verify the plug-in run-time archive

1 On PDE Manifest Editor, choose Runtime. Runtime appears, as shown in Figure 17-7.

Figure 17-7 Specifying run-time visibility

image

2 In Runtime, perform the following tasks:

• In Exported Packages, list all the packages that the plug-in exposes to clients.

• In Package Visibility, when the plug-in is in strict run-time mode, indicate whether a selected package is visible to downstream plug-ins or hidden except for the specified plug-ins.

• In Classpath, choose Add to add the name of an archive file or folder to the classpath.

How to specify the plug-in extension

1 On PDE Manifest Editor, choose Extensions.

2 In All Extensions, choose Add. New Extension appears.

3 On Extension Point Selection, in Extension Points, select a plug-in, such as the one in the following example:

org.eclipse.birt.report.designer.ui.reportitemUI

New Extension appears, as shown in Figure 17-8.

Figure 17-8 Selecting an extension point

image

Choose Finish. Extensions appears, as shown in Figure 17-9.

Figure 17-9 Viewing extension point selections

image

Repeat steps 2 and 3 to add more plug-ins to the list of required extension points in the Extensions page.

Creating the plug-in extension content

The XML schema specifies a grammar to use when creating an extension in the Eclipse PDE. Selecting an extension element in the Extensions page, Eclipse uses the XML schema to populate the Extension Element Details section with a list of valid attributes and values for the element.

In Extensions, as shown in Figure 17-10, if you choose Find declaring extension point, the PDE searches for the extension point currently selected in All Extensions. If you choose Open extension point schema, the PDE opens the .exsd file that contains the XML schema definitions. If you choose Show extension point description, the PDE generates an HTML page containing the information documented in the XML schema and displays the page in a viewer.

Figure 17-10 Using Search to find a declaring extension point

image

This section discusses the following tasks:

• Searching for and viewing extension point information

• Specifying plug-in extension content

• Specifying a build configuration

How to search for and view extension point information

1 In the Eclipse PDE, select a plug-in extension in All Extensions, such as org.eclipse.birt.report.designer.ui.reportitemUI.

2 In Extension Details, choose Find declaring extension point. Search appears. As shown in Figure 17-10, Search lists one match, org.eclipse.birt.report.designer.ui.reportitemUI.

3 In Search, double-click the match. In PDE Manifest Editor, the contents of the file org.eclipse.birt.report.designer.ui/plugin.xml appear in a new window, as shown in Figure 17-11.

Figure 17-11 Plugin.xml showing extension points

image

Plugin.xml describes the extension points, odadatasource, reportItemUI, menuBuilders, elementAdapters, reportItemEditpart, and DNDServices.

4 In PDE Manifest Editor, close the window displaying contents of the plugin.xml file.

5 Choose Extensions. In Extension Details, choose Open extension point schema. The PDE Manifest Editor opens the Report Item UI Extension Point schema, as shown in Figure 17-12.

Figure 17-12 Viewing the extension point schema

image

The schema displays an abstract of the general information, schema inclusions, and documentation.

6 In Extension Details, choose Show extension point description. A viewer opens, displaying the HTML document for the extension point, as shown in Figure 17-13.

Figure 17-13 Viewing the extension point description

image

In the HTML document, Configuration Markup displays the attribute list for the extension point. Scroll down to view all the contents of the HTML document, including the optional set of user interface elements for the report item extension, such as builder, palette, editor, outline, and description.

How to specify plug-in extension content

1 In PDE Manifest Editor, choose Extensions.

2 In All Extensions, right-click an extension point, such as org.eclipse.birt.report.designer.ui.reportItemUI. Then, choose New→<extension point element>. The example in Figure 17-14 shows how to select the extension point element, reportItemLabelUI.

Figure 17-14 Selecting an extension point element

image

Extensions appears, displaying the extension element and its details, as shown in Figure 17-15.

Figure 17-15 Viewing the extension and extension element details

image

In this example, All Extensions lists the extension, org.eclipse.birt.sample.reportitem.rotatedlabel.RotatedLabelUI (rotatedItemLabelUI), and Extension Element Details lists rotatedItemLabelUI properties. In Extension Element Details, the label for a required attribute, such as class, contains an asterisk.

3 To view the annotation for a property listed in Extension Element Details, place the cursor over the property label.

A Tooltip appears, displaying the annotation for the property from the XML schema. Figure 17-16 shows the annotation for the class property for the example extension element, rotatedItemLabelUI.

Figure 17-16 Viewing the annotation for an extension element

image

4 To specify the class attributes for an extension element, choose class in Extension Element Details. If the class file exists, the class file opens in PDE Manifest Editor. If no class file exists, Java Attribute Editor appears, as shown in Figure 17-17.

Figure 17-17 Specifying a class in Java Attribute Editor

image

In Java Attribute Editor, you can modify or add to the settings for the following class properties:

• Source folder

• Package

• Enclosing type

• Class name

• Modifiers, such as public, default, private, protected, abstract, final, and static

• Superclass

• Interfaces

• Method stubs, such as main, constructors, and inherited abstract methods

• Comments

After modifying setting, choose Finish. To add more elements and attributes to a selected extension point, repeat steps 1 and 2.

Figure 17-18 shows the full list of extension points required for the sample report item extension, org.eclipse.birt.sample.reportitem.rotatedlabel.

Figure 17-18 Viewing all required extension points for an extension

image

Building a plug-in extension

In Eclipse PDE Manifest Editor, use Build to specify the build configuration, including the following items:

• Runtime Information

Defines the libraries, the source folders to compile into each library, and the compilation order.

• Binary Build

Selects the files and folders to include in the binary build.

• Source Build

Selects the files and folders to include in the source build. Source Build is not typically required. Source Build uses the org.eclipse.pde.core.source extension point that allows the PDE to find source archives for libraries in other Eclipse plug-ins.

How to specify a build configuration

1 In PDE Manifest Editor, choose Build. Build Configuration appears. Figure 17-19 shows Build Configuration.

Figure 17-19 Build Configuration

image

2 In Runtime Information, choose Add Library. Add Entry appears.

3 In Add Entry, type the new library name, as shown in Figure 17-20, or select a run-time library name from the list.

Figure 17-20 Adding a library name

image

Choose OK. The new library name appears in Runtime Information.

4 To change the compilation order of a library, change its position in the list. In Runtime Information, select the library. Then, choose Up or Down. The example in Figure 17-21 shows mylibrary.jar selected and Down enabled.

Figure 17-21 Changing the compilation order of a library

image

5 To add a folder to a library, choose Add Folder.

6 In New Source Folder Select a folder such as src, as shown in Figure 17-22.

Figure 17-22 Specifying a new source folder

image

Choose OK. Runtime Information appears, as shown in Figure 17-23.

Figure 17-23 Viewing Runtime Information

image

7 In Binary Build, include a folder in the binary build by selecting the folder. Figure 17-24 shows the icons folder selected.

Figure 17-24 Including a folder in Binary Build

image

8 From the Eclipse menu, choose Project→Build All, to build a project.

Alternatively, you can choose Project→Build Automatically to build the project continuously as you make changes to the code.

Generating an Ant build script

The Eclipse PDE can generate an Ant build script to compile plug-in code, based on the settings in the build.properties file. The generated script is an XML file in which the elements are the required tasks for the build operation. The Ant build tool compiles the project, using the specified Java compiler.

How to generate an Ant build script

In Package Explorer, right-click the project’s plugin.xml file and choose PDE Tools→Create Ant Build File. PDE Tools creates an Ant script file, build.xml, in the project folder.

Testing a plug-in extension

You can launch an instance of the run-time workbench to test and debug the plug-in extension.

How to launch a run-time workbench

1 On PDE Manifest Editor, choose Overview. Overview appears as shown in Figure 17-25.

Figure 17-25 Viewing Overview showing testing and debugging options

image

2 In Testing, choose Launch an Eclipse application. Eclipse launches the run-time workbench.

In the report item extension example, Report Design—Eclipse SDK appears. In the run-time workbench, create a new report design project to use the report label extension.

Deploying the extension plug-in

In the PDE, a plug-in developer can use the Export Wizard to produce a distributable archive file that contains the plug-in code and other resources. A plug-in developer can create and manage an update site using the Update Site Editor in the Eclipse PDE. A user can find software and extract the contents of the archive file to an Eclipse installation using the install new software or update configuration managers.

How to deploy a plug-in extension

1 In the Eclipse PDE Manifest Editor, choose Overview.

2 In Exporting, choose Export Wizard. Export appears.

3 In Available Plug-ins and Fragments, select the plug-in to export. For example, select org.eclipse.birt.sample.reportitem.rotatedlabel.

4 In Export Destination, specify Archive file or Directory. For example, in Directory, type:

C:irt-runtime-2_6_0ReportEngineplugins

Export appears as shown in Figure 17-26.

Figure 17-26 Exporting a plug-in

image

5 In Export Options, select one of the following options, if necessary:

• Include source code

• Package plug-ins as individual JAR archives

• Save as Ant script

Choose Finish to export the plug-in to the specified destination.

Creating an update site project

A plug-in developer can also use a more structured approach and group plug-ins into features. Features contain information that enables the install new software or update configuration managers to locate published updates and discover new related features. Updates are typically published in a special internet directory called an update site, created and managed by a plug-in developer using the Update Site Editor.

A plug-in developer can create an update site by building an update site project in the Eclipse PDE workspace. The update site project contains a manifest file, site.xml, that lists the features and plug-ins packages.

The build operation for an update site puts the JAR files for features in a features folder and the JAR files for plug-ins in a plug-ins folder. The Eclipse PDE also provides support for uploading an update site to a remote server or local file system for distribution.

How to create an update site project

1 From the Eclipse menu, choose File→New→Project. New Project appears.

2 In Wizards, open Plug-in Development and select Update Site Project, as shown in Figure 17-27. Choose Next.

Figure 17-27 Selecting Update Site Project wizard

image

3 In Update Site Project, specify the following items:

• Project name

• Project contents directory, such as C:/birt-runtime-2_6_0 BIRT Update Site

• Web resources

• Select the option Generate web page listing of all available features within the site.

Creates index.html, site.css, and site.xls files to display the contents of the update site.

• Web resources location.

Change this setting to the web resources location. The default value is web.

Update Site Project appears as shown in Figure 17-28. Choose Finish.

Figure 17-28 Creating a new update site project

image

Update Site Map appears as shown in Figure 17-29.

Figure 17-29 Update Site Map

image

4 Choose New Category to create a feature category.

5 Choose Add Feature to add a feature to a selected category.

Installing available software

If all the dependent resources are available in the new environment, Eclipse can discover and activate the plug-in in the run-time environment. In an unmanaged distribution and installation, the user must find and install updates to the plug-in if a release occurs in the future.

Choose Help→ Install New Software to access available software. Install Software supports searching available sites for updates and new features, as shown in Figure 17-30.

Figure 17-30 Installing new software

image

Downloading the code for the extension examples

This book provides examples for the following types of BIRT extensions:

• Advanced report item

The example demonstrates how to develop additional user interface features for a custom, rotated report item. The example shows how to implement a report item builder, a context menu, a custom property page, and data binding.

• ODA drivers

The CSV ODA driver example is a plug-in that reads data from a CSV file. The Hibernate ODA driver example uses HQL (Hibernate Query Language) to provide a SQL-transparent extension that makes the ODA extension portable to all relational databases.

These examples also show how to develop an ODA extension to the BIRT Report Designer 2.6 user interface so that a report developer can select an extended ODA driver.

• Plug-in fragment

The plug-in fragment example adds Spanish and Japanese localization features for the BIRT Report Viewer to an existing plug-in.

• Report item

The example shows how to build a rotated label report item plug-in and add the report item to the BIRT Report Designer using the defined extension points. This plug-in renders the label of a report item as an image. The extension rotates the image in a report design to display the label at a specified angle.

• Report rendering

The examples show how to extend the emitter interfaces to build and deploy a report rendering plug-in that runs in the BIRT Report Engine environment. The CSV (Comma Separated Values) extension example is a plug-in that writes the table data in a report to a file in CSV format. The XML extension example is a plug-in that writes the table data in a report to a file in XML format.

You can download the source code for these extension examples at http://www.actuate.com/birt/contributions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset