Example usage for org.apache.poi.xslf.usermodel XSLFRelation COMMENTS

List of usage examples for org.apache.poi.xslf.usermodel XSLFRelation COMMENTS

Introduction

In this page you can find the example usage for org.apache.poi.xslf.usermodel XSLFRelation COMMENTS.

Prototype

XSLFRelation COMMENTS

To view the source code for org.apache.poi.xslf.usermodel XSLFRelation COMMENTS.

Click Source Link

Usage

From source file:org.apache.tika.parser.microsoft.ooxml.SXSLFPowerPointExtractorDecorator.java

License:Apache License

private void handleSlidePart(PackagePart slidePart, XHTMLContentHandler xhtml)
        throws IOException, SAXException {
    Map<String, String> linkedRelationships = loadLinkedRelationships(slidePart, false, metadata);

    //        Map<String, String> hyperlinks = loadHyperlinkRelationships(packagePart);
    xhtml.startElement("div", "class", "slide-content");
    try (InputStream stream = slidePart.getInputStream()) {
        context.getSAXParser().parse(new CloseShieldInputStream(stream),
                new OfflineContentHandler(new EmbeddedContentHandler(new OOXMLWordAndPowerPointTextHandler(
                        new OOXMLTikaBodyPartHandler(xhtml), linkedRelationships))));

    } catch (TikaException e) {
        //do something with this
    }//from   w w  w.  j ava 2 s.  c  om

    xhtml.endElement("div");

    handleBasicRelatedParts(XSLFRelation.SLIDE_LAYOUT.getRelation(), "slide-master-content", slidePart,
            new PlaceHolderSkipper(new OOXMLWordAndPowerPointTextHandler(new OOXMLTikaBodyPartHandler(xhtml),
                    linkedRelationships)));

    handleBasicRelatedParts(XSLFRelation.NOTES.getRelation(), "slide-notes", slidePart,
            new OOXMLWordAndPowerPointTextHandler(new OOXMLTikaBodyPartHandler(xhtml), linkedRelationships));

    handleBasicRelatedParts(XSLFRelation.NOTES_MASTER.getRelation(), "slide-notes-master", slidePart,
            new OOXMLWordAndPowerPointTextHandler(new OOXMLTikaBodyPartHandler(xhtml), linkedRelationships));

    handleBasicRelatedParts(XSLFRelation.COMMENTS.getRelation(), null, slidePart,
            new XSLFCommentsHandler(xhtml));

    //        handleBasicRelatedParts("");
}