Author: nick
Date: Wed Mar 19 18:54:03 2014
New Revision: 1579352
URL: http://svn.apache.org/r1579352
Log:
Add a XWPF Quick Guide, similar to the HWPF one
Added:
poi/site/publish/document/quick-guide-xwpf.html
poi/site/src/documentation/content/xdocs/document/quick-guide-xwpf.xml
Modified:
poi/site/publish/document/docoverview.html
poi/site/publish/document/index.html
poi/site/publish/document/projectplan.html
poi/site/publish/document/quick-guide.html
poi/site/src/documentation/content/xdocs/document/book.xml
Modified: poi/site/publish/document/docoverview.html
URL: http://svn.apache.org/viewvc/poi/site/publish/document/docoverview.html?rev=1579352&r1=1579351&r2=1579352&view=diff
==============================================================================
--- poi/site/publish/document/docoverview.html (original)
+++ poi/site/publish/document/docoverview.html Wed Mar 19 18:54:03 2014
@@ -90,7 +90,11 @@ if (VERSION > 3) {
</div>
<div class="menuItem">
-<a href="quick-guide.html">Quick Guide</a>
+<a href="quick-guide.html">HWPF Quick Guide</a>
+</div>
+
+<div class="menuItem">
+<a href="quick-guide-xwpf.html">XWPF Quick Guide</a>
</div>
<div class="menuItem">
Modified: poi/site/publish/document/index.html
URL: http://svn.apache.org/viewvc/poi/site/publish/document/index.html?rev=1579352&r1=1579351&r2=1579352&view=diff
==============================================================================
--- poi/site/publish/document/index.html (original)
+++ poi/site/publish/document/index.html Wed Mar 19 18:54:03 2014
@@ -86,7 +86,10 @@ if (VERSION > 3) {
<span class="menuSelected">Overview</span>
</div>
<div class="menuItem">
-<a href="quick-guide.html">Quick Guide</a>
+<a href="quick-guide.html">HWPF Quick Guide</a>
+</div>
+<div class="menuItem">
+<a href="quick-guide-xwpf.html">XWPF Quick Guide</a>
</div>
<div class="menuItem">
<a href="docoverview.html">HWPF Format</a>
Modified: poi/site/publish/document/projectplan.html
URL: http://svn.apache.org/viewvc/poi/site/publish/document/projectplan.html?rev=1579352&r1=1579351&r2=1579352&view=diff
==============================================================================
--- poi/site/publish/document/projectplan.html (original)
+++ poi/site/publish/document/projectplan.html Wed Mar 19 18:54:03 2014
@@ -90,7 +90,11 @@ if (VERSION > 3) {
</div>
<div class="menuItem">
-<a href="quick-guide.html">Quick Guide</a>
+<a href="quick-guide.html">HWPF Quick Guide</a>
+</div>
+
+<div class="menuItem">
+<a href="quick-guide-xwpf.html">XWPF Quick Guide</a>
</div>
<div class="menuItem">
Added: poi/site/publish/document/quick-guide-xwpf.html
URL: http://svn.apache.org/viewvc/poi/site/publish/document/quick-guide-xwpf.html?rev=1579352&view=auto
==============================================================================
--- poi/site/publish/document/quick-guide-xwpf.html (added)
+++ poi/site/publish/document/quick-guide-xwpf.html Wed Mar 19 18:54:03 2014
@@ -0,0 +1,267 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<!--*** This is a generated file. Do not edit. ***-->
+<link rel="stylesheet" href="../skin/tigris.css" type="text/css">
+<link rel="stylesheet" href="../skin/mysite.css" type="text/css">
+<link rel="stylesheet" href="../skin/site.css" type="text/css">
+<link media="print" rel="stylesheet" href="../skin/print.css" type="text/css">
+<title>POI-XWPF - A Quick Guide</title>
+</head>
+<body bgcolor="white" class="composite">
+<!--================= start Banner ==================-->
+<div id="banner">
+<table width="100%" cellpadding="8" cellspacing="0" summary="banner" border="0">
+<tbody>
+<tr>
+<!--================= start Group Logo ==================-->
+<td width="50%" align="left">
+<div class="groupLogo">
+<a href="http://poi.apache.org"><img border="0" class="logoImage" alt="Apache POI"
src="../resources/images/group-logo.jpg"></a>
+</div>
+</td>
+<!--================= end Group Logo ==================-->
+<!--================= start Project Logo ==================--><td width="50%" align="right">
+<div align="right" class="projectLogo">
+<a href="http://poi.apache.org/"><img border="0" class="logoImage" alt="POI" src="../resources/images/project-logo.jpg"></a>
+</div>
+</td>
+<!--================= end Project Logo ==================-->
+</tr>
+</tbody>
+</table>
+</div>
+<!--================= end Banner ==================-->
+<!--================= start Main ==================-->
+<table width="100%" cellpadding="0" cellspacing="0" border="0" summary="nav" id="breadcrumbs">
+<tbody>
+<!--================= start Status ==================-->
+<tr class="status">
+<td>
+<!--================= start BreadCrumb ==================--><a href="http://www.apache.org/">Apache</a>
| <a href="http://poi.apache.org/">POI</a><a href=""></a>
+<!--================= end BreadCrumb ==================--></td><td id="tabs">
+<!--================= start Tabs ==================-->
+<div class="tab">
+<span class="selectedTab"><a class="base-selected" href="../index.html">Home</a></span>
| <script language="Javascript" type="text/javascript">
+function printit() {
+if (window.print) {
+ window.print() ;
+} else {
+ var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH="0" HEIGHT="0" CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
+document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
+ WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML
= "";
+}
+}
+</script><script language="Javascript" type="text/javascript">
+var NS = (navigator.appName == "Netscape");
+var VERSION = parseInt(navigator.appVersion);
+if (VERSION > 3) {
+ document.write(' <a title="PRINT this page OUT" href="javascript:printit()">PRINT</a>');
+}
+</script>
+</div>
+<!--================= end Tabs ==================-->
+</td>
+</tr>
+</tbody>
+</table>
+<!--================= end Status ==================-->
+<table id="main" width="100%" cellpadding="8" cellspacing="0" summary="" border="0">
+<tbody>
+<tr valign="top">
+<!--================= start Menu ==================-->
+<td id="leftcol">
+<div id="navcolumn">
+<div class="menuBar">
+<div class="menu">
+<span class="menuLabel">Apache POI</span>
+
+<div class="menuItem">
+<a href="../index.html">Top</a>
+</div>
+
+</div>
+<div class="menu">
+<span class="menuLabel">HWPF+XWPF</span>
+
+<div class="menuItem">
+<a href="index.html">Overview</a>
+</div>
+
+<div class="menuItem">
+<a href="quick-guide.html">HWPF Quick Guide</a>
+</div>
+
+<div class="menuItem">
+<span class="menuSelected">XWPF Quick Guide</span>
+</div>
+
+<div class="menuItem">
+<a href="docoverview.html">HWPF Format</a>
+</div>
+
+<div class="menuItem">
+<a href="projectplan.html">HWPF Project plan</a>
+</div>
+
+</div>
+</div>
+</div>
+<form target="_blank" action="http://www.google.com/search" method="get">
+<table summary="search" border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td><img height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td
nowrap="nowrap">
+ Search Apache POI<br>
+<input value="poi.apache.org" name="sitesearch" type="hidden"><input size="10" name="q"
id="query" type="text"><img height="1" width="5" alt="" src="../skin/images/spacer.gif"
class="spacer"><input name="Search" value="GO" type="submit"></td><td><img
height="1" width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td>
+</tr>
+<tr>
+<td colspan="3"><img height="7" width="1" alt="" src="../skin/images/spacer.gif"
class="spacer"></td>
+</tr>
+<tr>
+<td class="bottom-left-thick"></td><td bgcolor="#a5b6c6"><img height="1"
width="1" alt="" src="../skin/images/spacer.gif" class="spacer"></td><td class="bottom-right-thick"></td>
+</tr>
+</table>
+</form>
+</td>
+<!--================= end Menu ==================-->
+<!--================= start Content ==================--><td>
+<div id="bodycol">
+<div class="app">
+<div align="center">
+<h1>POI-XWPF - A Quick Guide</h1>
+</div>
+<div class="h3">
+
+
+
+
+<p>XWPF has a fairly stable core API, providing read and write access
+ to the main parts of a Word .docx file, but it isn't complete. For
+ some things, it may be necessary to dive down into the low level XMLBeans
+ objects to manipulate the ooxml structure. If you find yourself having
+ to do this, please consider sending in a patch to enhance that, see the
+ <a href="../guidelines.html">"Contribution to POI" page</a>.</p>
+
+
+<a name="Basic+Text+Extraction"></a>
+<div class="h3">
+<h3>Basic Text Extraction</h3>
+</div>
+
+<p>For basic text extraction, make use of
+<span class="codefrag">org.apache.poi.xwpf.extractor.XWPFWordExtractor</span>.
It accepts an input
+stream or a <span class="codefrag">XWPFDocument</span>. The <span class="codefrag">getText()</span>
+method can be used to
+get the text from all the paragraphs, along with tables, headers etc.
+ </p>
+
+
+
+<a name="Specific+Text+Extraction"></a>
+<div class="h3">
+<h3>Specific Text Extraction</h3>
+</div>
+
+<p>To get specific bits of text, first create a
+<span class="codefrag">org.apache.poi.xwpf.XWPFDocument</span>. Select the <span
class="codefrag">IBodyElement</span>
+of interest (Table, Paragraph etc), and from there get a <span class="codefrag">XWPFRun</span>.
+Finally fetch the text and properties from that.
+ </p>
+
+
+
+<a name="Headers+and+Footers"></a>
+<div class="h3">
+<h3>Headers and Footers</h3>
+</div>
+
+<p>To get at the headers and footers of a word document, first create a
+<span class="codefrag">org.apache.poi.xwpf.XWPFDocument</span>. Next, you need
to create a
+<span class="codefrag">org.apache.poi.xwpf.usermodel.XWPFHeaderFooter</span>,
passing it your
+XWPFDocument. Finally, the XWPFHeaderFooter gives you access to the headers and
+footers, including first / even / odd page ones if defined in your
+document.</p>
+
+
+
+<a name="Changing+Text"></a>
+<div class="h3">
+<h3>Changing Text</h3>
+</div>
+
+<p>From a <span class="codefrag">XWPFParagraph</span>, it is possible to
fetch the existing
+ <span class="codefrag">XWPFRun</span> elements that make up the text.
To add new text,
+ the <span class="codefrag">createRun()</span> method will add a new <span
class="codefrag">XWPFRun</span>
+ to the end of the list. <span class="codefrag">insertNewRun(int)</span>
can instead be
+ used to add a new <span class="codefrag">XWPFRun</span> at a specific
point in the
+ paragraph.
+ </p>
+
+<p>Once you have a <span class="codefrag">XWPFRun</span>, you can use the
+ <span class="codefrag">setText(String)</span> method to make changes to
the text. To add
+ whitespace elements such as tabs and line breaks, it is necessary to use
+ methods like <span class="codefrag">addTab()</span> and <span class="codefrag">addCarriageReturn()</span>.
+ </p>
+
+
+
+<a name="Further+Examples"></a>
+<div class="h3">
+<h3>Further Examples</h3>
+</div>
+
+<p>For now, there are a limited number of XWPF examples in the
+ <a href="http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xwpf">Examples
Package</a>.
+ Beyond those, the best source of additional examples is in the unit
+ tests. <a href="http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/">
+ Browse the XWPF unit tests.</a>
+
+</p>
+
+
+
+<div id="authors" align="right">by Nick Burch</div>
+</div>
+</div>
+</div>
+</td>
+<!--================= end Content ==================-->
+</tr>
+</tbody>
+</table>
+<!--================= end Main ==================-->
+<!--================= start Footer ==================-->
+<div id="footer">
+<table summary="footer" cellspacing="0" cellpadding="4" width="100%" border="0">
+<tbody>
+<tr>
+<!--================= start Copyright ==================-->
+<td colspan="2">
+<div align="center">
+<div class="copyright">
+ Copyright © 2002-2012 The Apache Software Foundation. All
rights reserved.<br>
+ Apache POI, POI, Apache, the Apache feather logo, and the Apache
+ POI project logo are trademarks of The Apache Software Foundation.
+ </div>
+</div>
+</td>
+<!--================= end Copyright ==================-->
+</tr>
+<tr>
+<td align="left">
+<!--================= start Host ==================-->
+<!--================= end Host ==================--></td><td align="right">
+<!--================= start Credits ==================-->
+<div align="right">
+<div class="credit"></div>
+</div>
+<!--================= end Credits ==================-->
+</td>
+</tr>
+</tbody>
+</table>
+</div>
+<!--================= end Footer ==================-->
+</body>
+</html>
Modified: poi/site/publish/document/quick-guide.html
URL: http://svn.apache.org/viewvc/poi/site/publish/document/quick-guide.html?rev=1579352&r1=1579351&r2=1579352&view=diff
==============================================================================
--- poi/site/publish/document/quick-guide.html (original)
+++ poi/site/publish/document/quick-guide.html Wed Mar 19 18:54:03 2014
@@ -90,7 +90,11 @@ if (VERSION > 3) {
</div>
<div class="menuItem">
-<span class="menuSelected">Quick Guide</span>
+<span class="menuSelected">HWPF Quick Guide</span>
+</div>
+
+<div class="menuItem">
+<a href="quick-guide-xwpf.html">XWPF Quick Guide</a>
</div>
<div class="menuItem">
Modified: poi/site/src/documentation/content/xdocs/document/book.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/document/book.xml?rev=1579352&r1=1579351&r2=1579352&view=diff
==============================================================================
--- poi/site/src/documentation/content/xdocs/document/book.xml (original)
+++ poi/site/src/documentation/content/xdocs/document/book.xml Wed Mar 19 18:54:03 2014
@@ -24,7 +24,8 @@
</menu>
<menu label="HWPF+XWPF">
<menu-item label="Overview" href="index.html"/>
- <menu-item label="Quick Guide" href="quick-guide.html"/>
+ <menu-item label="HWPF Quick Guide" href="quick-guide.html"/>
+ <menu-item label="XWPF Quick Guide" href="quick-guide-xwpf.html"/>
<menu-item label="HWPF Format" href="docoverview.html"/>
<menu-item label="HWPF Project plan" href="projectplan.html"/>
</menu>
Added: poi/site/src/documentation/content/xdocs/document/quick-guide-xwpf.xml
URL: http://svn.apache.org/viewvc/poi/site/src/documentation/content/xdocs/document/quick-guide-xwpf.xml?rev=1579352&view=auto
==============================================================================
--- poi/site/src/documentation/content/xdocs/document/quick-guide-xwpf.xml (added)
+++ poi/site/src/documentation/content/xdocs/document/quick-guide-xwpf.xml Wed Mar 19 18:54:03
2014
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ====================================================================
+-->
+<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "../dtd/document-v13.dtd">
+
+<document>
+ <header>
+ <title>POI-XWPF - A Quick Guide</title>
+ <subtitle>Overview</subtitle>
+ <authors>
+ <person name="Nick Burch" email="nick at torchbox dot com"/>
+ </authors>
+ </header>
+
+ <body>
+ <p>XWPF has a fairly stable core API, providing read and write access
+ to the main parts of a Word .docx file, but it isn't complete. For
+ some things, it may be necessary to dive down into the low level XMLBeans
+ objects to manipulate the ooxml structure. If you find yourself having
+ to do this, please consider sending in a patch to enhance that, see the
+ <link href="../guidelines.html">"Contribution to POI" page</link>.</p>
+
+ <section><title>Basic Text Extraction</title>
+ <p>For basic text extraction, make use of
+<code>org.apache.poi.xwpf.extractor.XWPFWordExtractor</code>. It accepts an input
+stream or a <code>XWPFDocument</code>. The <code>getText()</code>
+method can be used to
+get the text from all the paragraphs, along with tables, headers etc.
+ </p>
+ </section>
+
+ <section><title>Specific Text Extraction</title>
+ <p>To get specific bits of text, first create a
+<code>org.apache.poi.xwpf.XWPFDocument</code>. Select the <code>IBodyElement</code>
+of interest (Table, Paragraph etc), and from there get a <code>XWPFRun</code>.
+Finally fetch the text and properties from that.
+ </p>
+ </section>
+
+ <section><title>Headers and Footers</title>
+ <p>To get at the headers and footers of a word document, first create a
+<code>org.apache.poi.xwpf.XWPFDocument</code>. Next, you need to create a
+<code>org.apache.poi.xwpf.usermodel.XWPFHeaderFooter</code>, passing it your
+XWPFDocument. Finally, the XWPFHeaderFooter gives you access to the headers and
+footers, including first / even / odd page ones if defined in your
+document.</p>
+ </section>
+
+ <section><title>Changing Text</title>
+ <p>From a <code>XWPFParagraph</code>, it is possible to fetch the existing
+ <code>XWPFRun</code> elements that make up the text. To add new text,
+ the <code>createRun()</code> method will add a new <code>XWPFRun</code>
+ to the end of the list. <code>insertNewRun(int)</code> can instead be
+ used to add a new <code>XWPFRun</code> at a specific point in the
+ paragraph.
+ </p>
+ <p>Once you have a <code>XWPFRun</code>, you can use the
+ <code>setText(String)</code> method to make changes to the text. To add
+ whitespace elements such as tabs and line breaks, it is necessary to use
+ methods like <code>addTab()</code> and <code>addCarriageReturn()</code>.
+ </p>
+ </section>
+
+ <section><title>Further Examples</title>
+ <p>For now, there are a limited number of XWPF examples in the
+ <link href="http://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xwpf">Examples
Package</link>.
+ Beyond those, the best source of additional examples is in the unit
+ tests. <link href="http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xwpf/">
+ Browse the XWPF unit tests.</link>
+ </p>
+ </section>
+ </body>
+</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org
|