| [birt-charting-dev] RE: [birt-dev] BPS 66 - Chart Simple API SPEC.pdf |
|
Wei,
The script engine API is in the report engine plugin, so I wonder why we need the extension point in the model plugin? The goal of this project is to provide a integrated and simple api for chart like the script engine API. The package name of that API isorg.eclipse.birt.report.engine.api.script
The extension point is needed to be able to instantiate the IChart when you call IReportDesign.getReportElement("chart name"); Since the implementation class of IReportDesign is done through ElementUtil.getElement(), which is also in the report engine, you need to instantiate the interface implementation from there (in the report engine), so it makes sense to have the extension in the engine, rather than the model. You can just add a case there for extended items, load the extension with the matching id, and create the class from the extension. I don't think the model will have any use for that extension, since it's a script engine api interface.
This API is not intended to be used in the Chart API standalone. The main reason is the integration with the scripting api (there is a dependency on the report script API, due to the extended interface) . That way, there will be a single API for accessing both report and chart elements, and report users won't need to learn a different API when using charts in a report. We do not want to add another API for standalone chart API users, which would be just confusing. We are looking in making the latter easier to use, but that's unrelated.
Thanks,
David
From: Wei Yan
The APIs can be used in two different cases:
The user has got the report handle somewhere. The user gets the IChart though the MODEL’s script API. The user changes the IChart through CHART API. The user saves the change the report design or uses it in somewhere else.
In this case, the CHART instance is created through MODEL API (such as getReportElement(“Chart”)).
1. onPrepare User can define this script used to change the chart definition before execution. 2. onCreate User can define this script used to change the content created by the chart, the changing will be serialized into the report document. 3. onRender User can define this script used to change the content before the rendering. The changed content will be rendered immediately. 4. onPageBreak The script is called when there exits a page-break. The behavior is undefined now. In this case, the report engine should create the CHART Script instance (IChart) and evaluates the script. This spec only defines the CHART APIs used in onPrepare. The onCreate/onRender is not defined here.
It seems that:
-Wei Yan
From:
birt-dev-bounces@xxxxxxxxxxx [mailto:birt-dev-bounces@xxxxxxxxxxx] On Behalf
Of David Michonneau
Hi All,
Here is the specification document for the Chart Simple API project. Its goal is to provide a simple API to modify charts inside a report design through the BIRT Report Engine Scripting API. Note that there is a new extension point in the engine plugin for extended items to extend the engine’s IReportItem interface.
You can also find this document on the wiki at http://wiki.eclipse.org/index.php/BPS66
Thanks,
David |