incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1010270 [5/13] - in /websites/staging/odftoolkit/trunk/content: ./ odftoolkit/ odftoolkit/GSoC/ odftoolkit/docs/ odftoolkit/docs/governance/ odftoolkit/odfdom/ odftoolkit/simple/ odftoolkit/simple/demo/ odftoolkit/simple/document/ odftoolk...
Date Tue, 11 Apr 2017 23:13:31 GMT
Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo2.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo2.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo2.html Tue Apr 11 23:13:30 2017
@@ -50,7 +50,18 @@
   <div id="clear"></div>
   
   <div id="sidenav">
-    <h1 id="general">General</h1>
+    <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<h1 id="general">General<a class="headerlink" href="#general" title="Permanent link">&para;</a></h1>
 <ul>
 <li><a href="/odftoolkit/index.html">About</a></li>
 <li><a href="/odftoolkit/downloads.html">Downloads</a></li>
@@ -58,21 +69,21 @@
 <li><a href="/odftoolkit/license.html">License</a></li>
 <li><a href="/odftoolkit/privacy.html">Privacy Policy</a></li>
 </ul>
-<h1 id="components">Components</h1>
+<h1 id="components">Components<a class="headerlink" href="#components" title="Permanent link">&para;</a></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">ODF Validator</a></li>
 <li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
 </ul>
-<h1 id="community">Community</h1>
+<h1 id="community">Community<a class="headerlink" href="#community" title="Permanent link">&para;</a></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>
+<h1 id="development">Development<a class="headerlink" href="#development" title="Permanent link">&para;</a></h1>
 <ul>
 <li><a href="/odftoolkit/source.html">Source Code</a></li>
 <li><a href="https://issues.apache.org/jira/browse/ODFTOOLKIT">Bug Tracker</a></li>
@@ -80,13 +91,12 @@
 <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>
+<h1 id="ppmc">PPMC<a class="headerlink" href="#ppmc" title="Permanent link">&para;</a></h1>
 <ul>
 <li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a></li>
-<li><a href="/odftoolkit/odftoolkit-release-guide.html">Release Guide</a> <br />
-</li>
+<li><a href="/odftoolkit/odftoolkit-release-guide.html">Release Guide</a>   </li>
 </ul>
-<h1 id="asf">ASF</h1>
+<h1 id="asf">ASF<a class="headerlink" href="#asf" title="Permanent link">&para;</a></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>
@@ -96,14 +106,21 @@
   <div id="contenta">
   
     
-    <p><strong><a href="index.html">Demos</a></strong> &gt; <strong>Persentation Extraction and Combination</strong>  <br />
-</p>
-<p><strong>Overview</strong>   <br />
-</p>
-<p>To show the operation of Presentation in Simple API, the Presentation Codmbination demo is used which combine two independent presentation documents together and extract the notes of each slide out to a Text document. <br />
-</p>
-<p>Here the original presentation documents "Pres1.odp" and "Pres2.odp" are used. Pres1.odp presents some basic concepts of XML and Pres2.odp presents some basic aspects of HTML. Both of them have their own cover page with the same slide name "Cover" at the front and an End page with the same slide name "end" at the end of the document. To combine these two presentation documents together, the following steps are used here. <br />
-</p>
+    <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p><strong><a href="index.html">Demos</a></strong> &gt; <strong>Persentation Extraction and Combination</strong>    </p>
+<p><strong>Overview</strong>     </p>
+<p>To show the operation of Presentation in Simple API, the Presentation Codmbination demo is used which combine two independent presentation documents together and extract the notes of each slide out to a Text document.   </p>
+<p>Here the original presentation documents "Pres1.odp" and "Pres2.odp" are used. Pres1.odp presents some basic concepts of XML and Pres2.odp presents some basic aspects of HTML. Both of them have their own cover page with the same slide name "Cover" at the front and an End page with the same slide name "end" at the end of the document. To combine these two presentation documents together, the following steps are used here.   </p>
 <p><ol>
  <li>Delete the last page of "Pres1.odp".</li>
  <li>Change the slide name of the cover page for each presentation document.</li>
@@ -113,17 +130,12 @@
  <li>Extract the notes from each slide in the presentation document and save them into a text document.</li>
  <li>Save the combined document and the text document.</li>
  </ol></p>
-<p>The contents of the text document which contains the notes of the presentation document is shown in the following picture, where each note is identified by the corresponding slide name. <br />
-</p>
+<p>The contents of the text document which contains the notes of the presentation document is shown in the following picture, where each note is identified by the corresponding slide name.   </p>
 <p><img src="image/ExtractedNotes.JPG" ></p>
-<p><strong>Code Introduction</strong> <br />
-</p>
-<p>To generate this sample, the Presentation and Text package in Simple API will be used. The related operations contains: load the existing presentation document, append one presentation to the end of another one, delete slide in the presentation, add new slide in the presentation, get certain slide in the presentation, add new notes to the slide, create a new text document, add new paragraph in the text document, etc.  <br />
-</p>
-<p>Seven functions exist in the resource: main(), Getpresentation(), ProcSlide(), titleofExtractnotes(), ExtractNotes(), FillExtractnotes() and saveDocument(). Each of them will be explained briefly in the following paragraphs. <br />
-</p>
-<p>First three variables should be used to hold the two presentation document and the text document. <br />
-</p>
+<p><strong>Code Introduction</strong>   </p>
+<p>To generate this sample, the Presentation and Text package in Simple API will be used. The related operations contains: load the existing presentation document, append one presentation to the end of another one, delete slide in the presentation, add new slide in the presentation, get certain slide in the presentation, add new notes to the slide, create a new text document, add new paragraph in the text document, etc.    </p>
+<p>Seven functions exist in the resource: main(), Getpresentation(), ProcSlide(), titleofExtractnotes(), ExtractNotes(), FillExtractnotes() and saveDocument(). Each of them will be explained briefly in the following paragraphs.   </p>
+<p>First three variables should be used to hold the two presentation document and the text document.   </p>
 <div class="codehilite"><pre><span class="n">PresentationDocument</span> <span class="n">presentationdoc</span><span class="p">;</span>
 <span class="n">PresentationDocument</span> <span class="n">presentationdoc2</span><span class="p">;</span>
 <span class="n">TextDocument</span> <span class="n">Extractednotes</span><span class="p">;</span>
@@ -132,19 +144,19 @@
 
 <p>In function Getpresentation(), the two presentation documents are loaded so that they can be operated by Simple API, and the text document is created to save the extracted notes. The codes are shown below:</p>
 <div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">Getpresentation</span><span class="p">()</span> <span class="p">{</span>
-    <span class="n">try</span> <span class="p">{</span>
-        <span class="n">presentationdoc</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;Pres1.odp&quot;</span><span class="p">);</span>
-        <span class="n">presentationdoc2</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;Pres2.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">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Unable to load document.&quot;</span><span class="p">);</span>
-        <span class="n">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">getMessage</span><span class="p">());</span>  
+    <span class="k">try</span> <span class="p">{</span>
+        <span class="n">presentationdoc</span><span class="p">=</span><span class="n">PresentationDocument</span><span class="p">.</span><span class="n">loadDocument</span><span class="p">(</span>&quot;<span class="n">Pres1</span><span class="p">.</span><span class="n">odp</span>&quot;<span class="p">);</span>
+        <span class="n">presentationdoc2</span><span class="p">=</span><span class="n">PresentationDocument</span><span class="p">.</span><span class="n">loadDocument</span><span class="p">(</span>&quot;<span class="n">Pres2</span><span class="p">.</span><span class="n">odp</span>&quot;<span class="p">);</span>  
+    <span class="p">}</span> <span class="k">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">System</span><span class="p">.</span><span class="n">err</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">Unable</span> <span class="n">to</span> <span class="n">load</span> <span class="n">document</span><span class="p">.</span>&quot;<span class="p">);</span>
+        <span class="n">System</span><span class="p">.</span><span class="n">err</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="n">getMessage</span><span class="p">());</span>  
     <span class="p">}</span>
 
-    <span class="n">try</span><span class="p">{</span>
-        <span class="n">Extractednotes</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="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">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Unable to create text document.&quot;</span><span class="p">);</span>
-        <span class="n">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">getMessage</span><span class="p">());</span>  
+    <span class="k">try</span><span class="p">{</span>
+        <span class="n">Extractednotes</span><span class="p">=</span><span class="n">TextDocument</span><span class="p">.</span><span class="n">newTextDocument</span><span class="p">();</span>
+    <span class="p">}</span> <span class="k">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">System</span><span class="p">.</span><span class="n">err</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">Unable</span> <span class="n">to</span> <span class="n">create</span> <span class="n">text</span> <span class="n">document</span><span class="p">.</span>&quot;<span class="p">);</span>
+        <span class="n">System</span><span class="p">.</span><span class="n">err</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="n">getMessage</span><span class="p">());</span>  
     <span class="p">}</span>
 <span class="p">}</span>
 </pre></div>
@@ -153,56 +165,53 @@
 <p>In function ProcSlide(), five main operations are used to process the document: delete extra slide (deleteSlideByIndex, deleteSlideByName), change slide name (setSlideName), combine these two presentations together (appendPresentation), add a new cover for the new combined document (newSlide), add title and notes for the new slide. Here the function getSlideCount() is used to get the slide number of the specified presentation document, getSlideByName()and getSlideByIndex() are used to get the specified slide, getNotesPage() and setTextContent() are used to add notes for the added slide. In order to add text to the title frame, a DrawTextBoxElement should be used to get the editable component. The codes are shown below:</p>
 <div class="codehilite"><pre><span class="n">Slide</span> <span class="n">slide</span><span class="p">;</span>
 <span class="n">Notes</span> <span class="n">notes</span><span class="p">;</span>
-<span class="nb">int</span> <span class="n">count</span><span class="o">=</span><span class="n">presentationdoc</span><span class="o">.</span><span class="n">getSlideCount</span><span class="p">();</span>
-<span class="n">presentationdoc</span><span class="o">.</span><span class="n">deleteSlideByIndex</span><span class="p">(</span><span class="n">count</span><span class="o">-</span><span class="mi">1</span><span class="p">);</span>    
-<span class="sr">//</span><span class="n">presentationdoc</span><span class="o">.</span><span class="n">deleteSlideByName</span><span class="p">(</span><span class="s">&quot;end&quot;</span><span class="p">);</span>
-<span class="n">slide</span><span class="o">=</span><span class="n">presentationdoc</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">slide</span><span class="o">.</span><span class="n">setSlideName</span><span class="p">(</span><span class="s">&quot;XML Cover&quot;</span><span class="p">);</span>
-<span class="n">slide</span><span class="o">=</span><span class="n">presentationdoc2</span><span class="o">.</span><span class="n">getSlideByName</span><span class="p">(</span><span class="s">&quot;Cover&quot;</span><span class="p">);</span>
-<span class="n">slide</span><span class="o">.</span><span class="n">setSlideName</span><span class="p">(</span><span class="s">&quot;HTML Cover&quot;</span><span class="p">);</span>
-<span class="n">presentationdoc</span><span class="o">.</span><span class="n">appendPresentation</span><span class="p">(</span><span class="n">presentationdoc2</span><span class="p">);</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;Cover&quot;</span><span class="p">,</span> <span class="n">SlideLayout</span><span class="o">.</span><span class="n">TITLE_ONLY</span><span class="p">);</span> 
-<span class="n">notes</span><span class="o">=</span><span class="n">slide</span><span class="o">.</span><span class="n">getNotesPage</span><span class="p">();</span>
-<span class="n">notes</span><span class="o">.</span><span class="n">addText</span><span class="p">(</span><span class="s">&quot;This is the cover of the new presentation document&quot;</span><span class="p">);</span>
-<span class="n">DrawTextBoxElement</span> <span class="n">textbox</span><span class="o">=</span><span class="p">(</span><span class="n">DrawTextBoxElement</span><span class="p">)</span><span class="n">slide</span><span class="o">.</span><span class="n">getOdfElement</span><span class="p">()</span><span class="o">.</span><span class="n">getFirstChild</span><span class="p">()</span><span class="o">.</span><span class="n">getFirstChild</span><span class="p">();</span>
-<span class="n">textbox</span><span class="o">.</span><span class="n">newTextPElement</span><span class="p">()</span><span class="o">.</span><span class="n">setTextContent</span><span class="p">(</span><span class="s">&quot;Combined Presentation&quot;</span><span class="p">);</span>
+<span class="n">int</span> <span class="n">count</span><span class="p">=</span><span class="n">presentationdoc</span><span class="p">.</span><span class="n">getSlideCount</span><span class="p">();</span>
+<span class="n">presentationdoc</span><span class="p">.</span><span class="n">deleteSlideByIndex</span><span class="p">(</span><span class="n">count</span><span class="o">-</span>1<span class="p">);</span>    
+<span class="o">//</span><span class="n">presentationdoc</span><span class="p">.</span><span class="n">deleteSlideByName</span><span class="p">(</span>&quot;<span class="k">end</span>&quot;<span class="p">);</span>
+<span class="n">slide</span><span class="p">=</span><span class="n">presentationdoc</span><span class="p">.</span><span class="n">getSlideByIndex</span><span class="p">(</span>0<span class="p">);</span>
+<span class="n">slide</span><span class="p">.</span><span class="n">setSlideName</span><span class="p">(</span>&quot;<span class="n">XML</span> <span class="n">Cover</span>&quot;<span class="p">);</span>
+<span class="n">slide</span><span class="p">=</span><span class="n">presentationdoc2</span><span class="p">.</span><span class="n">getSlideByName</span><span class="p">(</span>&quot;<span class="n">Cover</span>&quot;<span class="p">);</span>
+<span class="n">slide</span><span class="p">.</span><span class="n">setSlideName</span><span class="p">(</span>&quot;<span class="n">HTML</span> <span class="n">Cover</span>&quot;<span class="p">);</span>
+<span class="n">presentationdoc</span><span class="p">.</span><span class="n">appendPresentation</span><span class="p">(</span><span class="n">presentationdoc2</span><span class="p">);</span>
+<span class="n">slide</span><span class="p">=</span><span class="n">presentationdoc</span><span class="p">.</span><span class="n">newSlide</span><span class="p">(</span>0<span class="p">,</span> &quot;<span class="n">Cover</span>&quot;<span class="p">,</span> <span class="n">SlideLayout</span><span class="p">.</span><span class="n">TITLE_ONLY</span><span class="p">);</span> 
+<span class="n">notes</span><span class="p">=</span><span class="n">slide</span><span class="p">.</span><span class="n">getNotesPage</span><span class="p">();</span>
+<span class="n">notes</span><span class="p">.</span><span class="n">addText</span><span class="p">(</span>&quot;<span class="n">This</span> <span class="n">is</span> <span class="n">the</span> <span class="n">cover</span> <span class="n">of</span> <span class="n">the</span> <span class="n">new</span> <span class="n">presentation</span> <span class="n">document</span>&quot;<span class="p">);</span>
+<span class="n">DrawTextBoxElement</span> <span class="n">textbox</span><span class="p">=(</span><span class="n">DrawTextBoxElement</span><span class="p">)</span><span class="n">slide</span><span class="p">.</span><span class="n">getOdfElement</span><span class="p">().</span><span class="n">getFirstChild</span><span class="p">().</span><span class="n">getFirstChild</span><span class="p">();</span>
+<span class="n">textbox</span><span class="p">.</span><span class="n">newTextPElement</span><span class="p">().</span><span class="n">setTextContent</span><span class="p">(</span>&quot;<span class="n">Combined</span> <span class="n">Presentation</span>&quot;<span class="p">);</span>
 </pre></div>
 
 
