Interface IReportItemPresentation
public interface IReportItemPresentation
Represents the extended item presentation time extension.
The calling sequence in presentation engine might work as follows:
Design engine creates a new instance of the extended item.
Presentation engine detects that the element is an extended item. It
dynamically creates an object with type IReportItemPresentation.
The presentation engine calls various setXXX methods to pass
initialization parameters to the extension implementation.
deserialize method restores the generation time state
Render the extended item through onRowSets method, handled the returned
image
Call finish() for cleanup.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deserialize
(InputStream istream) deserializes generation time state information about the extended itemvoid
finish()
Performs clean up workint
returns the output type, which could be IMAGE, TEXT, HTML TEXT, DRAWING, etc.org.eclipse.birt.report.engine.extension.Size
getSize()
Get the size of the extended item.void
boolean
Check if can support cache in current situation.onRowSets
(IBaseResultSet[] results) Process the extended item.Deprecated.since BIRT 2.3void
Deprecated.implement #init(IReportItemPresentationInfo) instead.void
setApplicationClassLoader
(ClassLoader loader) Deprecated.implement #init(IReportItemPresentationInfo) instead.void
setDynamicStyle
(IStyle style) Deprecated.implement #init(IReportItemPresentationInfo) instead.void
setExtendedItemContent
(IContent content) Deprecated.implement #init(IReportItemPresentationInfo) instead.void
Deprecated.implement #init(IReportItemPresentationInfo) instead.void
setModelObject
(org.eclipse.birt.report.model.api.ExtendedItemHandle modelHandle) Deprecated.implement #init(IReportItemPresentationInfo) insteadvoid
setOutputFormat
(String outputFormat) Deprecated.implement #init(IReportItemPresentationInfo) instead.void
setReportQueries
(org.eclipse.birt.data.engine.api.IDataQueryDefinition[] queries) Deprecated.implement #init(IReportItemPresentationInfo) instead.void
setResolution
(int dpi) Deprecated.implement #init(IReportItemPresentationInfo) instead.void
setScriptContext
(org.eclipse.birt.report.engine.api.script.IReportContext context) Deprecated.implement #init(IReportItemPresentationInfo) instead.void
setSupportedImageFormats
(String supportedImageFormats) Deprecated.implement #init(IReportItemPresentationInfo) instead.
-
Field Details
-
OUTPUT_NONE
static final int OUTPUT_NONE- See Also:
-
OUTPUT_AS_IMAGE
static final int OUTPUT_AS_IMAGE- See Also:
-
OUTPUT_AS_TEXT
static final int OUTPUT_AS_TEXT- See Also:
-
OUTPUT_AS_HTML_TEXT
static final int OUTPUT_AS_HTML_TEXT- See Also:
-
OUTPUT_AS_DRAWING
static final int OUTPUT_AS_DRAWING- See Also:
-
OUTPUT_AS_CUSTOM
static final int OUTPUT_AS_CUSTOM- See Also:
-
OUTPUT_AS_IMAGE_WITH_MAP
static final int OUTPUT_AS_IMAGE_WITH_MAP- See Also:
-
OUTPUT_AS_UNKNOWN
static final int OUTPUT_AS_UNKNOWN- See Also:
-
-
Method Details
-
init
- Parameters:
info
- Presentation info of report item- Since:
- BIRT 2.3
-
setModelObject
Deprecated.implement #init(IReportItemPresentationInfo) insteadpasses a handle to the extended report item model to the extension- Parameters:
modelHandle
- a handle to the extended item model object
-
setApplicationClassLoader
Deprecated.implement #init(IReportItemPresentationInfo) instead.passes the class loader used to load user defined classes.- Parameters:
loader
- class loader used to load the classes
-
setScriptContext
Deprecated.implement #init(IReportItemPresentationInfo) instead.pass the script context to the report item.- Parameters:
context
- report context used by java-based script
-
setReportQueries
Deprecated.implement #init(IReportItemPresentationInfo) instead. pass the prepared query definition to extended item implementation, so that it can access data. -
setLocale
Deprecated.implement #init(IReportItemPresentationInfo) instead.passes the locale used in the presentation.- Parameters:
locale
- locale
-
setResolution
Deprecated.implement #init(IReportItemPresentationInfo) instead.passes the dpi (dot per inch) from the rendering environment to the extension. Mostly used for printing.- Parameters:
dpi
- the dpi of the rendering environment
-
setOutputFormat
Deprecated.implement #init(IReportItemPresentationInfo) instead.sets the output format, i.e., HTML, PDF, etc.- Parameters:
outputFormat
- the output format, i.e., html, pdf, etc.
-
setActionHandler
Deprecated.implement #init(IReportItemPresentationInfo) instead.- Parameters:
ah
- the HTML action handler used to create a URL based on an action
-
getImageMIMEType
String getImageMIMEType()- Returns:
- the image MIME type (e.g. "image/svg+xml")
-
setSupportedImageFormats
Deprecated.implement #init(IReportItemPresentationInfo) instead.sets the image formats that are supported for this output format. Formats are separated by semi-colon. For example, the argument could be JPG;PNG;BMP;SVG- Parameters:
supportedImageFormats
- the image formats that the presentation engine could support.
-
deserialize
deserializes generation time state information about the extended item- Parameters:
istream
- the input stream to deserialize generation time state from
-
getOutputType
int getOutputType()returns the output type, which could be IMAGE, TEXT, HTML TEXT, DRAWING, etc. For now, only Image is supported.- Parameters:
mimeType
- an out parameter that returns the MIME type of the output- Returns:
- output type, for now OUTPUT_AS_IMAGE only
-
onRowSets
@Deprecated Object onRowSets(IRowSet[] rowSets) throws org.eclipse.birt.core.exception.BirtException Deprecated.since BIRT 2.3processes the extended item in report presentation environment.- Parameters:
rowSets
- rowSets an array of row sets that is passed to the extension- Returns:
- the returned value could be different depending on the type of the output. For image, returns an input stream or byte array that the engine could retrieve data from
- Throws:
org.eclipse.birt.core.exception.BirtException
- throws exception when there is a problem processing the extended item
-
onRowSets
Process the extended item. It is called in render time.- Parameters:
results
- results is an array of query results which is passed to the extended item. The extended item could retrieve data from those results.- Returns:
- The returned value could be different depending on the type of the output. For image, returns an input stream or byte array.
- Throws:
org.eclipse.birt.core.exception.BirtException
- Throws exception when there is a problem processing the extended item
-
getSize
org.eclipse.birt.report.engine.extension.Size getSize()Get 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. Notice that 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.- Returns:
- the size of the extended item. Return null if the size does not matter or can not be determined.
-
finish
void finish()Performs clean up work -
setDynamicStyle
Deprecated.implement #init(IReportItemPresentationInfo) instead. Set dynamic style. -
setExtendedItemContent
Deprecated.implement #init(IReportItemPresentationInfo) instead.Set the content which is transformed from extended item. Extended item can process some properties itself, such as bookmark, style etc.- Parameters:
content
- content which is transformed from extended item.
-
getPresentationConfig
IReportItemPresentationInfo getPresentationConfig() -
isCacheable
boolean isCacheable()Check if can support cache in current situation. For example, the chart image is can't cached when export to some format and some property of chart is changed(e.g. by script), such as height, width etc.- Returns:
- true if can support cache, otherwise false
-