incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devin...@apache.org
Subject svn commit: r795159 - in /websites/production/odftoolkit: ./ content/odftoolkit/simple/demo/demo8.html content/odftoolkit/simple/demo/demo9.html
Date Fri, 02 Sep 2011 09:18:18 GMT
Author: devinhan
Date: Fri Sep  2 09:18:18 2011
New Revision: 795159

Log:
Publishing merge to odftoolkit site by devinhan

Modified:
    websites/production/odftoolkit/   (props changed)
    websites/production/odftoolkit/content/odftoolkit/simple/demo/demo8.html
    websites/production/odftoolkit/content/odftoolkit/simple/demo/demo9.html

Propchange: websites/production/odftoolkit/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep  2 09:18:18 2011
@@ -1 +1 @@
-/websites/staging/odftoolkit/trunk:794771-795152
+/websites/staging/odftoolkit/trunk:794771-795158

Modified: websites/production/odftoolkit/content/odftoolkit/simple/demo/demo8.html
==============================================================================
--- websites/production/odftoolkit/content/odftoolkit/simple/demo/demo8.html (original)
+++ websites/production/odftoolkit/content/odftoolkit/simple/demo/demo8.html Fri Sep  2 09:18:18
2011
@@ -78,225 +78,70 @@
   <div id="contenta">
   
     
-    <!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">
-
-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="demo8.html">Demo 7: Add 2D barcode image to a slide<a>
-
-</span>
-
-</div>
-
-<!---------------------------------------------------------------------------------------------------->
-
-<div class="contenttitle">
-
-<a name="overview">Overview</a>
-
-</div>
-
-<div class="bodytext">
-
-<p>This demo shows the power of image and metadata support in Simple ODF.<br /><br/>
-
-A 2D bar code is a special image that can be scanned by a smart phone or a dedicated scanner.
It could contain a URL, a books ISBN number a vCard for a person's contact, information, etc.
It makes it easy to transfer information into a smartphone from a physical object, like a
printed document, or a newspaper or magazine.<br /><br/>
-    In this demo, the contact information of a document's author has been put in the metadata
of a presentation document, with an ODF editor, such as IBM Lotus Symphony. The contact information
in the metadata is extracted with the Simple ODF API, and wrapped into JSON object. Then a
RESTful web service is called to generate a 2D bar code image based on this JSON object. 
-    The bar code image is then added to the first slide of this presentation using the Simple
ODF API.<br /><br/>
-
-This picture shows how the contact information is added to the metadata of this document.<br
/><br/>
-
-<img src="image/demo8_metadata.bmp" ></img><br/>
-<br />This picture shows the 2D bar code image added to the first slide of this presentation
document.<br /><br/> 
-<img src="image/demo8_slide.bmp" ></img><br/>
+    <p><a href="index.html"><strong>Demos</strong></a> &gt;
<b>Add 2D barcode image to a slide</b> <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, we load the presentation document, and extract
the metadata with Simple ODF API. Second, we invoke the web service to generate the bar code
image and get the URI of this image.
-
-Finally, we get the subtitle text box in the first slide, add an image just below of this
subtitle text box. Please note how FrameRectangle is used to specify the image position.<br
/><br/>
-
-<!--java code-->
-
-<pre class="brush:java;">
-
-public static void main(String[] args) {
-
-try {
-            //load the presentation
-            PresentationDocument presentation = PresentationDocument.loadDocument("Demotemplate.odp");
-            //get the metadata
-            Meta metaData = new Meta(presentation.getMetaDom());
-            String creator = metaData.getCreator();
-            String mailto = metaData.getUserDefinedDataValue("Email");
-            String phoneno = metaData.getUserDefinedDataValue("Phone");
-
-//invoke the 2D barcode service, and get the url
-            BarcodeImageGeneration demo = new BarcodeImageGeneration();
-            String url = demo.invokepost(creator,mailto,phoneno);
-
-//Add the image to the first slide
-            Slide slide = presentation.getSlideByIndex(0);
-            Textbox subtitleBox = slide.getTextboxByUsage(PresentationClass.SUBTITLE).get(0);
-            FrameRectangle subtitleRect = subtitleBox.getRectangle();
-            Image image = Image.newImage(slide, new URI(url));
-            FrameRectangle imageRect = image.getRectangle();
-            imageRect.setX(subtitleRect.getX()+(subtitleRect.getWidth()-imageRect.getWidth())/2);
-            imageRect.setY(subtitleRect.getY()+subtitleRect.getHeight());
-            image.setRectangle(imageRect);
-
-presentation.save("output.odp");
-
-} catch (Exception e) {
-            e.printStackTrace();
-        }
-
-}
-
-</pre>
-
+<p><strong>Overview</strong>  <br />
 </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.5</a>.
