From odf-commits-return-210-apmail-incubator-odf-commits-archive=incubator.apache.org@incubator.apache.org Tue Sep 6 02:12:13 2011 Return-Path: X-Original-To: apmail-incubator-odf-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-odf-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 64ACC7BDF for ; Tue, 6 Sep 2011 02:12:13 +0000 (UTC) Received: (qmail 5580 invoked by uid 500); 6 Sep 2011 02:12:13 -0000 Delivered-To: apmail-incubator-odf-commits-archive@incubator.apache.org Received: (qmail 5558 invoked by uid 500); 6 Sep 2011 02:12:13 -0000 Mailing-List: contact odf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: odf-dev@incubator.apache.org Delivered-To: mailing list odf-commits@incubator.apache.org Received: (qmail 5551 invoked by uid 99); 6 Sep 2011 02:12:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2011 02:12:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2011 02:11:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 785B72388A68 for ; Tue, 6 Sep 2011 02:11:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r795346 [3/17] - in /websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document: ./ cookbook/ javadoc/ javadoc/META-INF/ javadoc/index-files/ javadoc/org/ javadoc/org/odftoolkit/ javadoc/org/odftoolkit/simple/ javadoc/org/odftoolk... Date: Tue, 06 Sep 2011 02:11:17 -0000 To: odf-commits@incubator.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110906021135.785B72388A68@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Columns and Rows.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Columns and Rows.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Columns and Rows.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Presentation.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Presentation.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Presentation.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Slide.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Slide.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Slide.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Table.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Table.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Table.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Text Document.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Text Document.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Text Document.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate TextSearch.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate TextSearch.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate TextSearch.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Presentation Document.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Presentation Document.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Presentation Document.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Slide.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Slide.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Slide.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,275 @@ + + + + + + + + + +Slide + + + + + + + + + +
+ +
+ + + +
+
+
+
+
+ +
+ + +
+
+
+Add Slide +
+
+
+If you want to add new slide to the presentation document, you can use the following codes: +
+
+Here the SlideLayout is the layout model of the added slide, the first parameter is the index of the added slide and the second parameter is the name of this slide. +
+
+                PresentationDocument document=PresentationDocument.newPresentationDocument();	        			
+ document.newSlide(1, "new slide", SlideLayout.TITLE_ONLY);
+
+
+
+Get Slide +
+
+
+You can get the slide through the index in the presentation document, like follows: +
+
+		Slide slide;
+ slide=document.getSlideByIndex(0);
+
+
+Or you can get the slide through the name of it by using the following code: +
+
+		slide=document.getSlideByName("new slide");
+
+
+To get all the slides in the document,you can do like this: +
+
+		Iterator<Slide> slideList=document.getSlides();
+
+
+Also you can get the number of the slides in the document by the following code: +
+
+		int numSlide=document.getSlideCount();
+
+
+
+If you want to set a new name for a slide, you can use the following two methods: +
+
+		slide.setSlideName("second slide");	
+ document.getSlideByIndex(2).setSlideName("third slide");
+
+
+If you want to know the index and the name of one slide which is being operated, you can use the following codes: +
+
+		int slideIndex=slide.getSlideIndex();
+ String slideName=slide.getSlideName();
+
+
+
+Copy Slide +
+
+
+You can copy a slide in the presentation document from one position to another by using the following codes: +
+
+Here the first parameter is the source position of the slide need to be copied, the second parameter is the destination position of the slide need to be copied, and the last parameter is the new name of the copied slide. +
+
+		document.copySlide(1, 2, "copied slide");
+
+
+And also you can copy a slide from another document by using the following codes: +
+
+Here the first parameter of copyForeignSlide is the new position of the copied slide in the current document, the second parameter is the source document of the copied slide, and the last one is the slide index of the source document that need to be copied. +
+
+		 PresentationDocument documentmodel;
+ documentmodel=(PresentationDocument)PresentationDocument.loadDocument("presentation.odp");
+ document.copyForeignSlide(1, documentmodel, 2);
+
+
+
+To move one slide to another position of this presentation position, you can use the following codes: +
+
+Here the first parameter is the current index of the slide that need to be moved, and the second parameter is the index of the destination position before the move action. +
+
+		document.moveSlide(2, 1);		
+
+
+You can delete the slide either by through the index or through the name of the specified slide, like follows: +
+
+		document.deleteSlideByIndex(1);
+ document.deleteSlideByName("third slide");
+
+
+
+ You can set the text content of a slide with text box API since version 0.5. Below codes will get the title text box of a slide, set the text content, and then get the outline text box, set the list content. +
+
+	    Textbox titleBox = slide.getTextboxByUsage(PresentationClass.TITLE).get(0);
+ titleBox.setTextContent("This is the title");
+ Textbox outline = slide.getTextboxByUsage(PresentationClass.OUTLINE).get(0);
+ List txtList = outline.addList();
+ txtList.addItem("List Item1");
+ txtList.addItem("List Item2");
+
+
+To add some text, you can first get the notes of one slide and then add text to this corresponding notes. The following codes shows this process: +
+
+		Notes note=slide.getNotesPage();
+ note.addText("text notes");
+
+
+
+To add an image to slide, you can use below codes to simply add the image to the last slide of the presentation document. +
+
+		URI imageuri=new URI("namdaemun.jpg");
+ document.newImage(imageuri);
+
+
+Or you can use following code to add an image to a specific position you want +
+
+		Slide slide1 = document.getSlideByIndex(1);
+ Image image = Image.newImage(slide1, new URI("http://www.xxx.com/a.jpg"));
+ FrameRectangle rect = image.getRectangle();
+ rect.setX(4);
+ rect.setY(5.7);
+ image.setRectangle(rect);
+
+

