Bug 48574 - Extention of XWPF to insert paragraphs and tables form different Documents in one Document.
Summary: Extention of XWPF to insert paragraphs and tables form different Documents in...
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: 3.7-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
Depends on:
Reported: 2010-01-19 08:16 UTC by Philipp.Epp
Modified: 2016-06-13 06:07 UTC (History)
0 users

Extensions of XWPF to insert tables, paragraphs with pictures, styles and numberings (166.71 KB, application/octet-stream)
2010-01-19 08:16 UTC, Philipp.Epp
Test-Data of the test cases in the previous patch (125.06 KB, application/octet-stream)
2010-01-19 08:18 UTC, Philipp.Epp

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp.Epp 2010-01-19 08:16:46 UTC
Created attachment 24861 [details]
Extensions of XWPF to insert tables, paragraphs with pictures, styles and numberings

Actually I have to problem, with adding tables and paragraphs to a document. For example if I have three paragraphs between two tables I am only able to insert a table between these two tables. But I cannot position the table excatly after the first of the three paragraphs. Initially I tried to handle this problem with XmlCursors, but debugging an XmlCursor is not a very funny.  So I decided to create a marker Interface IBodyElement, which is implemented by XWPFParagraph and XWPFTable (Yes I call them BodyElements). On the other Hand I created the Interface IBody which is implemented by all Classes, who owns arrays with tables and paragraphs. (Actually this are the classes XWPFDocument, XWPFTableCell, XWPFHeaderFooter). In IBody there a some signature of methods which are handling the operations with XWPFTable and XWPFParagraph in a Body.
To support styles and numberings  the classes XWPFStyles, XWPFStyle, XWPFNumbering, XWPFNum, XWPFAbstractNum are added. The classes XWPFPictureData and XWPFPicture were created to support pictures. This classes are quit equal to XSSFPictureData and XSSFPicture. 

Hope you like my changes. :-)
Philipp Epp
Comment 1 Philipp.Epp 2010-01-19 08:18:53 UTC
Created attachment 24862 [details]
Test-Data of the test cases in the previous patch

this test-data must be added to Test-Data/documents/
Comment 2 Stefan Stern 2010-03-15 10:25:09 UTC
Hello all

Maybe someone can look into this. The attached patch contains a major contribution to the XWPF classes. The new classes and methods allow the modification of existing objects to some extent. 

If you need more information on the classes, the API or anything else, please let us know. 

The classes were created in terms of a diploma thesis and we internally use them. For now we merge ongoing POI commits with this patch, until either POI accepts the commit or comes up with some other API which provides equal modification options.

Stefan Stern
Comment 3 Philipp.Epp 2010-04-12 03:02:44 UTC
Hi at all,
Could somebody tell me what I did wrong with this patch? Is there any chance that it will be accepted like it is. Or do have to change it. (splitting it into smaller patches or changing the API). So that at least some parts of my patch will find a way into Apache POI.
Thank for your response
Philipp Epp
Comment 4 Nick Burch 2010-06-11 10:40:40 UTC
Thanks for this patch, applied to trunk in r953704 with only minor tweaks.

In future though, it's generally worth mentioning on the dev list when you're working on big contributions like this. That should allow you to get feedback, and give us a heads-up on the impending patch. This generally reduces the chances that everyone sees a monster patch and decides "I don't have time to review that now, I'll wait for someone else"...

Also, any chance you could send in an ICLA at some point when you have a minute? <http://www.apache.org/licenses/icla.txt>. Can just be emailed or faxed. It confirms that you understand the terms of the apache license that your contribution will be used under, and we like to have them from people who make large scale contributions so there's no confusion, and everyone's happy :)
Comment 5 Javen O'Neal 2016-06-13 04:59:26 UTC

Your patch included the following:
> +public class XWPFLatentStyles {
> +	private CTLatentStyles latentStyles;
> +	protected XWPFStyles styles; //LatentStyle shall know styles

Your patch didn't include a LatentStyle class. After 6 years, do you remember what LatentStyle was referring to?
Comment 6 Philipp.Epp 2016-06-13 06:07:46 UTC
Yes you're right. After 6 years I really do not know something about XWPF anymore. Sorry. Everything is gone.