public abstract class OOoContentTransformerHelper extends ContentTransformerHelper
ContentTransformer
s and ContentTransformerWorker
s.Modifier and Type | Field and Description |
---|---|
protected TransformerDebug |
transformerDebug |
transformerConfig
Constructor and Description |
---|
OOoContentTransformerHelper() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected abstract void |
convert(File tempFromFile,
net.sf.jooreports.converter.DocumentFormat sourceFormat,
File tempToFile,
net.sf.jooreports.converter.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.
|
void |
saveContentInFile(String sourceMimetype,
org.alfresco.service.cmr.repository.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 |
setTransformerDebug(TransformerDebug transformerDebug)
Helper setter of the transformer debug.
|
void |
transform(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options) |
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations, toString
protected TransformerDebug transformerDebug
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, net.sf.jooreports.converter.DocumentFormat sourceFormat, File tempToFile, net.sf.jooreports.converter.DocumentFormat targetFormat)
public void setTransformerDebug(TransformerDebug transformerDebug)
transformerDebug
- TransformerDebugprotected boolean isTransformationBlocked(String sourceMimetype, String targetMimetype)
sourceMimetype
- StringtargetMimetype
- Stringtrue
if the mimetypes are blocked, else false
public boolean isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
DocumentFormatRegistry
public String getComments(boolean available)
ContentTransformerHelper
AbstractContentTransformerLimits.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 ContentTransformerHelper
available
- 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(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options) throws Exception
Exception
public void saveContentInFile(String sourceMimetype, org.alfresco.service.cmr.repository.ContentReader reader, File file) throws org.alfresco.service.cmr.repository.ContentIOException
org.alfresco.service.cmr.repository.ContentIOException
protected 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–2017 Alfresco Software. All rights reserved.