+ +
+
+ +
+
+ + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Style Handling.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Style Handling.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Style Handling.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Table.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Table.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Table.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,227 @@ + + + + + + + + + +Table + + + + + + + + + +
+ +
+ + + +
+
+
+
+
+ +
+ + +
+
+
+Overview +
+
+
+ This Table API supports to manipulate tables in text and spreadsheet documents. It covers the table definition in ODF Specification 1.2 Committee Draft05 +
+
+
+Create Table +
+
+
+Let's create an empty table first.By default,the code below create a table with 5 columns and 2 rows. +
+
+            TextDocument document = TextDocument.newTextDocument();
+ Table table1 = Table.newTable(document);
+ table1.setTableName("table1");
+ document.save(filePath);
+
+
+If you want to create table with specified column and row,you can do like this: +
+
+            int row=4;
+ int column=3;
+ Table table2=Table.newTable(document, row, column);
+ table2.setTableName("table2");
+
+
+ If you want to put some numbers into a table while creating it, you can use the constructor Table.newTable(document,rowlabels,columnlabels, data) which you should specify a 2 dimension array as the data and 2 String arrays as table labels,one for row and the other for column. +
+
+        int rowcount = 10, columncount = 4;
+ double[][] data = new double[rowcount][columncount];
+ String[] rowlabels = new String[rowcount];
+ String[] columnlabels = new String[columncount];
+ Table table3=Table.newTable(document,rowlabels,columnlabels, data);
+ table3.setTableName("dataTable");
+
+
+You can also fill table with string values while creating it, to do this you should provide a 2 dimension string array instead of double array. +
+
+     	String[][] stringData = new String[rowcount][columncount];
+ Table table4 = Table.newTable(document, rowlabels, columnlabels, stringData);
+ table4.setTableName("stringTable");
+
+
+
+Find Table +
+
+
+To get all the tables in the document,you can do like this: +
+
+        List<Table> tableList=document.getTableList();
+
+
+If you want to get a single table,you can use the table name to find it.If it's not found,the method returns null. +
+
+        Table emptyTable=document.getTableByName("table1");
+
+
+
+Delete Table +
+
+
+        Table table = document.getTableByName("DeletedTable");
+ if (table != null) {
+ table.remove();
+ }
+
+
+
+Set Table +
+
+
+You can set or update table name,which can be regarded as table identifier in a document. +
+
+           table1.getTableName();
+ table1.setTableName("EnglishScore");
+
+
+If you want to change table width,you can do like this: +
+
+        Table tableWidth=document.getTableByName("table1");
+ if(tableWidth!=null) {
+ long width=500;
+ tableWidth.setWidth(width);
+ tableWidth.getWidth();
+ }
+
+
+Each table in the document has a protect attribute to show whether it is protected or not. +
+
+           boolean isProtected=table1.isProtected();
+ table1.setProtected(true);
+
+

