poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1142767 - in /poi/trunk/src/scratchpad: src/org/apache/poi/hwpf/converter/ src/org/apache/poi/hwpf/extractor/ testcases/org/apache/poi/hwpf/converter/ testcases/org/apache/poi/hwpf/extractor/
Date Mon, 04 Jul 2011 19:14:45 GMT
Author: sergey
Date: Mon Jul  4 19:14:44 2011
New Revision: 1142767

URL: http://svn.apache.org/viewvc?rev=1142767&view=rev
Log:
rename extractor -> converter and move to converter package

Added:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordUtils.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/FoDocumentFacade.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/FoDocumentFacade.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/HtmlDocumentFacade.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/NumberFormatter.java
      - copied, changed from r1137673, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/NumberFormatter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoUtils.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoUtils.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlUtils.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToExtractorSuite.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java
      - copied, changed from r1139204, poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToFoExtractor.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java
      - copied, changed from r1142765, poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToHtmlExtractor.java
Removed:
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordUtils.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/FoDocumentFacade.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/HtmlDocumentFacade.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/NumberFormatter.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoUtils.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlExtractor.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlUtils.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToExtractorSuite.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToFoExtractor.java
    poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToHtmlExtractor.java

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java
(from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordExtractor.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordExtractor.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordExtractor.java
(original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordConverter.java
Mon Jul  4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import java.util.HashMap;
 import java.util.List;
@@ -38,7 +38,7 @@ import org.apache.poi.util.POILogger;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-public abstract class AbstractWordExtractor
+public abstract class AbstractWordConverter
 {
     private static final byte BEL_MARK = 7;
 
@@ -49,7 +49,7 @@ public abstract class AbstractWordExtrac
     private static final byte FIELD_SEPARATOR_MARK = 20;
 
     private static final POILogger logger = POILogFactory
-            .getLogger( AbstractWordExtractor.class );
+            .getLogger( AbstractWordConverter.class );
 
     public abstract Document getDocument();
 

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java
(from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordUtils.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordUtils.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/AbstractWordUtils.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/AbstractWordUtils.java Mon
Jul  4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import java.io.Closeable;
 import java.io.File;

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/FoDocumentFacade.java (from
r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/FoDocumentFacade.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/FoDocumentFacade.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/FoDocumentFacade.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/FoDocumentFacade.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/FoDocumentFacade.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/FoDocumentFacade.java Mon Jul
 4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java
(from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/HtmlDocumentFacade.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/HtmlDocumentFacade.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/HtmlDocumentFacade.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/HtmlDocumentFacade.java Mon
Jul  4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/NumberFormatter.java (from
r1137673, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/NumberFormatter.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/NumberFormatter.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/NumberFormatter.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/NumberFormatter.java&r1=1137673&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/NumberFormatter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/NumberFormatter.java Mon Jul
 4 19:14:44 2011
@@ -17,24 +17,27 @@
  * ====================================================================
  */
 
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 /**
  * Comment me
- *
+ * 
  * @author Ryan Ackley
  */
-public final class NumberFormatter {
+public final class NumberFormatter
+{
 
-    private static String[] C_LETTERS = new String[] { "a", "b", "c", "d", "e", "f", "g",
"h", "i",
-            "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "y", "z"
};
-
-    private static String[] C_ROMAN = new String[] { "i", "ii", "iii", "iv", "v", "vi", "vii",
-            "viii", "ix", "x", "xi", "xii", "xiii", "xiv", "xv", "xvi", "xvii", "xviii",
"xix",
-            "xx", "xxi", "xxii", "xxiii", "xxiv", "xxv", "xxvi", "xxvii", "xxviii", "xxix",
"xxx",
-            "xxxi", "xxxii", "xxxiii", "xxxiv", "xxxv", "xxxvi", "xxxvii", "xxxvii", "xxxviii",
-            "xxxix", "xl", "xli", "xlii", "xliii", "xliv", "xlv", "xlvi", "xlvii", "xlviii",
-            "xlix", "l" };
+    private static String[] C_LETTERS = new String[] { "a", "b", "c", "d", "e",
+            "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
+            "s", "t", "u", "v", "x", "y", "z" };
+
+    private static String[] C_ROMAN = new String[] { "i", "ii", "iii", "iv",
+            "v", "vi", "vii", "viii", "ix", "x", "xi", "xii", "xiii", "xiv",
+            "xv", "xvi", "xvii", "xviii", "xix", "xx", "xxi", "xxii", "xxiii",
+            "xxiv", "xxv", "xxvi", "xxvii", "xxviii", "xxix", "xxx", "xxxi",
+            "xxxii", "xxxiii", "xxxiv", "xxxv", "xxxvi", "xxxvii", "xxxvii",
+            "xxxviii", "xxxix", "xl", "xli", "xlii", "xliii", "xliv", "xlv",
+            "xlvi", "xlvii", "xlviii", "xlix", "l" };
 
     private final static int T_ARABIC = 0;
     private final static int T_LOWER_LETTER = 4;
@@ -43,8 +46,10 @@ public final class NumberFormatter {
     private final static int T_UPPER_LETTER = 3;
     private final static int T_UPPER_ROMAN = 1;
 
-    public static String getNumber(int num, int style) {
-        switch (style) {
+    public static String getNumber( int num, int style )
+    {
+        switch ( style )
+        {
         case T_UPPER_ROMAN:
             return C_ROMAN[num - 1].toUpperCase();
         case T_LOWER_ROMAN:
@@ -56,7 +61,7 @@ public final class NumberFormatter {
         case T_ARABIC:
         case T_ORDINAL:
         default:
-            return String.valueOf(num);
+            return String.valueOf( num );
         }
     }
 }

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java
(from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoExtractor.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoExtractor.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoExtractor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoConverter.java Mon
Jul  4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import java.io.File;
 import java.io.FileWriter;
@@ -54,7 +54,7 @@ import org.w3c.dom.Text;
 /**
  * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com)
  */
-public class WordToFoExtractor extends AbstractWordExtractor
+public class WordToFoConverter extends AbstractWordConverter
 {
 
     /**
@@ -80,7 +80,7 @@ public class WordToFoExtractor extends A
     }
 
     private static final POILogger logger = POILogFactory
-            .getLogger( WordToFoExtractor.class );
+            .getLogger( WordToFoConverter.class );
 
     public static String getBorderType( BorderCode borderCode )
     {
@@ -132,21 +132,20 @@ public class WordToFoExtractor extends A
     }
 
     /**
-     * Java main() interface to interact with WordToFoExtractor
+     * Java main() interface to interact with {@link WordToFoConverter}
      * 
      * <p>
-     * Usage: WordToFoExtractor infile outfile
+     * Usage: WordToFoConverter infile outfile
      * </p>
      * Where infile is an input .doc file ( Word 97-2007) which will be rendered
      * as XSL-FO into outfile
-     * 
      */
     public static void main( String[] args )
     {
         if ( args.length < 2 )
         {
             System.err
-                    .println( "Usage: WordToFoExtractor <inputFile.doc> <saveTo.fo>"
);
+                    .println( "Usage: WordToFoConverter <inputFile.doc> <saveTo.fo>"
);
             return;
         }
 
@@ -154,7 +153,7 @@ public class WordToFoExtractor extends A
         System.out.println( "Saving output to " + args[1] );
         try
         {
-            Document doc = WordToFoExtractor.process( new File( args[0] ) );
+            Document doc = WordToFoConverter.process( new File( args[0] ) );
 
             FileWriter out = new FileWriter( args[1] );
             DOMSource domSource = new DOMSource( doc );
@@ -176,11 +175,11 @@ public class WordToFoExtractor extends A
     static Document process( File docFile ) throws Exception
     {
         final HWPFDocumentCore hwpfDocument = WordToFoUtils.loadDoc( docFile );
-        WordToFoExtractor wordToFoExtractor = new WordToFoExtractor(
+        WordToFoConverter wordToFoConverter = new WordToFoConverter(
                 DocumentBuilderFactory.newInstance().newDocumentBuilder()
                         .newDocument() );
-        wordToFoExtractor.processDocument( hwpfDocument );
-        return wordToFoExtractor.getDocument();
+        wordToFoConverter.processDocument( hwpfDocument );
+        return wordToFoConverter.getDocument();
     }
 
     private final Stack<BlockProperies> blocksProperies = new Stack<BlockProperies>();
@@ -188,14 +187,14 @@ public class WordToFoExtractor extends A
     protected final FoDocumentFacade foDocumentFacade;
 
     /**
-     * Creates new instance of {@link WordToFoExtractor}. Can be used for output
+     * Creates new instance of {@link WordToFoConverter}. Can be used for output
      * several {@link HWPFDocument}s into single FO document.
      * 
      * @param document
      *            XML DOM Document used as XSL FO document. Shall support
      *            namespaces
      */
-    public WordToFoExtractor( Document document )
+    public WordToFoConverter( Document document )
     {
         this.foDocumentFacade = new FoDocumentFacade( document );
     }

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoUtils.java (from
r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoUtils.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoUtils.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoUtils.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoUtils.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToFoUtils.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToFoUtils.java Mon Jul
 4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import org.apache.poi.hwpf.usermodel.BorderCode;
 import org.apache.poi.hwpf.usermodel.CharacterProperties;

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java
(from r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlExtractor.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlExtractor.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlExtractor.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlConverter.java Mon
Jul  4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import java.io.File;
 import java.io.FileWriter;
@@ -44,12 +44,18 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Text;
 
-import static org.apache.poi.hwpf.extractor.AbstractWordUtils.TWIPS_PER_INCH;
+import static org.apache.poi.hwpf.converter.AbstractWordUtils.TWIPS_PER_INCH;
 
 /**
+ * Converts Word files (95-2007) into HTML files.
+ * <p>
+ * This implementation doesn't create images or links to them. This can be
+ * changed by overriding {@link #processImage(Element, boolean, Picture)}
+ * method.
+ * 
  * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com)
  */
-public class WordToHtmlExtractor extends AbstractWordExtractor
+public class WordToHtmlConverter extends AbstractWordConverter
 {
 
     /**
@@ -69,7 +75,7 @@ public class WordToHtmlExtractor extends
     }
 
     private static final POILogger logger = POILogFactory
-            .getLogger( WordToHtmlExtractor.class );
+            .getLogger( WordToHtmlConverter.class );
 
     private static String getSectionStyle( Section section )
     {
@@ -100,10 +106,10 @@ public class WordToHtmlExtractor extends
     }
 
     /**
-     * Java main() interface to interact with WordToHtmlExtractor
+     * Java main() interface to interact with {@link WordToHtmlConverter}
      * 
      * <p>
-     * Usage: WordToHtmlExtractor infile outfile
+     * Usage: WordToHtmlConverter infile outfile
      * </p>
      * Where infile is an input .doc file ( Word 95-2007) which will be rendered
      * as HTML into outfile
@@ -113,7 +119,7 @@ public class WordToHtmlExtractor extends
         if ( args.length < 2 )
         {
             System.err
-                    .println( "Usage: WordToHtmlExtractor <inputFile.doc> <saveTo.html>"
);
+                    .println( "Usage: WordToHtmlConverter <inputFile.doc> <saveTo.html>"
);
             return;
         }
 
@@ -121,7 +127,7 @@ public class WordToHtmlExtractor extends
         System.out.println( "Saving output to " + args[1] );
         try
         {
-            Document doc = WordToHtmlExtractor.process( new File( args[0] ) );
+            Document doc = WordToHtmlConverter.process( new File( args[0] ) );
 
             FileWriter out = new FileWriter( args[1] );
             DOMSource domSource = new DOMSource( doc );
@@ -145,11 +151,11 @@ public class WordToHtmlExtractor extends
     static Document process( File docFile ) throws Exception
     {
         final HWPFDocumentCore wordDocument = WordToHtmlUtils.loadDoc( docFile );
-        WordToHtmlExtractor wordToHtmlExtractor = new WordToHtmlExtractor(
+        WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(
                 DocumentBuilderFactory.newInstance().newDocumentBuilder()
                         .newDocument() );
-        wordToHtmlExtractor.processDocument( wordDocument );
-        return wordToHtmlExtractor.getDocument();
+        wordToHtmlConverter.processDocument( wordDocument );
+        return wordToHtmlConverter.getDocument();
     }
 
     private final Stack<BlockProperies> blocksProperies = new Stack<BlockProperies>();
@@ -157,13 +163,13 @@ public class WordToHtmlExtractor extends
     private final HtmlDocumentFacade htmlDocumentFacade;
 
     /**
-     * Creates new instance of {@link WordToHtmlExtractor}. Can be used for
+     * Creates new instance of {@link WordToHtmlConverter}. Can be used for
      * output several {@link HWPFDocument}s into single HTML document.
      * 
      * @param document
      *            XML DOM Document used as HTML document
      */
-    public WordToHtmlExtractor( Document document )
+    public WordToHtmlConverter( Document document )
     {
         this.htmlDocumentFacade = new HtmlDocumentFacade( document );
     }

Copied: poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java (from
r1142765, poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlUtils.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java?p2=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java&p1=poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlUtils.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/extractor/WordToHtmlUtils.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hwpf/converter/WordToHtmlUtils.java Mon Jul
 4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import org.apache.poi.hwpf.usermodel.BorderCode;
 import org.apache.poi.hwpf.usermodel.CharacterProperties;

Copied: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java
(from r1142765, poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToExtractorSuite.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java?p2=poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java&p1=poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToExtractorSuite.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToExtractorSuite.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToConverterSuite.java
Mon Jul  4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import java.io.File;
 import java.io.FilenameFilter;
@@ -35,7 +35,7 @@ import junit.framework.TestSuite;
 import org.apache.poi.POIDataSamples;
 import org.apache.poi.hwpf.HWPFDocumentCore;
 
-public class TestWordToExtractorSuite
+public class TestWordToConverterSuite
 {
     /**
      * YK: a quick hack to exclude failing documents from the suite.
@@ -87,14 +87,14 @@ public class TestWordToExtractorSuite
         }
         catch ( Exception exc )
         {
-            // unable to parse file -- not WordToFoExtractor fault
+            // unable to parse file -- not WordToFoConverter fault
             return;
         }
 
-        WordToFoExtractor wordToFoExtractor = new WordToFoExtractor(
+        WordToFoConverter wordToFoConverter = new WordToFoConverter(
                 DocumentBuilderFactory.newInstance().newDocumentBuilder()
                         .newDocument() );
-        wordToFoExtractor.processDocument( hwpfDocument );
+        wordToFoConverter.processDocument( hwpfDocument );
 
         StringWriter stringWriter = new StringWriter();
 
@@ -103,7 +103,7 @@ public class TestWordToExtractorSuite
         transformer.setOutputProperty( OutputKeys.ENCODING, "utf-8" );
         transformer.setOutputProperty( OutputKeys.INDENT, "yes" );
         transformer.transform(
-                new DOMSource( wordToFoExtractor.getDocument() ),
+                new DOMSource( wordToFoConverter.getDocument() ),
                 new StreamResult( stringWriter ) );
 
         if ( html )

Copied: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java
(from r1139204, poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToFoExtractor.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java?p2=poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java&p1=poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToFoExtractor.java&r1=1139204&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToFoExtractor.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToFoConverter.java
Mon Jul  4 19:14:44 2011
@@ -16,7 +16,7 @@
  *    limitations under the License.
  * ====================================================================
  */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import java.io.StringWriter;
 
@@ -32,11 +32,11 @@ import org.apache.poi.POIDataSamples;
 import org.apache.poi.hwpf.HWPFDocument;
 
 /**
- * Test cases for {@link WordToFoExtractor}
+ * Test cases for {@link WordToFoConverter}
  * 
  * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com)
  */
-public class TestWordToFoExtractor extends TestCase
+public class TestWordToFoConverter extends TestCase
 {
     private static String getFoText( final String sampleFileName )
             throws Exception
@@ -44,10 +44,10 @@ public class TestWordToFoExtractor exten
         HWPFDocument hwpfDocument = new HWPFDocument( POIDataSamples
                 .getDocumentInstance().openResourceAsStream( sampleFileName ) );
 
-        WordToFoExtractor wordToFoExtractor = new WordToFoExtractor(
+        WordToFoConverter wordToFoConverter = new WordToFoConverter(
                 DocumentBuilderFactory.newInstance().newDocumentBuilder()
                         .newDocument() );
-        wordToFoExtractor.processDocument( hwpfDocument );
+        wordToFoConverter.processDocument( hwpfDocument );
 
         StringWriter stringWriter = new StringWriter();
 
@@ -55,30 +55,30 @@ public class TestWordToFoExtractor exten
                 .newTransformer();
         transformer.setOutputProperty( OutputKeys.INDENT, "yes" );
         transformer.transform(
-                new DOMSource( wordToFoExtractor.getDocument() ),
+                new DOMSource( wordToFoConverter.getDocument() ),
                 new StreamResult( stringWriter ) );
 
         String result = stringWriter.toString();
         return result;
     }
 
-    public void testHyperlink() throws Exception
+    public void testEquation() throws Exception
     {
-        final String sampleFileName = "hyperlink.doc";
+        final String sampleFileName = "equation.doc";
         String result = getFoText( sampleFileName );
 
         assertTrue( result
-                .contains( "<fo:basic-link external-destination=\"http://testuri.org/\">"
) );
-        assertTrue( result.contains( "Hyperlink text" ) );
+                .contains( "<!--Image link to '0.emf' can be here-->" ) );
     }
 
-    public void testEquation() throws Exception
+    public void testHyperlink() throws Exception
     {
-        final String sampleFileName = "equation.doc";
+        final String sampleFileName = "hyperlink.doc";
         String result = getFoText( sampleFileName );
 
         assertTrue( result
-                .contains( "<!--Image link to '0.emf' can be here-->" ) );
+                .contains( "<fo:basic-link external-destination=\"http://testuri.org/\">"
) );
+        assertTrue( result.contains( "Hyperlink text" ) );
     }
 
     public void testPageref() throws Exception

Copied: poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java
(from r1142765, poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToHtmlExtractor.java)
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java?p2=poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java&p1=poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToHtmlExtractor.java&r1=1142765&r2=1142767&rev=1142767&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/extractor/TestWordToHtmlExtractor.java
(original)
+++ poi/trunk/src/scratchpad/testcases/org/apache/poi/hwpf/converter/TestWordToHtmlConverter.java
Mon Jul  4 19:14:44 2011
@@ -14,7 +14,7 @@
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
-package org.apache.poi.hwpf.extractor;
+package org.apache.poi.hwpf.converter;
 
 import java.io.StringWriter;
 
@@ -30,11 +30,11 @@ import org.apache.poi.POIDataSamples;
 import org.apache.poi.hwpf.HWPFDocument;
 
 /**
- * Test cases for {@link WordToFoExtractor}
+ * Test cases for {@link WordToFoConverter}
  * 
  * @author Sergey Vladimirov (vlsergey {at} gmail {dot} com)
  */
-public class TestWordToHtmlExtractor extends TestCase
+public class TestWordToHtmlConverter extends TestCase
 {
     private static String getHtmlText( final String sampleFileName )
             throws Exception
@@ -42,10 +42,10 @@ public class TestWordToHtmlExtractor ext
         HWPFDocument hwpfDocument = new HWPFDocument( POIDataSamples
                 .getDocumentInstance().openResourceAsStream( sampleFileName ) );
 
-        WordToHtmlExtractor wordToHtmlExtractor = new WordToHtmlExtractor(
+        WordToHtmlConverter wordToHtmlConverter = new WordToHtmlConverter(
                 DocumentBuilderFactory.newInstance().newDocumentBuilder()
                         .newDocument() );
-        wordToHtmlExtractor.processDocument( hwpfDocument );
+        wordToHtmlConverter.processDocument( hwpfDocument );
 
         StringWriter stringWriter = new StringWriter();
 
@@ -55,7 +55,7 @@ public class TestWordToHtmlExtractor ext
         transformer.setOutputProperty( OutputKeys.ENCODING, "utf-8" );
         transformer.setOutputProperty( OutputKeys.METHOD, "html" );
         transformer.transform(
-                new DOMSource( wordToHtmlExtractor.getDocument() ),
+                new DOMSource( wordToHtmlConverter.getDocument() ),
                 new StreamResult( stringWriter ) );
 
         String result = stringWriter.toString();



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message