file2xliff4j
Class OdfExporter

java.lang.Object
  extended by file2xliff4j.OdfExporter
All Implemented Interfaces:
Converter
Direct Known Subclasses:
OOoTextExporter

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

Class to export XLIFF to an OpenDocumentFormat document. If the ODF document is an "intermediate" format, also convert it the "rest of the way" to the ultimate document in a format such as Microsoft Word or similar formats.

Author:
Weldon Whipple <weldon@lingotek.com>

Field Summary
 
Fields inherited from interface file2xliff4j.Converter
BLKSIZE, formatSuffix, skeletonSuffix, startXliff, stylesTSkeletonSuffix, tSkeletonSuffix, xliffSuffix, xmlDeclaration
 
Constructor Summary
OdfExporter()
          Creates a new instance of OdfExporter
 
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 one set of targets (in the translation units of an XLIFF file) back to the original format used by the content.xml component of an OpenOffice.org OpenDocument Format odt file.
 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 one set of targets (in the translation units of an XLIFF file) back to the original format used by the content.xml component of an OpenOffice.org OpenDocument Format odt file.
 
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

OdfExporter

public OdfExporter()
Creates a new instance of OdfExporter

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 one set of targets (in the translation units of an XLIFF file) back to the original format used by the content.xml component of an OpenOffice.org OpenDocument Format odt file. Use (besides the XLIFF file) the skeleton and format files that were generated when the XLIFF file was created.

Note: This conversion likely constitutes only one stage of the total conversion of a set of XLIFF targets back to the final destination format. (Example: An heir of this converter might be using the OdfExporter to convert to an intermediate format that will be further converted to a final Word, WordPerfect or Excel [say] document by the heir class.)

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the XLIFF targets to use in constructing the ODF document. The language is used in constructing a unique name for the output file. For example, if ja_JP is specified, the output file name is content.ja_jp.xml.
phaseName - The name of the phase to export. If this parameter's value is not null, it is matched against the value of the optional phase-name attribute of the target elements of the XLIFF document. If null, no check is made against a phase-name attribute.

If the phase name string consists entirely of numeric digit(s) equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see next parameter) search for targets with lower numbered phase names.

maxPhase - The maximum phase number. If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding - The encoding of the native document. This parameter is ignored for OpenDocument Format, since the content.xml file will always be encoded in UTF-8.
nativeFileType - This parameter is ignored. (The content.xml-format file that is generated by this exporter must be further processed before reaching the final-destination format specified when the XLIFF was created and stored in the XLIFF. For example, to become an OpenOffice.org odt document, the content.xml file must be placed in the ZIP-formatted odt file. To become a Word document, OpenOffice.org can be used to convert the odt file to a doc file.)
nativeFileName - This parameter is ignored. (Although other XLIFF-to-native format converters use the nativeFileName as the prefix to the names for the xliff, skeleton and format files, this converter will always use content.xml.xliff, content.xml.skeleton and content.xml.format as the names of those respective files. Also, the output file will be named content.<language>.xml, where <language> corresponds to the language code specified in the earlier language parameter. The reason for ignoring thie parameter is because the OdfExporter will *always* be used by an heir class to complete the export of the final file.)
baseDir - The directory (in the file system) from which input files (XLIFF, skeleton and format files) will be read, and to which the output file will be written.
notifier - Instance of a class that implements the Notifier interface (to send notifications in case of conversion error).
boundary - (Ignored. The boundary on which to segment translation units (e.g., on paragraph or sentence boundaries) is meaningful only for importers--converters that generate XLIFF from documents.)
generatedFileName - If non-null, the converter will write the name of the file (without parent directories) to which the generated output 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 one set of targets (in the translation units of an XLIFF file) back to the original format used by the content.xml component of an OpenOffice.org OpenDocument Format odt file. Use (besides the XLIFF file) the skeleton and format files that were generated when the XLIFF file was created.

Note: This conversion likely constitutes only one stage of the total conversion of a set of XLIFF targets back to the final destination format. (Example: An heir of this converter might be using the OdfExporter to convert to an intermediate format that will be further converted to a final Word, WordPerfect or Excel [say] document by the heir class.)

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the XLIFF targets to use in constructing the ODF document. The language is used in constructing a unique name for the output file. For example, if ja_JP is specified, the output file name is content.ja_jp.xml.
phaseName - The name of the phase to export. If this parameter's value is not null, it is matched against the value of the optional phase-name attribute of the target elements of the XLIFF document. If null, no check is made against a phase-name attribute.