-<p>In function titleofExtractnotes(), the title of the text document which is used to save the notes of each slide is added. And in function ExtractNotes(), the notes of each slide will be extracted (getTextContent), the function FillExtractnotes() will be called if the notes exists. Here function getSlideByIndex() is used to obtain the corresponding slide, getSlideName() is used to obtain the name of the specified slide in order to identify the notes. The codes are shown below: <br />
-</p>
-<div class="codehilite"><pre><span class="n">slide</span><span class="o">=</span><span class="n">presentationdoc</span><span class="o">.</span><span class="n">getSlideByIndex</span><span class="p">(</span><span class="n">i</span><span class="p">);</span>
-<span class="n">String</span> <span class="n">slidename</span><span class="o">=</span><span class="n">slide</span><span class="o">.</span><span class="n">getSlideName</span><span class="p">();</span>
-<span class="n">notes</span><span class="o">=</span><span class="n">slide</span><span class="o">.</span><span class="n">getNotesPage</span><span class="p">();</span> 
-<span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="n">notes</span><span class="o">.</span><span class="n">getOdfElement</span><span class="p">()</span><span class="o">.</span><span class="n">getTextContent</span><span class="p">()</span><span class="o">.</span><span class="n">isEmpty</span><span class="p">()){</span>
-    <span class="n">String</span> <span class="n">notestring</span><span class="o">=</span><span class="n">notes</span><span class="o">.</span><span class="n">getOdfElement</span><span class="p">()</span><span class="o">.</span><span class="n">getTextContent</span><span class="p">()</span><span class="o">.</span><span class="n">toString</span><span class="p">()</span><span class="o">.</span><span class="n">trim</span><span class="p">();</span>
+<p>In function titleofExtractnotes(), the title of the text document which is used to save the notes of each slide is added. And in function ExtractNotes(), the notes of each slide will be extracted (getTextContent), the function FillExtractnotes() will be called if the notes exists. Here function getSlideByIndex() is used to obtain the corresponding slide, getSlideName() is used to obtain the name of the specified slide in order to identify the notes. The codes are shown below:   </p>
+<div class="codehilite"><pre><span class="n">slide</span><span class="p">=</span><span class="n">presentationdoc</span><span class="p">.</span><span class="n">getSlideByIndex</span><span class="p">(</span><span class="nb">i</span><span class="p">);</span>
+<span class="n">String</span> <span class="n">slidename</span><span class="p">=</span><span class="n">slide</span><span class="p">.</span><span class="n">getSlideName</span><span class="p">();</span>
+<span class="n">notes</span><span class="p">=</span><span class="n">slide</span><span class="p">.</span><span class="n">getNotesPage</span><span class="p">();</span> 
+<span class="k">if</span><span class="p">(</span>!<span class="n">notes</span><span class="p">.</span><span class="n">getOdfElement</span><span class="p">().</span><span class="n">getTextContent</span><span class="p">().</span><span class="n">isEmpty</span><span class="p">()){</span>
+    <span class="n">String</span> <span class="n">notestring</span><span class="p">=</span><span class="n">notes</span><span class="p">.</span><span class="n">getOdfElement</span><span class="p">().</span><span class="n">getTextContent</span><span class="p">().</span><span class="n">toString</span><span class="p">().</span><span class="n">trim</span><span class="p">();</span>
     <span class="n">FillExtractnotes</span><span class="p">(</span><span class="n">notestring</span><span class="p">,</span><span class="n">slidename</span><span class="p">);</span>
 <span class="p">}</span>
 </pre></div>
 
 
-<p>In function FillExtractnotes, the notes will be added to the text document. Here the slide name is used as the identity and is followed by the corresponding notes, function newParagraph() is used to add a new paragraph in the text document. The codes are shown below: <br />
-</p>
-<div class="codehilite"><pre><span class="n">OdfTextParagraph</span> <span class="n">para</span> <span class="o">=</span><span class="n">Extractednotes</span><span class="o">.</span><span class="n">newParagraph</span><span class="p">();</span>
-<span class="n">para</span><span class="o">.</span><span class="n">setProperty</span><span class="p">(</span><span class="n">OdfParagraphProperties</span><span class="o">.</span><span class="n">MarginTop</span><span class="p">,</span> <span class="s">&quot;0.25cm&quot;</span><span class="p">);</span>
-<span class="n">para</span><span class="o">.</span><span class="n">setTextContent</span><span class="p">(</span><span class="s">&quot;Notes of &quot;</span><span class="o">+</span><span class="n">slidename</span><span class="o">+</span><span class="s">&quot;:&quot;</span><span class="p">);</span>             
-<span class="n">para</span><span class="o">=</span><span class="n">Extractednotes</span><span class="o">.</span><span class="n">newParagraph</span><span class="p">();</span>
-<span class="n">para</span><span class="o">.</span><span class="n">setProperty</span><span class="p">(</span><span class="n">OdfParagraphProperties</span><span class="o">.</span><span class="n">TextAlign</span><span class="p">,</span><span class="s">&quot;justify&quot;</span><span class="p">);</span>
-<span class="n">para</span><span class="o">.</span><span class="n">setTextContent</span><span class="p">(</span><span class="s">&quot;  &quot;</span><span class="o">+</span><span class="n">notestext</span><span class="p">);</span>
+<p>In function FillExtractnotes, the notes will be added to the text document. Here the slide name is used as the identity and is followed by the corresponding notes, function newParagraph() is used to add a new paragraph in the text document. The codes are shown below:   </p>
+<div class="codehilite"><pre><span class="n">OdfTextParagraph</span> <span class="n">para</span> <span class="p">=</span><span class="n">Extractednotes</span><span class="p">.</span><span class="n">newParagraph</span><span class="p">();</span>
+<span class="n">para</span><span class="p">.</span><span class="n">setProperty</span><span class="p">(</span><span class="n">OdfParagraphProperties</span><span class="p">.</span><span class="n">MarginTop</span><span class="p">,</span> &quot;0<span class="p">.</span>25<span class="n">cm</span>&quot;<span class="p">);</span>
+<span class="n">para</span><span class="p">.</span><span class="n">setTextContent</span><span class="p">(</span>&quot;<span class="n">Notes</span> <span class="n">of</span> &quot;<span class="o">+</span><span class="n">slidename</span><span class="o">+</span>&quot;<span class="p">:</span>&quot;<span class="p">);</span>             
+<span class="n">para</span><span class="p">=</span><span class="n">Extractednotes</span><span class="p">.</span><span class="n">newParagraph</span><span class="p">();</span>
+<span class="n">para</span><span class="p">.</span><span class="n">setProperty</span><span class="p">(</span><span class="n">OdfParagraphProperties</span><span class="p">.</span><span class="n">TextAlign</span><span class="p">,</span>&quot;<span class="n">justify</span>&quot;<span class="p">);</span>
+<span class="n">para</span><span class="p">.</span><span class="n">setTextContent</span><span class="p">(</span>&quot;  &quot;<span class="o">+</span><span class="n">notestext</span><span class="p">);</span>
 </pre></div>
 
 
-<p>In function saveDocument(), the new combined presentation document and the text document which contains the notes will be saved. The codes are shown below: <br />
-</p>
+<p>In function saveDocument(), the new combined presentation document and the text document which contains the notes will be saved. The codes are shown below:   </p>
 <div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">saveDocument</span><span class="p">(){</span>     
-    <span class="n">try</span><span class="p">{</span>
-        <span class="n">presentationdoc</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="s">&quot;Presentationsample.odp&quot;</span><span class="p">);</span>
-        <span class="n">presentationdoc</span><span class="o">.</span><span class="nb">close</span><span class="p">();</span>
-        <span class="n">Extractednotes</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="s">&quot;Extractednotes.odt&quot;</span><span class="p">);</span>
-        <span class="n">Extractednotes</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="n">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Unable to save document.&quot;</span><span class="p">);</span>
-        <span class="n">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="n">e</span><span class="o">.</span><span class="n">getMessage</span><span class="p">());</span>  
+    <span class="k">try</span><span class="p">{</span>
+        <span class="n">presentationdoc</span><span class="p">.</span><span class="n">save</span><span class="p">(</span>&quot;<span class="n">Presentationsample</span><span class="p">.</span><span class="n">odp</span>&quot;<span class="p">);</span>
+        <span class="n">presentationdoc</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+        <span class="n">Extractednotes</span><span class="p">.</span><span class="n">save</span><span class="p">(</span>&quot;<span class="n">Extractednotes</span><span class="p">.</span><span class="n">odt</span>&quot;<span class="p">);</span>
+        <span class="n">Extractednotes</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+    <span class="p">}</span><span class="k">catch</span><span class="p">(</span><span class="n">Exception</span> <span class="n">e</span><span class="p">){</span>
+        <span class="n">System</span><span class="p">.</span><span class="n">err</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">Unable</span> <span class="n">to</span> <span class="n">save</span> <span class="n">document</span><span class="p">.</span>&quot;<span class="p">);</span>
+        <span class="n">System</span><span class="p">.</span><span class="n">err</span><span class="p">.</span><span class="n">println</span><span class="p">(</span><span class="n">e</span><span class="p">.</span><span class="n">getMessage</span><span class="p">());</span>  
     <span class="p">}</span>   
 <span class="p">}</span>
 </pre></div>

Modified: websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo3.html
==============================================================================
--- websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo3.html (original)
+++ websites/staging/odftoolkit/trunk/content/odftoolkit/simple/demo/demo3.html Tue Apr 11 23:13:30 2017
@@ -50,7 +50,18 @@
   <div id="clear"></div>
   
   <div id="sidenav">
-    <h1 id="general">General</h1>
+    <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<h1 id="general">General<a class="headerlink" href="#general" title="Permanent link">&para;</a></h1>
 <ul>
 <li><a href="/odftoolkit/index.html">About</a></li>
 <li><a href="/odftoolkit/downloads.html">Downloads</a></li>
@@ -58,21 +69,21 @@
 <li><a href="/odftoolkit/license.html">License</a></li>
 <li><a href="/odftoolkit/privacy.html">Privacy Policy</a></li>
 </ul>
-<h1 id="components">Components</h1>
+<h1 id="components">Components<a class="headerlink" href="#components" title="Permanent link">&para;</a></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">ODF Validator</a></li>
 <li><a href="/odftoolkit/xsltrunner/ODFXSLTRunner.html">XSLT Runner</a></li>
 </ul>
-<h1 id="community">Community</h1>
+<h1 id="community">Community<a class="headerlink" href="#community" title="Permanent link">&para;</a></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>
+<h1 id="development">Development<a class="headerlink" href="#development" title="Permanent link">&para;</a></h1>
 <ul>
 <li><a href="/odftoolkit/source.html">Source Code</a></li>
 <li><a href="https://issues.apache.org/jira/browse/ODFTOOLKIT">Bug Tracker</a></li>
@@ -80,13 +91,12 @@
 <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>
+<h1 id="ppmc">PPMC<a class="headerlink" href="#ppmc" title="Permanent link">&para;</a></h1>
 <ul>
 <li><a href="/odftoolkit/ppmc-faqs.html">PPMC FAQs</a></li>
-<li><a href="/odftoolkit/odftoolkit-release-guide.html">Release Guide</a> <br />
-</li>
+<li><a href="/odftoolkit/odftoolkit-release-guide.html">Release Guide</a>   </li>
 </ul>
-<h1 id="asf">ASF</h1>
+<h1 id="asf">ASF<a class="headerlink" href="#asf" title="Permanent link">&para;</a></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>
@@ -96,116 +106,108 @@
   <div id="contenta">
   
     
