|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfile2xliff4j.OdfExporter
file2xliff4j.OOoTextExporter
public class OOoTextExporter
Class to export XLIFF to an OpenOffice.org OpenDocument Text (odt), Spreadsheet (ods) or Presentation (odp) document.
Field Summary | |
---|---|
protected static int |
BLKSIZE
|
Fields inherited from interface file2xliff4j.Converter |
---|
formatSuffix, skeletonSuffix, startXliff, stylesTSkeletonSuffix, tSkeletonSuffix, xliffSuffix, xmlDeclaration |
Constructor Summary | |
---|---|
OOoTextExporter()
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 a document in OpenOffice.org OpenDocument Text (odt) format. |
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 a document in OpenOffice.org OpenDocument Text (odt) format. |
java.lang.Object |
getConversionProperty(java.lang.String property)
Return an object representing a format-specific (and converter-specific) property. |
FileType |
getFileType()
Return the file type that this converter handles. |
void |
setConversionProperty(java.lang.String property,
java.lang.Object value)
Set a format-specific property that might affect the way that the conversion occurs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int BLKSIZE
Constructor Detail |
---|
public OOoTextExporter()
Method Detail |
---|
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
Note: This conversion actually uses the convert method of its superclass (OdfExporter) to generate a content.<language>.xml file--which is a special target-language-specific version of the "standard" content.xml file that is found in ZIP-formated OpenOffice.org odt files. After the superclass creates the content.<language>.xml file, this converter copies the original (used for import) odt file to one that inserts the target-language between the "stem" and the odt extension of the file name. It replaces the original content.xml (in the new odt copy) with the contents of the new content.<language>.xml file.
convert
in interface Converter
convert
in class OdfExporter
mode
- The mode of conversion (FROM_XLIFF in this case).language
- The language of the XLIFF target 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 and
the original input file was named myfile.odt, the output file name
is myfile.ja_jp.odt. (Note that the Java Locale's toString
method lowercases the characters of language codes.)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
(which we will place in the new odt file) will always be encoded in
UTF-8.nativeFileType
- This parameter is ignored. For export, the original
native file type is stored in the XLIFF, and is retrieved from that
location.nativeFileName
- The name of the original native document that was
first converted to XLIFF. If it was an OpenOffice.org OpenDocument
Text file, it ends in ".odt". (It might also end with something other
than ".odt")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.
ConversionException
- If a conversion exception is encountered.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
Note: This conversion actually uses the convert method of its superclass (OdfExporter) to generate a content.<language>.xml file--which is a special target-language-specific version of the "standard" content.xml file that is found in ZIP-formated OpenOffice.org odt files. After the superclass creates the content.<language>.xml file, this converter copies the original (used for import) odt file to one that inserts the target-language between the "stem" and the odt extension of the file name. It replaces the original content.xml (in the new odt copy) with the contents of the new content.<language>.xml file.
convert
in interface Converter
convert
in class OdfExporter
mode
- The mode of conversion (FROM_XLIFF in this case).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 and
the original input file was named myfile.odt, the output file name
is myfile.ja_jp.odt. (Note that the Java Locale's toString
method lowercases the characters of language codes.)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
(which we will place in the new odt file) will always be encoded in
UTF-8.nativeFileType
- This parameter is ignored. For export, the original
native file type is stored in the XLIFF, and is retrieved from that
location.nativeFileName
- The name of the original native document that was
first converted to XLIFF. If it was an OpenOffice.org OpenDocument
Text file, it ends in ".odt". (It might also end with something other
than ".odt")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.)
ConversionException
- If a conversion exception is encountered.@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
Note: This conversion actually uses the convert method of its superclass (OdfExporter) to generate a content.<language>.xml file--which is a special target-language-specific version of the "standard" content.xml file that is found in ZIP-formated OpenOffice.org odt files. After the superclass creates the content.<language>.xml file, this converter copies the original (used for import) odt file to one that inserts the target-language between the "stem" and the odt extension of the file name. It replaces the original content.xml (in the new odt copy) with the contents of the new content.<language>.xml file.
convert
in interface Converter
convert
in class OdfExporter
mode
- The mode of conversion (FROM_XLIFF in this case).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 and
the original input file was named myfile.odt, the output file name
is myfile.ja_jp.odt. (Note that the Java Locale's toString
method lowercases the characters of language codes.)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
(which we will place in the new odt file) will always be encoded in
UTF-8.nativeFileType
- This parameter is ignored. For export, the original
native file type is stored in the XLIFF, and is retrieved from that
location.nativeFileName
- The name of the original native document that was
first converted to XLIFF. If it was an OpenOffice.org OpenDocument
Text file, it ends in ".odt". (It might also end with something other
than ".odt")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).
ConversionException
- If a conversion exception is encountered.public java.lang.Object getConversionProperty(java.lang.String property)
getConversionProperty
in interface Converter
property
- The name of the property to return.
public FileType getFileType()
getFileType
in interface Converter
public void setConversionProperty(java.lang.String property, java.lang.Object value) throws ConversionException
Note: This converter needs no format-specific properties. If any are passed, they will be silently ignored.
setConversionProperty
in interface Converter
property
- The name of the propertyvalue
- The value of the property
ConversionException
- If the property isn't recognized (and if it matters).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |