|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.content.transform.ContentTransformerHelper
org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker
public class RuntimeExecutableContentTransformerWorker
This configurable wrapper is able to execute any command line transformation that accepts an input and an output file on the command line.
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
Field Summary | |
---|---|
static java.lang.String |
VAR_SOURCE
|
static java.lang.String |
VAR_TARGET
|
Constructor Summary | |
---|---|
RuntimeExecutableContentTransformerWorker()
|
Method Summary | |
---|---|
void |
afterPropertiesSet()
Executes the check command, if present. |
java.lang.String |
getVersionString()
Gets the version string captured from the check command. |
boolean |
isAvailable()
Signals whether this transformer is available. |
boolean |
isTransformable(java.lang.String sourceMimetype,
java.lang.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(java.lang.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. |
java.lang.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. |
Methods inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper |
---|
getMimetype, getMimetypeService, isExplicitTransformation, setExplicitTransformations, setMimetypeService |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String VAR_SOURCE
public static final java.lang.String VAR_TARGET
Constructor Detail |
---|
public RuntimeExecutableContentTransformerWorker()
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public 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(java.lang.String errCodesStr)
erroCodesStr
- public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public boolean isTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)
initialization
failed, then it returns 0.0.
Otherwise the explicit transformations are checked for the reliability.
isTransformable
in interface ContentTransformerWorker
AbstractContentTransformer.setExplicitTransformations(List)
public boolean isAvailable()
isAvailable
in interface ContentTransformerWorker
public java.lang.String getVersionString()
getVersionString
in interface ContentTransformerWorker
public final void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options) throws java.lang.Exception
transform
in interface ContentTransformerWorker
java.lang.Exception
#transformInternal(File, File)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |