Atlassian JIRA   History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: XRP-125
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Reporter: Evert De Rammelaere
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
xReporter

Processing of ResultSet (before XML generation)

Created: 26/Jul/07 06:58 AM   Updated: 02/Oct/07 11:01 AM
Component/s: xReporter
Affects Version/s: 1.3
Fix Version/s: 1.3

File Attachments: 1. PDF File Use case - period merge.pdf (18 kb)



 Description   
Our company has a few use cases which require the possibility to do some processing of the final ResultSet based upon actions from the user. We could do this processing step in several ways. XReporter could for instance generate its XML after which we could add some SaxStreamers before sending the results to the frontend. However this would be a havy duty for the programmer of such a SaxStreamer. There was also the idea of allowing one filter who would get the resultset and then stream XML. But after some discussion with Marc we came up with the idea of a ResultSetStreamer. While iterating the ResultSet we could insert our own streamers and at the end of this pipeline an XReporter serializer would generate the XML.

This proposed solution would have implications for all reports. A normal report would then become a report without any ResultSetStreamer's. So the pipeline concept would be the general way of doing things in XReporter and it would be up to the report designer to use this feature or not.

By using the streamer concept we also keep the memory footprint small.

The use case that brought up this issue will be soon included as attachment... This will make the needs more clear and show how ResultSetStreamer's can solve it in a generic way.

 All   Comments   Change History      Sort Order:
Comment by Evert De Rammelaere [26/Jul/07 06:59 AM]
The ResultSetStreamer will need to have access to parameters, its own configuration and to the actions of the user (selected columns, etc.)

Comment by Evert De Rammelaere [08/Aug/07 01:51 AM]
I have included the period merge use case as attachment.

Comment by Bruno Dumon [24/Sep/07 08:56 AM]
Implemented in SVN rev 756.

Some docs see http://cocoondev.org/xreporter/docs/core/reports.html#dsy86-cd_row_handlers

I have made a sample implementation of the period merger, and a sample report using the data provided in the use case. See the report 'residency.xml' in the the testconf.

Comment by Evert De Rammelaere [26/Sep/07 03:30 AM]
Bruno, I took a quick tour through the implementation and it looks at first sight what we need. Bravo! The PeriodMerger itself isn't finished since there should be 0..* sum columns, but the most important issue is that the mechanism of ResultSetStreamers (or row-handlers as it has been named) is implemented.

Just a remark however. I think a row-handler should have access to ALL columns selected from the database and not just the columns the user selected. Of course, this implies a row-handler having access to information on whether a column is selected by the user. I have a use case at hand where this would be a nice (necessary) improvement. Just think of a kind of head count on all people of department where the individual employees aren't in the output. The employees can have 1..* contracts in 1..* departments. Here I would want the row-handler to have access to the id's of those employees.

Comment by Bruno Dumon [26/Sep/07 04:47 AM]
Thanks for the quick feed back.

I committed some changes in SVN rev 771, the list of all ColumnDefinition's is now available via the OutputContext, the data of all these columns can be retrieved via the RowValues object.

Comment by Evert De Rammelaere [26/Sep/07 06:06 AM]
The PeriodMerger will need another patch to ignore the non-visual columns.

Comment by Bruno Dumon [26/Sep/07 09:59 AM]
Unless I'm overlooking something, I think it is ok like it is.

However, there is probably some confusion from the difference between:

- the Column[] array, which is the array of visible columns
- the ColumnDefinition[] array, which is the array of all columns

Since you don't really need the Column objects (all we ever do is Column.getColumnDefinition()), I have now simplified things: both for selected and all columns, the array of ColumnDefinition objects is provided, and the methods to retrieve them on OutputContext have better names now.

In case there's nonetheless an error, please correct me.

Comment by Evert De Rammelaere [27/Sep/07 01:23 AM]
OK, you were right. But it was a little confusing as you agreed with...

Comment by Evert De Rammelaere [02/Oct/07 11:01 AM]
One hopefully final remark on this matter... As I had noted before a row-handler works best under the condition of a certain ordering of the initial ResultSet. I would want to be able to check that ordering and implement then a failover when the user messed up the ordering. So I would like to have access to that user modified ordering. I am not sure whether this requires new instruments out of the xreporter box. What is your opinion on this? Maybe a small example can clarify how to handle this...