incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r795380 [1/2] - /websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/
Date Tue, 06 Sep 2011 10:20:37 GMT
Author: buildbot
Date: Tue Sep  6 10:20:36 2011
New Revision: 795380

Log:
Staging update by buildbot

Modified:
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Cell Range.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Cell.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Charts.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Column and Row.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Fields.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate TextSearch.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Presentation Document.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Slide.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Style Handling.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Table.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Text Document.html
    websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/TextExtractor.html

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Cell Range.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Cell Range.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Cell Range.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,115 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Cell Range.html">Cell Range</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Cell.html">previous</a></li>
+  <li><a href="Charts.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Get CellRange" >Get CellRange</a></strong>
+<hr/>
+<div class="bodytext">
+You can get cell range by providing start and end index of the column and row,or just provide start and end address of the cell(if you are using the spreadsheet.)
+</div>
+<br/><pre class='code' id="code0">
+        <span class='javaclass'>CellRange</span> cellRange = table.getCellRangeByPosition(1, 0, 2, 0);<br/>
+        <span class='javaclass'>CellRange</span> cellRangeAdd = table.getCellRangeByPosition("$E1","$E6");<br/>
+</pre>
+<br/><strong><a href="#Merge Text Table" >Merge Text Table</a></strong>
+<hr/>
+<div class="bodytext">
+The code below merges all of the selected cells into one:
+</div>
+<br/><pre class='code' id="code1">
+        <span class='javaclass'>Table</span> table1 = document.getTableByName("Table1");<br/>
+        <span class='javaclass'>CellRange</span> cellrange = table1.getCellRangeByPosition(0, 0, table1.getColumnCount()-1, table1.getRowCount()-1);<br/>
+        cellRange.merge();<br/>
+</pre>
+<br/><strong><a href="#Merge Text Column" >Merge Text Column</a></strong>
+<hr/>
+<div class="bodytext">
+The code below shows how to merge the cells of the first column into one :
+</div>
+<br/><pre class='code' id="code2">
+            table1 = document.getTableByName("Table1");<br/>
+            <span class='javaclass'>CellRange</span> firstColumn = table1.getCellRangeByPosition(0, 0, 0, table1.getRowCount()-1);<br/>
+            firstColumn.merge();<br/>
+</pre>
+<br/><strong><a href="#Merge Text Row" >Merge Text Row</a></strong>
+<hr/>
+<div class="bodytext">
+The code below shows how to merge the cells of the first 2 rows into one :
+</div>
+<br/><pre class='code' id="code3">
+        table1 = document.getTableByName("Table1");<br/>
+        <span class='basic'>int</span> rowCount = table1.getRowCount();<br/>
+                <span class='javaclass'>CellRange</span> firstTwoRow = table1.getCellRangeByPosition(0, 0, table1.getColumnCount()-1, 1);<br/>
+                firstTwoRow.merge();<br/>
+</pre>
+<br/><strong><a href="#Merge SpreadSheet" >Merge SpreadSheet</a></strong>
+<hr/>
+<div class="bodytext">
+Merge a spreadsheet's cell is the same as text document.Especially,when getting the cell range of spreadsheet,you can use special address instead of index.
+</div>
+<br/><pre class='code' id="code4">
+        <span class='javaclass'>Table</span> sheet1 = document.getTableByName("Sheet1");<br/>
+        <span class='javaclass'>CellRange</span> cellRange2 = sheet1.getCellRangeByPosition("$E1","$E6");<br/>
+        cellRange2.setCellRangeName("<span class='javaclass'>TimeCellRange</span>");<br/>
+        cellRange2.merge(); <br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Cell.html">previous</a></li>
+  <li><a href="Charts.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Cell.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Cell.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Cell.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,303 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Cell.html">Cell</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Column and Row.html">previous</a></li>
+  <li><a href="Cell Range.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Get Cell" >Get Cell</a></strong>
+<hr/>
+<div class="bodytext">
+If you want to get the specified cell in a table,you can use the getCellByPosition method of Table.
+</div>
+<div class="bodytext">
+The first parameter is the column index,the second parameter is the row index.
+</div>
+<br/><pre class='code' id="code0">
+         <span class='javaclass'>TextDocument</span> document = (<span class='javaclass'>TextDocument</span>) <span class='javaclass'>TextDocument</span>.loadDocument(filePath);<br/>
+     <span class='javaclass'>Table</span> table=document.getTableByName("stringTable");<br/>
+     <span class='javaclass'>Cell</span> cell=table.getCellByPosition(1, 1);<br/>
+</pre>
+<br/><div class="bodytext">
+If you are manipulating a spreadsheet,you can get the cell by its address:
+</div>
+<br/><pre class='code' id="code1">
+     <span class='javaclass'>Table</span> sheet1 = document.getTableByName("Sheet1");<br/>
+     <span class='javaclass'>Cell</span> odsCell=sheet1.getCellByPosition("A1");<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to get a cell from a row,you can specify the index of the cell in the row.
+</div>
+<br/><pre class='code' id="code2">
+     <span class='javaclass'>Row</span> row=table.getRowByIndex(1);<br/>
+     <span class='javaclass'>Cell</span> cell2=row.getCellByIndex(1);<br/>
+     <span class='javaclass'>System</span>.out.println(cell2.getStringValue());<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I have a Cell instance and want to know which column and row it belongs to ?
+</div>
+<div class="bodytext">
+The code below shows how you can do that:
+</div>
+<br/><pre class='code' id="code3">
+     <span class='javaclass'>Row</span> row1=cell.getTableRow();<br/>
+     <span class='javaclass'>Column</span> column1=cell.getTableColumn();<br/>
+</pre>
+<br/><strong><a href="#Control Cell Attributes" >Control Cell Attributes</a></strong>
+<hr/>
+<div class="bodytext">
+Use the getStyleName() method you can get the style name of the cell.
+</div>
+<div class="bodytext">
+If you want to change the style,it must be set when you set the display text.
+</div>
+<br/><pre class='code' id="code4">
+     <span class='javaclass'>String</span> cellSytle=cell.getStyleName();<br/>
+     cell.setDisplayText("content", cellSytle);<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I want to control the display alignment of the cell?
+</div>
+<div class="bodytext">
+You can set the horizontal and vertical alignment to do so.
+</div>
+<div class="bodytext">
+The code below shows how to get and set the alignment.You can refer to the javadoc about the alignment type.
+</div>
+<br/><pre class='code' id="code5">
+      <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>HorizontalAlignmentType</span> horizontalAlign=cell.getHorizontalAlignmentType();<br/>
+      <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>VerticalAlignmentType</span> verticalAlign=cell.getVerticalAlignmentType();<br/>
+      cell.setHorizontalAlignment(<span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>HorizontalAlignmentType</span>.<span class='javaclass'>CENTER</span>);<br/>
+      cell.setVerticalAlignment(<span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>VerticalAlignmentType</span>.<span class='javaclass'>BOTTOM</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+If the content of the cell is too long,you can set the wrap option of the cell.
+</div>
+<br/><pre class='code' id="code6">
+       cell.setTextWrapped(<span class='basic'>true</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+If don't know the cell is wrapped or not,you can use the method:
+</div>
+<br/><pre class='code' id="code7">
+       <span class='basic'>boolean</span> isTextWrapped=cell.isTextWrapped();<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to set the background color of the cell,be care that the color type is org.odftoolkit.odfdom.type.Color.
+</div>
+<br/><pre class='code' id="code8">
+        <span class='javaclass'>Color</span> cellBackgroundColor=cell.getCellBackgroundColor();<br/>
+        cell.setCellBackgroundColor(<span class='javaclass'>Color</span>.valueOf("#000000"));<br/>
+</pre>
+<br/><div class="bodytext">
+How can I control the spanned number of the column/row:
+</div>
+<br/><pre class='code' id="code9">
+        <span class='basic'>int</span> spannedNum=cell.getcgetColumnSpannedNumber();<br/>
+        cell.setColumnSpannedNumber(spannedNum);<br/>
+        <span class='basic'>int</span> rowSpannedNum=cell.getRowSpannedNumber();<br/>
+        cell.setRowSpannedNumber(rowSpannedNum);<br/>
+</pre>
+<br/><div class="bodytext">
+For column,maybe you want to know the column repeated number:
+</div>
+<br/><pre class='code' id="code10">
+        <span class='basic'>int</span> repeatedNum=cell.getColumnsRepeatedNumber();<br/>
+        cell.setColumnsRepeatedNumber(repeatedNum);<br/>
+</pre>
+<br/><div class="bodytext">
+How about formatting a cell's content? You can set the format string of the cell to do so.
+</div>
+<div class="bodytext">
+For example you want to format the date to yyyy-MM-dd ,you can:
+</div>
+<br/><pre class='code' id="code11">
+          <span class='javaclass'>String</span> cellFormatStr=cell.getFormatString();<br/>
+          cell.setDateValue(<span class='modifier'>new</span> <span class='javaclass'>GregorianCalendar</span>(2010,5,1));<br/>
+          cell.setFormatString("yyyy-<span class='javaclass'>MM</span>-dd");<br/>
+</pre>
+<br/><div class="bodytext">
+Be care that the setFormatString only works for float, date and percentage.
+</div>
+<div class="bodytext">
+You may be confused by the difference between getFormatString and getFormula,the difference is that:
+</div>
+<div class="bodytext">
+For the setFormula method,it just sets as a formula attribute,the cell value will not be calculated.
+</div>
+<br/><pre class='code' id="code12">
+          <span class='javaclass'>String</span> formula=cell.getFormula();<br/>
+          cell.setFormula(formula);    <br/>
+</pre>
+<br/><div class="bodytext">
+How can I clear the content of the cell?
+</div>
+<div class="bodytext">
+RemoveContent remove all of the cell while the removeTextContent only remove the text content of the cell.
+</div>
+<br/><pre class='code' id="code13">
+       cell.removeContent();<br/>
+       cell.removeTextContent();<br/>
+</pre>
+<br/><strong><a href="#Get&Set Cell Value Type" >Get&amp;Set Cell Value Type</a></strong>
+<hr/>
+<div class="bodytext">
+     The cell value can have different types,for the setValueType method:    the parameter can be    <ul><li>"boolean"</li>  <li>"currency"</li>     <li>"date"</li>     <li>"float"</li>         <li>"percentage"</li>  <li>"string"</li>   <li>"time"</li>     <li>"void"</li>     </ul>   If the parameter type is not a valid cell type, an IllegalArgumentException will be thrown.
+</div>
+<br/><pre class='code' id="code14">
+       <span class='javaclass'>String</span> valueType=cell.getValueType();<br/>
+       cell.setValueType(valueType);<br/>
+</pre>
+<br/><div class="bodytext">
+For the following getXXXValue() method:it gets the cell value as xxx type.An IllegalArgumentException will be thrown if the cell type is not xxx.
+</div>
+<a href="#Get&Set boolean type Cell" >Get&amp;Set boolean type Cell</a>
+<hr/>
+<div class="bodytext">
+    For setBooleanValue method:it sets the cell value as a boolean and sets the value type to be boolean.
+</div>
+<br/><pre class='code' id="code15">
+       <span class='basic'>boolean</span> booleanValue=cell.getBooleanValue();<br/>
+       cell.setBooleanValue(booleanValue);<br/>
+</pre>
+<br/><a href="#Get&Set currency type Cell" >Get&amp;Set currency type Cell</a>
+<hr/>
+<div class="bodytext">
+For the following getting methods,if the value type is not "currency", an IllegalArgumentException will be thrown.
+</div>
+<div class="bodytext">
+The currency code of the cell is like "USD", "EUR", "CNY", and the currency symbol is like "$"
+</div>
+<br/><pre class='code' id="code16">
+       <span class='javaclass'>String</span> currencyCode=cell.getCurrencyCode();  <br/>
+       cell.setCurrencyCode("<span class='javaclass'>USD</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+You can also set currency value and currency format.Please note the overall format includes the symbol character, for example: $#,##0.00.
+</div>
+<br/><pre class='code' id="code17">
+       cell.setCurrencyValue(100.00, "<span class='javaclass'>USD</span>");<br/>
+       cell.setCurrencyFormat("$", "$#,##0.00");<br/>
+</pre>
+<br/><a href="#Get&Set date type Cell" >Get&amp;Set date type Cell</a>
+<hr/>
+<br/><pre class='code' id="code18">
+       <span class='javaclass'>Calendar</span> dateValue=cell.getDateValue(); <br/>
+       cell.setDateValue(<span class='modifier'>new</span> <span class='javaclass'>GregorianCalendar</span>(2010,5,1));<br/>
+</pre>
+<br/><a href="#Get&Set float type Cell" >Get&amp;Set float type Cell</a>
+<hr/>
+<br/><pre class='code' id="code19">
+      <span class='basic'>double</span> floatValue=cell.getDoubleValue();  <br/>
+      cell.setDoubleValue(<span class='modifier'>new</span> <span class='javaclass'>Double</span>(22.99f));<br/>
+</pre>
+<br/><a href="#Get&Set percentage type Cell" >Get&amp;Set percentage type Cell</a>
+<hr/>
+<br/><pre class='code' id="code20">
+      <span class='basic'>double</span> percentageValue=cell.getPercentageValue();<br/>
+      cell.setPercentageValue(0.89);<br/>
+</pre>
+<br/><a href="#Get&Set string type Cell" >Get&amp;Set string type Cell</a>
+<hr/>
+<div class="bodytext">
+If the cell type is not string, the display text will be returned.
+</div>
+<br/><pre class='code' id="code21">
+      <span class='javaclass'>String</span> stringValue=cell.getStringValue();   <br/>
+      cell.setStringValue("simple");<br/>
+</pre>
+<br/><a href="#Deal with the Time Value" >Deal with the Time Value</a>
+<hr/>
+<div class="bodytext">
+If you want to get the string type of time value,you can format it:
+</div>
+<br/><pre class='code' id="code22">
+      cell.setTimeValue(<span class='javaclass'>Calendar</span>.getInstance());<br/>
+      <span class='javaclass'>SimpleDateFormat</span> simpleFormat = <span class='modifier'>new</span> <span class='javaclass'>SimpleDateFormat</span>("'<span class='javaclass'>PT</span>'<span class='javaclass'>HH</span>'H'mm'M'ss'S'");<br/>
+          <span class='javaclass'>String</span>  timeString= simpleFormat.format(cell.getTimeValue().getTime());<br/>
+</pre>
+<br/><a href="#Something about Display Text" >Something about Display Text</a>
+<hr/>
+<div class="bodytext">
+          Please note the display text in ODF viewer might be different from the value set by this method,    because the displayed text in ODF viewer is calculated and set by editor. 
+</div>
+<br/><pre class='code' id="code23">
+      <span class='javaclass'>String</span> displayText=cell.getDisplayText();<br/>
+      cell.setDisplayText(displayText);<br/>
+</pre>
+<br/><strong><a href="#Set image" >Set image</a></strong>
+<hr/>
+<div class="bodytext">
+        From version 0.5.5, we support high level APIs for images.      You can use following codes to set an image to a cell.
+</div>
+<br/><pre class='code' id="code24">
+        <span class='javaclass'>Image</span> myImage = cell.setImage(<span class='modifier'>new</span> <span class='javaclass'>URI</span>("http://www.xxx.com/a.jpg"));<br/>
+</pre>
+<br/><div class="bodytext">
+        You can use following codes to access an image in a cell.
+</div>
+<br/><pre class='code' id="code25">
+        <span class='javaclass'>Image</span> image = cell.getImage();<br/>
+        <span class='javaclass'>String</span> imagename = image.getName();<br/>
+        <span class='javaclass'>FrameRectangle</span> rect = image.getRectangle();<br/>
+        rect.setX(1);<br/>
+        rect.setY(1);<br/>
+        image.setRectangle(rect);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Column and Row.html">previous</a></li>
+  <li><a href="Cell Range.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Charts.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Charts.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Charts.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,176 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Charts.html">Charts</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Cell Range.html">previous</a></li>
+  <li><a href="Style Handling.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Overview" >Overview</a></strong>
+<hr/>
+<div class="bodytext">
+        Since 0.6, Simple ODF provides methods to manipulate charts in text document, spreadsheet document and presentation document.       You can create, update and delete charts with these methods.
+</div>
+<strong><a href="#Create charts" >Create charts</a></strong>
+<hr/>
+<div class="bodytext">
+        We all know, a chart is associated with a table. In order to create a chart, you must determine the data set of this chart.     The data set can be a cell range of a table, for example:
+</div>
+<br/><pre class='code' id="code0">
+        <span class='javaclass'>CellRangeAddressList</span> cellRange = <span class='javaclass'>CellRangeAddressList</span>.valueOf("A.A1:A.B3");<br/>
+        <span class='javaclass'>DataSet</span> dataSet = <span class='modifier'>new</span> <span class='javaclass'>DataSet</span>(cellRange, spreadsheetDoc, <span class='basic'>true</span>, <span class='basic'>true</span>, <span class='basic'>false</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+        Or a two dimensional array, for example:
+</div>
+<br/><pre class='code' id="code1">
+        <span class='basic'>int</span> row = 2, column = 3;<br/>
+        <span class='basic'>double</span>[][] data = <span class='modifier'>new</span> <span class='basic'>double</span>[column][row];<br/>
+        <span class='javaclass'>String</span>[] labels = <span class='modifier'>new</span> <span class='javaclass'>String</span>[row];<br/>
+        <span class='javaclass'>String</span>[] legends = <span class='modifier'>new</span> <span class='javaclass'>String</span>[column];<br/>
+        <span class='javaclass'>DataSet</span> dataset = <span class='modifier'>new</span> <span class='javaclass'>DataSet</span>(labels, legends, data);<br/>
+</pre>
+<br/><div class="bodytext">
+        You should also use rectangle to define the position and the size of this chart. For example: 
+</div>
+<br/><pre class='code' id="code2">
+        <span class='javaclass'>Rectangle</span> rect = <span class='modifier'>new</span> <span class='javaclass'>Rectangle</span>();<br/>
+        rect.x = 2000;<br/>
+        rect.y = 2700;<br/>
+        rect.width = 15000;<br/>
+        rect.height = 8000;<br/>
+        rect.y = 110000;<br/>
+</pre>
+<br/><div class="bodytext">
+        Then you can create a chart:
+</div>
+<br/><pre class='code' id="code3">
+        spreadsheetDoc.createChart("<span class='javaclass'>Page</span> <span class='javaclass'>Visit</span>", dataSet,rect);<br/>
+</pre>
+<br/><div class="bodytext">
+        There are some shortcut methods to create charts, for example, below codes show how to create a chart in a text document:
+</div>
+<br/><pre class='code' id="code4">
+        <span class='javaclass'>Chart</span> chart = textDoc.createChart(<br/>
+                "<span class='javaclass'>Page</span> <span class='javaclass'>Visit</span>", spreadsheetDoc,<br/>
+                cellRange, <span class='basic'>true</span>, <span class='basic'>true</span>, <span class='basic'>false</span>, rect);<br/>
+</pre>
+<br/><div class="bodytext">
+        If you want to create a chart in a spreadsheet document, you need to specify a cell to be the anchor of this chart, for example: 
+</div>
+<br/><pre class='code' id="code5">
+        spreadsheetDoc.createChart("<span class='javaclass'>Page</span> <span class='javaclass'>Visit</span>", spreadsheetDoc, cellRange,<br/>
+                <span class='basic'>true</span>, <span class='basic'>true</span>, <span class='basic'>false</span>, rect, spreadsheetDoc.getTableByName("C")<br/>
+                        .getCellByPosition("D10"));<br/>
+</pre>
+<br/><div class="bodytext">
+        If you want to create a chart in a presentation document, you can use the existing layout of a slide, which means, you don't need to specify        a rectangle. The layouts that could contain a chart include: TITLE_PLUS_CHART, TITLE_PLUS_2_CHART, TITLE_LEFT_CHART_RIGHT_OUTLINE,      TITLE_PLUS_3_OBJECT, and TITLE_PLUS_4_OBJECT. For example:
+</div>
+<br/><pre class='code' id="code6">
+        <span class='javaclass'>Slide</span> slide = presentationDoc.newSlide(2, "Slide3",<br/>
+                <span class='javaclass'>SlideLayout</span>.TITLE_PLUS_2_CHART);<br/>
+        chart = slide.createChart("<span class='javaclass'>Count</span> of <span class='javaclass'>Visits</span>", spreadsheetDoc,<br/>
+                cellRange, <span class='basic'>true</span>, <span class='basic'>true</span>, <span class='basic'>false</span>, <span class='basic'>null</span>);<br/>
+</pre>
+<br/><strong><a href="#Update charts" >Update charts</a></strong>
+<hr/>
+<div class="bodytext">
+        You can update charts properties, for example, the title, axis title, chart type, whether to apply 3D effect, whether to use legend with API.       For example:
+</div>
+<br/><pre class='code' id="code7">
+        chart.setChartTitle("<span class='javaclass'>New</span> title");<br/>
+        chart.setAxisTitle("<span class='javaclass'>Hour</span>", "<span class='javaclass'>Number</span>");<br/>
+        chart.setChartType(<span class='javaclass'>ChartType</span>.<span class='javaclass'>AREA</span>);<br/>
+        chart.setApply3DEffect(<span class='basic'>true</span>);<br/>
+        chart.setUseLegend(<span class='basic'>true</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+        You can update the data set too. For example:
+</div>
+<br/><pre class='code' id="code8">
+        chart.setChartData(<span class='modifier'>new</span> <span class='javaclass'>DataSet</span>(<span class='javaclass'>CellRangeAddressList</span>.valueOf("A.A1:A.C4"), spreadsheetDoc, true, true, true));<br/>
+</pre>
+<br/><strong><a href="#Get and delete charts" >Get and delete charts</a></strong>
+<hr/>
+<div class="bodytext">
+        You can get charts by title e.g.
+</div>
+<br/><pre class='code' id="code9">
+        chart = textDoc.getChartByTitle("<span class='javaclass'>New</span> title").get(0);<br/>
+</pre>
+<br/><div class="bodytext">
+        You can also get a chart by its unique ID. The unique ID of a chart in Simple ODF API is the path of the chart document (relative to the ODF document package).     The unique ID can be gotten with method:
+</div>
+<br/><pre class='code' id="code10">
+        <span class='javaclass'>String</span> chartid = chart.getChartID();<br/>
+        chart = textDoc.getChartById(chartid);<br/>
+</pre>
+<br/><div class="bodytext">
+        You can also get the count of charts in this document.
+</div>
+<br/><pre class='code' id="code11">
+        <span class='basic'>int</span> count = textDoc.getChartCount();<br/>
+</pre>
+<br/><div class="bodytext">
+        You can delete a chart by ID or by title, e.g.
+</div>
+<br/><pre class='code' id="code12">
+        textDoc.deleteChartById(chartid);<br/>
+        textDoc.deleteChartByTitle("<span class='javaclass'>New</span> title");<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Cell Range.html">previous</a></li>
+  <li><a href="Style Handling.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Column and Row.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Column and Row.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Column and Row.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,159 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Column and Row.html">Column and Row</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Table.html">previous</a></li>
+  <li><a href="Cell.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Get Column/Row" >Get Column/Row</a></strong>
+<hr/>
+<div class="bodytext">
+The class Column/Row represents the column/row of table.To get all the columns or rows you can use the getColumnList or getRowList of the table instance.
+</div>
+<br/><pre class='code' id="code0">
+    <span class='javaclass'>List</span>&lt;<span class='javaclass'>Column</span>&gt; columns = table.getColumnList();<br/>
+    <span class='javaclass'>List</span>&lt;<span class='javaclass'>Row</span>&gt; rows = table.getRowList();<br/>
+</pre>
+<br/><div class="bodytext">
+You can also get single column/row by specifying the index of the column/row.
+</div>
+<div class="bodytext">
+The column/row index start from 0.If not found, null will be returned.
+</div>
+<br/><pre class='code' id="code1">
+    <br/>
+    <span class='javaclass'>Column</span> column = table.getColumnByIndex(2);<br/>
+    <span class='javaclass'>Row</span> row = table.getRowByIndex(0);<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to know the count of header column/row in the table,you can do like this:
+</div>
+<br/><pre class='code' id="code2">
+    <span class='basic'>int</span> headerColumnCount = table.getHeaderColumnCount();<br/>
+    <span class='basic'>int</span> headerRowCount = table.getHeaderRowCount();<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to know the index of the column/row,you can use the method below:
+</div>
+<br/><pre class='code' id="code3">
+    <span class='basic'>int</span> columnIndex=column.getColumnIndex();<br/>
+    <span class='basic'>int</span> rowIndex=row.getRowIndex();<br/>
+</pre>
+<br/><div class="bodytext">
+Can I get the previous or next Column/Row by the current column/row instance?
+</div>
+<div class="bodytext">
+Yes,you can ask the column/row instance itself,if it doesn't exist,null will be returned.
+</div>
+<br/><pre class='code' id="code4">
+    <span class='javaclass'>Column</span> previousCol=column.getPreviousColumn();<br/>
+    <span class='javaclass'>Column</span> nextCol=column.getNextColumn();<br/>
+    <span class='javaclass'>Row</span> previousRow=row.getPreviousRow();<br/>
+    <span class='javaclass'>Row</span> nextRow=row.getNextRow();<br/>
+</pre>
+<br/><strong><a href="#Append or Insert Column/Row" >Append or Insert Column/Row</a></strong>
+<hr/>
+<div class="bodytext">
+You can add a column to the end or insert many columns before the specified index
+</div>
+<div class="bodytext">
+The appendColumn/Row method add an empty column/row at the end and return the new appended column/row
+</div>
+<br/><pre class='code' id="code5">
+    <span class='javaclass'>Column</span> newColumn=table.appendColumn();<br/>
+    <span class='javaclass'>Row</span> newRow=table.appendRow();<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I want to insert a column/row into the specified position?
+</div>
+<div class="bodytext">
+     You can use the insertColumn/RowBefore method,whose first parameter is the index of the column/row to be inserted before;   The second parameter is the number of columns/rows to be inserted.
+</div>
+<br/><pre class='code' id="code6">
+    <span class='javaclass'>List</span>&lt;<span class='javaclass'>Column</span>&gt; cols = table.insertColumnsBefore(1, 2);<br/>
+    <span class='javaclass'>List</span>&lt;<span class='javaclass'>Row</span>&gt; newRows = table.insertRowsBefore(0, 2);<br/>
+</pre>
+<br/><strong><a href="#Remove Columns/Rows" >Remove Columns/Rows</a></strong>
+<hr/>
+<div class="bodytext">
+You can delete a number of columns/rows by index
+</div>
+<div class="bodytext">
+The first parameter is the index of the first column/row to delete; The second parameter is the number of columns/rows to delete.
+</div>
+<div class="bodytext">
+The code below remove 1 column whose index is 2;remove 2 rows whose index is 1,2. 
+</div>
+<br/><pre class='code' id="code7">
+    table.removeColumnsByIndex(2, 1);<br/>
+    table.removeRowsByIndex(1, 2);<br/>
+</pre>
+<br/><strong><a href="#Set Column/Row" >Set Column/Row</a></strong>
+<hr/>
+<div class="bodytext">
+If you want to change the width of the column or the height of the row,you can use it like this:
+</div>
+<div class="bodytext">
+If the second parameter of row's setHeight is true, the row can fit the height to the text, vice versa.
+</div>
+<br/><pre class='code' id="code8">
+    column.setWidth(column.getWidth()/2);<br/>
+    row.setHeight(row.getHeight()/2, <span class='basic'>true</span>);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Table.html">previous</a></li>
+  <li><a href="Cell.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Fields.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Fields.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Fields.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,192 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Fields.html">Fields</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="TextExtractor.html">previous</a></li>
+  <li><a href="Manipulate Metadata.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Variable Field" >Variable Field</a></strong>
+<hr/>
+<div class="bodytext">
+            You can use the following code to create a variable field, and set the value.
+</div>
+<br/><pre class='code' id="code0">
+            <span class='javaclass'>TextDocument</span> doc = <span class='javaclass'>TextDocument</span>.newTextDocument();<br/>
+            <span class='javaclass'>Paragraph</span> paragraph = doc.addParagraph("test_con_variable:");<br/>
+            <span class='javaclass'>VariableField</span> simpleVariableField = <span class='javaclass'>Fields</span>.createSimpleVariableField(doc, "test_con_variable");<br/>
+            simpleVariableField.updateField("true", paragraph.getOdfElement());<br/>
+</pre>
+<br/><div class="bodytext">
+            Following code can be used to set value to variable field, and append it to an ODF element.
+</div>
+<br/><pre class='code' id="code1">
+            simpleVariableField.updateField("user variable content", null);<br/>
+            simpleVariableField.displayField(paragraph.getOdfElement());<br/>
+</pre>
+<br/><strong><a href="#Condition Field" >Condition Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a condition field.
+</div>
+<br/><pre class='code' id="code2">
+            <span class='javaclass'>Paragraph</span> newParagraph = doc.addParagraph("<span class='javaclass'>Condition</span> <span class='javaclass'>Field</span> <span class='javaclass'>Test</span>:");<br/>
+            <span class='javaclass'>ConditionField</span> conditionField = <span class='javaclass'>Fields</span>.createConditionField(newParagraph.getOdfElement(), "test_con_variable == "true"",<br/>
+                    "trueText", "falseText");<br/>
+</pre>
+<br/><strong><a href="#Hidden Field" >Hidden Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a hidden field.
+</div>
+<br/><pre class='code' id="code3">
+            newParagraph = doc.addParagraph("<span class='javaclass'>Hide</span> <span class='javaclass'>Text</span> <span class='javaclass'>Field</span> <span class='javaclass'>Test</span>:");<br/>
+            conditionField = <span class='javaclass'>Fields</span>.createHiddenTextField(newParagraph.getOdfElement(), "test_con_variable == "true"", "hiddenText");<br/>
+</pre>
+<br/><strong><a href="#Cross Reference Field" >Cross Reference Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a reference field.
+</div>
+<br/><pre class='code' id="code4">
+            <span class='javaclass'>OdfElement</span> newTextSpanElement = ((<span class='javaclass'>TextPElement</span>)doc.addParagraph("<span class='javaclass'>Reference</span> <span class='javaclass'>Content</span>:").getOdfElement()).newTextSpanElement();<br/>
+            newTextSpanElement.setTextContent("<span class='javaclass'>This</span> is a test reference content.");<br/>
+            <span class='javaclass'>ReferenceField</span> referenceField = <span class='javaclass'>Fields</span>.createReferenceField(newTextSpanElement, "test-ref");<br/>
+</pre>
+<br/><div class="bodytext">
+            Following code can be used to append a reference field.
+</div>
+<br/><pre class='code' id="code5">
+            referenceField.appendReferenceTo(doc.addParagraph("<span class='javaclass'>User</span> <span class='javaclass'>Reference</span> <span class='javaclass'>Field</span>:").getOdfElement(), <span class='javaclass'>ReferenceField</span>.<span class='javaclass'>DisplayType</span>.<span class='javaclass'>TEXT</span>);<br/>
+</pre>
+<br/><strong><a href="#Chapter Field" >Chapter Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a chapter field.
+</div>
+<br/><pre class='code' id="code6">
+            <span class='javaclass'>ChapterField</span> chapterField = <span class='javaclass'>Fields</span>.createChapterField(doc.addParagraph("<span class='javaclass'>Chapter</span>:").getOdfElement());<br/>
+</pre>
+<br/><strong><a href="#Title and Subject Field" >Title and Subject Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a title field.
+</div>
+<br/><pre class='code' id="code7">
+            <span class='javaclass'>TitleField</span> titleField = <span class='javaclass'>Fields</span>.createTitleField(doc.addParagraph("<span class='javaclass'>The</span> <span class='javaclass'>Title</span>:").getOdfElement());<br/>
+</pre>
+<br/><div class="bodytext">
+            Following code can be used to create a subject field.
+</div>
+<br/><pre class='code' id="code8">
+            <span class='javaclass'>SubjectField</span> subjectField = <span class='javaclass'>Fields</span>.createSubjectField(doc.addParagraph("<span class='javaclass'>The</span> <span class='javaclass'>Subject</span>:").getOdfElement());<br/>
+</pre>
+<br/><strong><a href="#Author Field" >Author Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a author initial field and a author name field.
+</div>
+<br/><pre class='code' id="code9">
+            <span class='javaclass'>AuthorField</span> authorField = <span class='javaclass'>Fields</span>.createAuthorInitialsField(doc.addParagraph("<span class='javaclass'>The</span> initials of the author :").getOdfElement());<br/>
+            authorField = <span class='javaclass'>Fields</span>.createAuthorNameField(doc.addParagraph("<span class='javaclass'>Author</span>:").getOdfElement());<br/>
+</pre>
+<br/><strong><a href="#Page Number Field" >Page Number Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a current page number field.
+</div>
+<br/><pre class='code' id="code10">
+            <span class='javaclass'>PageNumberField</span> numberField = <span class='javaclass'>Fields</span>.createCurrentPageNumberField(doc.addParagraph("<span class='javaclass'>Current</span> <span class='javaclass'>Page</span> <span class='javaclass'>Number</span>:").getOdfElement());<br/>
+            numberField.setNumberFormat(<span class='javaclass'>NumberFormat</span>.UPPERCASE_LATIN_ALPHABET);<br/>
+            numberField.setDisplayPage(<span class='javaclass'>DisplayType</span>.NEXT_PAGE);<br/>
+</pre>
+<br/><div class="bodytext">
+            Following code can be used to create a previous page number and a next page number field.
+</div>
+<br/><pre class='code' id="code11">
+            numberField = <span class='javaclass'>Fields</span>.createPreviousPageNumberField(doc.addParagraph("<span class='javaclass'>Previous</span> <span class='javaclass'>Page</span> <span class='javaclass'>Number</span>:").getOdfElement());<br/>
+            numberField = <span class='javaclass'>Fields</span>.createNextPageNumberField(doc.addParagraph("<span class='javaclass'>Next</span> <span class='javaclass'>Page</span> <span class='javaclass'>Number</span>:").getOdfElement());<br/>
+</pre>
+<br/><strong><a href="#Page Number Field" >Page Number Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a page count field, and set the number format.
+</div>
+<br/><pre class='code' id="code12">
+            <span class='javaclass'>PageCountField</span> countField = <span class='javaclass'>Fields</span>.createPageCountField(doc.addParagraph("<span class='javaclass'>Page</span> <span class='javaclass'>Count</span>:").getOdfElement());<br/>
+            countField.setNumberFormat(<span class='javaclass'>NumberFormat</span>.UPPERCASE_LATIN_ALPHABET);<br/>
+</pre>
+<br/><strong><a href="#Date Field" >Date Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a date field, and set the format.
+</div>
+<br/><pre class='code' id="code13">
+            <span class='javaclass'>DateField</span> dateField = <span class='javaclass'>Fields</span>.createDateField(doc.addParagraph("<span class='javaclass'>Date</span>:").getOdfElement());<br/>
+            dateField.formatDate("yy-<span class='javaclass'>MM</span>-dd");<br/>
+</pre>
+<br/><strong><a href="#Time Field" >Time Field</a></strong>
+<hr/>
+<div class="bodytext">
+            Following code can be used to create a time field, and set the format.
+</div>
+<br/><pre class='code' id="code14">
+            <span class='javaclass'>TimeField</span> timeField = <span class='javaclass'>Fields</span>.createTimeField(doc.addParagraph("<span class='javaclass'>Time</span>:").getOdfElement());<br/>
+            timeField.formatTime("<span class='javaclass'>HH</span>:mm:ss a");<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="TextExtractor.html">previous</a></li>
+  <li><a href="Manipulate Metadata.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,133 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Manipulate Metadata.html">Manipulate Metadata</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Fields.html">previous</a></li>
+  <li><a href="Text Document.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Overview" >Overview</a></strong>
+<hr/>
+<div class="bodytext">
+     This <a href="">Meta</a> API supports to access and set document metadata. It covers the metadata definitions in <a href="http:docs.oasis-open.org/office/v1.2/cd05/OpenDocument-v1.2-cd05-part1.html#a_4_Metadata">ODF Specification 1.2 Committee Draft05</a>
+</div>
+<strong><a href="#Get Meta object" >Get Meta object</a></strong>
+<hr/>
+<div class="bodytext">
+     First you load an ODF text document(for example),then get the meta file DOM and then use the meta DOM to create an instance of     the Meta. Use Meta you can access all the supported elements.
+</div>
+<br/><pre class='code' id="code0">
+    <span class='javaclass'>TextDocument</span> doc = (<span class='javaclass'>TextDocument</span>) <span class='javaclass'>TextDocument</span>.loadDocument("testtable.odt");<br/>
+    <span class='javaclass'>OdfFileDom</span> metadom = doc.getMetaDom();<br/>
+    <span class='javaclass'>Meta</span> metadata = <span class='modifier'>new</span> <span class='javaclass'>Meta</span>(metadom);<br/>
+</pre>
+<br/><strong><a href="#Access metadata" >Access metadata</a></strong>
+<hr/>
+<div class="bodytext">
+     After creating the Meta instance,you can use it to manipulate the metadata:     for example, you can set a value for the &lt;meta:generator&gt; like this:
+</div>
+<br/><pre class='code' id="code1">
+    metadata.setGenerator("<span class='javaclass'>OpenOffice</span>.org/3.0$Win32 <span class='javaclass'>OpenOffice</span>.org_project/300m15$<span class='javaclass'>Build</span>-9379");<br/>
+</pre>
+<br/><div class="bodytext">
+     The &lt;meta:keyword&gt; may contain many keywords, you can set the whole list of keywords and add one keyword as you want.     the api currently do not provide the direct method for deleting one keyword ,you can get the keyword list first,and then     delete the keyword,finally set the list to the element.
+</div>
+<br/><pre class='code' id="code2">
+       metadata.addKeyword("java");<br/>
+      <span class='javaclass'>List</span>&lt;<span class='javaclass'>String</span>&gt; keywords=metadata.getKeywords();<br/>
+      keywords.remove("java");<br/>
+      metadata.setKeywords(keywords);<br/>
+</pre>
+<br/><strong><a href="#Access the user defined element" >Access the user defined element</a></strong>
+<hr/>
+<div class="bodytext">
+    To manipulate the user defined data,you should get the list of their names,and then use the names to     update the data or its datatype or delete the whole user defined data.    you can use the setUserDefinedData(String name, String type, String value) method to update data,if the    name not exists in the document,the method will add the new user defined data.
+</div>
+<br/><pre class='code' id="code3">
+      <span class='javaclass'>List</span>&lt;<span class='javaclass'>String</span>&gt; names=metadata.getUserDefinedDataNames();<br/>
+      <span class='control'>for</span> (<span class='javaclass'>String</span> name : names) {<br/>
+      metadata.removeUserDefinedDataByName(name);<br/>
+      }<br/>
+      <span class='javaclass'>String</span> key="newId";<br/>
+<span class='comments'>      //org.odftoolkit.odfdom.dom.attribute.meta.MetaValueTypeAttribute.Value</span>
+      metadata.setUserDefinedData(key, <span class='javaclass'>Value</span>.<span class='javaclass'>STRING</span>.toString(), "new001");<br/>
+<span class='comments'>      //update the  datatype</span>
+      metadata.setUserDefinedDataType(key, <span class='javaclass'>Value</span>.<span class='javaclass'>BOOLEAN</span>.toString());<br/>
+<span class='comments'>      //update the data value</span>
+      metadata.setUserDefinedDataValue(key, "false");<br/>
+      <br/>
+<span class='comments'>      //get the datatype</span>
+      <span class='javaclass'>String</span> dataType=metadata.getUserDefinedDataType(key);<br/>
+<span class='comments'>      //get the data value</span>
+      <span class='javaclass'>String</span> dataValue=metadata.getUserDefinedDataValue(key);    <br/>
+</pre>
+<br/><strong><a href="#Access the document statistics" >Access the document statistics</a></strong>
+<hr/>
+<div class="bodytext">
+    if you want to access the document statistics,you should get a DocumentStatistic instance,    if the return is null,it means that this ODF document doesn't have any document statistic information,you should    create a document statistics object.
+</div>
+<br/><pre class='code' id="code4">
+    <span class='javaclass'>DocumentStatistic</span> stat = metadata.getDocumentStatistic();<br/>
+    <span class='control'>if</span>(stat==<span class='basic'>null</span>) {<br/>
+        stat=<span class='modifier'>new</span> <span class='javaclass'>DocumentStatistic</span>(metadata.getOfficeMetaElement().newMetaDocumentStatisticElement());<br/>
+    }<br/>
+    <br/>
+    stat.setCellCount(3);<br/>
+    <span class='javaclass'>Integer</span> cellCount=stat.getCellCount();<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Fields.html">previous</a></li>
+  <li><a href="Text Document.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate TextSearch.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate TextSearch.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Manipulate TextSearch.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,227 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Manipulate TextSearch.html">Manipulate TextSearch</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Style Handling.html">previous</a></li>
+  <li><a href="TextExtractor.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#TextNavigation" >TextNavigation</a></strong>
+<hr/>
+<div class="bodytext">
+        First an ODF text document is needed to test the navigation operation. The following codes shows two main functions of TextNavigation       :hasNext() and getCurrentItem(). The first parameter of the TextNavigation constructor is the matched pattern String, and the second is     the navigation scope.
+</div>
+<div class="bodytext">
+        The result of function getCurrentItem is a Selection object, so a TextSelection object is used here to check out        the result.Finally the informations of all the String "What" in the text document will be printed out.
+</div>
+<br/><pre class='code' id="code0">
+        <span class='javaclass'>TextDocument</span> textdoc=(<span class='javaclass'>TextDocument</span>)<span class='javaclass'>TextDocument</span>.loadDocument("textsearch.odt");<br/>
+        <span class='javaclass'>TextNavigation</span> search1;<br/>
+        search1=<span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("<span class='javaclass'>What</span>",textdoc);<br/>
+        <span class='control'>while</span> (search1.hasNext()) {<br/>
+            <span class='javaclass'>TextSelection</span> item1 = (<span class='javaclass'>TextSelection</span>) search1.nextSelection();<br/>
+            <span class='javaclass'>System</span>.out.println(item1);<br/>
+        }       <br/>
+</pre>
+<br/><strong><a href="#TextSelection" >TextSelection</a></strong>
+<hr/>
+<a href="#Get Index/Text of TextSelection" >Get Index/Text of TextSelection</a>
+<hr/>
+<div class="bodytext">
+        Run the following codes will get the text content of the searched String "good" and the corresponding index in      the text document.
+</div>
+<br/><pre class='code' id="code1">
+        <span class='javaclass'>TextNavigation</span> search2=<span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("good",textdoc);<br/>
+        <span class='control'>while</span>(search2.hasNext()){<br/>
+            <span class='javaclass'>TextSelection</span> item2=(<span class='javaclass'>TextSelection</span>) search2.nextSelection();<br/>
+            <span class='javaclass'>String</span> searchedText=item2.getText();<br/>
+            <span class='basic'>int</span> searchedIndex=item2.getIndex();  <br/>
+            <span class='javaclass'>System</span>.out.println(searchedText);<br/>
+            <span class='javaclass'>System</span>.out.println(searchedIndex);<br/>
+        }       <br/>
+</pre>
+<br/><a href="#Cut String" >Cut String</a>
+<hr/>
+<div class="bodytext">
+        To cut some specified string in a text document, you can do like the following codes which      cut off all the String "day" in the document.
+</div>
+<br/><pre class='code' id="code2">
+            search2=<span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("day",textdoc);<br/>
+        <span class='control'>while</span>(search2.hasNext()){<br/>
+            <span class='javaclass'>TextSelection</span> item=(<span class='javaclass'>TextSelection</span>) search2.nextSelection();<br/>
+            item.cut(); <br/>
+        }       <br/>
+</pre>
+<br/><a href="#Paste String" >Paste String</a>
+<hr/>
+<div class="bodytext">
+        The following codes paste the string "change" both at the front and at the end of the string "good",        by using the function pasteAtFrontOf() and pasteAtEndOf().
+</div>
+<br/><pre class='code' id="code3">
+        search2 = <span class='basic'>null</span>;<br/>
+        search2 = <span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("good", textdoc);<br/>
+        <span class='javaclass'>TextSelection</span> pastesource = <span class='basic'>null</span>;<br/>
+        <span class='javaclass'>TextNavigation</span> search3 = <span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("change", textdoc);<br/>
+        <span class='control'>if</span> (search3.hasNext()) {<br/>
+            pastesource = (<span class='javaclass'>TextSelection</span>) search3.nextSelection();<br/>
+        }       <br/>
+        <span class='control'>while</span> (search2.hasNext()) {<br/>
+            <span class='javaclass'>TextSelection</span> item = (<span class='javaclass'>TextSelection</span>) search2.nextSelection(); <br/>
+<span class='comments'>         //paste "change" at the front of "good"</span>
+            pastesource.pasteAtFrontOf(item);<br/>
+<span class='comments'>         //paste "change" at the end of "good"</span>
+            pastesource.pasteAtEndOf(item);<br/>
+        }<br/>
+</pre>
+<br/><a href="#Replace String" >Replace String</a>
+<hr/>
+<div class="bodytext">
+The following codes replace all the string "replacesource" with the string "replacedest" in the text document.
+</div>
+<br/><pre class='code' id="code4">
+        search2 = <span class='basic'>null</span>;<br/>
+        search2 = <span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("replacesource", textdoc);<br/>
+        <span class='control'>if</span> (search3.hasNext()) {<br/>
+            <span class='javaclass'>TextSelection</span> item= (<span class='javaclass'>TextSelection</span>) search3.nextSelection();<br/>
+            item.replaceWith("replacedest");<br/>
+        }       <br/>
+</pre>
+<br/><a href="#Add Reference to String" >Add Reference to String</a>
+<hr/>
+<div class="bodytext">
+        To add reference for a string, you can do like the following codes. Here        function addHref is used, the parameter of it is an URL object. The codes add network address       "http:www.ibm.com" to the string "network".
+</div>
+<br/><pre class='code' id="code5">
+        search2 = <span class='basic'>null</span>;<br/>
+        search2 = <span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("network", textdoc);<br/>
+        <span class='control'>while</span> (search2.hasNext()) {<br/>
+            <span class='javaclass'>TextSelection</span> item = (<span class='javaclass'>TextSelection</span>) search2.nextSelection();<br/>
+            item.addHref(<span class='modifier'>new</span> <span class='javaclass'>URL</span>("http://www.ibm.com"));<br/>
+        }<br/>
+</pre>
+<br/><a href="#Add Comment" >Add Comment</a>
+<hr/>
+<div class="bodytext">
+        Adding comment is a useful function when review document, such as spell check and security check.       You can do it like the following codes. Here, function addComment is used, the first parameter is       the comment content, the second parameter is the comment author. The codes add a spell suggestion       before the string "natwork".
+</div>
+<br/><pre class='code' id="code6">
+        <span class='javaclass'>TextNavigation</span> search4 = <span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("natwork", textdoc);<br/>
+        <span class='control'>while</span> (search4.hasNext()) {<br/>
+            <span class='javaclass'>TextSelection</span> selection = (<span class='javaclass'>TextSelection</span>) search4.nextSelection();<br/>
+            selection.addComment("<span class='javaclass'>Please</span> change 'natwork' with 'network'.",  "<span class='javaclass'>SpellChecker</span>");<br/>
+        }<br/>
+</pre>
+<br/><strong><a href="#FieldSelection" >FieldSelection</a></strong>
+<hr/>
+<div class="bodytext">
+        Field Selection is a decorator class of TextSelection, which help user replace a text content with field.       Following code can be used to search the document content, and replace with a simple field.
+</div>
+<br/><pre class='code' id="code7">
+        <span class='javaclass'>TextDocument</span> doc = <span class='javaclass'>TextDocument</span>.loadDocument("fieldSample.odt");<br/>
+        <span class='javaclass'>TextNavigation</span> search = <span class='modifier'>new</span> <span class='javaclass'>TextNavigation</span>("<span class='javaclass'>ReplaceDateTarget</span>", doc);<br/>
+        <span class='control'>while</span> (search.hasNext()) {<br/>
+            <span class='javaclass'>TextSelection</span> item = (<span class='javaclass'>TextSelection</span>) search.nextSelection();<br/>
+            <span class='javaclass'>FieldSelection</span> fieldSelection = <span class='modifier'>new</span> <span class='javaclass'>FieldSelection</span>(item);<br/>
+            fieldSelection.replaceWithSimpleField(<span class='javaclass'>Field</span>.<span class='javaclass'>FieldType</span>.FIXED_DATE_FIELD);<br/>
+        }<br/>
+</pre>
+<br/><div class="bodytext">
+        Following code can be used to search the document content, and replace with a condition field.
+</div>
+<br/><pre class='code' id="code8">
+        <span class='javaclass'>TextSelection</span> item = (<span class='javaclass'>TextSelection</span>) search.nextSelection();<br/>
+        <span class='javaclass'>FieldSelection</span> fieldSelection = <span class='modifier'>new</span> <span class='javaclass'>FieldSelection</span>(item);<br/>
+        fieldSelection.replaceWithConditionField("test_con_variable == "true"", "trueText", "falseText");<br/>
+</pre>
+<br/><div class="bodytext">
+        Following code can be used to replace with a hidden field.
+</div>
+<br/><pre class='code' id="code9">
+        fieldSelection.replaceWithHiddenTextField("test_con_variable == "true"", "hiddenText");<br/>
+</pre>
+<br/><div class="bodytext">
+        Following code can be used to replace with a reference field.
+</div>
+<br/><pre class='code' id="code10">
+        <span class='javaclass'>ReferenceField</span> referenceField = <span class='javaclass'>Fields</span>.createReferenceField(doc.addParagraph("span").getOdfElement(), "selection-test-ref");<br/>
+        fieldSelection.replaceWithReferenceField(referenceField, <span class='javaclass'>ReferenceField</span>.<span class='javaclass'>DisplayType</span>.<span class='javaclass'>TEXT</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+        Following code can be used to replace with a variable field.
+</div>
+<br/><pre class='code' id="code11">
+        <span class='javaclass'>VariableField</span> userVariableField = <span class='javaclass'>Fields</span>.createUserVariableField(doc, "selection_user_variable", "test");<br/>
+        fieldSelection.replaceWithVariableField(userVariableField);<br/>
+</pre>
+<br/><strong><a href="#TextStyleNavigation" >TextStyleNavigation</a></strong>
+<hr/>
+<div class="bodytext">
+        Similar with TextNavigation, TextStyleNavigation has two main functions: getCurrentItem() and       hasNext() which is shown in the following codes. The input parameter of TextStyleNavigation constructor     is a map of OdfStyleProperty, so here a TreeMap "searchProps" which contains the Style properties is used       to construct the TextStyleNavigation object.
+</div>
+<br/><pre class='code' id="code12">
+        <span class='javaclass'>TextStyleNavigation</span> searchStyle1;<br/>
+        <span class='javaclass'>TreeMap</span>&lt;<span class='javaclass'>OdfStyleProperty</span>, <span class='javaclass'>String</span>&gt; searchProps = <span class='modifier'>new</span> <span class='javaclass'>TreeMap</span>&lt;<span class='javaclass'>OdfStyleProperty</span>, <span class='javaclass'>String</span>&gt;();<br/>
+        searchProps.put(<span class='javaclass'>StyleTextPropertiesElement</span>.<span class='javaclass'>FontName</span>, "<span class='javaclass'>Times</span> <span class='javaclass'>New</span> Roman1");<br/>
+        searchProps.put(<span class='javaclass'>StyleTextPropertiesElement</span>.<span class='javaclass'>FontSize</span>, "16pt");<br/>
+        searchStyle1 = <span class='modifier'>new</span> <span class='javaclass'>TextStyleNavigation</span>(searchProps, textdoc);<br/>
+        <span class='control'>if</span> (searchStyle1.hasNext()) {<br/>
+            <span class='javaclass'>TextSelection</span> itemstyle = (<span class='javaclass'>TextSelection</span>) searchStyle1.nextSelection();<br/>
+            <span class='javaclass'>System</span>.out.print((itemstyle.toString()));<br/>
+        }<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Style Handling.html">previous</a></li>
+  <li><a href="TextExtractor.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Presentation Document.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Presentation Document.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Presentation Document.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,107 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Presentation Document.html">Presentation Document</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Text Document.html">previous</a></li>
+  <li><a href="Slide.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Create Presentation Document" >Create Presentation Document</a></strong>
+<hr/>
+<div class="bodytext">
+Let's create an empty presentation document first. The following codes generates an empty presentation document with one slide:
+</div>
+<br/><pre class='code' id="code0">
+            <span class='javaclass'>PresentationDocument</span> document=<span class='javaclass'>PresentationDocument</span>.newPresentationDocument();  <br/>
+            document.save(filePath);<br/>
+</pre>
+<br/><div class="bodytext">
+We can also create a presentation template document by using the following codes. The operation of the template document is the same with the normal presentation document.
+</div>
+<br/><pre class='code' id="code1">
+                    <span class='javaclass'>PresentationDocument</span> documentTmp=<span class='javaclass'>PresentationDocument</span>.newPresentationTemplateDocument();              <br/>
+</pre>
+<br/><strong><a href="#Get Presentation Document" >Get Presentation Document</a></strong>
+<hr/>
+<div class="bodytext">
+We can get the existing presentation Document by using the loadDocument function like follows: 
+</div>
+<div class="bodytext">
+Here presentation.odp is the name of the existing presentation document.
+</div>
+<div class="bodytext">
+Also we can append all the slides of the specified presentation document to the current document by using the following codes:
+</div>
+<div class="bodytext">
+Here the slides of the documents "presentation.odp" will be appended to "document".
+</div>
+<br/><pre class='code' id="code2">
+            <span class='javaclass'>PresentationDocument</span> presentationmodel;<br/>
+            presentationmodel=(<span class='javaclass'>PresentationDocument</span>)<span class='javaclass'>PresentationDocument</span>.loadDocument("presentation.odp");<br/>
+                document.appendPresentation(presentationmodel);        <br/>
+</pre>
+<br/><strong><a href="#Change Presentation Mode" >Change Presentation Mode</a></strong>
+<hr/>
+<div class="bodytext">
+We can switch the mode presentation documents by using the following codes. Here the first one convert the presentation document to a template, and the second one convert the template to a normal presentation document.
+</div>
+<br/><pre class='code' id="code3">
+            document.changeMode(<span class='javaclass'>OdfMediaType</span>.PRESENTATION_TEMPLATE); <br/>
+            documentTmp.changeMode(<span class='javaclass'>OdfMediaType</span>.<span class='javaclass'>PRESENTATION</span>);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Text Document.html">previous</a></li>
+  <li><a href="Slide.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Slide.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Slide.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/document/cookbook/Slide.html Tue Sep  6 10:20:36 2011
@@ -36,10 +36,199 @@
   </div>
   <div id="clear"></div>
   
-  <div id="content">
+  <div id="sidenav">
+    <h1 id="general">General</h1>
+<ul>
+<li><a href="/odftoolkit/index.html">About</a></li>
+<li><a href="http://incubator.apache.org/projects/odftoolkit.html">Incubator page</a></li>
+<li><a href="/odftoolkit/license.html">License</a></li>
+</ul>
+<h1 id="components">Components</h1>
+<ul>
+<li><a href="/odftoolkit/odfdom/index.html">ODFDOM</a></li>
+<li><a href="/odftoolkit/simple/index.html">Simple API</a></li>
+<li><a href="/odftoolkit/conformance/ODFValidator.html">Conformance Tools</a></li>
+<li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
+</ul>
+<h1 id="community">Community</h1>
+<ul>
+<li><a href="/odftoolkit/get-involved.html">Get Involved</a></li>
+<li><a href="/odftoolkit/mailing-lists.html">Mailing Lists</a></li>
+<li><a href="/odftoolkit/people.html">People</a></li>
+<li><a href="/odftoolkit/community-faqs.html">Community FAQs</a></li>
+</ul>
+<h1 id="development">Development</h1>
+<ul>
+<li><a href="/odftoolkit/source.html">Source Code</a></li>
+<li><a href="/odftoolkit/website-local.html">Website</a></li>
+<li><a href="/odftoolkit/developer-faqs.html">Developer FAQs</a></li>
+</ul>
+<h1 id="ppmc">PPMC</h1>
+<ul>
+<li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a><br />
+</li>
+</ul>
+<h1 id="asf">ASF</h1>
+<ul>
+<li><a href="http://www.apache.org">Apache Software Foundation</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">Thanks</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">Become a Sponsor</a></li>
+</ul>
+  </div>
+  <div id="contenta">
   
     
-    
+    <p><strong><a href="../index.html">Documents</a></strong> &gt; <strong><a href="index.html">Cookbook</a></strong> &gt;<strong><a href="Slide.html">Slide</a></strong>
+<div class="navigation">
+ <ul>
+  <li><a href="Presentation Document.html">previous</a></li>
+  <li><a href="Table.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<strong><a href="#Add Slide" >Add Slide</a></strong>
+<hr/>
+<div class="bodytext">
+If you want to add new slide to the presentation document, you can use the following codes:
+</div>
+<div class="bodytext">
+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.
+</div>
+<br/><pre class='code' id="code0">
+                <span class='javaclass'>PresentationDocument</span> document=<span class='javaclass'>PresentationDocument</span>.newPresentationDocument();                     <br/>
+        document.newSlide(1, "new slide", <span class='javaclass'>SlideLayout</span>.TITLE_ONLY);<br/>
+</pre>
+<br/><strong><a href="#Get Slide" >Get Slide</a></strong>
+<hr/>
+<div class="bodytext">
+You can get the slide through the index in the presentation document, like follows:
+</div>
+<br/><pre class='code' id="code1">
+        <span class='javaclass'>Slide</span> slide;<br/>
+        slide=document.getSlideByIndex(0);<br/>
+</pre>
+<br/><div class="bodytext">
+Or you can get the slide through the name of it by using the following code:
+</div>
+<br/><pre class='code' id="code2">
+        slide=document.getSlideByName("new slide");<br/>
+</pre>
+<br/><div class="bodytext">
+To get all the slides in the document,you can do like this:
+</div>
+<br/><pre class='code' id="code3">
+        <span class='javaclass'>Iterator</span>&lt;<span class='javaclass'>Slide</span>&gt; slideList=document.getSlides();<br/>
+</pre>
+<br/><div class="bodytext">
+Also you can get the number of the slides in the document by the following code:
+</div>
+<br/><pre class='code' id="code4">
+        <span class='basic'>int</span> numSlide=document.getSlideCount();<br/>
+</pre>
+<br/><strong><a href="#Set/Get Slide Name/Index" >Set/Get Slide Name/Index</a></strong>
+<hr/>
+<div class="bodytext">
+If you want to set a new name for a slide, you can use the following two methods:
+</div>
+<br/><pre class='code' id="code5">
+        slide.setSlideName("second slide"); <br/>
+        document.getSlideByIndex(2).setSlideName("third slide");<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to know the index and the name of one slide which is being operated, you can use the following codes:
+</div>
+<br/><pre class='code' id="code6">
+        <span class='basic'>int</span> slideIndex=slide.getSlideIndex();<br/>
+        <span class='javaclass'>String</span> slideName=slide.getSlideName();<br/>
+</pre>
+<br/><strong><a href="#Copy Slide" >Copy Slide</a></strong>
+<hr/>
+<div class="bodytext">
+You can copy a slide in the presentation document from one position to another by using the following codes:
+</div>
+<div class="bodytext">
+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. 
+</div>
+<br/><pre class='code' id="code7">
+        document.copySlide(1, 2, "copied slide");<br/>
+</pre>
+<br/><div class="bodytext">
+And also you can copy a slide from another document by using the following codes:
+</div>
+<div class="bodytext">
+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.
+</div>
+<br/><pre class='code' id="code8">
+         <span class='javaclass'>PresentationDocument</span> documentmodel;<br/>
+         documentmodel=(<span class='javaclass'>PresentationDocument</span>)<span class='javaclass'>PresentationDocument</span>.loadDocument("presentation.odp");<br/>
+         document.copyForeignSlide(1, documentmodel, 2);<br/>
+</pre>
+<br/><strong><a href="#Move/Delete Slide" >Move/Delete Slide</a></strong>
+<hr/>
+<div class="bodytext">
+To move one slide to another position of this presentation position, you can use the following codes:
+</div>
+<div class="bodytext">
+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.
+</div>
+<br/><pre class='code' id="code9">
+        document.moveSlide(2, 1);       <br/>
+</pre>
+<br/><div class="bodytext">
+You can delete the slide either by through the index or through the name of the specified slide, like follows:
+</div>
+<br/><pre class='code' id="code10">
+        document.deleteSlideByIndex(1);<br/>
+        document.deleteSlideByName("third slide");<br/>
+</pre>
+<br/><strong><a href="#Add Text to Slide" >Add Text to Slide</a></strong>
+<hr/>
+<div class="bodytext">
+      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.
+</div>
+<br/><pre class='code' id="code11">
+        <span class='javaclass'>Textbox</span> titleBox = slide.getTextboxByUsage(<span class='javaclass'>PresentationClass</span>.<span class='javaclass'>TITLE</span>).get(0);<br/>
+        titleBox.setTextContent("<span class='javaclass'>This</span> is the title");<br/>
+        <span class='javaclass'>Textbox</span> outline = slide.getTextboxByUsage(<span class='javaclass'>PresentationClass</span>.<span class='javaclass'>OUTLINE</span>).get(0);<br/>
+        <span class='javaclass'>List</span> txtList = outline.addList();<br/>
+        txtList.addItem("<span class='javaclass'>List</span> Item1");<br/>
+        txtList.addItem("<span class='javaclass'>List</span> Item2");<br/>
+</pre>
+<br/><div class="bodytext">
+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:
+</div>
+<br/><pre class='code' id="code12">
+        <span class='javaclass'>Notes</span> note=slide.getNotesPage();<br/>
+        note.addText("text notes");<br/>
+</pre>
+<br/><strong><a href="#Add Image to Slide" >Add Image to Slide</a></strong>
+<hr/>
+<div class="bodytext">
+To add an image to slide, you can use below codes to simply add the image to the last slide of the presentation document.
+</div>
+<br/><pre class='code' id="code13">
+        <span class='javaclass'>URI</span> imageuri=<span class='modifier'>new</span> <span class='javaclass'>URI</span>("namdaemun.jpg");<br/>
+        document.newImage(imageuri);<br/>
+</pre>
+<br/><div class="bodytext">
+Or you can use following code to add an image to a specific position you want
+</div>
+<br/><pre class='code' id="code14">
+        <span class='javaclass'>Slide</span> slide1 = document.getSlideByIndex(1);<br/>
+        <span class='javaclass'>Image</span> image = <span class='javaclass'>Image</span>.newImage(slide1, <span class='modifier'>new</span> <span class='javaclass'>URI</span>("http://www.xxx.com/a.jpg"));<br/>
+        <span class='javaclass'>FrameRectangle</span> rect = image.getRectangle();<br/>
+        rect.setX(4);<br/>
+        rect.setY(5.7);<br/>
+        image.setRectangle(rect);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Presentation Document.html">previous</a></li>
+  <li><a href="Table.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div></p>
   </div>
 
   <div id="footera">



Mime
View raw message