# Extended Item Presentation-Time Support

###### Identifier:

org.eclipse.birt.report.engine.reportitempresentation

###### Since:

1.0

###### Description:

This extension point specifies how the new report item should be instantiated, processed, and rendered at presentation (rendering) time. In a server environment, the plugin registry uses this extension point registration to discover supported report item extensions.

###### Configuration Markup:

<!ELEMENT extension (reportItem+)>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED

>

- point - a fully qualified identifier of the target extension point
- id - an optional identifier of the extension instance
- name - an optional name of the extension instance

<!ELEMENT reportItem EMPTY>

<!ATTLIST reportItem

name CDATA #REQUIRED

class CDATA #REQUIRED

supportedFormats CDATA #IMPLIED

>

- name - the unique name of the extended item, i.e., "org.eclipse.birt.chart" for BIRT supplied chart extension.
- class - the java class that implements the `IReportItemPresentation`
- supportedFormats - The supported rendering formats for this extended item. The value for this attribute is a comma-separated string, i.e., "HTML,PDF,EXCEL', etc. The string is case-insensitive.

###### Examples:

The following is a sample usage of the reportItemPresentation extension point:

    <extension point="org.eclipse.birt.report.engine.reportitempresentation"
    name="chart presentation extension">
      <reportItem name="org.eclipse.birt.chart" class="org.eclipse.birt.report.chartitem.ChartPresentation"
      supportedFormats="FO,HTML,PDF"/>
     </extension>

###### API Information:

The value of the class attribute must be the fully qualified name of a class that implements `org.eclipse.birt.engine.extension.IReportItemPresentation`. The interface provides the following functions:

- `public void setModelObject(ExtendedItemHandle handle)` ---- passes the model object to the extension provider.
- `public void setResolution(int dpi)` ---- passes the rendering environment resolution (dpi, i.e., dot per inch) to extension provider.
- `public void setOutputFormat(String outputFormat)` ---- passes the output format, i.e., HTMl, PDF, etc. to extension provider.
- `public void setSupportedImageFormats(String supportedImageFormats)` ---- passes the supported image formats in the rendering environments to the extension provider. Image formats are separated by semi-colon. For example, the argument could be JPG;PNG;BMP;SVG
- `public void setLocale(Locale locale)` ---- passes the rendering locale to the extension provider.
- `public Object onRowSets(IRowSet[] rowSets) throws BirtException` ---- processes the extended item in report presentation environment. The data that the report item needs is passed in through the rowSets array. The return value captures the presentation time output of the report item, and differs for different rendering primitives.
- `public void deserialize(InputStream istream)` ---- deserializes the report item generation time state
- `public int getOutputType(String mimeType)` ---- returns the output type, which could be one of the supported primitive, i.e., image, string, html segment, etc.
- `public void Size getSize()` ---- gets the size of the extended item. The size is a Dimension object. The width and height can only be in absolute units (inch, mm, etc.) or pixel. It can not be a relative size such as 150% or 1.2em. An extended item can obtain its design-time size information by querying DE. This function is needed because the actual size may not be the same as the design-time size.
- `public void finish()` ---- performs cleanup jobs

###### Supplied Implementation:

Chart as an extended item

Copyright (c) 2005 Actuate Corporation. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-2.0.html
Contributors: Actuate Corporation - initial API and implementation