Bug 45018 - [PATCH] Patch to fetch embedded documents from OOXML files
Summary: [PATCH] Patch to fetch embedded documents from OOXML files
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.0-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-16 06:53 UTC by Yury Batrakov
Modified: 2008-05-28 08:44 UTC (History)
0 users



Attachments
patch file (2.92 KB, patch)
2008-05-16 06:53 UTC, Yury Batrakov
Details | Diff
OOXML word file with attachments (133.18 KB, application/octet-stream)
2008-05-26 04:29 UTC, Yury Batrakov
Details
OOXML Excel file with attachments (31.53 KB, application/octet-stream)
2008-05-26 04:30 UTC, Yury Batrakov
Details
OOXML PPoint file with attachments (100.15 KB, application/octet-stream)
2008-05-26 04:31 UTC, Yury Batrakov
Details
updated word file (141.56 KB, application/octet-stream)
2008-05-27 09:32 UTC, Yury Batrakov
Details
updated patch file (7.36 KB, patch)
2008-05-27 09:32 UTC, Yury Batrakov
Details | Diff
updated excel file (61.18 KB, application/octet-stream)
2008-05-27 09:33 UTC, Yury Batrakov
Details
updated ppt file (229.80 KB, application/octet-stream)
2008-05-27 09:34 UTC, Yury Batrakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Batrakov 2008-05-16 06:53:58 UTC
Created attachment 21975 [details]
patch file

This patch provides an ability to fetch files embedded in OOXML package.
Comment 1 Nick Burch 2008-05-23 08:05:10 UTC
Thanks for this, applied to the branch

Any chance you could upload an OOXML file that contains an embeded document? That way, we'll be able to write a test to ensure it's all working properly.

(I'm leaving the bug open for now, until we get the file)
Comment 2 Yury Batrakov 2008-05-26 04:29:25 UTC
Created attachment 22003 [details]
OOXML word file with attachments
Comment 3 Yury Batrakov 2008-05-26 04:30:31 UTC
Created attachment 22004 [details]
OOXML Excel file with attachments
Comment 4 Yury Batrakov 2008-05-26 04:31:00 UTC
Created attachment 22005 [details]
OOXML PPoint file with attachments
Comment 5 Yury Batrakov 2008-05-26 04:32:11 UTC
I attached word, excel and ppoint files, once i get Visio 2007, I'll upload OOXML visio as well
Comment 6 Nick Burch 2008-05-27 05:36:09 UTC
Thanks for these files, I've added them to svn

One thing though - only the word file was coming up with attachments using your patch. Is that expected?

(Test is src/ooxml/testcases/org/apache/poi/TestEmbeded.java in the ooxml branch)
Comment 7 Yury Batrakov 2008-05-27 05:39:00 UTC
hmm, I'll have a look at that
Comment 8 Yury Batrakov 2008-05-27 06:13:20 UTC
oops, my fault. excel and powerpoint don't store OLE objects' relations in core part as word does. If noone minds me implementing this, I'll fix that
Comment 9 Nick Burch 2008-05-27 06:14:42 UTC
Go for it!
Comment 10 Yury Batrakov 2008-05-27 09:27:56 UTC
Here I am with the changes:
1. The issue was fixed
2. Also I found out that MS Office has different types for embedded OOXML files and other files. This was took into account: test documents was updated with OOXML attachments (attached) and expected file counts in test were incremented.
3. Extensions .xlsx and .pptx for test files are incorrect - looks like MSOffice chooses them for sheets and slides, but not for workbooks and presentation. Only when I changed them to xlsm and pptm, word started opening them without error messages. I changed them in test, Nick, could you also upload new files and delete old ones?
Comment 11 Yury Batrakov 2008-05-27 09:32:12 UTC
Created attachment 22012 [details]
updated word file
Comment 12 Yury Batrakov 2008-05-27 09:32:57 UTC
Created attachment 22013 [details]
updated patch file
Comment 13 Yury Batrakov 2008-05-27 09:33:33 UTC
Created attachment 22014 [details]
updated excel file
Comment 14 Yury Batrakov 2008-05-27 09:34:06 UTC
Created attachment 22015 [details]
updated ppt file
Comment 15 Yury Batrakov 2008-05-27 09:36:09 UTC
please read "could you also upload new files" as "could you also check in new files to SVN"
Comment 16 Nick Burch 2008-05-28 06:32:12 UTC
New batch committed to svn, thanks for the quick update

Hopefully you now see why we're so keen on unit tests :)
Comment 17 Yury Batrakov 2008-05-28 08:44:09 UTC
yes, i do see. that was caused by rush i was in finishing my application at my work. in future i promise to test my changes more carefully and write junit tests also :)