Class LocalTransformServiceRegistry
- java.lang.Object
-
- org.alfresco.transform.client.model.config.TransformServiceRegistryImpl
-
- org.alfresco.repo.content.transform.LocalTransformServiceRegistry
-
- All Implemented Interfaces:
TransformServiceRegistry,org.springframework.beans.factory.InitializingBean
public class LocalTransformServiceRegistry extends TransformServiceRegistryImpl implements org.springframework.beans.factory.InitializingBean
ImplementsTransformServiceRegistryproviding a mechanism of validating if a local transformation (based onLocalTransformrequest is supported. It also extends this interface to provide atransform(org.alfresco.service.cmr.repository.ContentReader, org.alfresco.service.cmr.repository.ContentWriter, java.util.Map<java.lang.String, java.lang.String>, java.lang.String, org.alfresco.service.cmr.repository.NodeRef)method.- Author:
- adavis
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.alfresco.transform.client.model.config.TransformServiceRegistryImpl
TransformServiceRegistryImpl.Data, TransformServiceRegistryImpl.TransformServiceRegistryJob
-
-
Field Summary
-
Fields inherited from class org.alfresco.transform.client.model.config.TransformServiceRegistryImpl
data, enabled
-
-
Constructor Summary
Constructors Constructor Description LocalTransformServiceRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected TransformServiceRegistryImpl.DatacreateData()protected StringgetBaseUrlIfTesting(String name, String baseUrl)LocalTransformgetLocalTransform(Map<String,String> actualOptions, String renditionName, String sourceMimetype, String targetMimetype, long sourceSizeInBytes)protected org.apache.commons.logging.LoggetLog()longgetMaxSize(String sourceMimetype, String targetMimetype, Map<String,String> options, String renditionName)Returns the maximun size (in bytes) of the source content that can be transformed.org.alfresco.service.cmr.repository.MimetypeServicegetMimetypeService()StringgetPipelineConfigDir()protected StringgetProperty(String name, String defaultValue)Gets a property from an alfresco global property but falls back to a System property with the same name to allow dynamic creation of transformers without having to have an AMP to add the alfresco global property.protected TransformServiceRegistryImpl.DatareadConfig()protected voidregister(TransformServiceRegistryImpl.Data data, Transformer transformer, String baseUrl, String readFrom)voidsetMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)voidsetPipelineConfigDir(String pipelineConfigDir)voidsetProperties(Properties properties)The Alfresco global properties.voidsetRetryTransformOnDifferentMimeType(boolean retryTransformOnDifferentMimeType)voidsetStrictMimeTypeCheck(boolean strictMimeTypeCheck)voidsetTransformerDebug(TransformerDebug transformerDebug)voidtransform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, Map<String,String> actualOptions, String renditionName, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef)-
Methods inherited from class org.alfresco.transform.client.model.config.TransformServiceRegistryImpl
getCounts, getCronExpression, getData, getFirstTime, getInitialAndOnErrorCronExpression, getScheduler, getTransformerName, isSupported, readConfigAndReplace, register, setCronExpression, setEnabled, setFirstTime, setInitialAndOnErrorCronExpression, setJsonObjectMapper, setScheduler, setSuccessReadingRemoteConfig
-
-
-
-
Method Detail
-
setPipelineConfigDir
public void setPipelineConfigDir(String pipelineConfigDir)
-
getPipelineConfigDir
public String getPipelineConfigDir()
-
setProperties
public void setProperties(Properties properties)
The Alfresco global properties.
-
setMimetypeService
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
-
getMimetypeService
public org.alfresco.service.cmr.repository.MimetypeService getMimetypeService()
-
setTransformerDebug
public void setTransformerDebug(TransformerDebug transformerDebug)
-
setStrictMimeTypeCheck
public void setStrictMimeTypeCheck(boolean strictMimeTypeCheck)
-
setRetryTransformOnDifferentMimeType
public void setRetryTransformOnDifferentMimeType(boolean retryTransformOnDifferentMimeType)
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classTransformServiceRegistryImpl- Throws:
Exception
-
readConfig
protected TransformServiceRegistryImpl.Data readConfig() throws IOException
- Specified by:
readConfigin classTransformServiceRegistryImpl- Throws:
IOException
-
createData
protected TransformServiceRegistryImpl.Data createData()
- Overrides:
createDatain classTransformServiceRegistryImpl
-
register
protected void register(TransformServiceRegistryImpl.Data data, Transformer transformer, String baseUrl, String readFrom)
- Overrides:
registerin classTransformServiceRegistryImpl
-
getLog
protected org.apache.commons.logging.Log getLog()
- Specified by:
getLogin classTransformServiceRegistryImpl
-
getProperty
protected String getProperty(String name, String defaultValue)
Gets a property from an alfresco global property but falls back to a System property with the same name to allow dynamic creation of transformers without having to have an AMP to add the alfresco global property.
-
getMaxSize
public long getMaxSize(String sourceMimetype, String targetMimetype, Map<String,String> options, String renditionName)
Description copied from interface:TransformServiceRegistryReturns the maximun size (in bytes) of the source content that can be transformed.- Specified by:
getMaxSizein interfaceTransformServiceRegistry- Overrides:
getMaxSizein classTransformServiceRegistryImpl- Parameters:
sourceMimetype- the mimetype of the source contenttargetMimetype- the mimetype of the targetoptions- the actual name value pairs available that could be passed to the Transform Service.renditionName- (optional) name for the set of options and target mimetype. If supplied is used to cache results to avoid having to work out if a given transformation is supported a second time. The sourceMimetype and sourceSizeInBytes may still change. In the case of ACS this is the rendition name.- Returns:
- the maximum size (in bytes) of the source content that can be transformed. If
-1there is no limit, but if0the transform is not supported.
-
transform
public void transform(org.alfresco.service.cmr.repository.ContentReader reader, org.alfresco.service.cmr.repository.ContentWriter writer, Map<String,String> actualOptions, String renditionName, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef) throws Exception- Throws:
Exception
-
-