file2xliff4j
Class OdfImporter

java.lang.Object
  extended by file2xliff4j.OdfImporter
All Implemented Interfaces:
Converter
Direct Known Subclasses:
OOoTextImporter

public abstract class OdfImporter
extends java.lang.Object
implements Converter

The OdfImporter is used to import Open Document Format to XLIFF.

Author:
Weldon Whipple <weldon@lingotek.com>

Field Summary
 
Fields inherited from interface file2xliff4j.Converter
BLKSIZE, formatSuffix, skeletonSuffix, startXliff, stylesTSkeletonSuffix, tSkeletonSuffix, xliffSuffix, xmlDeclaration
 
Constructor Summary
OdfImporter()
          Constructor for the ODF importer.
 
Method Summary
 ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier)
          Deprecated. 
 ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier, SegmentBoundary boundary, java.io.StringWriter generatedFileName)
          Convert the content.xml and styles.xml files (within an OpenOffice.org OpenDocument Format odt file) to XLIFF, creating xliff, skeleton and format files as output.
 ConversionStatus convert(ConversionMode mode, java.util.Locale language, java.lang.String phaseName, int maxPhase, java.nio.charset.Charset nativeEncoding, FileType nativeFileType, java.lang.String nativeFileName, java.lang.String baseDir, Notifier notifier, SegmentBoundary boundary, java.io.StringWriter generatedFileName, java.util.Set<f2xutils.XMLTuXPath> skipList)
          Convert the content.xml file (within an OpenOffice.org OpenDocument Format odt file) to XLIFF, creating xliff, skeleton and format files as output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface file2xliff4j.Converter
getConversionProperty, getFileType, setConversionProperty
 

Constructor Detail

OdfImporter

public OdfImporter()
Constructor for the ODF importer.

Method Detail

convert

public ConversionStatus convert(ConversionMode mode,
                                java.util.Locale language,
                                java.lang.String phaseName,
                                int maxPhase,
                                java.nio.charset.Charset nativeEncoding,
                                FileType nativeFileType,
                                java.lang.String nativeFileName,
                                java.lang.String baseDir,
                                Notifier notifier,
                                SegmentBoundary boundary,
                                java.io.StringWriter generatedFileName)
                         throws ConversionException
Convert the content.xml and styles.xml files (within an OpenOffice.org OpenDocument Format odt file) to XLIFF, creating xliff, skeleton and format files as output.

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the input file.
nativeEncoding - The encoding of the input file. This parameter will normally be null, signifying that the default UTF-8 encoding be used.
phaseName - The target phase-name. This value is ignored.
maxPhase - The maximum phase number. This value is ignored.
nativeFileType - The type of the original native file. This parameter provides the value for the datatype attribute of the XLIFF's file element. If the ODF importer is converting an intermediate file that began as (say) a Word file, the value should indicate the type of the original file ("WORD" for Word files).
nativeFileName - The name of the input ODF file. This will be either content.xml. (Additionally, the styles file is assumed to be named styles.xml.)
baseDir - The directory that contains the input ODF file--from which we will read the input file. This is also the directory in which the output xliff, skeleton and format files will be written. The output files will be named as follows:
  • content.xml.xliff
  • content.xml.skeleton
  • content.xml.format
notifier - Instance of a class that implements the Notifier interface (to send notifications in case of conversion error).
boundary - The boundary on which to segment translation units (e.g., on paragraph or sentence boundaries)
generatedFileName - If non-null, the converter will write the name of the file (without parent directories) to which the generated XLIFF file was written.
Returns:
Indicator of the status of the conversion.
Throws:
ConversionException - If a conversion exception is encountered.

convert

public ConversionStatus convert(ConversionMode mode,
                                java.util.Locale language,
                                java.lang.String phaseName,
                                int maxPhase,
                                java.nio.charset.Charset nativeEncoding,
                                FileType nativeFileType,
                                java.lang.String nativeFileName,
                                java.lang.String baseDir,
                                Notifier notifier,
                                SegmentBoundary boundary,
                                java.io.StringWriter generatedFileName,
                                java.util.Set<f2xutils.XMLTuXPath> skipList)
                         throws ConversionException
Convert the content.xml file (within an OpenOffice.org OpenDocument Format odt file) to XLIFF, creating xliff, skeleton and format files as output.

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the input file.
nativeEncoding - The encoding of the input file. This parameter will normally be null, signifying that the default UTF-8 encoding be used.
phaseName - The target phase-name. This value is ignored.
maxPhase - The maximum phase number. This value is ignored.
nativeFileType - The type of the original native file. This parameter provides the value for the datatype attribute of the XLIFF's file element. If the ODF importer is converting an intermediate file that began as (say) a Word file, the value should indicate the type of the original file ("WORD" for Word files).
nativeFileName - The name of the input ODF file. (Should likely be content.xml, but anything *might* work.)
baseDir - The directory that contains the input ODF file--from which we will read the input file. This is also the directory in which the output xliff, skeleton and format files will be written. The output files will be named as follows:cd tu
  • content.xml.xliff
  • content.xml.skeleton
  • content.xml.format
notifier - Instance of a class that implements the Notifier interface (to send notifications in case of conversion error).
boundary - The boundary on which to segment translation units (e.g., on paragraph or sentence boundaries)
generatedFileName - If non-null, the converter will write the name of the file (without parent directories) to which the generated XLIFF file was written.
skipList - (Not used by this converter.)
Returns:
Indicator of the status of the conversion.
Throws:
ConversionException - If a conversion exception is encountered.

convert

@Deprecated
public ConversionStatus convert(ConversionMode mode,
                                           java.util.Locale language,
                                           java.lang.String phaseName,
                                           int maxPhase,
                                           java.nio.charset.Charset nativeEncoding,
                                           FileType nativeFileType,
                                           java.lang.String nativeFileName,
                                           java.lang.String baseDir,
                                           Notifier notifier)
                         throws ConversionException
Deprecated. 

Convert the content.xml file (within an OpenOffice.org OpenDocument Format odt file) to XLIFF, creating xliff, skeleton and format files as output.

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the input file.
nativeEncoding - The encoding of the input file. This parameter will normally be null, signifying that the default UTF-8 encoding be used.
phaseName - The target phase-name. This value is ignored.
maxPhase - The maximum phase number. This value is ignored.
nativeFileType - The type of the original native file. This parameter provides the value for the datatype attribute of the XLIFF's file element. If the ODF importer is converting an intermediate file that began as (say) a Word file, the value should indicate the type of the original file ("WORD" for Word files).
nativeFileName - The name of the input ODF file. (Should likely be content.xml, but anything *might* work.)
baseDir - The directory that contains the input ODF file--from which we will read the input file. This is also the directory in which the output xliff, skeleton and format files will be written. The output files will be named as follows:cd tu
  • content.xml.xliff
  • content.xml.skeleton
  • content.xml.format
notifier - Instance of a class that implements the Notifier interface (to send notifications in case of conversion error).
Returns:
Indicator of the status of the conversion.
Throws:
ConversionException - If a conversion exception is encountered.