Package org.odftoolkit.odfdom.dom

Examples of org.odftoolkit.odfdom.dom.OdfContentDom.newOdfElement()


   *         based on the given URI.
   * */
  public String newImage(URI imageUri) {
    try {
      OdfContentDom contentDom = this.getContentDom();
      OdfDrawFrame drawFrame = contentDom.newOdfElement(OdfDrawFrame.class);
      XPath xpath = contentDom.getXPath();
      if (this instanceof SpreadsheetDocument) {
        TableTableCellElement lastCell = (TableTableCellElement) xpath.evaluate("//table:table-cell[last()]",
            contentDom, XPathConstants.NODE);
        lastCell.appendChild(drawFrame);
View Full Code Here


      sdoc = (TextDocument) doc;
    }

    protected DrawFrameElement getChartFrame() throws Exception {
      OdfContentDom contentDom2 = sdoc.getContentDom();
      DrawFrameElement drawFrame = contentDom2.newOdfElement(DrawFrameElement.class);
      TextPElement lastPara = sdoc.getContentRoot().newTextPElement();
      lastPara.appendChild(drawFrame);
      drawFrame.setTextAnchorTypeAttribute(TextAnchorTypeAttribute.Value.PARAGRAPH.toString());
      return drawFrame;
    }
View Full Code Here

   * @return         Returns the internal package path of the image, which was created based on the given URI.
   * */
  public String newImage(URI imageUri) {
    try {
      OdfContentDom contentDom = this.getContentDom();
      OdfDrawFrame drawFrame = contentDom.newOdfElement(OdfDrawFrame.class);
      XPath xpath = contentDom.getXPath();
      if (this instanceof OdfSpreadsheetDocument) {
        TableTableCellElement lastCell = (TableTableCellElement) xpath.evaluate("//table:table-cell[last()]", contentDom, XPathConstants.NODE);
        lastCell.appendChild(drawFrame);
        drawFrame.removeAttribute("text:anchor-type");
View Full Code Here

      sdoc = (TextDocument) doc;
    }

    protected DrawFrameElement getChartFrame() throws Exception {
      OdfContentDom contentDom2 = sdoc.getContentDom();
      DrawFrameElement drawFrame = contentDom2.newOdfElement(DrawFrameElement.class);
      TextPElement lastPara = sdoc.getContentRoot().newTextPElement();
      lastPara.appendChild(drawFrame);
      drawFrame.setTextAnchorTypeAttribute(TextAnchorTypeAttribute.Value.PARAGRAPH.toString());
      return drawFrame;
    }
View Full Code Here

      sdoc = (PresentationDocument) doc;
    }

    protected DrawFrameElement getChartFrame() throws Exception {
      OdfContentDom contentDom2 = sdoc.getContentDom();
      DrawFrameElement drawFrame = contentDom2.newOdfElement(DrawFrameElement.class);
      DrawPageElement lastPage = (DrawPageElement) contentDom2.getXPath().evaluate("//draw:page[last()]",
          contentDom2, XPathConstants.NODE);
      lastPage.appendChild(drawFrame);
      drawFrame.setTextAnchorTypeAttribute(TextAnchorTypeAttribute.Value.PAGE.toString());
      return drawFrame;
View Full Code Here

      sdoc = (SpreadsheetDocument) doc;
    }

    protected DrawFrameElement getChartFrame() throws Exception {
      OdfContentDom contentDom2 = sdoc.getContentDom();
      DrawFrameElement drawFrame = contentDom2.newOdfElement(DrawFrameElement.class);
      TableTableCellElement lastCell = (TableTableCellElement) contentDom2.getXPath().evaluate(
          "//table:table-cell[last()]", contentDom2, XPathConstants.NODE);
      lastCell.appendChild(drawFrame);
      drawFrame.removeAttribute("text:anchor-type");
      this.drawFrame = drawFrame;
View Full Code Here

   *         based on the given URI.
   * */
  public String newImage(URI imageUri) {
    try {
      OdfContentDom contentDom = this.getContentDom();
      OdfDrawFrame drawFrame = contentDom.newOdfElement(OdfDrawFrame.class);
      XPath xpath = contentDom.getXPath();
      if (this instanceof SpreadsheetDocument) {
        TableTableCellElement lastCell = (TableTableCellElement) xpath.evaluate("//table:table-cell[last()]", contentDom, XPathConstants.NODE);
        lastCell.appendChild(drawFrame);
        drawFrame.removeAttribute("text:anchor-type");
View Full Code Here

   * @return         Returns the internal package path of the image, which was created based on the given URI.
   * */
  public String newImage(URI imageUri) {
    try {
      OdfContentDom contentDom = this.getContentDom();
      OdfDrawFrame drawFrame = contentDom.newOdfElement(OdfDrawFrame.class);
      XPath xpath = contentDom.getXPath();
      if (this instanceof OdfSpreadsheetDocument) {
        TableTableCellElement lastCell = (TableTableCellElement) xpath.evaluate("//table:table-cell[last()]", contentDom, XPathConstants.NODE);
        lastCell.appendChild(drawFrame);
        drawFrame.removeAttribute("text:anchor-type");
View Full Code Here

    parent.appendChild(tm);
    m1 = odt.getInContentMetadataFromCache();
    TestCase.assertEquals(1, m1.size());
    parent.removeChild(tm);

    TextPElement pEle = contentDom.newOdfElement(TextPElement.class);
    parent.appendChild(pEle);
    pEle.setXhtmlAboutAttribute("[dbpedia:J._K._Rowling]");
    pEle.setXhtmlPropertyAttribute("dbpprop:birthDate dbpprop:dateOfBirth");
    pEle.setXhtmlDatatypeAttribute("xsd:date");
    pEle.setXhtmlContentAttribute("1965-07-31");
View Full Code Here

    parent.appendChild(pEle);
    m1 = odt.getInContentMetadataFromCache();
    TestCase.assertEquals(1, m1.size());
    parent.removeChild(pEle);

    TextHElement hEle = contentDom.newOdfElement(TextHElement.class);
    parent.appendChild(hEle);
    hEle.setXhtmlAboutAttribute("[dbpedia:J._K._Rowling]");
    hEle.setXhtmlPropertyAttribute("dbpprop:children");
    hEle.setXhtmlDatatypeAttribute("xsd:integer");
    hEle.setTextContent("2");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.