On Thu, Feb 5, 2009 at 14:34, Dan Miron <[email protected]> wrote:
Hi guys, In order to implement the chart macro (http://jira.xwiki.org/jira/browse/XWIKI-2883) , i propose the following:
- Create a new TableBlockDataSource which implements the com.xpn.xwiki.plugin.charts.source.DataSource and which will take data from a table contained within a Wiki2.0 document. - Use the existing ChartPlugin for aquiring this new data source and generate the graph.
IMO macro should not use old api/plugins, if a chart component is needed that the chart macro would used we should create it. In a general manner I are trying to never use anything from pmd xxwiki-core in component but translate and redesign useful xwiki-core code into new components (like observationmanager, the rendering it self, etc.).
This new datasource, in order to be compatible with the chartPlugin, gets its parameters via a Map<String, String>. So I'm thinking of passing the current document and the table number as strings encoded in such a Map and then, in the datasource parsing the document and getting its DOM tree and then extracting the data from it.
What do you think about this approach?
Tnx, Dan
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne