incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svanteschub...@apache.org
Subject svn commit: r795094 [2/3] - in /websites/production/odftoolkit: ./ content/odftoolkit/ content/odftoolkit/simple/ content/odftoolkit/simple/demo/
Date Thu, 01 Sep 2011 11:33:54 GMT
Modified: websites/production/odftoolkit/content/odftoolkit/simple/demo/demo4.html
==============================================================================
--- websites/production/odftoolkit/content/odftoolkit/simple/demo/demo4.html (original)
+++ websites/production/odftoolkit/content/odftoolkit/simple/demo/demo4.html Thu Sep  1 11:33:54 2011
@@ -21,39 +21,8 @@
 
 <link href="/odftoolkit/css/odf.css" rel="stylesheet" type="text/css">
 
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" href="../images/style.css" type="text/css" />
-
-
-<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
-
-<title>Demos - SimpleODF</title>
-<style type="text/css">
-<!--
-.STYLE1 {
-	color: #FFFFFF;
-	font-size: 24px;
-}
-.STYLE2 {font-size: 32px}
-.STYLE3 {font-size: 16px}
-.STYLE4 {font-size: 36px}
--->
-    </style>
-	<script type="text/javascript">
-
-  var _gaq = _gaq || [];
-  _gaq.push(['_setAccount', 'UA-22366020-1']);
-  _gaq.push(['_trackPageview']);
-
-  (function() {
-    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-  })();
-
-</script>
-
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
 </head>
 
@@ -67,391 +36,468 @@
   </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">
   
     
