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.
The 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_DIR\eclipse\plugins\org.eclipse.birt.report.designer.ui
\schema\reportitemUI.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 text 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.
A convenient way to examine an extension schema is with the Schema HTML Viewer, as shown in Figure 22‑6.
Figure 22‑6 Viewing a schema
Listing 22‑1 is a partial schema example showing reportitemUI.exsd. The ellipses (…) mark the places in the code where lines are omitted.
Listing 22‑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">
<annotation>
<appinfo>
<meta.element />
</appinfo>
</annotation>
<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>