+ +
+
+ +
+
+ + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Text Document.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Text Document.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Text Document.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/TextExtractor.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/TextExtractor.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/TextExtractor.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,144 @@ + + + + + + + + + +TextExtractor + + + + + + + + + +
+ +
+ + + +
+
+
+
+
+ +
+ + +
+
+
+Get Text +
+
+
+ TextExtractor provides a method to get the display text of a single element. EditableTextExtractor is a sub class of TextExtractor. It provides a method to return all the text that the user can typically edit in a document, including text in cotent.xml, header and footer in styles.xml, meta data in meta.xml. +
+
+ The following codes use EditableTextExtractor as an example, the text of the document "textExtractor.odt" is extracted for user. For TextExtractor, it can't extract the text from a TextDocument. +
+
+		TextDocument textdoc=(TextDocument)TextDocument.loadDocument("textExtractor.odt");
+ EditableTextExtractor extractorD = EditableTextExtractor.newOdfEditableTextExtractor(textdoc);
+ String output = extractorD.getText();
+ System.out.println(output);
+
+
+ In the following codes, the whole document content will be returned. This operation is the same in TextExtractor. +
+
+		OdfElement elem=textdoc.getContentRoot();
+ EditableTextExtractor extractorE = EditableTextExtractor.newOdfEditableTextExtractor(elem);
+ System.out.println(extractorE.getText());
+
+

+ +
+
+ +
+
+ + +
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + + Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/cookbook.css ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/cookbook.css (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/cookbook.css Tue Sep 6 02:11:09 2011 @@ -0,0 +1,226 @@ +body { + + font-family: "Verdana", sans-serif; + + margin-left:20px; + +} + +hr {height:2px;border-width:0;color:gray;background-color:black;} + + + +.page{ + + font-weight: bold + +} + + + +.page a:hover{ + + color: #FFF; + + background-color: #FF7F50; + +} + +.section{ + + font-weight: bold + +} + +.section a:hover{ + + color: #FFF; + + background-color: #FF7F50; + +} + +.subsection{ + + font-style: italic; + +} + +.subsection a:hover{ + + color: #FFF; + + background-color: #FF7F50; + +} + +.paragraph{ + + + +} + + + + + +div.navigation { + + height: 30px; + + + border-top: solid #000 1px; + + border-bottom: solid #000 1px; + + background-color: #007CA6; + +} + +div.navigation ul { + + margin: 0px; + + padding: 0px; + + font-family: Tahoma,sans-serif; + + font-size: 18px;; + + color: #FFF; + + line-height: 30px; + + white-space: nowrap; + + float:right; + +} + +div.navigation li { + + + + list-style-type: none; + + display: inline; + +} + +div.navigation li a { + + padding: 7px 10px; + + color: #FFF; + +} + +div.navigation li a:link { + + color: #FFF: + +} + + + +div.navigation li a:hover { + + font-weight: bold; + + color: #FFF; + + background-color: #43C7F4; + +} + + + + +.pageli{ + + + +} + + + +.sectionli{ + + + +} + + + +.subsectionli{ + + + +} + + + +/* styles for the code block */ + +.code{ + + + + margin: 0 ; + + padding: 0 ; + + border: 0 ; + + + + background-color: #F8F8FF ; + + text-align: left ; + + float: none ; + + + + vertical-align: baseline ; + + position: static ; + + left: auto ; + + top: auto ; + + right: auto ; + + bottom: auto ; + + height: auto ; + + width: 920px; + word-break:break-all; +white-space:pre-wrap; + font-family: "Consolas","Courier New","Verdana"; + + font-size:14px; + + + +} + +.access{ color:blue;} + +.modifier{ color:darkred;} + +.control{ color:coral;} + +.error{ color:red;} + +.pkg{ color:deepskyblue; } + +.basic{ color:navy;} + +.ref{ color:gray;} + +.comments{ color:#AA7700;} + +.javaclass{ color:green;} Added: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/index.html ============================================================================== --- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/index.html (added) +++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/index.html Tue Sep 6 02:11:09 2011 @@ -0,0 +1,364 @@ + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + +
+
+
+
+
+ +
+ +
+
+Text +
+
+ +
+
+Presentation +
+
+ +
+
+Table +
+
+ +
+
+Chart +
+
+ +
+
+Style +
+
+ + + + +
+ +
+
+
+Field +
+
+ +
+
+Metadata +
+
+ +
+
+ +
+
+ +

+
+ +
+
+


Powered by the Apache CMS.

+
+
+

+ Apache "ODF Toolkit" is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. + Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and + decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is + not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has + yet to be fully endorsed by the ASF.

+

+ Copyright © 2011 The Apache Software Foundation Licensed under the Apache License, Version 2.0. + Contact Us +
Apache and the Apache feather logos are trademarks of The Apache Software Foundation. +
Other names appearing on the site may be trademarks of their respective owners. +

+
+
+ + +