-    <p><strong><a href="index.html">Demos</a></strong> &gt; <strong>Navigation API in Hotel Receipt</strong>   <br />
-</p>
-<p><strong>Overview</strong>  <br />
-</p>
-<p>This demo is a simple template application about hotel receipt. By loading the configuration file "consume-data.properties" and navigating the hotel receipt template, this demo could generate the ODF documents (ODT, ODP, and ODS format).  <br />
-</p>
-<p>In the generated ODF documents, you can see the concrete information about hotel receipt, such as hotel name, customer name, consume time, consume data, total expense, headcount, and consume item details including the price, quantity, total expense of each item. Taking the ODT document as an example, the ODT document template is shown in the following picture. Please notice the area surrounding by eight small green square, it is a chart. Because this chart is generated by the column ConsumeItem and the column Total Expense($) in the above table and the values of the column Total Expense($) are not numeric type, the template chart might not display correctly in your ODF editor, but it will display correctly after the template is expanded. <br />
-</p>
-<p><img src="image/ODT Templating.jpg" ></img><br />
-</p>
-<p>And the generated ODT document is shown in the following picture. <br />
-</p>
+    <style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p><strong><a href="index.html">Demos</a></strong> &gt; <strong>Navigation API in Hotel Receipt</strong>     </p>
+<p><strong>Overview</strong>    </p>
+<p>This demo is a simple template application about hotel receipt. By loading the configuration file "consume-data.properties" and navigating the hotel receipt template, this demo could generate the ODF documents (ODT, ODP, and ODS format).    </p>
+<p>In the generated ODF documents, you can see the concrete information about hotel receipt, such as hotel name, customer name, consume time, consume data, total expense, headcount, and consume item details including the price, quantity, total expense of each item. Taking the ODT document as an example, the ODT document template is shown in the following picture. Please notice the area surrounding by eight small green square, it is a chart. Because this chart is generated by the column ConsumeItem and the column Total Expense($) in the above table and the values of the column Total Expense($) are not numeric type, the template chart might not display correctly in your ODF editor, but it will display correctly after the template is expanded.   </p>
+<p><img src="image/ODT Templating.jpg" ></img>  </p>
+<p>And the generated ODT document is shown in the following picture.   </p>
 <p><img src="image/Generated ODT.jpg" ></img></p>
-<p>Use Simple API to complete this simple template application. This demo mainly uses the API of package navigation.  <br />
-</p>
-<p>In the root directory of this demo project, there are three defined ODF template documents, "Navigation-ODT-Templating.odt", "Navigation-ODP-Templating.odp" and "Navigation-ODS-Templating.ods", and one configuration file, "consume-data.properties". Run NavigationForODF.java, and then in the root directory of this demo project you can find three generated ODF documents, "Navigation-ODT-Generated.odt", "Navigation-ODP-Generated.odp" and "Navigation-ODS-Generated.ods", which contain the information of "consume-data.properties". In these ODF documents, the consume item details are shown as table and chart.  <br />
-</p>
-<p>Please notice the differences of ODT, ODP, ODS template document. In ODT and ODS template documents, the chart could be automatically generated by the ODF editor according to the data of table, and in this demo the data of chart comes from the column of ConsumeItem and Total Expense($). But in ODP template documents, the chart can not be automatically generated by the table, in fact, the chart in ODP template document is created manually through the function "insert chart" of openoffice, and the type of second column must be numeric. In addition, please notice the cell value of ODS document, the cell value has character type and numeric type, for example, ‘5,000 represents character type and 5,000 represents numeric type, and we could see that the different point is the single quotation marks before 5,000. <br />
-</p>
+<p>Use Simple API to complete this simple template application. This demo mainly uses the API of package navigation.    </p>
+<p>In the root directory of this demo project, there are three defined ODF template documents, "Navigation-ODT-Templating.odt", "Navigation-ODP-Templating.odp" and "Navigation-ODS-Templating.ods", and one configuration file, "consume-data.properties". Run NavigationForODF.java, and then in the root directory of this demo project you can find three generated ODF documents, "Navigation-ODT-Generated.odt", "Navigation-ODP-Generated.odp" and "Navigation-ODS-Generated.ods", which contain the information of "consume-data.properties". In these ODF documents, the consume item details are shown as table and chart.    </p>
+<p>Please notice the differences of ODT, ODP, ODS template document. In ODT and ODS template documents, the chart could be automatically generated by the ODF editor according to the data of table, and in this demo the data of chart comes from the column of ConsumeItem and Total Expense($). But in ODP template documents, the chart can not be automatically generated by the table, in fact, the chart in ODP template document is created manually through the function "insert chart" of openoffice, and the type of second column must be numeric. In addition, please notice the cell value of ODS document, the cell value has character type and numeric type, for example, ‘5,000 represents character type and 5,000 represents numeric type, and we could see that the different point is the single quotation marks before 5,000.   </p>
 <p><strong>Code Introduction</strong></p>
-<p>First, load the key-value in the file "consume-data.properties" into the instance of Properties, and put ConsumeItem as key and TotalExpenseOfItem as value to the instance of HashMap for navigating ODP document template. <br />
-</p>
+<p>First, load the key-value in the file "consume-data.properties" into the instance of Properties, and put ConsumeItem as key and TotalExpenseOfItem as value to the instance of HashMap for navigating ODP document template.   </p>
 <div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">loadConsumeData</span><span class="p">(</span><span class="n">String</span> <span class="n">filepath</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{</span>
