public class TransformerConfigImpl extends org.springframework.extensions.surf.util.AbstractLifecycleBean implements TransformerConfig
ALL_SUFFIXES, AMP, ANY, AVAILABLE, BLACKLIST, CONTENT, DEBUG_ENTRIES, DEFAULT_TRANSFORMER, EDITION, ENTRIES, ERROR_TIME, EXTENSIONS, FAILOVER, INITIAL_COUNT, INITIAL_TIME, LIMIT_PAIR_SUFFIXES, LIMIT_SUFFIXES, LOG_ENTRIES, MAX_PAGES, MAX_SOURCE_SIZE_K_BYTES, MIMETYPES, NO_SUFFIXES, PAGE_LIMIT, PIPE, PIPELINE, PREFIX, PRIORITY, PRIORITY_DEFAULT, PRIORITY_EXPLICIT, READ_LIMIT_K_BYTES, READ_LIMIT_TIME_MS, SEPARATORS, STRICT_MIMETYPE_CHECK_WHITELIST_MIMETYPES, SUMMARY_TRANSFORMER_NAME, SUPPORTED, THRESHOLD_COUNT, TIMEOUT_MS, TRANSFORMER, USE
Constructor and Description |
---|
TransformerConfigImpl() |
Modifier and Type | Method and Description |
---|---|
List<org.alfresco.service.cmr.repository.NodeRef> |
getBlacklist(ContentTransformer transformer,
String sourceMimetype,
String targetMimetype)
Returns a list of blacklisted NodeRefs of the specified transformer for the the combination of source and target mimetype.
|
TransformationOptionLimits |
getLimits(ContentTransformer transformer,
String sourceMimetype,
String targetMimetype,
String use)
Returns the limits defined for the combination of transformer, sourceMimetype and targetMimetype.
|
int |
getPriority(ContentTransformer transformer,
String sourceMimetype,
String targetMimetype)
Returns the priority of the specified transformer for the the combination of source and target mimetype.
|
String |
getProperties(boolean changesOnly)
Returns a sorted set of all transformer properties, their values and includes
comments about the properties.
|
String |
getProperty(String name)
Returns a transformer property value.
|
TransformerStatistics |
getStatistics(ContentTransformer transformer,
String sourceMimetype,
String targetMimetype,
boolean createNew)
Returns and creates if needed the
TransformerStatistics object for the combination of
transformer, sourceMimetype and targetMimetype. |
int |
getThresholdCount(ContentTransformer transformer,
String sourceMimetype,
String targetMimetype)
Returns the threshold of the transformer.
|
void |
initialise()
Called by spring after bean is initialised.
|
boolean |
isSupportedTransformation(ContentTransformer transformer,
String sourceMimetype,
String targetMimetype,
TransformationOptions options)
Returns true if the supplied mimetype transformation pair is allowed by the list of supported
and unsupported transformations.
|
protected void |
onBootstrap(org.springframework.context.ApplicationEvent event) |
protected void |
onShutdown(org.springframework.context.ApplicationEvent event) |
int |
removeProperties(String propertyNames)
Removes transformer properties.
|
void |
setContentService(ContentService contentService) |
void |
setContentTransformerRegistry(ContentTransformerRegistry transformerRegistry) |
void |
setDescriptorService(DescriptorService descriptorService) |
void |
setGlobalProperties(Properties globalProperties) |
void |
setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
Sets of the mimetype service.
|
void |
setModuleService(ModuleService moduleService) |
int |
setProperties(String propertyNamesAndValues)
Sets a transformer property values.
|
void |
setTransformerDebug(TransformerDebug transformerDebug) |
void |
setTransformerDebugLog(TransformerDebugLog transformerDebugLog) |
void |
setTransformerLog(TransformerLog transformerLog) |
boolean |
strictMimetypeCheck(String declaredMimetype,
String detectedMimetype)
When strict mimetype checking is performed before a transformation, this method is called.
|
public void setMimetypeService(org.alfresco.service.cmr.repository.MimetypeService mimetypeService)
mimetypeService
- public void setContentService(ContentService contentService)
public void setContentTransformerRegistry(ContentTransformerRegistry transformerRegistry)
public void setTransformerDebug(TransformerDebug transformerDebug)
public void setTransformerLog(TransformerLog transformerLog)
public void setTransformerDebugLog(TransformerDebugLog transformerDebugLog)
public void setGlobalProperties(Properties globalProperties)
public void setModuleService(ModuleService moduleService)
public void setDescriptorService(DescriptorService descriptorService)
public void initialise()
protected void onBootstrap(org.springframework.context.ApplicationEvent event)
onBootstrap
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
protected void onShutdown(org.springframework.context.ApplicationEvent event)
onShutdown
in class org.springframework.extensions.surf.util.AbstractLifecycleBean
public String getProperty(String name)
getProperty
in interface TransformerConfig
name
- of the property.null
if not set.public String getProperties(boolean changesOnly)
TransformerConfig
getProperties
in interface TransformerConfig
changesOnly
- only custom values will be included.public int setProperties(String propertyNamesAndValues)
setProperties
in interface TransformerConfig
propertyNamesAndValues
- new line separated name and valuespublic int removeProperties(String propertyNames)
TransformerConfig
removeProperties
in interface TransformerConfig
propertyNames
- new line separated names. Any values will be ignored.public TransformerStatistics getStatistics(ContentTransformer transformer, String sourceMimetype, String targetMimetype, boolean createNew)
TransformerStatistics
object for the combination of
transformer, sourceMimetype and targetMimetype. When transformer is null this is the
system wide summary object for a combination of sourceMimetype and targetMimetype.
When both sourceMimetype and targetMimetype are null this is the transformer's summary
object. When all three parameters are null this is the system wide summary for all
transformers.getStatistics
in interface TransformerConfig
transformer
- the transformer for which data is being recorded.sourceMimetype
- the source mimetype.targetMimetype
- the source mimetype.createNew
- indicates if a new object should be created if it does not exist.TransformerStatistics
.public TransformationOptionLimits getLimits(ContentTransformer transformer, String sourceMimetype, String targetMimetype, String use)
getLimits
in interface TransformerConfig
use
- to which the limits will be put. For example "index", "webpreview", "doclib", "syncRule",
"aysncRule". null
is the default.public boolean isSupportedTransformation(ContentTransformer transformer, String sourceMimetype, String targetMimetype, TransformationOptions options)
isSupportedTransformation
in interface TransformerConfig
options
- not currently usedpublic int getPriority(ContentTransformer transformer, String sourceMimetype, String targetMimetype)
getPriority
in interface TransformerConfig
TransformerConfig.PRIORITY_EXPLICIT
(50). By default transformers have a default of 100.public List<org.alfresco.service.cmr.repository.NodeRef> getBlacklist(ContentTransformer transformer, String sourceMimetype, String targetMimetype)
getBlacklist
in interface TransformerConfig
public boolean strictMimetypeCheck(String declaredMimetype, String detectedMimetype)
strictMimetypeCheck
in interface TransformerConfig
declaredMimetype
- the mimetype on the source nodedetectedMimetype
- returned by Tika having looked at the content.public int getThresholdCount(ContentTransformer transformer, String sourceMimetype, String targetMimetype)
getThresholdCount
in interface TransformerConfig
Copyright © 2005–2017 Alfresco Software. All rights reserved.