Dan Miron 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.
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.
Actually, I discovered that the parameters map is untyped, so instead of
passing the document name, we could pass the XDom tree, so to avoid
parsing twice the same document.
What do you think about this approach?
Tnx,
Dan
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs