You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Stefan Stern <st...@mind8.com> on 2009/08/06 10:59:14 UTC

Issue in POIXMLDocumentPart with PPTX

Hello devs

While building the PPTX according to your code in XSSF and XWPT, I 
stumbled accross a problem with the recursive loading in the 
POIXMLDocumentPart.

While Word and Spreadsheet do not have any loops in their relations, 
Powerpoint defines a lot of vice-versa relationships. Example: the 
SlideMaster has relations to its SlideLayouts, while the SlideLayouts 
have a relation to their SlideMaster. The POIXMLDocument.read 
implementation in beta6 says: go and load your stuff (with the factory), 
then check your relations. If you have any, go down and load them too. 
As PPTX defines SlideMaster and SlideLayout , which reference each 
other, this ends up in a endless loop.

My proposal:
Let the POIXMLDocument manage the link between a PackagePart and its 
POIXMLDocumentPart element. When reading the POIXMLDocument, traverse 
the relations, but instatiate new POIXMLDocumentPart objects only once 
per PackagePart. If it already available, do nothing and return the 
object which is already linked to this PackagePart. As the 
POIXMLDocument is on the same hierarchy as the OPCPackage, as it is the 
single root element from that package. And the POIXMLDocumentParts are 
on par with PackageParts, so the hierarchy maps and the object 
lifecycles are congruent.

Hope I was able to describe the problem. :)

Kind regards,
Stefan Stern

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org