@AlfrescoPublicApi public class RuntimeExecutableContentTransformerWorker extends ContentTransformerHelper implements ContentTransformerWorker, org.springframework.beans.factory.InitializingBean
The following parameters are use:
Provided that the command executed ultimately transforms the source file and leaves the result in the target file, the transformation should be successful.NOTE: It is only the contents of the files that can be transformed. Any attempt to modify the source or target file metadata will, at best, have no effect, but may ultimately lead to the transformation failing. This is because the files provided are both temporary files that reside in a location outside the system's content store.
This transformer requires the setting of the explicitTransformations property.
RuntimeExec| Modifier and Type | Field and Description |
|---|---|
static String |
VAR_PAGE_RANGE |
static String |
VAR_SOURCE |
static String |
VAR_TARGET |
transformerConfig| Constructor and Description |
|---|
RuntimeExecutableContentTransformerWorker() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Executes the check command, if present.
|
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.
|
String |
getVersionString()
Gets the version string captured from the check command.
|
boolean |
isAvailable()
Signals whether this transformer is available.
|
boolean |
isTransformable(String sourceMimetype,
String targetMimetype,
TransformationOptions options)
If the initialization failed, then it returns 0.0.
|
void |
setCheckCommand(org.alfresco.util.exec.RuntimeExec checkCommand)
Set the runtime executer that will be called as part of the initialisation
to determine if the transformer is able to function.
|
void |
setErrorCodes(String errCodesStr)
A comma or space separated list of values that, if returned by the executed command,
indicate an error value.
|
void |
setTransformCommand(org.alfresco.util.exec.RuntimeExec transformCommand)
Set the runtime executer that will called to perform the actual transformation.
|
String |
toString() |
void |
transform(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
Converts the source and target content to temporary files with the
correct extensions for the mimetype that they map to.
|
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformationspublic static final String VAR_SOURCE
public static final String VAR_TARGET
public static final String VAR_PAGE_RANGE
public RuntimeExecutableContentTransformerWorker()
public String toString()
toString in class ContentTransformerHelperpublic void setCheckCommand(org.alfresco.util.exec.RuntimeExec checkCommand)
The command will be considered to have failed if the
checkCommand - the initialisation check commandpublic void setTransformCommand(org.alfresco.util.exec.RuntimeExec transformCommand)
transformCommand - the runtime transform commandpublic void setErrorCodes(String errCodesStr)
errCodesStr - Stringpublic void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic boolean isTransformable(String sourceMimetype, String targetMimetype, TransformationOptions options)
isTransformable in interface ContentTransformerWorkerAbstractContentTransformer.setExplicitTransformations(List)public 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 interface ContentTransformerWorkergetComments 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.ContentTransformer.getComments(boolean)public boolean isAvailable()
isAvailable in interface ContentTransformerWorkerpublic String getVersionString()
getVersionString in interface ContentTransformerWorkerpublic final void transform(org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer,
TransformationOptions options)
throws Exception
transform in interface ContentTransformerWorkerExceptionContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions)Copyright © 2005–2018 Alfresco Software. All rights reserved.