-
+<p>This demo shows the power of image and metadata support in Simple API.<br />
 </p>
-
-<p>
-
-You can download the code of this demo from <a href="TwoDBarcodeDemo.zip"><img src="../images/link.png"></img>here</a>.
-
+<p>A 2D bar code is a special image that can be scanned by a smart phone or a dedicated
scanner. It could contain a URL, a books ISBN number a vCard for a person's contact, information,
etc. It makes it easy to transfer information into a smartphone from a physical object, like
a printed document, or a newspaper or magazine. <br />
 </p>
-
-<p>
-
-The dependent library jslib.zip can be downloaded from <a href="http://puzzle.dl.sourceforge.net/sourceforge/xulmaker/jslib.zip"><img
src="../images/link.png"></img>here</a>.
-
+<p>In this demo, the contact information of a document's author has been put in the
metadata of a presentation document, with an ODF editor, such as IBM Lotus Symphony. The contact
information in the metadata is extracted with the Simple ODF API, and wrapped into JSON object.
Then a RESTful web service is called to generate a 2D bar code image based on this JSON object.
 <br />
 </p>
-</div>
-
-<!---------------------------------------------------------------------------------------------------->
-
-</div>
-
-<div id="footer" class="smallgraytext"> <a href="#">Home</a> | <a href="#">About
Us</a> | <a href="#">Contact Us</a> </div>
+<p>The bar code image is then added to the first slide of this presentation using the
Simple API. <br />
+</p>
+<p>This picture shows how the contact information is added to the metadata of this
document.  <br />
+</p>
+<p><img alt="image1" src="image/demo8_metadata.bmp" /></p>
+<p>This picture shows the 2D bar code image added to the first slide of this presentation
document.<br /><br/> 
+<img alt="image2" src="image/demo8_slide.bmp" /> <br />
+</p>
+<p><strong>Code Introduction</strong><br />
+</p>
+<p>There code of this demo is very simple. First, we load the presentation document,
and extract the metadata with Simple ODF API. Second, we invoke the web service to generate
the bar code image and get the URI of this image.  <br />
+</p>
+<p>Finally, we get the subtitle text box in the first slide, add an image just below
of this subtitle text box. Please note how FrameRectangle is used to specify the image position.
 <br />
