poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "honyk" <j.tosov...@email.cz>
Subject [XSLF] Create entry without record in presentation.xml.rels
Date Wed, 03 Jul 2013 19:11:27 GMT
Dear All,

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?

Thanks, Jan




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


Mime
View raw message