public abstract class AbstractDocumentContentConverterService extends Object implements DocumentContentConverterService
This class is responsible for document content conversion (usually for *->pdf for preview and pdf download purposes) Service uses cache (memory and disk) to minimize unneeded conversions.
| Constructor and Description |
|---|
AbstractDocumentContentConverterService(ContentManager contentManager,
WorkObjectService workObjectService,
String cacheTempPath,
String tempFileNamePrefix,
List<DocumentContentConverter> contentConverters,
StatisticsAwareCache statisticsAwareCache) |
| Modifier and Type | Method and Description |
|---|---|
void |
evictCachedFile(String globalId)
Evict the cached file from the corresponding WorkObject.
|
Set<com.google.common.net.MediaType> |
getAcceptableMediaTypes()
Returns set of supported media types, which is converter able to convert
|
org.springframework.core.io.Resource |
getConvertedContent(String id)
Returns converted content for a given document work object.
|
ContentMetadata |
getConvertedContentMetadata(String id)
Returns converted
ContentMetadata for the given document work object reference |
Pair<ContentMetadata,org.springframework.core.io.Resource> |
getConvertedContentMetadataAndInputStream(String id)
Returns converted content for the given document identifier
|
ContentReference |
getConvertedContentReference(String id)
Returns converted
ContentReference for the given document work object reference |
boolean |
isConvertible(WorkObject workObject)
Is given workObject convertible by this service
|
void |
shutdown()
Clean up the cache and remove all temporary files
|
public AbstractDocumentContentConverterService(ContentManager contentManager, WorkObjectService workObjectService, String cacheTempPath, String tempFileNamePrefix, List<DocumentContentConverter> contentConverters, StatisticsAwareCache statisticsAwareCache)
contentManager - content manager to use for obtaining contentworkObjectService - generic workobject service for resolving workobjectscacheTempPath - directory in which temporary converted content is stored. If null or empty default path (${edoras-one.home}/temp) is used. Directory is always cleaned
up on the spring application context refresh.tempFileNamePrefix - file name prefix used for cached files (can be empty)contentConverters - converters to use for content conversionstatisticsAwareCache - One cache.public org.springframework.core.io.Resource getConvertedContent(String id)
DocumentContentConverterServiceReturns converted content for a given document work object.
getConvertedContent in interface DocumentContentConverterServiceid - the document identifierpublic Pair<ContentMetadata,org.springframework.core.io.Resource> getConvertedContentMetadataAndInputStream(String id)
DocumentContentConverterServiceReturns converted content for the given document identifier
getConvertedContentMetadataAndInputStream in interface DocumentContentConverterServiceid - document identifierContentMetadata and converted content InputStreampublic ContentReference getConvertedContentReference(String id)
DocumentContentConverterServiceReturns converted ContentReference for the given document work object reference
getConvertedContentReference in interface DocumentContentConverterServiceid - document identifierContentReferencepublic ContentMetadata getConvertedContentMetadata(String id)
DocumentContentConverterServiceReturns converted ContentMetadata for the given document work object reference
getConvertedContentMetadata in interface DocumentContentConverterServiceid - document identifierContentMetadatapublic boolean isConvertible(WorkObject workObject)
DocumentContentConverterServiceIs given workObject convertible by this service
isConvertible in interface DocumentContentConverterServiceworkObject - to convertpublic void shutdown()
Clean up the cache and remove all temporary files
shutdown in interface DocumentContentConverterServicepublic void evictCachedFile(String globalId)
Evict the cached file from the corresponding WorkObject.
evictCachedFile in interface DocumentContentConverterServiceglobalId - The global ID to evictpublic Set<com.google.common.net.MediaType> getAcceptableMediaTypes()
DocumentContentConverterServiceReturns set of supported media types, which is converter able to convert
getAcceptableMediaTypes in interface DocumentContentConverterServiceMediaTypeCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.