Bug 56023 - [PATCH] Include cell comments in XSSFEventBasedExcelExtractor output
Summary: [PATCH] Include cell comments in XSSFEventBasedExcelExtractor output
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.10-dev
Hardware: Macintosh All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2014-01-17 05:06 UTC by Shaun Kalley
Modified: 2014-07-30 07:44 UTC (History)
0 users



Attachments
diff for this patch (10.94 KB, text/plain)
2014-01-17 05:06 UTC, Shaun Kalley
Details
test file to go in test-data/spreadsheet (28.46 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2014-01-17 05:07 UTC, Shaun Kalley
Details
diff for this patch (revised) (9.19 KB, text/plain)
2014-01-17 17:43 UTC, Shaun Kalley
Details
test file to go in test-data/spreadsheet (35.84 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2014-01-20 21:25 UTC, Shaun Kalley
Details
diff for this patch (31.58 KB, text/plain)
2014-01-20 21:26 UTC, Shaun Kalley
Details
updated diff for this patch as requested (20.00 KB, patch)
2014-03-10 18:00 UTC, Shaun Kalley
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Shaun Kalley 2014-01-17 05:06:59 UTC
Created attachment 31219 [details]
diff for this patch

This patch includes cell comments in the extracted text in the same format as for XSSFExcelExtractor.
Comment 1 Shaun Kalley 2014-01-17 05:07:55 UTC
Created attachment 31220 [details]
test file to go in test-data/spreadsheet
Comment 2 Shaun Kalley 2014-01-17 17:43:14 UTC
Created attachment 31225 [details]
diff for this patch (revised)

I had made an addition to XSSFReader to get the CommentsTable which turned out to be unnecessary as it was already available through the SheetIterator.
Comment 3 Shaun Kalley 2014-01-20 21:25:17 UTC
Created attachment 31243 [details]
test file to go in test-data/spreadsheet
Comment 4 Shaun Kalley 2014-01-20 21:26:29 UTC
Created attachment 31244 [details]
diff for this patch

This diff is built upon the diffs for https://issues.apache.org/bugzilla/show_bug.cgi?id=56011 and https://issues.apache.org/bugzilla/show_bug.cgi?id=56022 as the code overlaps.
Comment 5 Shaun Kalley 2014-01-20 21:29:45 UTC
This patch adds functionality to include comments in XSSFEventBasedExcelExtractor's output.  It goes beyond parity with XSSFExcelExtractor in that it (1) included comments from otherwise-empty cells, and (2) doesn't duplicate the author's name in the output.

This patch also includes a fix to the broken equals() method of CellReference as well as adding hashCode().
Comment 6 Nick Burch 2014-03-09 09:53:32 UTC
I've had a look at the patch, and it looks good to me, thanks for that!

However... when I try to apply it to trunk, it doesn't go on cleanly. Any chance you could bring your working copy up to trunk, then let us have an updated version to apply?

(I've applied the CellReference fix in r1575683)
Comment 7 Shaun Kalley 2014-03-10 17:59:19 UTC
Thanks for your effort on this!  I've generated an updated diff based on the current trunk.
Comment 8 Shaun Kalley 2014-03-10 18:00:44 UTC
Created attachment 31378 [details]
updated diff for this patch as requested
Comment 9 Nick Burch 2014-07-24 20:14:51 UTC
Applied (with some changes) in r1613266.

I'm a little worried about backwards compatibility though - anyone who currently implements SheetContentsHandler will suddenly find their code won't compile / run on 3.11

What do you think about us adding a second interface for people who want comments, to maintain backwards compatibility? 

(We need to decide ASAP, before 3.11 beta 1 gets released)
Comment 10 Nick Burch 2014-07-30 07:44:03 UTC
In r1614576 I've tweaked the changes to XSSFSheetXMLHandler.SheetContentsHandler, to require fewer backwards incompatible changes for those upgrading

Given that, I think we can close this now. Thanks for the contribution!