If the phase name string consists entirely of numeric digit(s) equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see next parameter) search for targets with lower numbered phase names.

maxPhase - The maximum phase number. If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding - The encoding of the native document. This parameter is ignored for OpenDocument Format, since the content.xml file will always be encoded in UTF-8.
nativeFileType - This parameter is ignored. (The content.xml-format file that is generated by this exporter must be further processed before reaching the final-destination format specified when the XLIFF was created and stored in the XLIFF. For example, to become an OpenOffice.org odt document, the content.xml file must be placed in the ZIP-formatted odt file. To become a Word document, OpenOffice.org can be used to convert the odt file to a doc file.)
nativeFileName - This parameter is ignored. (Although other XLIFF-to-native format converters use the nativeFileName as the prefix to the names for the xliff, skeleton and format files, this converter will always use content.xml.xliff, content.xml.skeleton and content.xml.format as the names of those respective files. Also, the output file will be named content.<language>.xml, where <language> corresponds to the language code specified in the earlier language parameter. The reason for ignoring thie parameter is because the OdfExporter will *always* be used by an heir class to complete the export of the final file.)
baseDir - The directory (in the file system) from which input files (XLIFF, skeleton and format files) will be read, and to which the output file will be written.
notifier - Instance of a class that implements the Notifier interface (to send notifications in case of conversion error).
boundary - (Ignored. The boundary on which to segment translation units (e.g., on paragraph or sentence boundaries) is meaningful only for importers--converters that generate XLIFF from documents.)
generatedFileName - If non-null, the converter will write the name of the file (without parent directories) to which the generated output 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 one set of targets (in the translation units of an XLIFF file) back to the original format used by the content.xml component of an OpenOffice.org OpenDocument Format odt file. Use (besides the XLIFF file) the skeleton and format files that were generated when the XLIFF file was created.

Note: This conversion likely constitutes only one stage of the total conversion of a set of XLIFF targets back to the final destination format. (Example: An heir of this converter might be using the OdfExporter to convert to an intermediate format that will be further converted to a final Word, WordPerfect or Excel [say] document by the heir class.)

Specified by:
convert in interface Converter
Parameters:
mode - The mode of conversion (to or from XLIFF).
language - The language of the XLIFF targets to use in constructing the ODF document. The language is used in constructing a unique name for the output file. For example, if ja_JP is specified, the output file name is content.ja_jp.xml.
phaseName - The name of the phase to export. If this parameter's value is not null, it is matched against the value of the optional phase-name attribute of the target elements of the XLIFF document. If null, no check is made against a phase-name attribute.

If the phase name string consists entirely of numeric digit(s) equivalent to an integer with value greater than 1 but less than or equal to maxPhase (see next parameter) search for targets with lower numbered phase names.

maxPhase - The maximum phase number. If phaseName is specified as "0" and maxPhase is a non-negative integer, search for the highest "numbered" phase, starting at maxPhase, and searching down to phase "1".
nativeEncoding - The encoding of the native document. This parameter is ignored for OpenDocument Format, since the content.xml file will always be encoded in UTF-8.
nativeFileType - This parameter is ignored. (The content.xml-format file that is generated by this exporter must be further processed before reaching the final-destination format specified when the XLIFF was created and stored in the XLIFF. For example, to become an OpenOffice.org odt document, the content.xml file must be placed in the ZIP-formatted odt file. To become a Word document, OpenOffice.org can be used to convert the odt file to a doc file.)
nativeFileName - This parameter is ignored. (Although other XLIFF-to-native format converters use the nativeFileName as the prefix to the names for the xliff, skeleton and format files, this converter will always use content.xml.xliff, content.xml.skeleton and content.xml.format as the names of those respective files. Also, the output file will be named content.<language>.xml, where <language> corresponds to the language code specified in the earlier language parameter. The reason for ignoring thie parameter is because the OdfExporter will *always* be used by an heir class to complete the export of the final file.)
baseDir - The directory (in the file system) from which input files (XLIFF, skeleton and format files) will be read, and to which the output file will be written.
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.