-    <span class="n">InputStream</span> <span class="n">is</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FileInputStream</span><span class="p">(</span><span class="n">filepath</span><span class="p">);</span>
-    <span class="n">properties</span><span class="o">.</span><span class="n">load</span><span class="p">(</span><span class="n">is</span><span class="p">);</span>
-    <span class="n">is</span><span class="o">.</span><span class="nb">close</span><span class="p">();</span>
-    <span class="sr">//</span> <span class="n">put</span> <span class="n">ConsumeItem</span> <span class="n">as</span> <span class="n">key</span> <span class="ow">and</span> <span class="n">TotalExpenseOfItem</span> <span class="n">as</span> <span class="n">value</span> <span class="n">to</span> <span class="nb">map</span>
-    <span class="n">Enumeration</span><span class="sr">&lt;String&gt;</span> <span class="n">enu</span> <span class="o">=</span> <span class="p">(</span><span class="n">Enumeration</span><span class="sr">&lt;String&gt;</span><span class="p">)</span> <span class="n">properties</span><span class="o">.</span><span class="n">propertyNames</span><span class="p">();</span>
-    <span class="k">while</span> <span class="p">(</span><span class="n">enu</span><span class="o">.</span><span class="n">hasMoreElements</span><span class="p">())</span> <span class="p">{</span>
-        <span class="n">String</span> <span class="n">key</span> <span class="o">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">enu</span><span class="o">.</span><span class="n">nextElement</span><span class="p">();</span>
-        <span class="k">if</span> <span class="p">(</span><span class="n">key</span><span class="o">.</span><span class="n">contains</span><span class="p">(</span><span class="s">&quot;ConsumeItem&quot;</span><span class="p">))</span> <span class="p">{</span>
-            <span class="n">String</span> <span class="n">consumeItem</span> <span class="o">=</span> <span class="n">properties</span><span class="o">.</span><span class="n">getProperty</span><span class="p">(</span><span class="n">key</span><span class="p">);</span>
-            <span class="n">String</span> <span class="n">totalExpenseOfItem</span> <span class="o">=</span> <span class="n">properties</span><span class="o">.</span><span class="n">getProperty</span><span class="p">(</span><span class="s">&quot;TotalExpenseOfItem&quot;</span>
-                                        <span class="o">+</span> <span class="n">key</span><span class="o">.</span><span class="n">charAt</span><span class="p">(</span><span class="n">key</span><span class="o">.</span><span class="nb">length</span><span class="p">()</span> <span class="o">-</span> <span class="mi">1</span><span class="p">));</span>
-            <span class="nb">map</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">consumeItem</span><span class="p">,</span> <span class="n">totalExpenseOfItem</span><span class="p">);</span>
+    <span class="n">InputStream</span> <span class="n">is</span> <span class="p">=</span> <span class="n">new</span> <span class="n">FileInputStream</span><span class="p">(</span><span class="n">filepath</span><span class="p">);</span>
+    <span class="k">properties</span><span class="p">.</span><span class="n">load</span><span class="p">(</span><span class="n">is</span><span class="p">);</span>
+    <span class="n">is</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+    <span class="o">//</span> <span class="n">put</span> <span class="n">ConsumeItem</span> <span class="n">as</span> <span class="n">key</span> <span class="n">and</span> <span class="n">TotalExpenseOfItem</span> <span class="n">as</span> <span class="n">value</span> <span class="n">to</span> <span class="n">map</span>
+    <span class="n">Enumeration</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">enu</span> <span class="p">=</span> <span class="p">(</span><span class="n">Enumeration</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span><span class="p">)</span> <span class="k">properties</span><span class="p">.</span><span class="n">propertyNames</span><span class="p">();</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">enu</span><span class="p">.</span><span class="n">hasMoreElements</span><span class="p">())</span> <span class="p">{</span>
+        <span class="n">String</span> <span class="n">key</span> <span class="p">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">enu</span><span class="p">.</span><span class="n">nextElement</span><span class="p">();</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">key</span><span class="p">.</span><span class="n">contains</span><span class="p">(</span>&quot;<span class="n">ConsumeItem</span>&quot;<span class="p">))</span> <span class="p">{</span>
+            <span class="n">String</span> <span class="n">consumeItem</span> <span class="p">=</span> <span class="k">properties</span><span class="p">.</span><span class="n">getProperty</span><span class="p">(</span><span class="n">key</span><span class="p">);</span>
+            <span class="n">String</span> <span class="n">totalExpenseOfItem</span> <span class="p">=</span> <span class="k">properties</span><span class="p">.</span><span class="n">getProperty</span><span class="p">(</span>&quot;<span class="n">TotalExpenseOfItem</span>&quot;
+                                        <span class="o">+</span> <span class="n">key</span><span class="p">.</span><span class="n">charAt</span><span class="p">(</span><span class="n">key</span><span class="p">.</span><span class="nb">length</span><span class="p">()</span> <span class="o">-</span> 1<span class="p">));</span>
+            <span class="n">map</span><span class="p">.</span><span class="n">put</span><span class="p">(</span><span class="n">consumeItem</span><span class="p">,</span> <span class="n">totalExpenseOfItem</span><span class="p">);</span>
         <span class="p">}</span>
     <span class="p">}</span>
 <span class="p">}</span>
 </pre></div>
 
 
-<p>Then, introduce how to navigate the template documents and generate the ODF documents.  <br />
-</p>
-<p><strong><em>Navigate ODT document template</em></strong><br />
-</p>
-<p>Load "Navigation-ODT-Templating.odt" and get the instance of TextDocument. Then traverse the instance of Properties, use the API of TextNavigation and TextSelection to complete the replacement of template document as the line 10-14. Please notice the line 17 and 18, make sure that the chart is shown rightly when open the generated document, so is navigating ODP and ODS document template. At last, generate "Navigation-ODT-Generated.odt" as the line 19.  <br />
-</p>
+<p>Then, introduce how to navigate the template documents and generate the ODF documents.    </p>
+<p><strong><em>Navigate ODT document template</em></strong>  </p>
+<p>Load "Navigation-ODT-Templating.odt" and get the instance of TextDocument. Then traverse the instance of Properties, use the API of TextNavigation and TextSelection to complete the replacement of template document as the line 10-14. Please notice the line 17 and 18, make sure that the chart is shown rightly when open the generated document, so is navigating ODP and ODS document template. At last, generate "Navigation-ODT-Generated.odt" as the line 19.    </p>
 <div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">navigateODT</span><span class="p">()</span> <span class="n">throws</span> <span class="n">Exception</span> <span class="p">{</span>
-    <span class="n">Iterator</span> <span class="n">it</span> <span class="o">=</span> <span class="n">properties</span><span class="o">.</span><span class="n">entrySet</span><span class="p">()</span><span class="o">.</span><span class="n">iterator</span><span class="p">();</span>
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;Navigate ODT document: Navigation-ODT-Templating.odt&quot;</span><span class="p">);</span>
-    <span class="n">TextDocument</span> <span class="n">textdoc</span> <span class="o">=</span> <span class="p">(</span><span class="n">TextDocument</span><span class="p">)</span> <span class="n">TextDocument</span><span class="o">.</span><span class="n">loadDocument</span><span class="p">(</span><span class="s">&quot;Navigation-ODT-Templating.odt&quot;</span><span class="p">);</span>
+    <span class="n">Iterator</span> <span class="n">it</span> <span class="p">=</span> <span class="k">properties</span><span class="p">.</span><span class="n">entrySet</span><span class="p">().</span><span class="n">iterator</span><span class="p">();</span>
+    <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="n">Navigate</span> <span class="n">ODT</span> <span class="n">document</span><span class="p">:</span> <span class="n">Navigation</span><span class="o">-</span><span class="n">ODT</span><span class="o">-</span><span class="n">Templating</span><span class="p">.</span><span class="n">odt</span>&quot;<span class="p">);</span>
+    <span class="n">TextDocument</span> <span class="n">textdoc</span> <span class="p">=</span> <span class="p">(</span><span class="n">TextDocument</span><span class="p">)</span> <span class="n">TextDocument</span><span class="p">.</span><span class="n">loadDocument</span><span class="p">(</span>&quot;<span class="n">Navigation</span><span class="o">-</span><span class="n">ODT</span><span class="o">-</span><span class="n">Templating</span><span class="p">.</span><span class="n">odt</span>&quot;<span class="p">);</span>
     <span class="n">TextNavigation</span> <span class="n">search</span><span class="p">;</span>
