You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by honyk <j....@email.cz> on 2013/08/20 13:42:10 UTC

RE: [XSLF] Create entry without record in presentation.xml.rels

On 2013-07-03 honyk wrote:
> 
> I create new Notes Slide (XSLFNotes) this way:
> 
> in XMLSlideShow:
> 
> private XSLFNotes createNotesSlide(XSLFSlide slide) {
>   ...
>   // (1) determines the slide index (nasty way) used for unique notes
> index
>   Integer slideIndex =
> Integer.parseInt(slide.getPackageRelationship().getId().substring(3));
> 
>   // (2) creates a new Notes Slide
>   XSLFNotes notesSlide = (XSLFNotes)
> createRelationship(XSLFRelation.NOTES,
>       XSLFFactory.getInstance(), slideIndex);
> 
>   // (3) create relation to Notes Master
>   notesSlide.addRelation(_notesMaster.getPackageRelationship().getId(),
> _notesMaster);
>   PackagePartName notesMasterPackagePartName =
> _notesMaster.getPackagePart().getPartName();
> 
> notesSlide.getPackagePart().addRelationship(notesMasterPackagePartName,
> TargetMode.INTERNAL,
>           _notesMaster.getPackageRelationship().getRelationshipType());
> 
>   // other relations...
> 
> The new created Notes Slide (2) creates relations in
> presentation.xml.rels
> automatically, but here this kind of entry is not allowed. The presence
> is
> not fatal, file can be opened in PowerPoint 2007-2010, but it is
> reported by
> OOXML SDK validation tool.
> 
> I've tried to use createRelationship(..., ..., ..., ..., true) which do
> not
> create relation (which one?), but in this case I cannot create
> relations in
> the next step (3) - I am getting NPE.
> 
> Is there any way to fix this?
> 

Can I create a new entry (Notes Slide in my case) without record in
presentation.xml.rels ?

Thanks, Jan


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