Class RuntimeExecutableContentTransformerWorker
- java.lang.Object
-
- org.alfresco.repo.content.transform.ContentTransformerHelper
-
- org.alfresco.repo.content.transform.RuntimeExecutableContentTransformerWorker
-
- All Implemented Interfaces:
ContentTransformerWorker,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
@Deprecated @AlfrescoPublicApi public class RuntimeExecutableContentTransformerWorker extends ContentTransformerHelper implements ContentTransformerWorker, org.springframework.beans.factory.InitializingBean
Deprecated.The transformations code is being moved out of the codebase and replaced by the new async RenditionService2 or other external libraries.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.
- Since:
- 1.1
- Author:
- Derek Hulley
- See Also:
RuntimeExec
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVAR_PAGE_RANGEDeprecated.static java.lang.StringVAR_SOURCEDeprecated.static java.lang.StringVAR_TARGETDeprecated.-
Fields inherited from class org.alfresco.repo.content.transform.ContentTransformerHelper
transformerConfig
-
-
Constructor Summary
Constructors Constructor Description RuntimeExecutableContentTransformerWorker()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidafterPropertiesSet()Deprecated.Executes the check command, if present.java.lang.StringgetComments(boolean available)Deprecated.Overridden to supply a comment or String of commented out transformation properties that specify any (hard coded or implied) supported transformations.java.lang.StringgetVersionString()Deprecated.Gets the version string captured from the check command.booleanisAvailable()Deprecated.Signals whether this transformer is available.booleanisTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.If the initialization failed, then it returns 0.0.voidsetCheckCommand(org.alfresco.util.exec.RuntimeExec checkCommand)Deprecated.Set the runtime executer that will be called as part of the initialisation to determine if the transformer is able to function.voidsetErrorCodes(java.lang.String errCodesStr)Deprecated.A comma or space separated list of values that, if returned by the executed command, indicate an error value.voidsetTransformCommand(org.alfresco.util.exec.RuntimeExec transformCommand)Deprecated.Set the runtime executer that will called to perform the actual transformation.java.lang.StringtoString()Deprecated.voidtransform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options)Deprecated.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
deprecatedSetter, equals, getBeanName, getCommentsOnlySupports, getExtensionOrAny, getMimetype, getMimetypeService, getName, getSimpleName, hashCode, isExplicitTransformation, isSupportedTransformation, onlySupports, register, setBeanName, setExplicitTransformations, setMimetypeService, setSupportedTransformations, setTransformerConfig, setUnsupportedTransformations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.alfresco.repo.content.transform.ContentTransformerWorker
remoteTransformerClientConfigured
-
-
-
-
Field Detail
-
VAR_SOURCE
public static final java.lang.String VAR_SOURCE
Deprecated.- See Also:
- Constant Field Values
-
VAR_TARGET
public static final java.lang.String VAR_TARGET
Deprecated.- See Also:
- Constant Field Values
-
VAR_PAGE_RANGE
public static final java.lang.String VAR_PAGE_RANGE
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classContentTransformerHelper
-
setCheckCommand
public void setCheckCommand(org.alfresco.util.exec.RuntimeExec checkCommand)
Deprecated.Set the runtime executer that will be called as part of the initialisation to determine if the transformer is able to function. This is optional, but allows the transformer registry to detect and avoid using this instance if it is not working.The command will be considered to have failed if the
- Parameters:
checkCommand- the initialisation check command
-
setTransformCommand
public void setTransformCommand(org.alfresco.util.exec.RuntimeExec transformCommand)
Deprecated.Set the runtime executer that will called to perform the actual transformation.- Parameters:
transformCommand- the runtime transform command
-
setErrorCodes
public void setErrorCodes(java.lang.String errCodesStr)
Deprecated.A comma or space separated list of values that, if returned by the executed command, indicate an error value. This defaults to "1, 2".- Parameters:
errCodesStr- String
-
afterPropertiesSet
public void afterPropertiesSet()
Deprecated.Executes the check command, if present. Any errors will result in this component being rendered unusable within the transformer registry, but may still be called directly.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
isTransformable
public boolean isTransformable(java.lang.String sourceMimetype, java.lang.String targetMimetype, TransformationOptions options)Deprecated.If the initialization failed, then it returns 0.0. Otherwise the explicit transformations are checked for the reliability.- Specified by:
isTransformablein interfaceContentTransformerWorker- Returns:
- Returns 1.0 if initialization succeeded, otherwise 0.0.
- See Also:
AbstractContentTransformer.setExplicitTransformations(List)
-
getComments
public java.lang.String getComments(boolean available)
Deprecated.Description copied from class:ContentTransformerHelperOverridden to supply a comment or String of commented out transformation properties that specify any (hard coded or implied) supported transformations. Used when providing a list of properties to an administrators who may be setting other transformation properties, via JMX. Consider overriding if {linkAbstractContentTransformerLimits.isTransformableMimetype(String, String, TransformationOptions)orContentTransformerWorker.isTransformable(String, String, TransformationOptions)have been overridden. SeeContentTransformerHelper.getCommentsOnlySupports(List, List, boolean)which may be used to help construct a comment.- Specified by:
getCommentsin interfaceContentTransformerWorker- Overrides:
getCommentsin classContentTransformerHelper- Parameters:
available- indicates if the transformer has been registered and is available to be selected.falseindicates that the transformer is only available as a component of a complex transformer.- Returns:
- one line per property. The simple transformer name is returned by default as a comment.
- See Also:
ContentTransformer.getComments(boolean)
-
isAvailable
public boolean isAvailable()
Deprecated.Signals whether this transformer is available.- Specified by:
isAvailablein interfaceContentTransformerWorker- Returns:
- true, if is available
-
getVersionString
public java.lang.String getVersionString()
Deprecated.Gets the version string captured from the check command.- Specified by:
getVersionStringin interfaceContentTransformerWorker- Returns:
- the version string
-
transform
public final void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, TransformationOptions options) throws java.lang.ExceptionDeprecated.Converts the source and target content to temporary files with the correct extensions for the mimetype that they map to.- Specified by:
transformin interfaceContentTransformerWorker- Throws:
java.lang.Exception- See Also:
ContentTransformer.transform(ContentReader, ContentWriter, TransformationOptions)
-
-