-    <span class="k">while</span> <span class="p">(</span><span class="n">it</span><span class="o">.</span><span class="n">hasNext</span><span class="p">())</span> <span class="p">{</span>
-        <span class="n">Map</span><span class="o">.</span><span class="n">Entry</span> <span class="n">entry</span> <span class="o">=</span> <span class="p">(</span><span class="n">Map</span><span class="o">.</span><span class="n">Entry</span><span class="p">)</span> <span class="n">it</span><span class="o">.</span><span class="k">next</span><span class="p">();</span>
-        <span class="n">String</span> <span class="n">key</span> <span class="o">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">entry</span><span class="o">.</span><span class="n">getKey</span><span class="p">();</span>
-        <span class="n">String</span> <span class="n">value</span> <span class="o">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">entry</span><span class="o">.</span><span class="n">getValue</span><span class="p">();</span>
-        <span class="n">search</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TextNavigation</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">textdoc</span><span class="p">);</span>
-        <span class="k">while</span> <span class="p">(</span><span class="n">search</span><span class="o">.</span><span class="n">hasNext</span><span class="p">())</span> <span class="p">{</span>
-            <span class="n">TextSelection</span> <span class="n">item</span> <span class="o">=</span> <span class="p">(</span><span class="n">TextSelection</span><span class="p">)</span> <span class="n">search</span><span class="o">.</span><span class="n">nextSelection</span><span class="p">();</span>
-            <span class="n">item</span><span class="o">.</span><span class="n">replaceWith</span><span class="p">(</span><span class="n">value</span><span class="p">);</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">it</span><span class="p">.</span><span class="n">hasNext</span><span class="p">())</span> <span class="p">{</span>
+        <span class="n">Map</span><span class="p">.</span><span class="n">Entry</span> <span class="n">entry</span> <span class="p">=</span> <span class="p">(</span><span class="n">Map</span><span class="p">.</span><span class="n">Entry</span><span class="p">)</span> <span class="n">it</span><span class="p">.</span><span class="n">next</span><span class="p">();</span>
+        <span class="n">String</span> <span class="n">key</span> <span class="p">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">entry</span><span class="p">.</span><span class="n">getKey</span><span class="p">();</span>
+        <span class="n">String</span> <span class="n">value</span> <span class="p">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">entry</span><span class="p">.</span><span class="n">getValue</span><span class="p">();</span>
+        <span class="n">search</span> <span class="p">=</span> <span class="n">new</span> <span class="n">TextNavigation</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">textdoc</span><span class="p">);</span>
+        <span class="k">while</span> <span class="p">(</span><span class="n">search</span><span class="p">.</span><span class="n">hasNext</span><span class="p">())</span> <span class="p">{</span>
+            <span class="n">TextSelection</span> <span class="n">item</span> <span class="p">=</span> <span class="p">(</span><span class="n">TextSelection</span><span class="p">)</span> <span class="n">search</span><span class="p">.</span><span class="n">nextSelection</span><span class="p">();</span>
+            <span class="n">item</span><span class="p">.</span><span class="n">replaceWith</span><span class="p">(</span><span class="n">value</span><span class="p">);</span>
         <span class="p">}</span>
     <span class="p">}</span>
-    <span class="sr">//</span> <span class="n">remove</span> <span class="n">ObjectReplacements</span><span class="sr">/ and Thumbnails/</span>
-    <span class="n">textdoc</span><span class="o">.</span><span class="n">getPackage</span><span class="p">()</span><span class="o">.</span><span class="n">removePackageDocument</span><span class="p">(</span><span class="s">&quot;ObjectReplacements/&quot;</span><span class="p">);</span>
-    <span class="n">textdoc</span><span class="o">.</span><span class="n">getPackage</span><span class="p">()</span><span class="o">.</span><span class="n">removePackageDocument</span><span class="p">(</span><span class="s">&quot;Thumbnails/&quot;</span><span class="p">);</span>
-    <span class="n">textdoc</span><span class="o">.</span><span class="n">save</span><span class="p">(</span><span class="s">&quot;Navigation-ODT-Generated.odt&quot;</span><span class="p">);</span>
-    <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;...\nNavigation is over, and Navigation-ODT-Generated.odt is generated&quot;</span><span class="p">);</span>
+    <span class="o">//</span> <span class="n">remove</span> <span class="n">ObjectReplacements</span><span class="o">/</span> <span class="n">and</span> <span class="n">Thumbnails</span><span class="o">/</span>
+    <span class="n">textdoc</span><span class="p">.</span><span class="n">getPackage</span><span class="p">().</span><span class="n">removePackageDocument</span><span class="p">(</span>&quot;<span class="n">ObjectReplacements</span><span class="o">/</span>&quot;<span class="p">);</span>
+    <span class="n">textdoc</span><span class="p">.</span><span class="n">getPackage</span><span class="p">().</span><span class="n">removePackageDocument</span><span class="p">(</span>&quot;<span class="n">Thumbnails</span><span class="o">/</span>&quot;<span class="p">);</span>
+    <span class="n">textdoc</span><span class="p">.</span><span class="n">save</span><span class="p">(</span>&quot;<span class="n">Navigation</span><span class="o">-</span><span class="n">ODT</span><span class="o">-</span><span class="n">Generated</span><span class="p">.</span><span class="n">odt</span>&quot;<span class="p">);</span>
+    <span class="n">System</span><span class="p">.</span><span class="n">out</span><span class="p">.</span><span class="n">println</span><span class="p">(</span>&quot;<span class="p">..</span><span class="o">.\</span><span class="n">nNavigation</span> <span class="n">is</span> <span class="n">over</span><span class="p">,</span> <span class="n">and</span> <span class="n">Navigation</span><span class="o">-</span><span class="n">ODT</span><span class="o">-</span><span class="n">Generated</span><span class="p">.</span><span class="n">odt</span> <span class="n">is</span> <span class="n">generated</span>&quot;<span class="p">);</span>
 <span class="p">}</span>
 </pre></div>
 
 
-<p><strong><em>Navigate ODP document template</em></strong> <br />
-</p>
-<p>Unlike the ODT document, the chart of ODP document is an embedded document. Before navigate the chart, get the embedded document as the line 2 and 3. The chart comes from a table, and we could change the chart by setting the cell value of the table as the line 13-15. The line 15 uses the Class DefaultCellValueAdapter to update the cell value and value type.  <br />
-</p>
-<div class="codehilite"><pre>    <span class="sr">//</span> <span class="n">set</span> <span class="n">the</span> <span class="n">cell</span> <span class="n">value</span> <span class="n">in</span> <span class="n">the</span> <span class="n">table</span> <span class="n">of</span> <span class="n">embedderdocument</span>
-    <span class="n">List</span><span class="sr">&lt;Document&gt;</span> <span class="n">embeddedDocuments</span> <span class="o">=</span> <span class="n">pdoc</span><span class="o">.</span><span class="n">getEmbeddedDocuments</span><span class="p">();</span>
-    <span class="n">Document</span> <span class="n">embeddedDocument</span> <span class="o">=</span> <span class="n">embeddedDocuments</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">Table</span> <span class="n">table</span> <span class="o">=</span> <span class="n">embeddedDocument</span><span class="o">.</span><span class="n">getTableList</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>
+<p><strong><em>Navigate ODP document template</em></strong>   </p>
+<p>Unlike the ODT document, the chart of ODP document is an embedded document. Before navigate the chart, get the embedded document as the line 2 and 3. The chart comes from a table, and we could change the chart by setting the cell value of the table as the line 13-15. The line 15 uses the Class DefaultCellValueAdapter to update the cell value and value type.    </p>
+<div class="codehilite"><pre>    <span class="o">//</span> <span class="n">set</span> <span class="n">the</span> <span class="n">cell</span> <span class="n">value</span> <span class="n">in</span> <span class="n">the</span> <span class="n">table</span> <span class="n">of</span> <span class="n">embedderdocument</span>
+    <span class="n">List</span><span class="o">&lt;</span><span class="n">Document</span><span class="o">&gt;</span> <span class="n">embeddedDocuments</span> <span class="p">=</span> <span class="n">pdoc</span><span class="p">.</span><span class="n">getEmbeddedDocuments</span><span class="p">();</span>
+    <span class="n">Document</span> <span class="n">embeddedDocument</span> <span class="p">=</span> <span class="n">embeddedDocuments</span><span class="p">.</span><span class="n">get</span><span class="p">(</span>0<span class="p">);</span>
+    <span class="n">Table</span> <span class="n">table</span> <span class="p">=</span> <span class="n">embeddedDocument</span><span class="p">.</span><span class="n">getTableList</span><span class="p">().</span><span class="n">get</span><span class="p">(</span>0<span class="p">);</span>
     <span class="n">String</span> <span class="n">consumeItem</span><span class="p">;</span>
     <span class="n">String</span> <span class="n">totalExpenseOfItem</span><span class="p">;</span>