-    
-<div id="page" align="center">
-  <div id="content" style="width:920px" class="contentpanel">
-    <div id="topheader">
-      <div class="topright"> </div>
-    </div>
-    <div id="menu">
-      <div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
-    </div>
-    <div id="subcontent" align ="left">
-        <div align="left" class="titletext"> <span >
-		<a href="index.html">Simple Demos<a> > 
-		<a href="demo4.html">Demo 3: List and Table Conversion<a>
-		</span> 
-		</div>
-		
-		<!---------------------------------------------------------------------------------------------------->	
-<div class="contenttitle">
-
-    <a name="overview">Overview</a>
-
-</div>
-
-<div class="bodytext">
-
-    <p> Starting in version 0.4, we have added methods to support bullet, numbered and 
-
-    image lists to the Simple API. This includes frequently used features 
-
-    for processing lists and list item. This demo is designed to show the power 
-
-    of List API and help you learn how to use it. <br/> <br/> This demo shows 
-
-    how to convert between a nested List and Table. As you can see in the 
-
-    following two pictures, on the left we have a simple outline of a corporate 
-
-    hierarchy. There are four departments in this company.  Each department has 
-
-    several managers and each manager has several reporting staff.  Now we want 
-
-    to change this list to a table, just like the picture on the right 
-
-    shows.<br/> <br/> &nbsp;&nbsp;&nbsp;<img 
-
-    src="image/demo4_organization_list.png"><br/> <br/> However, 
-
-    sometimes we want to convert in the opposite direction, from a table to a 
-
-    list. Take the following two pictures as example.  The left one is table of 
-
-    country calling codes, which includes the codes of countries from different 
-
-    continents. Suppose you want to convert this table representation into a 
-
-    nested list.  The picture on the right shows the conversion result. The 
-
-    first level list show the continent names and the second level list show 
-
-    the countries and their calling codes.<br/> <br/> <img 
-
-    src="image/demo4_code_list.png" ><br/> <br/> You can see similar 
-
-    functionality in office software, such as selective copy and paste. In the 
-
-    next section, I will show how easy to do these kinds of conversions using 
-
-    the Simple API. 
-
-    </p>
-
-</div>
-
-<hr/>
-
-<div class="contenttitle">
-
-    <a name="codeintroduction">Code Introduction</a>
-
-</div>
-
-<div class="bodytext">
-
-    <p>
-
-    Let's have a look at the main method. It will help us get an overview of 
-
-    this demo. First, the list data text document, "ListTable.odt" and table 
-
-    data spreadsheet document "TableList.ods" are loaded. Secondly, we use the 
-
-    list iteration function to get all of the lists in the text document and 
-
-    invoke the method <code>convertFromListToTable</code> to convert each of them to a table. 
-
-    Finally, we get the data table from "TableList.ods" and invoke the method 
-
-    <code>convertFromTableToList</code> to convert this table to a list. All of the updated 
-
-    documents are saved as new files. You can open them and see the 
-
-    conversion results.
-
-    </p>
-
-    <!--java code-->
-
-    <pre class="brush:java;">
-
-	public static void main(String[] args) {
-
-		try {
-
-			TextDocument textDoc = TextDocument.loadDocument("ListTable.odt");
-
-			SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument("TableList.ods");
-
-			// covert list in text document to spreadsheet table
-
-			Iterator<list> listIterator = textDoc.getListIterator();
-
-			int i = 1;
-
-			String[] tableLabel = { "DEPARTMENT", "MANAGER", "EMPLOYEE" };
-
-			while (listIterator.hasNext()) {
-
-				List list = listIterator.next();
-
-				Table newTable = Table.newTable(spreadsheetDoc);
-
-				for (int columnIndex = 0; columnIndex < tableLabel.length; columnIndex++) {
-
-					newTable.getCellByPosition(columnIndex, 0).setStringValue(tableLabel[columnIndex]);
-
-				}
-
-				newTable.setTableName("ListTable" + (i++));
-
-				convertFromListToTable(list, newTable, 0, 1);
-
-			}
-
-			spreadsheetDoc.save("TableListUpdate.ods");
-
-			// covert table in spreadsheet to list in text document
-
-			Table sheet1 = spreadsheetDoc.getTableByName("Sheet1");
-
-			textDoc.newParagraph("ListConvertedFromTable");
-
-			List newList = textDoc.addList();
-
-			convertFromTableToList(sheet1, newList, 0, 0, sheet1.getColumnCount() - 1, sheet1.getRowCount() - 1);
-
-			textDoc.save("ListTableUpdate.odt");
-
-		} catch (Exception e) {
-
-			e.printStackTrace();
-
-		}
-
-	}
-
-    </pre>
-
-</p>
-
-<p>
-
-In the following two sections, I will review the implementation of the methods 
-
-<code>convertFromListToTable</code> and <code>convertFromTableToList</code>. <br/><br/>
-
-<b>Convert from List to Table</b>
-
-<br/><br/>
-
-This is a recursive method, similar to a depth-first tree traversal. You 
-
-determine the paste cell address by <code>startColumn</code> and <code>startRow</code>. First, all of the 
-
-items in the list are retrieved. Second, each list item is converted to table 
-
-cell. Its text content is extracted and set as the cell's display text. If the 
-
-item has a sub list, its sub list is also handled the same as the parent list. 
-
-<br/><br/> After all of the items are converted to cells, we invoke 
-
-<code>CellRange.merge()</code> to merge the blank cells. The generation document appears just 
-
-like the picture shown earlier.<br/>
-
-    <!--java code-->
-
-<pre class="brush:java;">
-
-	private static int convertFromListToTable(List list, Table table, int startColumn, int startRow) {
-
-		java.util.List<listitem> items = list.getItems();
-
-		int newItemCount = startRow;
-
-		for (ListItem item : items) {
-
-			Cell cell = table.getCellByPosition(startColumn, newItemCount);
-
-			cell.setStringValue(item.getTextContent());
-
-			cell.setVerticalAlignment(VerticalAlignmentType.MIDDLE);
-
-			Iterator<list> listIterator = item.listIterator();
-
-			startRow = newItemCount;
-
-			while (listIterator.hasNext()) {
-
-				List subList = listIterator.next();
-
-				newItemCount = convertFromListToTable(subList, table, startColumn + 1, newItemCount);
-
-			}
-
-			// merge
-
-			CellRange cellRange = table.getCellRangeByPosition(startColumn, startRow, startColumn, newItemCount);
-
-			cellRange.merge();
-
-			newItemCount++;
-
-		}
-
-		if (list.size() > 0) {
-
-			return newItemCount - 1;
-
-		} else {
-
-			return startRow;
-
-		}
-
-	}
-
-    </pre>
-
-</p>
-
-<br/>
-
-<p>
-
-<b>Convert from Table to List</b>
-
-<br/><br/>
-
-This is also a recursive method. You determine the conversion range of the table 
-
-by <code>startColumn</code>, <code>startRow</code>, <code>endColumn</code> and <code>endRow</code>. First, every cell in the 
-
-selected range is retrieved by <code>Table.getCellByPosition</code>. Next, a list item is 
-
-created to store the cell display text. If the <code>rowSpannedNumber > 1</code>, that means 
-
-this item has a sub list. Parts of the cells in the right columns of this cell 
-
-become the items of the sub list. They are also determined by recursive calls to 
-
-<code>convertFromTableToList</code>. If the <code>rowSpannedNumber = 1</code>, there is no need to create 
-
-a sub list, all of the content in the right cells is just added to this 
-
-item.<br/>
-
-    <!--java code-->
-
-<pre class="brush:java;">
-
-    private static void convertFromTableToList(Table table, List list, int startColumn, int startRow, int endColumn,
-
-			int endRow) {
-
-		while (startRow <= endRow) {
-
-			Cell cell = table.getCellByPosition(startColumn, startRow);
-
-			int rowSpannedNumber = cell.getRowSpannedNumber();
-
-			String cellText = cell.getDisplayText();
-
-			if (!"".equals(cellText)) {
-
-				ListItem item = list.addItem(cellText);
-
-				int columnSpannedNumber = cell.getColumnSpannedNumber();
-
-				int newStartColumn = startColumn + columnSpannedNumber;
-
-				if (newStartColumn <= endColumn) {
-
-					if (rowSpannedNumber > 1) {
-
-						List subList = item.addList();
-
-						convertFromTableToList(table, subList, newStartColumn, startRow, endColumn, startRow
-
-								+ rowSpannedNumber - 1);
-
-					} else {
-
-						int tmpStartColumn = newStartColumn;
-
-						while (tmpStartColumn <= endColumn) {
-
-							cell = table.getCellByPosition(tmpStartColumn, startRow);
-
-							cellText = cell.getDisplayText();
-
-							if (!"".equals(cellText)) {
-
-								item.setTextContent(item.getTextContent() + "|" + cellText);
-
-							}
-
-							tmpStartColumn += cell.getColumnSpannedNumber();
-
-						}
-
-					}
-
-				}
-
-			}
-
-			startRow += rowSpannedNumber;
-
-		}
-
-	}
-
-</pre>
-
-</p>
-
-</div>
-
-<hr/>
-
-<div class="contenttitle">
-
-    <a name="download">Download</a>
-
-</div>
-
-<div class="bodytext">
-
-    <p>
-
-    Powered by Simple API version <a target="_new" href="../downloads.html"><img src="../images/link.png"></img>0.4</a>.
-
-    </p>
-
-    <p>
-
-    You can download the code of this demo from <a href="table_list_convertion.zip"><img src="../images/link.png"></img>here</a>.
-
-    </p>
-
-</div>
-<!---------------------------------------------------------------------------------------------------->		
-		
-		
-
-    </div>
-    <div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="#">About Us</a> | <a href="mailto:Daisy@odftoolkit.org">Contact Us</a> </div>
-  </div>
-</div>
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+
+<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
+
+<title>Demos - SimpleODF</title>
+<style type="text/css">
+<!--
+.STYLE1 {
+    color: #FFFFFF;
+    font-size: 24px;
+}
+.STYLE2 {font-size: 32px}
+.STYLE3 {font-size: 16px}
+.STYLE4 {font-size: 36px}
+-->
+    </style>
+    <script type="text/javascript">
+
+var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-22366020-1']);
+  _gaq.push(['_trackPageview']);
+
+(function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();
+
+</script>
+</head>
+<body>
+<div id="page" align="center">
+  <div id="content" style="width:920px" class="contentpanel">
+    <div id="topheader">
+      <div class="topright"> </div>
+    </div>
+    <div id="menu">
+      <div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+    </div>
+    <div id="subcontent" align ="left">
+        <div align="left" class="titletext"> <span >
+        <a href="index.html">Simple Demos<a> > 
+        <a href="demo4.html">Demo 3: List and Table Conversion<a>
+        </span> 
+        </div>
+
+<!----------------------------------------------------------------------------------------------------> 
+<div class="contenttitle">
+
+<a name="overview">Overview</a>
+
+</div>
+
+<div class="bodytext">
+
+<p> Starting in version 0.4, we have added methods to support bullet, numbered and
+
+image lists to the Simple API. This includes frequently used features
+
+for processing lists and list item. This demo is designed to show the power
+
+of List API and help you learn how to use it. <br/> <br/> This demo shows
+
+how to convert between a nested List and Table. As you can see in the
+
+following two pictures, on the left we have a simple outline of a corporate
+
+hierarchy. There are four departments in this company.  Each department has
+
+several managers and each manager has several reporting staff.  Now we want
+
+to change this list to a table, just like the picture on the right
+
+shows.<br/> <br/> &nbsp;&nbsp;&nbsp;<img
+
+src="image/demo4_organization_list.png"><br/> <br/> However,
+
+sometimes we want to convert in the opposite direction, from a table to a
+
+list. Take the following two pictures as example.  The left one is table of
+
+country calling codes, which includes the codes of countries from different
+
+continents. Suppose you want to convert this table representation into a
+
+nested list.  The picture on the right shows the conversion result. The
+
+first level list show the continent names and the second level list show
+
+the countries and their calling codes.<br/> <br/> <img
+
+src="image/demo4_code_list.png" ><br/> <br/> You can see similar
+
+functionality in office software, such as selective copy and paste. In the
+
+next section, I will show how easy to do these kinds of conversions using
+
+the Simple API.
+
+</p>
+
+</div>
+
+<hr/>
+
+<div class="contenttitle">
+
+<a name="codeintroduction">Code Introduction</a>
+
+</div>
+
+<div class="bodytext">
+
+<p>
+
+Let's have a look at the main method. It will help us get an overview of
+
+this demo. First, the list data text document, "ListTable.odt" and table
+
+data spreadsheet document "TableList.ods" are loaded. Secondly, we use the
+
+list iteration function to get all of the lists in the text document and
+
+invoke the method <code>convertFromListToTable</code> to convert each of them to a table.
+
+Finally, we get the data table from "TableList.ods" and invoke the method
+
+<code>convertFromTableToList</code> to convert this table to a list. All of the updated
+
+documents are saved as new files. You can open them and see the
+
+conversion results.
+
+</p>
+
+<!--java code-->
+
+<pre class="brush:java;">
+
+public static void main(String[] args) {
+
+try {
+
+TextDocument textDoc = TextDocument.loadDocument("ListTable.odt");
+
+SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument("TableList.ods");
+
+// covert list in text document to spreadsheet table
+
+Iterator<list> listIterator = textDoc.getListIterator();
+
+int i = 1;
+
+String[] tableLabel = { "DEPARTMENT", "MANAGER", "EMPLOYEE" };
+
+while (listIterator.hasNext()) {
+
+List list = listIterator.next();
+
+Table newTable = Table.newTable(spreadsheetDoc);
+
+for (int columnIndex = 0; columnIndex < tableLabel.length; columnIndex++) {
+
+newTable.getCellByPosition(columnIndex, 0).setStringValue(tableLabel[columnIndex]);
+
+}
+
+newTable.setTableName("ListTable" + (i++));
+
+convertFromListToTable(list, newTable, 0, 1);
+
+}
+
+spreadsheetDoc.save("TableListUpdate.ods");
+
+// covert table in spreadsheet to list in text document
+
+Table sheet1 = spreadsheetDoc.getTableByName("Sheet1");
+
+textDoc.newParagraph("ListConvertedFromTable");
+
+List newList = textDoc.addList();
+
+convertFromTableToList(sheet1, newList, 0, 0, sheet1.getColumnCount() - 1, sheet1.getRowCount() - 1);
+
+textDoc.save("ListTableUpdate.odt");
+
+} catch (Exception e) {
+
+e.printStackTrace();
+
+}
+
+}
+
+</pre>
+
+</p>
+
+<p>
+
+In the following two sections, I will review the implementation of the methods
+
+<code>convertFromListToTable</code> and <code>convertFromTableToList</code>. <br/><br/>
+
+<b>Convert from List to Table</b>
+
+<br/><br/>
+
+This is a recursive method, similar to a depth-first tree traversal. You
+
+determine the paste cell address by <code>startColumn</code> and <code>startRow</code>. First, all of the
+
+items in the list are retrieved. Second, each list item is converted to table
+
+cell. Its text content is extracted and set as the cell's display text. If the
+
+item has a sub list, its sub list is also handled the same as the parent list.
+
+<br/><br/> After all of the items are converted to cells, we invoke
+
+<code>CellRange.merge()</code> to merge the blank cells. The generation document appears just
+
+like the picture shown earlier.<br/>
+
+<!--java code-->
+
+<pre class="brush:java;">
+
+private static int convertFromListToTable(List list, Table table, int startColumn, int startRow) {
+
+java.util.List<listitem> items = list.getItems();
+
+int newItemCount = startRow;
+
+for (ListItem item : items) {
+
+Cell cell = table.getCellByPosition(startColumn, newItemCount);
+
+cell.setStringValue(item.getTextContent());
+
+cell.setVerticalAlignment(VerticalAlignmentType.MIDDLE);
+
+Iterator<list> listIterator = item.listIterator();
+
+startRow = newItemCount;
+
+while (listIterator.hasNext()) {
+
+List subList = listIterator.next();
+
+newItemCount = convertFromListToTable(subList, table, startColumn + 1, newItemCount);
+
+}
+
+// merge
+
+CellRange cellRange = table.getCellRangeByPosition(startColumn, startRow, startColumn, newItemCount);
+
+cellRange.merge();
+
+newItemCount++;
+
+}
+
+if (list.size() > 0) {
+
+return newItemCount - 1;
+
+} else {
+
+return startRow;
+
+}
+
+}
+
+</pre>
+
+</p>
+
+<br/>
+
+<p>
+
+<b>Convert from Table to List</b>
+
+<br/><br/>
+
+This is also a recursive method. You determine the conversion range of the table
+
+by <code>startColumn</code>, <code>startRow</code>, <code>endColumn</code> and <code>endRow</code>. First, every cell in the
+
+selected range is retrieved by <code>Table.getCellByPosition</code>. Next, a list item is
+
+created to store the cell display text. If the <code>rowSpannedNumber > 1</code>, that means
+
+this item has a sub list. Parts of the cells in the right columns of this cell
+
+become the items of the sub list. They are also determined by recursive calls to
+
+<code>convertFromTableToList</code>. If the <code>rowSpannedNumber = 1</code>, there is no need to create
+
+a sub list, all of the content in the right cells is just added to this
+
+item.<br/>
+
+<!--java code-->
+
+<pre class="brush:java;">
+
+private static void convertFromTableToList(Table table, List list, int startColumn, int startRow, int endColumn,
+
+int endRow) {
+
+while (startRow <= endRow) {
+
+Cell cell = table.getCellByPosition(startColumn, startRow);
+
+int rowSpannedNumber = cell.getRowSpannedNumber();
+
+String cellText = cell.getDisplayText();
+
+if (!"".equals(cellText)) {
+
+ListItem item = list.addItem(cellText);
+
+int columnSpannedNumber = cell.getColumnSpannedNumber();
+
+int newStartColumn = startColumn + columnSpannedNumber;
+
+if (newStartColumn <= endColumn) {
+
+if (rowSpannedNumber > 1) {
+
+List subList = item.addList();
+
+convertFromTableToList(table, subList, newStartColumn, startRow, endColumn, startRow
+
++ rowSpannedNumber - 1);
+
+} else {
+
+int tmpStartColumn = newStartColumn;
+
+while (tmpStartColumn <= endColumn) {
+
+cell = table.getCellByPosition(tmpStartColumn, startRow);
+
+cellText = cell.getDisplayText();
+
+if (!"".equals(cellText)) {
+
+item.setTextContent(item.getTextContent() + "|" + cellText);
+
+}
+
+tmpStartColumn += cell.getColumnSpannedNumber();
+
+}
+
+}
+
+}
+
+}
+
+startRow += rowSpannedNumber;
+
+}
+
+}
+
+</pre>
+
+</p>
+
+</div>
+
+<hr/>
+
+<div class="contenttitle">
+
+<a name="download">Download</a>
+
+</div>
+
+<div class="bodytext">
+
+<p>
+
+Powered by Simple API version <a target="_new" href="../downloads.html"><img src="../images/link.png"></img>0.4</a>.
+
+</p>
+
+<p>
+
+You can download the code of this demo from <a href="table_list_convertion.zip"><img src="../images/link.png"></img>here</a>.
+
+</p>
+
+</div>
+<!---------------------------------------------------------------------------------------------------->
+
+</div>
+    <div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="#">About Us</a> | <a href="mailto:Daisy@odftoolkit.org">Contact Us</a> </div>
+  </div>
+</div>
+</body>
+</html>
+
+<script type="text/javascript" src="scripts/shCore.js"></script>
 
+<script type="text/javascript" src="scripts/shBrushJava.js"></script>
 
+<script type="text/javascript"> SyntaxHighlighter.all();</script>
   </div>
 
   <div id="footera">

Modified: websites/production/odftoolkit/content/odftoolkit/simple/demo/demo5.html
==============================================================================
--- websites/production/odftoolkit/content/odftoolkit/simple/demo/demo5.html (original)
+++ websites/production/odftoolkit/content/odftoolkit/simple/demo/demo5.html Thu Sep  1 11:33:54 2011
@@ -21,36 +21,8 @@
 
 <link href="/odftoolkit/css/odf.css" rel="stylesheet" type="text/css">
 
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" href="../images/style.css" type="text/css" />
-<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
-<title>Demos - SimpleODF</title>
-<style type="text/css">
-<!--
-.STYLE1 {
-	color: #FFFFFF;
-	font-size: 24px;
-}
-.STYLE2 {font-size: 32px}
-.STYLE3 {font-size: 16px}
-.STYLE4 {font-size: 36px}
--->
-    </style>
-	<script type="text/javascript">
-
-  var _gaq = _gaq || [];
-  _gaq.push(['_setAccount', 'UA-22366020-1']);
-  _gaq.push(['_trackPageview']);
-
-  (function() {
-    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-  })();
-
-</script>
-
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
 </head>
 
@@ -64,197 +36,257 @@
   </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">
   
     
-    
-<div id="page" align="center">
-  <div id="content" style="width:920px" class="contentpanel">
-    <div id="topheader">
-      <div class="topright"> </div>
-    </div>
-    <div id="menu">
-      <div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
-    </div>
-    <div id="subcontent" align ="left">
-        <div align="left" class="titletext"> <span >
-		<a href="index.html">Simple Demos<a> > 
-		<a href="demo5.html">Demo 4: Multiple Presentations Assembler<a>
-		</span> 
-		</div>
-		
-		<!---------------------------------------------------------------------------------------------------->	
-<div class="contenttitle">
-
-
-    <a name="overview">Overview</a>
-
-
-</div>
-
-
-<div class="bodytext">
-
-
-    <p> If you make a lot of presentations in your daily work, you  know that you don't always  create a presentation from scratch. 
-	Assembling several different presentations together to make a new presentation, e.g. copying several pages from presentation A 
-	and copying another several pages from presentation B, is a common activity for the presentation author.
-    <br> This demo provides a Java application that can assemble  specific pages of presentations together and make one presentation from the command line.
-	<br> Here is an example. I want to make a presentation with the first page from presentation A, 
-    the first page from presentation B and  the first page from presentation C. I can call the following command:
-    <br><code>Java PresentationAssembler -in PresentationA.odp(1) -in PresentationB.odp(1) -in PresentationC.odp(1-2) -out newPresentation.odp</code>
-    <br/> <br/> A new presentation will be generated which is showed in the following picture. You can see, the pictures, the styles and master pages are copied also.<br/> <br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img 
-
-
-    src="image/demo5_doc.jpg" ><br/> <br/> In the next section, I will show how easy it is to create this assembling application using the Simple API.  
-
-
-    </p>
-
-
-</div>
-
-
-<hr/>
-
-
-<div class="contenttitle">
-
-
-    <a name="codeintroduction">Code Introduction</a>
-
-
-</div>
-
-
-<div class="bodytext">
-
-    <p>
-    <code>assemble</code> is the method that accepts the command line parameters, analyzes them, and assembles presentations 
-	with the Simple Java API for ODF. In this method, a new presentation is created, and then, pages from other presentation 
-	documents are attached while the command line is being analyzed. Simple Java API for ODF provides very simple methods to
-	copy pages from other presentations:
-	 <br>
-	 <br><code>PresentationDocument.copyForeignSlide(int destIndex, PresentationDocument srcDoc, int srcIndex)</code>
-	 <br>and
-	 <br><code>PresentationDocument.appendPresentation(PresentationDocument srcDoc)</code>.
-	 <br>
-	 <br>After the slides are attached, the first slide of the new presentation is deleted by invoking method 
-	 <code>PresentationDocument.deleteSlideByIndex(int index)</code>. 
-	 This is because the first slide is an empty slide which was created when the new presentation was created with 
-	 method <code>PresentationDocument.newPresentationDocument()</code>
-	
-    </p>
-    <p>Below is the source code of method <code>assemble</code>. Most of the code is used to analyze the command line
-	parameters. Only a few statements are used to attach slides to the new presentation. So you can see how powerful 
-	functions Simple Java API for ODF provides.  </p>
-
-    <!--java code-->
-
-
-    <pre class="brush:java;">
-
-
-	public void assemble(String[] args) throws Exception
-	{
-		String outputFileName="default.odp";
-		int pageIndex = 1;
-		PresentationDocument doc = PresentationDocument.newPresentationDocument();
-		int i=0;
-		while (i < args.length)
-		{
-			String param = args[i];
-			if (param.equals("-out")) //get the output file name
-				outputFileName = args[++i];
-			else if (param.equals("-in")) //get the input file name 
-			{
-				String pageDesc = args[++i];
-				String filename = pageDesc, pagelist;
-				int indexStart = pageDesc.indexOf('('); //get the page numbers
-				int[] srcPages = null;
-				if (indexStart > -1)
-				{
-					filename = pageDesc.substring(0, indexStart);
-					pagelist = pageDesc.substring(indexStart+1, pageDesc.length()-1);
-					srcPages = getPageNumbers(pagelist); //analysis the page number description 
-									                     //and return all page numbers that need to be copied
-				}
-				PresentationDocument sourceDoc = PresentationDocument.loadDocument(new File(filename));
-				if (srcPages==null)
-				{
-					doc.appendPresentation(sourceDoc);
-					pageIndex += sourceDoc.getSlideCount();
-				} else for(int j=0;j < srcPages.length;j++)
-				{
-					doc.copyForeignSlide(pageIndex, sourceDoc, srcPages[j]);
-					pageIndex++;
-				}
-			}
-			i++;
-		}
-		doc.deleteSlideByIndex(0);
-		doc.save(outputFileName);
-		doc.close();
-	}
-
-
-    </pre>
-
-
-</p>
-
-
-<p>
-
-
-</p>
-
-
-</div>
-
-
-<hr/>
-
-
-<div class="contenttitle">
-
-
-    <a name="download">Download</a>
-
-
-</div>
-
-
-<div class="bodytext">
-
-
-    <p>
-
-
-    Powered by the Simple Java API for ODF version  <a target="_new" href="../downloads.html"><img src="../images/link.png"></img>0.4.5</a>.
-
-
-    </p>
-
-
-    <p>
-
-
-    You can download the code of this demo from <a href="PresentationAssembler.zip">here</a>.
-
-
-    </p>
-
-
-</div>
-<!---------------------------------------------------------------------------------------------------->		
-		
-		    </div>
-    <div id="footer" class="smallgraytext"> <a href="#">Home</a> | <a href="#">About Us</a> | <a href="#">Contact Us</a> </div>
-  </div>
-</div>
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
+<title>Demos - SimpleODF</title>
+<style type="text/css">
+<!--
+.STYLE1 {
+    color: #FFFFFF;
+    font-size: 24px;
+}
+.STYLE2 {font-size: 32px}
+.STYLE3 {font-size: 16px}
+.STYLE4 {font-size: 36px}
+-->
+    </style>
+    <script type="text/javascript">
+
+<p>var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-22366020-1']);
+  _gaq.push(['_trackPageview']);</p>
+<p>(function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();</p>
+<p></script>
+</head>
+<body>
+<div id="page" align="center">
+  <div id="content" style="width:920px" class="contentpanel">
+    <div id="topheader">
+      <div class="topright"> </div>
+    </div>
+    <div id="menu">
+      <div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+    </div>
+    <div id="subcontent" align ="left">
+        <div align="left" class="titletext"> <span >
+        <a href="index.html">Simple Demos<a> &gt; 
+        <a href="demo5.html">Demo 4: Multiple Presentations Assembler<a>
+        </span> 
+        </div></p>
+<div class="codehilite"><pre>    <span class="sr">&lt;!----------------------------------------------------------------------------------------------------&gt;</span>
+</pre></div>
+
+
+<div class="contenttitle">
+
+<div class="codehilite"><pre><span class="nt">&lt;a</span> <span class="na">name=</span><span class="s">&quot;overview&quot;</span><span class="nt">&gt;</span>Overview<span class="nt">&lt;/a&gt;</span>
+</pre></div>
+
+
+</div>
+
+<div class="bodytext">
+
+<div class="codehilite"><pre><span class="nt">&lt;p&gt;</span> If you make a lot of presentations in your daily work, you  know that you don&#39;t always  create a presentation from scratch. 
+Assembling several different presentations together to make a new presentation, e.g. copying several pages from presentation A 
+and copying another several pages from presentation B, is a common activity for the presentation author.
+<span class="nt">&lt;br&gt;</span> This demo provides a Java application that can assemble  specific pages of presentations together and make one presentation from the command line.
+<span class="nt">&lt;br&gt;</span> Here is an example. I want to make a presentation with the first page from presentation A, 
+the first page from presentation B and  the first page from presentation C. I can call the following command:
+<span class="nt">&lt;br&gt;&lt;code&gt;</span>Java PresentationAssembler -in PresentationA.odp(1) -in PresentationB.odp(1) -in PresentationC.odp(1-2) -out newPresentation.odp<span class="nt">&lt;/code&gt;</span>
+<span class="nt">&lt;br/&gt;</span> <span class="nt">&lt;br/&gt;</span> A new presentation will be generated which is showed in the following picture. You can see, the pictures, the styles and master pages are copied also.<span class="nt">&lt;br/&gt;</span> <span class="nt">&lt;br/&gt;</span> <span class="ni">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</span><span class="nt">&lt;img</span>
+
+<span class="na">src=</span><span class="s">&quot;image/demo5_doc.jpg&quot;</span> <span class="nt">&gt;&lt;br/&gt;</span> <span class="nt">&lt;br/&gt;</span> In the next section, I will show how easy it is to create this assembling application using the Simple API.
+
+<span class="nt">&lt;/p&gt;</span>
+</pre></div>
+
+
+</div>
+
+<hr/>
+
+<div class="contenttitle">
+
+<div class="codehilite"><pre><span class="nt">&lt;a</span> <span class="na">name=</span><span class="s">&quot;codeintroduction&quot;</span><span class="nt">&gt;</span>Code Introduction<span class="nt">&lt;/a&gt;</span>
+</pre></div>
+
+
+</div>
+
+<div class="bodytext">
+
+<div class="codehilite"><pre><span class="nt">&lt;p&gt;</span>
+<span class="nt">&lt;code&gt;</span>assemble<span class="nt">&lt;/code&gt;</span> is the method that accepts the command line parameters, analyzes them, and assembles presentations 
+with the Simple Java API for ODF. In this method, a new presentation is created, and then, pages from other presentation 
+documents are attached while the command line is being analyzed. Simple Java API for ODF provides very simple methods to
+copy pages from other presentations:
+ <span class="nt">&lt;br&gt;</span>
+ <span class="nt">&lt;br&gt;&lt;code&gt;</span>PresentationDocument.copyForeignSlide(int destIndex, PresentationDocument srcDoc, int srcIndex)<span class="nt">&lt;/code&gt;</span>
+ <span class="nt">&lt;br&gt;</span>and
+ <span class="nt">&lt;br&gt;&lt;code&gt;</span>PresentationDocument.appendPresentation(PresentationDocument srcDoc)<span class="nt">&lt;/code&gt;</span>.
+ <span class="nt">&lt;br&gt;</span>
+ <span class="nt">&lt;br&gt;</span>After the slides are attached, the first slide of the new presentation is deleted by invoking method 
+ <span class="nt">&lt;code&gt;</span>PresentationDocument.deleteSlideByIndex(int index)<span class="nt">&lt;/code&gt;</span>. 
+ This is because the first slide is an empty slide which was created when the new presentation was created with 
+ method <span class="nt">&lt;code&gt;</span>PresentationDocument.newPresentationDocument()<span class="nt">&lt;/code&gt;</span>
+
+<span class="nt">&lt;/p&gt;</span>
+<span class="nt">&lt;p&gt;</span>Below is the source code of method <span class="nt">&lt;code&gt;</span>assemble<span class="nt">&lt;/code&gt;</span>. Most of the code is used to analyze the command line
+parameters. Only a few statements are used to attach slides to the new presentation. So you can see how powerful 
+functions Simple Java API for ODF provides.  <span class="nt">&lt;/p&gt;</span>
+
+<span class="c">&lt;!--java code--&gt;</span>
+
+<span class="nt">&lt;pre</span> <span class="na">class=</span><span class="s">&quot;brush:java;&quot;</span><span class="nt">&gt;</span>
+
+public void assemble(String[] args) throws Exception
+{
+    String outputFileName=&quot;default.odp&quot;;
+    int pageIndex = 1;
+    PresentationDocument doc = PresentationDocument.newPresentationDocument();
+    int i=0;
+    while (i <span class="nt">&lt; args.length</span><span class="err">)</span>
+    <span class="err">{</span>
+        <span class="err">String</span> <span class="na">param =</span> <span class="s">args[i];</span>
+        <span class="err">if</span> <span class="err">(param.equals(&quot;-out&quot;))</span> <span class="err">//get</span> <span class="err">the</span> <span class="err">output</span> <span class="err">file</span> <span class="err">name</span>
+            <span class="na">outputFileName =</span> <span class="s">args[++i];</span>
+        <span class="err">else</span> <span class="err">if</span> <span class="err">(param.equals(&quot;-in&quot;))</span> <span class="err">//get</span> <span class="err">the</span> <span class="err">input</span> <span class="err">file</span> <span class="err">name</span> 
+        <span class="err">{</span>
+            <span class="err">String</span> <span class="na">pageDesc =</span> <span class="s">args[++i];</span>
+            <span class="err">String</span> <span class="na">filename =</span> <span class="s">pageDesc,</span> <span class="err">pagelist;</span>
+            <span class="err">int</span> <span class="na">indexStart =</span> <span class="s">pageDesc.indexOf(&#39;(&#39;);</span> <span class="err">//get</span> <span class="err">the</span> <span class="err">page</span> <span class="err">numbers</span>
+            <span class="err">int[]</span> <span class="na">srcPages =</span> <span class="s">null;</span>
+            <span class="err">if</span> <span class="err">(indexStart</span> <span class="nt">&gt;</span> -1)
+            {
+                filename = pageDesc.substring(0, indexStart);
+                pagelist = pageDesc.substring(indexStart+1, pageDesc.length()-1);
+                srcPages = getPageNumbers(pagelist); //analysis the page number description 
+                                                     //and return all page numbers that need to be copied
+            }
+            PresentationDocument sourceDoc = PresentationDocument.loadDocument(new File(filename));
+            if (srcPages==null)
+            {
+                doc.appendPresentation(sourceDoc);
+                pageIndex += sourceDoc.getSlideCount();
+            } else for(int j=0;j <span class="nt">&lt; srcPages.length</span><span class="err">;j++)</span>
+            <span class="err">{</span>
+                <span class="err">doc.copyForeignSlide(pageIndex,</span> <span class="err">sourceDoc,</span> <span class="err">srcPages[j]);</span>
+                <span class="err">pageIndex++;</span>
+            <span class="err">}</span>
+        <span class="err">}</span>
+        <span class="err">i++;</span>
+    <span class="err">}</span>
+    <span class="err">doc.deleteSlideByIndex(0);</span>
+    <span class="err">doc.save(outputFileName);</span>
+    <span class="err">doc.close();</span>
+<span class="err">}</span>
+
+<span class="err">&lt;/pre</span><span class="nt">&gt;</span>
+</pre></div>
+
+
+</p>
+
+<p>
+
+</p>
+
+</div>
+
+<hr/>
+
+<div class="contenttitle">
+
+<div class="codehilite"><pre><span class="nt">&lt;a</span> <span class="na">name=</span><span class="s">&quot;download&quot;</span><span class="nt">&gt;</span>Download<span class="nt">&lt;/a&gt;</span>
+</pre></div>
+
+
+</div>
+
+<div class="bodytext">
+
+<div class="codehilite"><pre><span class="nt">&lt;p&gt;</span>
+
+Powered by the Simple Java API for ODF version  <span class="nt">&lt;a</span> <span class="na">target=</span><span class="s">&quot;_new&quot;</span> <span class="na">href=</span><span class="s">&quot;../downloads.html&quot;</span><span class="nt">&gt;&lt;img</span> <span class="na">src=</span><span class="s">&quot;../images/link.png&quot;</span><span class="nt">&gt;&lt;/img&gt;</span>0.4.5<span class="nt">&lt;/a&gt;</span>.
+
+<span class="nt">&lt;/p&gt;</span>
+
+<span class="nt">&lt;p&gt;</span>
+
+You can download the code of this demo from <span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;PresentationAssembler.zip&quot;</span><span class="nt">&gt;</span>here<span class="nt">&lt;/a&gt;</span>.
+
+<span class="nt">&lt;/p&gt;</span>
+</pre></div>
+
+
+<p></div>
+<!---------------------------------------------------------------------------------------------------->   <br />
+</p>
+<div class="codehilite"><pre>        <span class="nt">&lt;/div&gt;</span>
+<span class="nt">&lt;div</span> <span class="na">id=</span><span class="s">&quot;footer&quot;</span> <span class="na">class=</span><span class="s">&quot;smallgraytext&quot;</span><span class="nt">&gt;</span> <span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;#&quot;</span><span class="nt">&gt;</span>Home<span class="nt">&lt;/a&gt;</span> | <span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;#&quot;</span><span class="nt">&gt;</span>About Us<span class="nt">&lt;/a&gt;</span> | <span class="nt">&lt;a</span> <span class="na">href=</span><span class="s">&quot;#&quot;</span><span class="nt">&gt;</span>Contact Us<span class="nt">&lt;/a&gt;</span> <span class="nt">&lt;/div&gt;</span>
+</pre></div>
+
+
+<p></div>
+</div>
+</body>
+</html></p>
+<script type="text/javascript" src="scripts/shCore.js"></script>
 
+<script type="text/javascript" src="scripts/shBrushJava.js"></script>
 
+<script type="text/javascript"> SyntaxHighlighter.all();</script>
   </div>
 
   <div id="footera">

Modified: websites/production/odftoolkit/content/odftoolkit/simple/demo/demo6.html
==============================================================================
--- websites/production/odftoolkit/content/odftoolkit/simple/demo/demo6.html (original)
+++ websites/production/odftoolkit/content/odftoolkit/simple/demo/demo6.html Thu Sep  1 11:33:54 2011
@@ -21,39 +21,8 @@
 
 <link href="/odftoolkit/css/odf.css" rel="stylesheet" type="text/css">
 
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" href="../images/style.css" type="text/css" />
-<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
-<title>Demos - SimpleODF</title>
-<style type="text/css">
-<!--
-.STYLE1 {
-	color: #FFFFFF;
-	font-size: 24px;
-}
-.STYLE2 {font-size: 32px}
-.STYLE3 {font-size: 16px}
-.STYLE4 {font-size: 36px}
--->
-</style>
-<script type="text/javascript" src="scripts/shCore.js"></script>  
-<script type="text/javascript" src="scripts/shBrushJava.js"></script>  
-<script type="text/javascript"> SyntaxHighlighter.all();</script>
-<script type="text/javascript">
-
-  var _gaq = _gaq || [];
-  _gaq.push(['_setAccount', 'UA-22366020-1']);
-  _gaq.push(['_trackPageview']);
-
-  (function() {
-    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-  })();
-
-</script>
-
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
 </head>
 
@@ -67,110 +36,186 @@
   </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">
   
     
-    
-<div id="page" align="center">
-  <div id="content" style="width:920px" class="contentpanel">
-    <div id="topheader">
-      <div class="topright"> </div>
-    </div>
-    <div id="menu">
-      <div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
-    </div>
-    <div id="subcontent" align ="left">
-        <div align="left" class="titletext"> <span >
-		<a href="index.html">Simple Demos<a> > 
-		<a href="demo6.html">Demo 5: Booking Sheet with Text Box<a>
-		</span> 
-		</div>
-		
-		<!---------------------------------------------------------------------------------------------------->	
-<div class="contenttitle">
-    <a name="overview">Overview</a>
-</div>
-<div class="bodytext">
-    <p>This demo shows the power of text box and paragraph support in Simple ODF.<br/>
-	The background of this demo is that a travel agency has to help customers book hotel. They have a spreadsheet file in hand, which records all of the visitors' information. They need to generate an order form with the requirements of hotel reservation using these data. A order form template has been supplied. This program generates order forms for all the visitors based on records of passengers in spreadsheet and the given template.<br/><br/>
-<img src="image/demo6.png" ><br/><br/> 
-</p>
-</div>
-<hr/>
-<div class="contenttitle">
-    <a name="codeintroduction">Code Introduction</a>
-</div>
-<div class="bodytext">
-    <p>
-	There code of this demo is very simple. First, load template document and spreadsheet separately. Secondly, iterate data table and create new section and paragraph. The Text Boxes in the paragraph are also cloned. All of them are iterated and filled information from data table.<br/>
-	Data items counts are also computed. These counts are wrote to the bottom table of the sheet.<br/>
-    <!--java code-->
-    <pre class="brush:java;">
-	public static void main(String[] args) {
-		try {
-			// load template document
-			TextDocument doc = TextDocument.loadDocument("DemoTemplate.odt");
-			Table roomtable = doc.getTableByName("RoomTable");
-			roomtable.remove();
-			Section templateSection = doc.getSectionByName("SectionForm");
-			// load passenger data document
-			SpreadsheetDocument data = SpreadsheetDocument.loadDocument("Passengers.ods");
-			Table table = data.getTableByName("passenger");
-			int count = table.getRowCount();
-			int type1Count = 0, type2Count = 0, type3Count = 0;
-			for (int i = 1; i < count; i++) {
-				Row row = table.getRowByIndex(i);
-				for (int j = 0; j < 6; j++) {
-					Paragraph para = templateSection.getParagraphByIndex(j,	false);
-					Textbox nameBox = para.getTextboxIterator().next();
-					String content = row.getCellByIndex(j).getDisplayText();
-					nameBox.setTextContent(content);
-					if (j == 5) {
-						if (content.equals("Deluxe Room"))
-							type1Count++;
-						else if (content.equals("Studio/Junior Suite"))
-							type2Count++;
-						else if (content.equals("Executive Suite"))
-							type3Count++;
-					}
-				}
-				doc.appendSection(templateSection, false);
-				doc.addParagraph(null);
-			}
-			templateSection.remove();
-			roomtable.getCellByPosition(2, 1).setStringValue(type1Count + "");
-			roomtable.getCellByPosition(2, 2).setStringValue(type2Count + "");
-			roomtable.getCellByPosition(2, 3).setStringValue(type3Count + "");
-
-			doc.getContentRoot().appendChild(roomtable.getOdfElement());
-			doc.save("output.odt");
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-	}
-    </pre>
-</p>
-</div>
-<hr/>
-<div class="contenttitle">
-    <a name="download">Download</a>
-</div>
-<div class="bodytext">
-  <p>
-    Powered by the Simple Java API for ODF version  <a target="_new" href="../downloads.html"><img src="../images/link.png"></img>0.5</a>.
-  </p>
-  <p>
-    You can download the code of this demo from <a href="TextboxDemo.zip"><img src="../images/link.png"></img>here</a>.
-  </p>
-</div>
-<!---------------------------------------------------------------------------------------------------->		
-</div>
-<div id="footer" class="smallgraytext"> <a href="#">Home</a> | <a href="#">About Us</a> | <a href="#">Contact Us</a> </div>
-</div>
-</div>
-
-
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
+<title>Demos - SimpleODF</title>
+<style type="text/css">
+<!--
+.STYLE1 {
+    color: #FFFFFF;
+    font-size: 24px;
+}
+.STYLE2 {font-size: 32px}
+.STYLE3 {font-size: 16px}
+.STYLE4 {font-size: 36px}
+-->
+</style>
+<script type="text/javascript" src="scripts/shCore.js"></script>  
+<script type="text/javascript" src="scripts/shBrushJava.js"></script>  
+<script type="text/javascript"> SyntaxHighlighter.all();</script>
+<script type="text/javascript">
+
+<p>var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-22366020-1']);
+  _gaq.push(['_trackPageview']);</p>
+<p>(function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();</p>
+<p></script>
+</head>
+<body>
+<div id="page" align="center">
+  <div id="content" style="width:920px" class="contentpanel">
+    <div id="topheader">
+      <div class="topright"> </div>
+    </div>
+    <div id="menu">
+      <div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+    </div>
+    <div id="subcontent" align ="left">
+        <div align="left" class="titletext"> <span >
+        <a href="index.html">Simple Demos<a> &gt; 
+        <a href="demo6.html">Demo 5: Booking Sheet with Text Box<a>
+        </span> 
+        </div></p>
+<div class="codehilite"><pre>    <span class="sr">&lt;!----------------------------------------------------------------------------------------------------&gt;</span>
+</pre></div>
+
+
+<p><div class="contenttitle">
+    <a name="overview">Overview</a>
+</div>
+<div class="bodytext">
+    <p>This demo shows the power of text box and paragraph support in Simple ODF.<br/>
+    The background of this demo is that a travel agency has to help customers book hotel. They have a spreadsheet file in hand, which records all of the visitors' information. They need to generate an order form with the requirements of hotel reservation using these data. A order form template has been supplied. This program generates order forms for all the visitors based on records of passengers in spreadsheet and the given template.<br/><br/>
+<img src="image/demo6.png" ><br/><br/> 
+</p>
+</div>
+<hr/>
+<div class="contenttitle">
+    <a name="codeintroduction">Code Introduction</a>
+</div>
+<div class="bodytext">
+    <p>
+    There code of this demo is very simple. First, load template document and spreadsheet separately. Secondly, iterate data table and create new section and paragraph. The Text Boxes in the paragraph are also cloned. All of them are iterated and filled information from data table.<br/>
+    Data items counts are also computed. These counts are wrote to the bottom table of the sheet.<br/>
+    <!--java code-->
+    <pre class="brush:java;">
+    public static void main(String[] args) {
+        try {
+            // load template document
+            TextDocument doc = TextDocument.loadDocument("DemoTemplate.odt");
+            Table roomtable = doc.getTableByName("RoomTable");
+            roomtable.remove();
+            Section templateSection = doc.getSectionByName("SectionForm");
+            // load passenger data document
+            SpreadsheetDocument data = SpreadsheetDocument.loadDocument("Passengers.ods");
+            Table table = data.getTableByName("passenger");
+            int count = table.getRowCount();
+            int type1Count = 0, type2Count = 0, type3Count = 0;
+            for (int i = 1; i &lt; count; i++) {
+                Row row = table.getRowByIndex(i);
+                for (int j = 0; j &lt; 6; j++) {
+                    Paragraph para = templateSection.getParagraphByIndex(j, false);
+                    Textbox nameBox = para.getTextboxIterator().next();
+                    String content = row.getCellByIndex(j).getDisplayText();
+                    nameBox.setTextContent(content);
+                    if (j == 5) {
+                        if (content.equals("Deluxe Room"))
+                            type1Count++;
+                        else if (content.equals("Studio/Junior Suite"))
+                            type2Count++;
+                        else if (content.equals("Executive Suite"))
+                            type3Count++;
+                    }
+                }
+                doc.appendSection(templateSection, false);
+                doc.addParagraph(null);
+            }
+            templateSection.remove();
+            roomtable.getCellByPosition(2, 1).setStringValue(type1Count + "");
+            roomtable.getCellByPosition(2, 2).setStringValue(type2Count + "");
+            roomtable.getCellByPosition(2, 3).setStringValue(type3Count + "");</p>
+<div class="codehilite"><pre>        <span class="n">doc</span><span class="o">.</span><span class="n">getContentRoot</span><span class="p">()</span><span class="o">.</span><span class="n">appendChild</span><span class="p">(</span><span class="n">roomtable</span><span class="o">.</span><span class="n">getOdfElement</span><span class="p">());</span>
+        <span class="n">doc</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="s">&quot;output.odt&quot;</span><span class="p">);</span>
+    <span class="p">}</span> <span class="n">catch</span> <span class="p">(</span><span class="n">Exception</span> <span class="n">e</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">e</span><span class="o">.</span><span class="n">printStackTrace</span><span class="p">();</span>
+    <span class="p">}</span>
+
+<span class="p">}</span>
+<span class="sr">&lt;/pre&gt;</span>
+</pre></div>
+
+
+<p></p>
+</div>
+<hr/>
+<div class="contenttitle">
+    <a name="download">Download</a>
+</div>
+<div class="bodytext">
+  <p>
+    Powered by the Simple Java API for ODF version  <a target="_new" href="../downloads.html"><img src="../images/link.png"></img>0.5</a>.
+  </p>
+  <p>
+    You can download the code of this demo from <a href="TextboxDemo.zip"><img src="../images/link.png"></img>here</a>.
+  </p>
+</div>
+<!---------------------------------------------------------------------------------------------------->   <br />
+</div>
+<div id="footer" class="smallgraytext"> <a href="#">Home</a> | <a href="#">About Us</a> | <a href="#">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html> </p>
   </div>
 
   <div id="footera">

Modified: websites/production/odftoolkit/content/odftoolkit/simple/demo/demo7.html
==============================================================================
--- websites/production/odftoolkit/content/odftoolkit/simple/demo/demo7.html (original)
+++ websites/production/odftoolkit/content/odftoolkit/simple/demo/demo7.html Thu Sep  1 11:33:54 2011
@@ -21,39 +21,8 @@
 
 <link href="/odftoolkit/css/odf.css" rel="stylesheet" type="text/css">
 
-
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="stylesheet" href="../images/style.css" type="text/css" />
-<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
-<title>Demos - SimpleODF</title>
-<style type="text/css">
-<!--
-.STYLE1 {
-	color: #FFFFFF;
-	font-size: 24px;
-}
-.STYLE2 {font-size: 32px}
-.STYLE3 {font-size: 16px}
-.STYLE4 {font-size: 36px}
--->
-</style>
-<script type="text/javascript" src="scripts/shCore.js"></script>  
-<script type="text/javascript" src="scripts/shBrushJava.js"></script>  
-<script type="text/javascript"> SyntaxHighlighter.all();</script>
-<script type="text/javascript">
-
-  var _gaq = _gaq || [];
-  _gaq.push(['_setAccount', 'UA-22366020-1']);
-  _gaq.push(['_trackPageview']);
-
-  (function() {
-    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-  })();
-
-</script>
-
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
 </head>
 
@@ -67,192 +36,266 @@
   </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">
   
     
-    
-<div id="page" align="center">
-  <div id="content" style="width:920px" class="contentpanel">
-    <div id="topheader">
-      <div class="topright"> </div>
-    </div>
-    <div id="menu">
-      <div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
-    </div>
-    <div id="subcontent" align ="left">
-        <div align="left" class="titletext"> <span >
-		<a href="index.html">Simple Demos<a> > 
-		<a href="demo7.html">Demo 6: Offer Letter with Text Fields<a>
-		</span> 
-		</div>
-		
-		<!---------------------------------------------------------------------------------------------------->	
-<div class="contenttitle">
-    <a name="overview">Overview</a>
-</div>
-<div class="bodytext">
-    <p> We have introduced several samples about how to use Simple ODF API to generate document from the predefined templete, for example, <a href="demo3.html"><img src="../images/link.png">Demo 3: Navigation API in Hotel Receipt</a>. I believe you have known how easy it is. But sounds like, we never talk about how to create a template document using  Simple ODF API. <br/><br/>
-Today, let's do it.<br/><br/>
-Simple ODF API provides Fields API since version 0.5. OpenDocument text documents or OpenDocument text content embedded in other types of documents may contain variable text elements called fields. Fields are commonly used for, a page number field displays the number of the page on which it appears or a creation date field displays the date on which a document was created. Besides, there are several advance field, such as, variable field and condition field.<br/><br/>
-This demo provides a Java application which can create the offer letter template document from a sample and use it to generate new offer letters with the information from a spreadsheet. The template document contains some fields whose content is decided by the information from data file.<br/><br/>
-The following picture show a sample offer letter. I have labeled the variable content with blod and color style.<br/><br/>
-<img src="image/offer-letter-sample.png" ><br/><br/> 
-This offer was generated on "2011-01-20". It also can be in any other date, so this text content should be replaced by a date field. "Tom King" is the receiver, this name can be replaced with a variable field, then we can send it to any other perpson. Similarly, "software engineer" is the job title of "Tom King", "R&D" is the branch which he belongs to, and "2011-03-12" is his onboard date, all of them should be replaced by variable field in a template document.<br/><br/> 
-Salary and allowance are more complex. Different job titles and branches have different rules. Simplicity, we assume that except "Secretary" is 5,500,00, all of the other job titles are 6,000.00. We also assume that employees from "Sales" don't have allowance. Condition field or Hidden Text field is needed to realize these rules. The same as certificates/testimonials, for campus hires, they need supply "Educational certificates", while for professinal hires, they need supply "Experience certificates from previous employers" and "Copy of resignation/acceptation letter and relieving letter". This is another use case of condition field.<br/><br/>
-After replaced all of these variable content with fields, the template document is ready. The process of generate new offer letter is very simple. Only need to load the following data, update the variable values with the data and save as a new document. <br/><br/>
-<img src="image/candidate-data.png" ><br/><br/>
-No need text content search, no need target replace. It's faster than the content replace way. Beside, the variable content is highlighted automatically by Symphony or Open Office when the document is opend. The following is a generated letter sample.<br/><br/>
-<img src="image/generated-offer-letter.png" ><br/><br/>
-As using fields, the new offer letter is easily updated without inconsistent, even though after generated. You can do it in Symphony or Open Office.
-</p>
-</div>
-<hr/>
-<div class="contenttitle">
-    <a name="codeintroduction">Code Introduction</a>
-</div>
-<div class="bodytext">
-    <p>
-	There are two methods in the class, <code>createFieldTemplate()</code> is used to create template document from sample, and <code>generateOfferLetterDocument()</code> is used to generated new document using template and data file.<br/>
-	<!--java code-->
-    <pre class="brush:java;">
-	public static void main(String[] args) {
-		try {
-			// create offer letter template with sample offer letter.
-			createFieldTemplate();
-			// generate offer letters for the candidates from spreadsheet document.
-			generateOfferLetterDocument();
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-    </pre>
-    </p>
-    <p>Below is the source code of method <code>createFieldTemplate()</code>. The basic process is find the variable content and replace it with a field. We use <code>FixedDateField</code>, <code>UserVariableField</code>, <code>ConditionField</code> and <code>HiddenTextField</code> in this method. Simple ODF API provides more types of fields. For more information, please reference the <a href="../javadoc/index.html"><img src="../images/link.png"></img>Javadoc</a> or <a href="../cookbook/index.html"><img src="../images/link.png"></img>CookBook</a>.<br/>
-    <!--java code-->
-    <pre class="brush:java;">
-	public static void createFieldTemplate() throws Exception {
-		TextDocument sampleDocument = TextDocument.loadDocument("Tom's Offer.odt");
-		// replace offer date with FixedDateField
-		TextNavigation search = new TextNavigation("2011-01-20", sampleDocument);
-		while (search.hasNext()) {
-			TextSelection item = (TextSelection) search.nextSelection();
-			FieldSelection fieldSelection = new FieldSelection(item);
-			fieldSelection.replaceWithSimpleField(Field.FieldType.FIXED_DATE_FIELD);
-		}
-		// replace candidate name with UserVariableField
-		VariableField candidateVar = Fields.createUserVariableField(sampleDocument, "candidateVar", "Tom King");
-		search = new TextNavigation("Tom King", sampleDocument);
-		while (search.hasNext()) {
-			TextSelection item = (TextSelection) search.nextSelection();
-			FieldSelection fieldSelection = new FieldSelection(item);
-			fieldSelection.replaceWithVariableField(candidateVar);
-		}
-		// replace job title with UserVariableField
-		VariableField jobTitleVar = Fields.createUserVariableField(sampleDocument, "jobTitleVar", "software engineer");
-		search = new TextNavigation("software engineer", sampleDocument);
-		while (search.hasNext()) {
-			TextSelection item = (TextSelection) search.nextSelection();
-			FieldSelection fieldSelection = new FieldSelection(item);
-			fieldSelection.replaceWithVariableField(jobTitleVar);
-		}
-		// replace branch with UserVariableField
-		VariableField branchVar = Fields.createUserVariableField(sampleDocument, "branchVar", "R&D");
-		search = new TextNavigation("R&D", sampleDocument);
-		while (search.hasNext()) {
-			TextSelection item = (TextSelection) search.nextSelection();
-			FieldSelection fieldSelection = new FieldSelection(item);
-			fieldSelection.replaceWithVariableField(branchVar);
-		}
-		// replace onboard date with UserVariableField
-		VariableField onBoardDateVar = Fields.createUserVariableField(sampleDocument, "onBoardDateVar", "2011-03-12");
-		search = new TextNavigation("2011-03-12", sampleDocument);
-		while (search.hasNext()) {
-			TextSelection item = (TextSelection) search.nextSelection();
-			FieldSelection fieldSelection = new FieldSelection(item);
-			fieldSelection.replaceWithVariableField(onBoardDateVar);
-		}
-		// replace salary with ConditionField
-		search = new TextNavigation("6,000.00", sampleDocument);
-		while (search.hasNext()) {
-			TextSelection item = (TextSelection) search.nextSelection();
-			FieldSelection fieldSelection = new FieldSelection(item);
-			fieldSelection.replaceWithConditionField("jobTitleVar != \"Secretary\"", "6,000.00", "5,500.00");
-		}
-		// replace consolidated allowance with HiddenTextField
-		search = new TextNavigation(" and a Consolidated Allowance of 400\\$ per month", sampleDocument);
-		while (search.hasNext()) {
-			TextSelection item = (TextSelection) search.nextSelection();
-			FieldSelection fieldSelection = new FieldSelection(item);
-			fieldSelection.replaceWithHiddenTextField("branchVar == \"Sales\"", " and a Consolidated Allowance of 400$ per month");
-		}
-		// replace certificates/testimonials with ConditionField
-		Fields.createUserVariableField(sampleDocument, "campusHireVar", "N");
-		search = new TextNavigation("\\* Educational certificates", sampleDocument);
-		while (search.hasNext()) {
-			TextSelection item = (TextSelection) search.nextSelection();
-			FieldSelection fieldSelection = new FieldSelection(item);
-			fieldSelection
-					.replaceWithConditionField(
-							"campusHireVar == \"Y\"",
-							"* Educational certificates",
-							"* Experience certificates from previous employers\n* Copy of resignation/acceptation letter and relieving letter");
-		}
-		sampleDocument.save("OfferTemplate.odt");
-	}
-    </pre>
-</p>
-<p>Method <code>generateOfferLetterDocument()</code> is easier. Just load the template document and data docuemnt and fill new value to all of the variables. <code>getVariableFieldByName()</code> is a method of <code>VariableContainer</code> used to iterate variable field by name.
-<br/>
-    <!--java code-->
-    <pre class="brush:java;">
-	public static void generateOfferLetterDocument() throws Exception {
-		TextDocument templateDocument = TextDocument.loadDocument("OfferTemplate.odt");
-		SpreadsheetDocument dataDocument = SpreadsheetDocument.loadDocument("Candidates.ods");
-		Table table = dataDocument.getTableByName("Sheet1");
-		int rowCount = table.getRowCount();
-		for(int i = 1; i &lt rowCount; i++)
-		{
-			Row row = table.getRowByIndex(i);
-			String name = row.getCellByIndex(0).getDisplayText();
-			VariableField candidateVar = templateDocument.getVariableFieldByName("candidateVar");
-			candidateVar.updateField(name, null);
-			String jobTitle = row.getCellByIndex(1).getDisplayText();
-			VariableField jobTitleVar = templateDocument.getVariableFieldByName("jobTitleVar");
-			jobTitleVar.updateField(jobTitle, null);
-			String branch = row.getCellByIndex(2).getDisplayText();
-			VariableField branchVar = templateDocument.getVariableFieldByName("branchVar");
-			branchVar.updateField(branch, null);
-			String isCampusHire = row.getCellByIndex(3).getDisplayText();
-			VariableField campusHireVar = templateDocument.getVariableFieldByName("campusHireVar");
-			campusHireVar.updateField(isCampusHire, null);
-			String onBoradDate = row.getCellByIndex(4).getDisplayText();
-			VariableField onBoardDateVar = templateDocument.getVariableFieldByName("onBoardDateVar");
-			onBoardDateVar.updateField(onBoradDate, null);
-			templateDocument.save(name+"'s offer letter.odt");
-		}
-	}
-    </pre>
-</p>
-</div>
-<hr/>
-<div class="contenttitle">
-    <a name="download">Download</a>
-</div>
-<div class="bodytext">
-  <p>
-    Powered by the Simple Java API for ODF version  <a target="_new" href="../downloads.html"><img src="../images/link.png"></img>0.5</a>.
-  </p>
-  <p>
-    You can download the code of this demo from <a href="demo7.zip"><img src="../images/link.png"></img>here</a>.
-  </p>
-</div>
-<!---------------------------------------------------------------------------------------------------->		
-</div>
-<div id="footer" class="smallgraytext"> <a href="#">Home</a> | <a href="#">About Us</a> | <a href="#">Contact Us</a> </div>
-</div>
-</div>
+    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<link type="text/css" rel="stylesheet" href="styles/shCoreEclipse.css"/>
+<title>Demos - SimpleODF</title>
+<style type="text/css">
+<!--
+.STYLE1 {
+    color: #FFFFFF;
+    font-size: 24px;
+}
+.STYLE2 {font-size: 32px}
+.STYLE3 {font-size: 16px}
+.STYLE4 {font-size: 36px}
+-->
+</style>
+<script type="text/javascript" src="scripts/shCore.js"></script>  
+<script type="text/javascript" src="scripts/shBrushJava.js"></script>  
+<script type="text/javascript"> SyntaxHighlighter.all();</script>
+<script type="text/javascript">
+
+<p>var _gaq = _gaq || [];
+  _gaq.push(['_setAccount', 'UA-22366020-1']);
+  _gaq.push(['_trackPageview']);</p>
+<p>(function() {
+    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+  })();</p>
+<p></script>
+</head>
+<body>
+<div id="page" align="center">
+  <div id="content" style="width:920px" class="contentpanel">
+    <div id="topheader">
+      <div class="topright"> </div>
+    </div>
+    <div id="menu">
+      <div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+    </div>
+    <div id="subcontent" align ="left">
+        <div align="left" class="titletext"> <span >
+        <a href="index.html">Simple Demos<a> &gt; 
+        <a href="demo7.html">Demo 6: Offer Letter with Text Fields<a>
+        </span> 
+        </div></p>
+<div class="codehilite"><pre>    <span class="sr">&lt;!----------------------------------------------------------------------------------------------------&gt;</span>
+</pre></div>
 
 
+<p><div class="contenttitle">
+    <a name="overview">Overview</a>
+</div>
+<div class="bodytext">
+    <p> We have introduced several samples about how to use Simple ODF API to generate document from the predefined templete, for example, <a href="demo3.html"><img src="../images/link.png">Demo 3: Navigation API in Hotel Receipt</a>. I believe you have known how easy it is. But sounds like, we never talk about how to create a template document using  Simple ODF API. <br/><br/>
+Today, let's do it.<br/><br/>
+Simple ODF API provides Fields API since version 0.5. OpenDocument text documents or OpenDocument text content embedded in other types of documents may contain variable text elements called fields. Fields are commonly used for, a page number field displays the number of the page on which it appears or a creation date field displays the date on which a document was created. Besides, there are several advance field, such as, variable field and condition field.<br/><br/>
+This demo provides a Java application which can create the offer letter template document from a sample and use it to generate new offer letters with the information from a spreadsheet. The template document contains some fields whose content is decided by the information from data file.<br/><br/>
+The following picture show a sample offer letter. I have labeled the variable content with blod and color style.<br/><br/>
+<img src="image/offer-letter-sample.png" ><br/><br/> 
+This offer was generated on "2011-01-20". It also can be in any other date, so this text content should be replaced by a date field. "Tom King" is the receiver, this name can be replaced with a variable field, then we can send it to any other perpson. Similarly, "software engineer" is the job title of "Tom King", "R&amp;D" is the branch which he belongs to, and "2011-03-12" is his onboard date, all of them should be replaced by variable field in a template document.<br/><br/> 
+Salary and allowance are more complex. Different job titles and branches have different rules. Simplicity, we assume that except "Secretary" is 5,500,00, all of the other job titles are 6,000.00. We also assume that employees from "Sales" don't have allowance. Condition field or Hidden Text field is needed to realize these rules. The same as certificates/testimonials, for campus hires, they need supply "Educational certificates", while for professinal hires, they need supply "Experience certificates from previous employers" and "Copy of resignation/acceptation letter and relieving letter". This is another use case of condition field.<br/><br/>
+After replaced all of these variable content with fields, the template document is ready. The process of generate new offer letter is very simple. Only need to load the following data, update the variable values with the data and save as a new document. <br/><br/>
+<img src="image/candidate-data.png" ><br/><br/>
+No need text content search, no need target replace. It's faster than the content replace way. Beside, the variable content is highlighted automatically by Symphony or Open Office when the document is opend. The following is a generated letter sample.<br/><br/>
+<img src="image/generated-offer-letter.png" ><br/><br/>
+As using fields, the new offer letter is easily updated without inconsistent, even though after generated. You can do it in Symphony or Open Office.
+</p>
+</div>
+<hr/>
+<div class="contenttitle">
+    <a name="codeintroduction">Code Introduction</a>
+</div>
+<div class="bodytext">
+    <p>
+    There are two methods in the class, <code>createFieldTemplate()</code> is used to create template document from sample, and <code>generateOfferLetterDocument()</code> is used to generated new document using template and data file.<br/>
+    <!--java code-->
+    <pre class="brush:java;">
+    public static void main(String[] args) {
+        try {
+            // create offer letter template with sample offer letter.
+            createFieldTemplate();
+            // generate offer letters for the candidates from spreadsheet document.
+            generateOfferLetterDocument();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    </pre>
+    </p>
+    <p>Below is the source code of method <code>createFieldTemplate()</code>. The basic process is find the variable content and replace it with a field. We use <code>FixedDateField</code>, <code>UserVariableField</code>, <code>ConditionField</code> and <code>HiddenTextField</code> in this method. Simple ODF API provides more types of fields. For more information, please reference the <a href="../javadoc/index.html"><img src="../images/link.png"></img>Javadoc</a> or <a href="../cookbook/index.html"><img src="../images/link.png"></img>CookBook</a>.<br/>
+    <!--java code-->
+    <pre class="brush:java;">
+    public static void createFieldTemplate() throws Exception {
+        TextDocument sampleDocument = TextDocument.loadDocument("Tom's Offer.odt");
+        // replace offer date with FixedDateField
+        TextNavigation search = new TextNavigation("2011-01-20", sampleDocument);
+        while (search.hasNext()) {
+            TextSelection item = (TextSelection) search.nextSelection();
+            FieldSelection fieldSelection = new FieldSelection(item);
+            fieldSelection.replaceWithSimpleField(Field.FieldType.FIXED_DATE_FIELD);
+        }
+        // replace candidate name with UserVariableField
+        VariableField candidateVar = Fields.createUserVariableField(sampleDocument, "candidateVar", "Tom King");
+        search = new TextNavigation("Tom King", sampleDocument);
+        while (search.hasNext()) {
+            TextSelection item = (TextSelection) search.nextSelection();
+            FieldSelection fieldSelection = new FieldSelection(item);
+            fieldSelection.replaceWithVariableField(candidateVar);
+        }
+        // replace job title with UserVariableField
+        VariableField jobTitleVar = Fields.createUserVariableField(sampleDocument, "jobTitleVar", "software engineer");
+        search = new TextNavigation("software engineer", sampleDocument);
+        while (search.hasNext()) {
+            TextSelection item = (TextSelection) search.nextSelection();
+            FieldSelection fieldSelection = new FieldSelection(item);
+            fieldSelection.replaceWithVariableField(jobTitleVar);
+        }
+        // replace branch with UserVariableField
+        VariableField branchVar = Fields.createUserVariableField(sampleDocument, "branchVar", "R&amp;D");
+        search = new TextNavigation("R&amp;D", sampleDocument);
+        while (search.hasNext()) {
+            TextSelection item = (TextSelection) search.nextSelection();
+            FieldSelection fieldSelection = new FieldSelection(item);
+            fieldSelection.replaceWithVariableField(branchVar);
+        }
+        // replace onboard date with UserVariableField
+        VariableField onBoardDateVar = Fields.createUserVariableField(sampleDocument, "onBoardDateVar", "2011-03-12");
+        search = new TextNavigation("2011-03-12", sampleDocument);
+        while (search.hasNext()) {
+            TextSelection item = (TextSelection) search.nextSelection();
+            FieldSelection fieldSelection = new FieldSelection(item);
+            fieldSelection.replaceWithVariableField(onBoardDateVar);
+        }
+        // replace salary with ConditionField
+        search = new TextNavigation("6,000.00", sampleDocument);
+        while (search.hasNext()) {
+            TextSelection item = (TextSelection) search.nextSelection();
+            FieldSelection fieldSelection = new FieldSelection(item);
+            fieldSelection.replaceWithConditionField("jobTitleVar != "Secretary"", "6,000.00", "5,500.00");
+        }
+        // replace consolidated allowance with HiddenTextField
+        search = new TextNavigation(" and a Consolidated Allowance of 400\$ per month", sampleDocument);
+        while (search.hasNext()) {
+            TextSelection item = (TextSelection) search.nextSelection();
+            FieldSelection fieldSelection = new FieldSelection(item);
+            fieldSelection.replaceWithHiddenTextField("branchVar == "Sales"", " and a Consolidated Allowance of 400$ per month");
+        }
+        // replace certificates/testimonials with ConditionField
+        Fields.createUserVariableField(sampleDocument, "campusHireVar", "N");
+        search = new TextNavigation("\<em> Educational certificates", sampleDocument);
+        while (search.hasNext()) {
+            TextSelection item = (TextSelection) search.nextSelection();
+            FieldSelection fieldSelection = new FieldSelection(item);
+            fieldSelection
+                    .replaceWithConditionField(
+                            "campusHireVar == "Y"",
+                            "</em> Educational certificates",
+                            "<em> Experience certificates from previous employersn</em> Copy of resignation/acceptation letter and relieving letter");
+        }
+        sampleDocument.save("OfferTemplate.odt");
+    }
+    </pre>
+</p>
+<p>Method <code>generateOfferLetterDocument()</code> is easier. Just load the template document and data docuemnt and fill new value to all of the variables. <code>getVariableFieldByName()</code> is a method of <code>VariableContainer</code> used to iterate variable field by name.
+<br/>
+    <!--java code-->
+    <pre class="brush:java;">
+    public static void generateOfferLetterDocument() throws Exception {
+        TextDocument templateDocument = TextDocument.loadDocument("OfferTemplate.odt");
+        SpreadsheetDocument dataDocument = SpreadsheetDocument.loadDocument("Candidates.ods");
+        Table table = dataDocument.getTableByName("Sheet1");
+        int rowCount = table.getRowCount();
+        for(int i = 1; i &amp;lt rowCount; i++)
+        {
+            Row row = table.getRowByIndex(i);
+            String name = row.getCellByIndex(0).getDisplayText();
+            VariableField candidateVar = templateDocument.getVariableFieldByName("candidateVar");
+            candidateVar.updateField(name, null);
+            String jobTitle = row.getCellByIndex(1).getDisplayText();
+            VariableField jobTitleVar = templateDocument.getVariableFieldByName("jobTitleVar");
+            jobTitleVar.updateField(jobTitle, null);
+            String branch = row.getCellByIndex(2).getDisplayText();
+            VariableField branchVar = templateDocument.getVariableFieldByName("branchVar");
+            branchVar.updateField(branch, null);
+            String isCampusHire = row.getCellByIndex(3).getDisplayText();
+            VariableField campusHireVar = templateDocument.getVariableFieldByName("campusHireVar");
+            campusHireVar.updateField(isCampusHire, null);
+            String onBoradDate = row.getCellByIndex(4).getDisplayText();
+            VariableField onBoardDateVar = templateDocument.getVariableFieldByName("onBoardDateVar");
+            onBoardDateVar.updateField(onBoradDate, null);
+            templateDocument.save(name+"'s offer letter.odt");
+        }
+    }
+    </pre>
+</p>
+</div>
+<hr/>
+<div class="contenttitle">
+    <a name="download">Download</a>
+</div>
+<div class="bodytext">
+  <p>
+    Powered by the Simple Java API for ODF version  <a target="_new" href="../downloads.html"><img src="../images/link.png"></img>0.5</a>.
+  </p>
+  <p>
+    You can download the code of this demo from <a href="demo7.zip"><img src="../images/link.png"></img>here</a>.
+  </p>
+</div>
+<!---------------------------------------------------------------------------------------------------->   <br />
+</div>
+<div id="footer" class="smallgraytext"> <a href="#">Home</a> | <a href="#">About Us</a> | <a href="#">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html> </p>
   </div>
 
   <div id="footera">



Mime
View raw message