+</p>
+<div class="codehilite"><pre><span class="n">public</span> <span
class="n">static</span> <span class="n">void</span> <span class="n">main</span><span
class="p">(</span><span class="n">String</span><span class="o">[]</span>
<span class="n">args</span><span class="p">)</span> <span class="p">{</span>
 
-</div>
+    <span class="n">try</span> <span class="p">{</span>
+        <span class="sr">//</span><span class="n">load</span> <span
class="n">the</span> <span class="n">presentation</span>
+        <span class="n">PresentationDocument</span> <span class="n">presentation</span>
<span class="o">=</span> <span class="n">PresentationDocument</span><span
class="o">.</span><span class="n">loadDocument</span><span class="p">(</span><span
class="s">&quot;Demotemplate.odp&quot;</span><span class="p">);</span>
+        <span class="sr">//g</span><span class="n">et</span> <span
class="n">the</span> <span class="n">metadata</span>
+        <span class="n">Meta</span> <span class="n">metaData</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">Meta</span><span
class="p">(</span><span class="n">presentation</span><span class="o">.</span><span
class="n">getMetaDom</span><span class="p">());</span>
+        <span class="n">String</span> <span class="n">creator</span>
<span class="o">=</span> <span class="n">metaData</span><span class="o">.</span><span
class="n">getCreator</span><span class="p">();</span>
+        <span class="n">String</span> <span class="n">mailto</span>
<span class="o">=</span> <span class="n">metaData</span><span class="o">.</span><span
class="n">getUserDefinedDataValue</span><span class="p">(</span><span
class="s">&quot;Email&quot;</span><span class="p">);</span>
+        <span class="n">String</span> <span class="n">phoneno</span>
<span class="o">=</span> <span class="n">metaData</span><span class="o">.</span><span
class="n">getUserDefinedDataValue</span><span class="p">(</span><span
class="s">&quot;Phone&quot;</span><span class="p">);</span>
+
+        <span class="sr">//i</span><span class="n">nvoke</span> <span
class="n">the</span> <span class="mi">2</span><span class="n">D</span>
<span class="n">barcode</span> <span class="n">service</span><span
class="p">,</span> <span class="ow">and</span> <span class="n">get</span>
<span class="n">the</span> <span class="n">url</span>
+        <span class="n">BarcodeImageGeneration</span> <span class="n">demo</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">BarcodeImageGeneration</span><span
class="p">();</span>
+        <span class="n">String</span> <span class="n">url</span>
<span class="o">=</span> <span class="n">demo</span><span class="o">.</span><span
class="n">invokepost</span><span class="p">(</span><span class="n">creator</span><span
class="p">,</span><span class="n">mailto</span><span class="p">,</span><span
class="n">phoneno</span><span class="p">);</span>
+
+        <span class="sr">//</span><span class="n">Add</span> <span
class="n">the</span> <span class="n">image</span> <span class="n">to</span>
<span class="n">the</span> <span class="n">first</span> <span class="n">slide</span>
+        <span class="n">Slide</span> <span class="n">slide</span>
<span class="o">=</span> <span class="n">presentation</span><span
class="o">.</span><span class="n">getSlideByIndex</span><span class="p">(</span><span
class="mi">0</span><span class="p">);</span>
+        <span class="n">Textbox</span> <span class="n">subtitleBox</span>
<span class="o">=</span> <span class="n">slide</span><span class="o">.</span><span
class="n">getTextboxByUsage</span><span class="p">(</span><span class="n">PresentationClass</span><span
class="o">.</span><span class="n">SUBTITLE</span><span class="p">)</span><span
class="o">.</span><span class="n">get</span><span class="p">(</span><span
class="mi">0</span><span class="p">);</span>
+        <span class="n">FrameRectangle</span> <span class="n">subtitleRect</span>
<span class="o">=</span> <span class="n">subtitleBox</span><span
class="o">.</span><span class="n">getRectangle</span><span class="p">();</span>
+        <span class="n">Image</span> <span class="n">image</span>
<span class="o">=</span> <span class="n">Image</span><span class="o">.</span><span
class="n">newImage</span><span class="p">(</span><span class="n">slide</span><span
class="p">,</span> <span class="k">new</span> <span class="n">URI</span><span
class="p">(</span><span class="n">url</span><span class="p">));</span>
+        <span class="n">FrameRectangle</span> <span class="n">imageRect</span>
<span class="o">=</span> <span class="n">image</span><span class="o">.</span><span
class="n">getRectangle</span><span class="p">();</span>
+        <span class="n">imageRect</span><span class="o">.</span><span
class="n">setX</span><span class="p">(</span><span class="n">subtitleRect</span><span
class="o">.</span><span class="n">getX</span><span class="p">()</span><span
class="o">+</span><span class="p">(</span><span class="n">subtitleRect</span><span
class="o">.</span><span class="n">getWidth</span><span class="p">()</span><span
class="o">-</span><span class="n">imageRect</span><span class="o">.</span><span
class="n">getWidth</span><span class="p">())</span><span class="o">/</span><span
class="mi">2</span><span class="p">);</span>
+        <span class="n">imageRect</span><span class="o">.</span><span
class="n">setY</span><span class="p">(</span><span class="n">subtitleRect</span><span
class="o">.</span><span class="n">getY</span><span class="p">()</span><span
class="o">+</span><span class="n">subtitleRect</span><span class="o">.</span><span
class="n">getHeight</span><span class="p">());</span>
+        <span class="n">image</span><span class="o">.</span><span
class="n">setRectangle</span><span class="p">(</span><span class="n">imageRect</span><span
class="p">);</span>
+
+        <span class="n">presentation</span><span class="o">.</span><span
class="n">save</span><span class="p">(</span><span class="s">&quot;output.odp&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>
 
-</div>
+<span class="p">}</span>
+</pre></div>
 
-</body>
 
-</html>
+<p><strong>Download</strong><br />
+</p>
+<p>Powered by the Simple Java API for ODF version <a href="../downloads.html">0.5.5</a>.
<br />
+You can download the code of this demo from <a href="TwoDBarcodeDemo.zip">here</a>.<br
/>
+The dependent library jslib.zip can be downloaded from <a href="http://puzzle.dl.sourceforge.net/sourceforge/xulmaker/jslib.zip">here</a>.</p>
   </div>
 
   <div id="footera">

Modified: websites/production/odftoolkit/content/odftoolkit/simple/demo/demo9.html
==============================================================================
--- websites/production/odftoolkit/content/odftoolkit/simple/demo/demo9.html (original)
+++ websites/production/odftoolkit/content/odftoolkit/simple/demo/demo9.html Fri Sep  2 09:18:18
2011
@@ -78,101 +78,34 @@
   <div id="contenta">
   
     
-    <!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">
-  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="demo9.html">Demo 8: Create Analysis Report with Charts<a>
-    </span> 
-</div>
-<!---------------------------------------------------------------------------------------------------->

-<div class="contenttitle">
-    <a name="overview">Overview</a>
-</div>
-<div class="bodytext">
-    <p>
-    Simple ODF provides Chart API since version 0.6. Chart is a visualized way of data show
in electronic document. For ODF document, text document, spreadsheet document and presentation
document can embed charts to help describe content. This demo shows the power of chart support
in Simple ODF.<br/><br/>
-    In this demo, a web traffic analytics report will be generated in presentation document
and text document format. The initial data is stored in a spreadsheet document, which includes
visitors, traffic sources and page visit information. These data will be used in charts. Each
chart chooses a cell range and uses the values of these cells to draw picture. It's easy and
convenient.<br/><br/>
-    No need predefined template, all of the document are generated by Simple ODF API. This
demo not only tell you how to use Chart API, but also teach you ro use slide layout to improve
presentation design.<br/><br/>
-    This picture shows the generated presentation document.<br/><br/>
-    <img src="image/demo9p.png"></img><br/><br/>
-    This picture shows the generated text document.<br/><br/>
-    <img src="image/demo9t.png"></img><br/><br/>
-    Besides, we also supply some codes to show how to create chart in a spreadsheet document.
The following picture shows the generated document.<br/><br/> 
-    <img src="image/demo9s.png"></img><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 clear. First, we create a presentation document and load
the data document. Second, we create cover page and set its content. Thirdly, we add charts
to each slide. If you want to add chart to a slide, you must chose a layout which can hold
chart. In Simple ODF 0.6, these layouts are "TITLE_PLUS_CHART", "TITLE_PLUS_2_CHART", "TITLE_LEFT_CHART_RIGHT_OUTLINE",
"TITLE_PLUS_3_OBJECT", "TITLE_PLUS_4_OBJECT". Different layout can own different count of
charts. Please be sure you know that, otherwise chart insert would be failed. For slide, you
needn't set the chart size or position, Simple ODF will do it automatically. Finally, the
data document is closed and the new created document is saved. <br/><br/>
-    <!--java code-->
-    <pre class="brush:java;">
-    private static void generatePresentationChart() {
-        try {
-            PresentationDocument presentationDoc = PresentationDocument.newPresentationDocument();
-            SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument("demo9_data.ods");
+    <p><a href="index.html"><strong>Simple Demos</strong></a>
&gt;  <b>Create Analysis Report with Charts</b><br />
+</p>
+<p><strong>Overview</strong></p>
+<p>Simple ODF provides Chart API since version 0.6. Chart is a visualized way of data
show in electronic document. For ODF document, text document, spreadsheet document and presentation
document can embed charts to help describe content. This demo shows the power of chart support
in Simple ODF.  <br />
+</p>
+<p>In this demo, a web traffic analytics report will be generated in presentation document
and text document format. The initial data is stored in a spreadsheet document, which includes
visitors, traffic sources and page visit information. These data will be used in charts. Each
chart chooses a cell range and uses the values of these cells to draw picture. It's easy and
convenient.  <br />
+</p>
+<p>No need predefined template, all of the document are generated by Simple ODF API.
This demo not only tell you how to use Chart API, but also teach you ro use slide layout to
improve presentation design.<br/><br/>
+This picture shows the generated presentation document.  <br />
+</p>
+<p><img alt="image" src="image/demo9p.png" /> <br />
+This picture shows the generated text document.  <br />
+</p>
+<p><img alt="image" src="image/demo9t.png" /><br />
+</p>
+<p>Besides, we also supply some codes to show how to create chart in a spreadsheet
document. The following picture shows the generated document. <br />
+</p>
+<p><img alt="image" src="image/demo9s.png" /> <br />
+</p>
+<p><strong>Code Introduction</strong></p>
+<p>There code of this demo is very clear. First, we create a presentation document
and load the data document. Second, we create cover page and set its content. Thirdly, we
add charts to each slide. If you want to add chart to a slide, you must chose a layout which
can hold chart. In Simple ODF 0.6, these layouts are "TITLE_PLUS_CHART", "TITLE_PLUS_2_CHART",
"TITLE_LEFT_CHART_RIGHT_OUTLINE", "TITLE_PLUS_3_OBJECT", "TITLE_PLUS_4_OBJECT". Different
layout can own different count of charts. Please be sure you know that, otherwise chart insert
would be failed. For slide, you needn't set the chart size or position, Simple ODF will do
it automatically. Finally, the data document is closed and the new created document is saved.
<br />
+</p>
+<div class="codehilite"><pre><span class="n">private</span> <span
class="n">static</span> <span class="n">void</span> <span class="n">generatePresentationChart</span><span
class="p">()</span> <span class="p">{</span>
+    <span class="n">try</span> <span class="p">{</span>
+        <span class="n">PresentationDocument</span> <span class="n">presentationDoc</span>
<span class="o">=</span> <span class="n">PresentationDocument</span><span
class="o">.</span><span class="n">newPresentationDocument</span><span
class="p">();</span>
+        <span class="n">SpreadsheetDocument</span> <span class="n">spreadsheetDoc</span>
<span class="o">=</span> <span class="n">SpreadsheetDocument</span><span
class="o">.</span><span class="n">loadDocument</span><span class="p">(</span><span
class="s">&quot;demo9_data.ods&quot;</span><span class="p">);</span>
 
-<div class="codehilite"><pre>        <span class="sr">//</span> <span
class="n">create</span> <span class="n">cover</span> <span class="n">page</span>
+        <span class="sr">//</span> <span class="n">create</span>
<span class="n">cover</span> <span class="n">page</span>
         <span class="n">Slide</span> <span class="n">slide</span>
<span class="o">=</span> <span class="n">presentationDoc</span><span
class="o">.</span><span class="n">newSlide</span><span class="p">(</span><span
class="mi">0</span><span class="p">,</span> <span class="s">&quot;Slide1&quot;</span><span
class="p">,</span> <span class="n">SlideLayout</span><span class="o">.</span><span
class="n">TITLE_SUBTITLE</span><span class="p">);</span>
         <span class="n">setSlideTextContent</span><span class="p">(</span><span
class="n">slide</span><span class="p">,</span> <span class="s">&quot;Simple
Website Analytics Report&quot;</span><span class="p">,</span> <span
class="s">&quot;2011-04-27~2011-05-27&quot;</span><span class="p">);</span>
 
@@ -226,20 +159,17 @@ var s = document.getElementsByTagName('s
         <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>
-<p>
-    The following codes show how to generate the text document format report. Different from
presentation, you need to set chart size before add it to the document.<br/><br/>
-    <!--java code-->
-    <pre class="brush:java;">
-    private static void generateTextDocument() {
-        try {
-            TextDocument textDoc = TextDocument.newTextDocument();
-            SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument("demo9_data.ods");</p>
-<div class="codehilite"><pre>        <span class="sr">//</span> <span
class="n">create</span> <span class="n">cover</span> <span class="n">page</span>
+<p>The following codes show how to generate the text document format report. Different
from presentation, you need to set chart size before add it to the document. <br />
+</p>
+<div class="codehilite"><pre><span class="n">private</span> <span
class="n">static</span> <span class="n">void</span> <span class="n">generateTextDocument</span><span
class="p">()</span> <span class="p">{</span>
+    <span class="n">try</span> <span class="p">{</span>
+        <span class="n">TextDocument</span> <span class="n">textDoc</span>
<span class="o">=</span> <span class="n">TextDocument</span><span
class="o">.</span><span class="n">newTextDocument</span><span class="p">();</span>
+        <span class="n">SpreadsheetDocument</span> <span class="n">spreadsheetDoc</span>
<span class="o">=</span> <span class="n">SpreadsheetDocument</span><span
class="o">.</span><span class="n">loadDocument</span><span class="p">(</span><span
class="s">&quot;demo9_data.ods&quot;</span><span class="p">);</span>
+
+        <span class="sr">//</span> <span class="n">create</span>
<span class="n">cover</span> <span class="n">page</span>
         <span class="n">textDoc</span><span class="o">.</span><span
class="n">addParagraph</span><span class="p">(</span><span class="s">&quot;Simple
Website Analytics Report(2011-04-27~2011-05-27)&quot;</span><span class="p">);</span>
         <span class="n">textDoc</span><span class="o">.</span><span
class="n">addParagraph</span><span class="p">(</span><span class="s">&quot;Visitors
Overview&quot;</span><span class="p">);</span>
         <span class="sr">//</span> <span class="n">create</span>
<span class="n">visitors</span> <span class="n">overview</span> <span
class="n">page</span> <span class="mi">1</span>
@@ -283,53 +213,34 @@ var s = document.getElementsByTagName('s
         <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>
-<p>
-    Lastly, let's have a look at how to add chart to spreadsheet document. It's similar with
text and presentation documents. On the other hand, it also has a special feature. You can
specify a cell as the position where the chart should be located.<br/><br/>
-    <!--java code-->
-    <pre class="brush:java;">
-    private static void generateSpreadsheetDocument() {
-        try {
-            SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument("demo9_data.ods");
-            // create visitors overview page 1
-            CellRangeAddressList cellRange = CellRangeAddressList.valueOf("A.A1:A.B3");
-            Rectangle rect = new Rectangle();
-            rect.width = 15000;
-            rect.height = 8000;
-            Cell positionCell = spreadsheetDoc.getTableByName("B").getCellByPosition("E1");
-            spreadsheetDoc.createChart("Page Visit", spreadsheetDoc, cellRange, true, true,
false, rect, positionCell);
-            spreadsheetDoc.save("demo9s.ods");
-            spreadsheetDoc.close();
-        } 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.6</a>.
-  </p>
-  <p>
-    You can download the code of this demo from <a href="demo9.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>
+<p>Lastly, let's have a look at how to add chart to spreadsheet document. It's similar
with text and presentation documents. On the other hand, it also has a special feature. You
can specify a cell as the position where the chart should be located.  <br />
+</p>
+<div class="codehilite"><pre><span class="n">private</span> <span
class="n">static</span> <span class="n">void</span> <span class="n">generateSpreadsheetDocument</span><span
class="p">()</span> <span class="p">{</span>
+    <span class="n">try</span> <span class="p">{</span>
+        <span class="n">SpreadsheetDocument</span> <span class="n">spreadsheetDoc</span>
<span class="o">=</span> <span class="n">SpreadsheetDocument</span><span
class="o">.</span><span class="n">loadDocument</span><span class="p">(</span><span
class="s">&quot;demo9_data.ods&quot;</span><span class="p">);</span>
+        <span class="sr">//</span> <span class="n">create</span>
<span class="n">visitors</span> <span class="n">overview</span> <span
class="n">page</span> <span class="mi">1</span>
+        <span class="n">CellRangeAddressList</span> <span class="n">cellRange</span>
<span class="o">=</span> <span class="n">CellRangeAddressList</span><span
class="o">.</span><span class="n">valueOf</span><span class="p">(</span><span
class="s">&quot;A.A1:A.B3&quot;</span><span class="p">);</span>
+        <span class="n">Rectangle</span> <span class="n">rect</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">Rectangle</span><span
class="p">();</span>
+        <span class="n">rect</span><span class="o">.</span><span
class="n">width</span> <span class="o">=</span> <span class="mi">15000</span><span
class="p">;</span>
+        <span class="n">rect</span><span class="o">.</span><span
class="n">height</span> <span class="o">=</span> <span class="mi">8000</span><span
class="p">;</span>
+        <span class="n">Cell</span> <span class="n">positionCell</span>
<span class="o">=</span> <span class="n">spreadsheetDoc</span><span
class="o">.</span><span class="n">getTableByName</span><span class="p">(</span><span
class="s">&quot;B&quot;</span><span class="p">)</span><span
class="o">.</span><span class="n">getCellByPosition</span><span class="p">(</span><span
class="s">&quot;E1&quot;</span><span class="p">);</span>
+        <span class="n">spreadsheetDoc</span><span class="o">.</span><span
class="n">createChart</span><span class="p">(</span><span class="s">&quot;Page
Visit&quot;</span><span class="p">,</span> <span class="n">spreadsheetDoc</span><span
class="p">,</span> <span class="n">cellRange</span><span class="p">,</span>
<span class="n">true</span><span class="p">,</span> <span class="n">true</span><span
class="p">,</span> <span class="n">false</span><span class="p">,</span>
<span class="n">rect</span><span class="p">,</span> <span class="n">positionCell</span><span
class="p">);</span>
+        <span class="n">spreadsheetDoc</span><span class="o">.</span><span
class="n">save</span><span class="p">(</span><span class="s">&quot;demo9s.ods&quot;</span><span
class="p">);</span>
+        <span class="n">spreadsheetDoc</span><span class="o">.</span><span
class="nb">close</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>
+</pre></div>
+
+
+<p><strong>Download</strong>  <br />
+</p>
+<p>Powered by the Simple Java API for ODF version <a href="../downloads.html">0.6</a>.<br
/>
+You can download the code of this demo from <a href="demo9.zip">here</a>.</p>
   </div>
 
   <div id="footera">



Mime
View raw message