-    <span class="nb">int</span> <span class="nb">index</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
-    <span class="n">Iterator</span><span class="sr">&lt;String&gt;</span> <span class="n">it</span> <span class="o">=</span> <span class="nb">map</span><span class="o">.</span><span class="n">keySet</span><span class="p">()</span><span class="o">.</span><span class="n">iterator</span><span class="p">();</span>
-    <span class="k">while</span> <span class="p">(</span><span class="n">it</span><span class="o">.</span><span class="n">hasNext</span><span class="p">())</span> <span class="p">{</span>
-        <span class="nb">index</span><span class="o">++</span><span class="p">;</span>
-        <span class="n">consumeItem</span> <span class="o">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">it</span><span class="o">.</span><span class="k">next</span><span class="p">();</span>
-        <span class="n">totalExpenseOfItem</span> <span class="o">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="nb">map</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">consumeItem</span><span class="p">);</span>
-        <span class="n">table</span><span class="o">.</span><span class="n">getColumnByIndex</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">getCellByIndex</span><span class="p">(</span><span class="nb">index</span><span class="p">)</span><span class="o">.</span><span class="n">setDisplayText</span><span class="p">(</span><span class="n">consumeItem</span><span class="p">);</span>
-        <span class="n">table</span><span class="o">.</span><span class="n">getColumnByIndex</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">getCellByIndex</span><span class="p">(</span><span class="nb">index</span><span class="p">)</span><span class="o">.</span><span class="n">setDisplayText</span><span class="p">(</span><span class="n">totalExpenseOfItem</span><span class="p">,</span> <span class="k">new</span> <span class="n">DefaultCellValueAdapter</span><span class="p">());</span>
+    <span class="n">int</span> <span class="n">index</span> <span class="p">=</span> 0<span class="p">;</span>
+    <span class="n">Iterator</span><span class="o">&lt;</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">it</span> <span class="p">=</span> <span class="n">map</span><span class="p">.</span><span class="n">keySet</span><span class="p">().</span><span class="n">iterator</span><span class="p">();</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">it</span><span class="p">.</span><span class="n">hasNext</span><span class="p">())</span> <span class="p">{</span>
+        <span class="n">index</span><span class="o">++</span><span class="p">;</span>
+        <span class="n">consumeItem</span> <span class="p">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">it</span><span class="p">.</span><span class="n">next</span><span class="p">();</span>
+        <span class="n">totalExpenseOfItem</span> <span class="p">=</span> <span class="p">(</span><span class="n">String</span><span class="p">)</span> <span class="n">map</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="n">consumeItem</span><span class="p">);</span>
+        <span class="n">table</span><span class="p">.</span><span class="n">getColumnByIndex</span><span class="p">(</span>0<span class="p">).</span><span class="n">getCellByIndex</span><span class="p">(</span><span class="n">index</span><span class="p">).</span><span class="n">setDisplayText</span><span class="p">(</span><span class="n">consumeItem</span><span class="p">);</span>
+        <span class="n">table</span><span class="p">.</span><span class="n">getColumnByIndex</span><span class="p">(</span>1<span class="p">).</span><span class="n">getCellByIndex</span><span class="p">(</span><span class="n">index</span><span class="p">).</span><span class="n">setDisplayText</span><span class="p">(</span><span class="n">totalExpenseOfItem</span><span class="p">,</span> <span class="n">new</span> <span class="n">DefaultCellValueAdapter</span><span class="p">());</span>
     <span class="p">}</span>
 </pre></div>
 
 
-<p><strong><em>Navigate ODS document template</em></strong> <br />
-</p>
-<p>Unlike the ODT document, use the Class CellSelection to complete the replacement. Class CellSelection is the subclass of Class TextSelection. Use the method "advancedReplaceWith" to update the cell value and value type.  <br />
-</p>
-<div class="codehilite"><pre>    <span class="n">search</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TextNavigation</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">ssdoc</span><span class="p">);</span>
-    <span class="k">while</span> <span class="p">(</span><span class="n">search</span><span class="o">.</span><span class="n">hasNext</span><span class="p">())</span> <span class="p">{</span>
-        <span class="n">CellSelection</span> <span class="n">item</span> <span class="o">=</span> <span class="p">(</span><span class="n">CellSelection</span><span class="p">)</span> <span class="n">search</span><span class="o">.</span><span class="n">nextSelection</span><span class="p">();</span>
-        <span class="n">item</span><span class="o">.</span><span class="n">advancedReplaceWith</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="k">new</span> <span class="n">DefaultCellValueAdapter</span><span class="p">());</span>
+<p><strong><em>Navigate ODS document template</em></strong>   </p>
+<p>Unlike the ODT document, use the Class CellSelection to complete the replacement. Class CellSelection is the subclass of Class TextSelection. Use the method "advancedReplaceWith" to update the cell value and value type.    </p>
+<div class="codehilite"><pre>    <span class="n">search</span> <span class="p">=</span> <span class="n">new</span> <span class="n">TextNavigation</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">ssdoc</span><span class="p">);</span>
+    <span class="k">while</span> <span class="p">(</span><span class="n">search</span><span class="p">.</span><span class="n">hasNext</span><span class="p">())</span> <span class="p">{</span>
+        <span class="n">CellSelection</span> <span class="n">item</span> <span class="p">=</span> <span class="p">(</span><span class="n">CellSelection</span><span class="p">)</span> <span class="n">search</span><span class="p">.</span><span class="n">nextSelection</span><span class="p">();</span>
+        <span class="n">item</span><span class="p">.</span><span class="n">advancedReplaceWith</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">new</span> <span class="n">DefaultCellValueAdapter</span><span class="p">());</span>
     <span class="p">}</span>
 </pre></div>
 
 
-<p><strong>Download</strong> <br />
-</p>
+<p><strong>Download</strong>   </p>
 <p>Powered by Simple API version <a href="../downloads.html">0.3.5</a>.<br />
-You can download the code of this demo from <a href="Navigation-for-ODF.zip">here</a>.<br />
-</p>
+You can download the code of this demo from <a href="Navigation-for-ODF.zip">here</a>.  </p>
   </div>
 
   <div id="footera">



Mime
View raw message