public abstract class OOoContentTransformerHelper extends ContentTransformerHelper
ContentTransformers and ContentTransformerWorkers.| Modifier and Type | Field and Description |
|---|---|
protected RemoteTransformerClient |
remoteTransformerClient |
protected TransformerDebug |
transformerDebug |
transformerConfig| Constructor and Description |
|---|
OOoContentTransformerHelper() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected abstract void |
convert(File tempFromFile,
org.artofsolving.jodconverter.document.DocumentFormat sourceFormat,
File tempToFile,
org.artofsolving.jodconverter.document.DocumentFormat targetFormat) |
protected boolean |
encodeAsUtf8(String sourceMimetype,
String encoding)
Returns
true if the input file should be transformed to UTF8 encoding. |
String |
getComments(boolean available)
Overridden to supply a comment or String of commented out transformation properties
that specify any (hard coded or implied) supported transformations.
|
protected abstract org.apache.commons.logging.Log |
getLogger() |
protected abstract String |
getTempFilePrefix() |
String |
getVersionString() |
abstract boolean |
isAvailable() |
boolean |
isTransformable(String sourceMimetype,
String targetMimetype,
TransformationOptions options) |
protected boolean |
isTransformationBlocked(String sourceMimetype,
String targetMimetype)
There are some conversions that fail, despite the converter believing them possible.
|
protected boolean |
remoteTransformerClientConfigured() |
void |
saveContentInFile(String sourceMimetype,
ContentReader reader,
File file)
Populates a file with the content in the reader.
|
void |
setDocumentFormatsConfiguration(String path)
Set a non-default location from which to load the document format mappings.
|
void |
setRemoteTransformerClient(RemoteTransformerClient remoteTransformerClient)
Sets the optional remote transformer client which will be used in preference to a local command if available.
|
void |
setTransformerDebug(TransformerDebug transformerDebug)
Helper setter of the transformer debug.
|
void |
transform(ContentReader reader,
ContentWriter writer,
TransformationOptions options) |
protected void |
transformLocal(ContentReader reader,
ContentWriter writer,
TransformationOptions options,
String sourceMimetype,
String sourceExtension,
String targetExtension,
org.artofsolving.jodconverter.document.DocumentFormat sourceFormat,
org.artofsolving.jodconverter.document.DocumentFormat targetFormat) |
protected void |
transformRemote(ContentReader reader,
ContentWriter writer,
TransformationOptions options,
String sourceMimetype,
String sourceExtension,
String targetExtension) |
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations, toStringprotected TransformerDebug transformerDebug
protected RemoteTransformerClient remoteTransformerClient
public void setDocumentFormatsConfiguration(String path)
path - a resource location supporting the file: or classpath: prefixesprotected abstract org.apache.commons.logging.Log getLogger()
protected abstract String getTempFilePrefix()
public abstract boolean isAvailable()
protected abstract void convert(File tempFromFile, org.artofsolving.jodconverter.document.DocumentFormat sourceFormat, File tempToFile, org.artofsolving.jodconverter.document.DocumentFormat targetFormat)
public void setTransformerDebug(TransformerDebug transformerDebug)
transformerDebug - TransformerDebugpublic void setRemoteTransformerClient(RemoteTransformerClient remoteTransformerClient)
remoteTransformerClient - may be null;protected boolean remoteTransformerClientConfigured()
public void afterPropertiesSet()
protected boolean isTransformationBlocked(String sourceMimetype, String targetMimetype)
sourceMimetype - StringtargetMimetype - Stringtrue if the mimetypes are blocked, else falsepublic boolean isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
DocumentFormatRegistrypublic String getComments(boolean available)
ContentTransformerHelperAbstractContentTransformerLimits.isTransformableMimetype(String, String, TransformationOptions)
or ContentTransformerWorker.isTransformable(String, String, TransformationOptions)
have been overridden.
See ContentTransformerHelper.getCommentsOnlySupports(List, List, boolean) which may be used to help construct a comment.getComments in class ContentTransformerHelperavailable - indicates if the transformer has been registered and is available to be selected.
false indicates that the transformer is only available as a component of a
complex transformer.public String getVersionString()
public void transform(ContentReader reader, ContentWriter writer, TransformationOptions options) throws Exception
Exceptionprotected void transformLocal(ContentReader reader, ContentWriter writer, TransformationOptions options, String sourceMimetype, String sourceExtension, String targetExtension, org.artofsolving.jodconverter.document.DocumentFormat sourceFormat, org.artofsolving.jodconverter.document.DocumentFormat targetFormat)
protected void transformRemote(ContentReader reader, ContentWriter writer, TransformationOptions options, String sourceMimetype, String sourceExtension, String targetExtension) throws IllegalAccessException
IllegalAccessExceptionpublic void saveContentInFile(String sourceMimetype, ContentReader reader, File file) throws ContentIOException
ContentIOExceptionprotected boolean encodeAsUtf8(String sourceMimetype, String encoding)
true if the input file should be transformed to UTF8 encoding.OpenOffice/LibreOffice is unable to support the import of text files that are SHIFT JIS encoded (and others: windows-1252...) so transformed to UTF-8.
Copyright © 2005–2020 Alfresco Software. All rights reserved.