writer2latex
Class Application

java.lang.Object
  extended by writer2latex.Application

public final class Application
extends java.lang.Object

Commandline utility to convert an OpenOffice.org Writer XML file into XHTML/LaTeX/BibTeX

The utility is invoked with the following command line:

java -jar writer2latex.jar [options] source [target]

Where the available options are

where option can be any simple option known to Writer2LaTeX (see documentation for the configuration file).


Field Summary
(package private)  boolean bBatch
           
private  boolean bRecurse
           
private  Config config
           
(package private)  L10n l10n
           
private  java.util.Hashtable options
           
private  java.lang.String sConfigFileName
           
(package private)  java.lang.String sDefaultCountry
           
(package private)  java.lang.String sDefaultLang
           
private  java.lang.String sOutFileExtension
           
private  java.lang.String sOutFileName
           
private  java.lang.String sOutPathName
           
private  java.lang.String sOutputFormat
           
private  java.lang.String sSource
           
private  java.lang.String sTarget
           
private  java.lang.String sTargetMIME
           
private  java.lang.String sTemplateFileName
           
private  XhtmlDocument template
           
private  byte[] templateBytes
           
 
Constructor Summary
Application()
           
 
Method Summary
private  void convertDirectory(java.io.File dir, java.lang.String sOutPathName)
           
private  java.lang.String convertFile(java.io.File file, java.lang.String sOutPathName)
           
private  void doConversion()
          Converts the document
private  java.lang.String getArg(int i, java.lang.String[] args)
          Extract the next argument from the array, while checking to see that the array size is not exceeded.
static void main(java.lang.String[] args)
          Main method
private  void parseCommandLine(java.lang.String[] sArgs)
          Parse command-line arguments.
private static void showUsage(java.lang.String msg)
          Display usage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sTargetMIME

private java.lang.String sTargetMIME

bRecurse

private boolean bRecurse

sConfigFileName

private java.lang.String sConfigFileName

sTemplateFileName

private java.lang.String sTemplateFileName

options

private java.util.Hashtable options

sSource

private java.lang.String sSource

sTarget

private java.lang.String sTarget

sOutputFormat

private java.lang.String sOutputFormat

sOutPathName

private java.lang.String sOutPathName

sOutFileName

private java.lang.String sOutFileName

sOutFileExtension

private java.lang.String sOutFileExtension

templateBytes

private byte[] templateBytes

template

private XhtmlDocument template

config

private Config config

l10n

L10n l10n

bBatch

boolean bBatch

sDefaultLang

java.lang.String sDefaultLang

sDefaultCountry

java.lang.String sDefaultCountry
Constructor Detail

Application

public Application()
Method Detail

main

public static final void main(java.lang.String[] args)
Main method

Parameters:
args - The argument passed on the command line.

doConversion

private void doConversion()
Converts the document

Throws:
java.lang.IllegalArgumentException - If an argument is invalid.

convertFile

private java.lang.String convertFile(java.io.File file,
                                     java.lang.String sOutPathName)

convertDirectory

private void convertDirectory(java.io.File dir,
                              java.lang.String sOutPathName)

showUsage

private static void showUsage(java.lang.String msg)
Display usage.


parseCommandLine

private void parseCommandLine(java.lang.String[] sArgs)
                       throws java.lang.IllegalArgumentException
Parse command-line arguments.

Parameters:
args - Array of command line arguments.
Throws:
java.lang.IllegalArgumentException - If an argument is invalid.

getArg

private java.lang.String getArg(int i,
                                java.lang.String[] args)
                         throws java.lang.IllegalArgumentException
Extract the next argument from the array, while checking to see that the array size is not exceeded. Throw a friendly error message in case the arg is missing.

Parameters:
i - Argument index.
args - Array of command line arguments.
Returns:
The argument with the specified index.
Throws:
java.lang.IllegalArgumentException - If an argument is invalid.