Slide extends Component implements ListContainer, TableContainer, TextboxContainer, ChartContainer { public DrawPageElement getOdfElement() { return maSlideElement; } private  Slide(DrawPageElement pageElement); static Slide getInstance(DrawPageElement pageElement); DrawPageElement getOdfElement(); int getSlideIndex(); String getSlideName(); void setSlideName(String name); Notes getNotesPage(); OdfElement getListContainerElement(); List addList(); List addList(ListDecorator decorator); void clearList(); Iterator<List> getListIterator(); boolean removeList(List list); Table addTable(); Table addTable(int numRows, int numCols); Table getTableByName(String name); java.util.List<Table> getTableList(); TableBuilder getTableBuilder(); OdfElement getTableContainerElement(); Textbox addTextbox(); Iterator<Textbox> getTextboxIterator(); boolean removeTextbox(Textbox box); OdfElement getFrameContainerElement(); Textbox addTextbox(FrameRectangle position); Textbox getTextboxByName(String name); java.util.List<Textbox> getTextboxByUsage(PresentationDocument.PresentationClass usage); Chart createChart(String title, DataSet dataset, Rectangle rect); Chart createChart(String title, SpreadsheetDocument document, CellRangeAddressList cellRangeAddr, boolean firstRowAsLabel,
			boolean firstColumnAsLabel, boolean rowAsDataSeries, Rectangle rect); Chart createChart(String title, String[] labels, String[] legends, double[][] data, Rectangle rect); void deleteChartById(String chartId); void deleteChartByTitle(String title); Chart getChartById(String chartId); java.util.List<Chart> getChartByTitle(String title); int getChartCount();  }
@Test public void testAppendPresentation() { try { doc = PresentationDocument.loadDocument(ResourceUtilities .getTestResourceAsStream(TEST_PRESENTATION_FILE_MAIN)); doc2 = PresentationDocument.loadDocument(ResourceUtilities .getTestResourceAsStream(TEST_PRESENTATION_FILE_ANOTHER)); int slideCount = doc.getSlideCount(); int slideCount2 = doc2.getSlideCount(); String EMBEDDOC_NAME = "Object 2"; Assert.assertNotNull(doc.getEmbeddedDocument(EMBEDDOC_NAME)); Assert.assertNotNull(doc2.getEmbeddedDocument(EMBEDDOC_NAME)); doc2.appendPresentation(doc); Assert.assertTrue((slideCount + slideCount2) == doc2.getSlideCount()); Slide slide = doc2.getSlideByIndex(103); DrawPageElement slideEle = slide.getOdfElement(); NodeList objectList = slideEle.getElementsByTagNameNS(OdfDocumentNamespace.DRAW.getUri(), "object"); Assert.assertTrue(objectList.getLength() == 2); DrawObjectElement object1 = (DrawObjectElement) objectList.item(0); String linkPath = object1.getXlinkHrefAttribute(); Assert.assertTrue(linkPath.startsWith("./Object 2") && !linkPath.equals("./Object 2")); } catch (Exception e) { LOG.log(Level.SEVERE, e.getMessage(), e); Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'"); } try { doc2.save(ResourceUtilities.newTestOutputFile(TEST_PRESENTATION_FILE_OUT_PREFIX + "Merge2.odp")); } catch (Exception e) { LOG.log(Level.SEVERE, e.getMessage(), e); Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'"); } }
@Test public void testCopyThreeDoc() { try { PresentationDocument testdoc1 = PresentationDocument.loadDocument(ResourceUtilities .getTestResourceAsStream(TEST_PRESENTATION_DOCUMENT1)); PresentationDocument testdoc2 = PresentationDocument.loadDocument(ResourceUtilities .getTestResourceAsStream(TEST_PRESENTATION_DOCUMENT2)); PresentationDocument testdoc3 = PresentationDocument.loadDocument(ResourceUtilities .getTestResourceAsStream(TEST_PRESENTATION_DOCUMENT3)); testdoc1.copyForeignSlide(1, testdoc2, 0); testdoc1.copyForeignSlide(2, testdoc3, 0); DrawPageElement slide1 = testdoc1.getSlideByIndex(0).getOdfElement(); DrawPageElement slide2 = testdoc1.getSlideByIndex(1).getOdfElement(); DrawPageElement slide3 = testdoc1.getSlideByIndex(2).getOdfElement(); String slideStyle1 = slide1.getDrawNameAttribute(); String slideStyle2 = slide2.getDrawNameAttribute(); String slideStyle3 = slide3.getDrawNameAttribute(); LOG.info(slideStyle1); LOG.info(slideStyle2); LOG.info(slideStyle3); testdoc1.save(ResourceUtilities.newTestOutputFile(TEST_PRESENTATION_FILE_OUT_PREFIX + "CopyThreeDoc.odp")); Assert.assertNotSame(slideStyle1, slideStyle2); Assert.assertNotSame(slideStyle2, slideStyle3); } catch (Exception e) { LOG.log(Level.SEVERE, e.getMessage(), e); Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'"); } }