public class DefaultMediaConversionService extends java.lang.Object implements MediaConversionService
MediaConversionService implementation.| Constructor and Description |
|---|
DefaultMediaConversionService() |
public void afterPropertiesSet()
org.springframework.beans.factory.InitializingBean#afterPropertiesSet()public int deleteConvertedMedias(MediaContainerModel container)
MediaContainerModel.deleteConvertedMedias in interface MediaConversionServicecontainer - the MediaContainerModel to clean upMediaConversionService.deleteConvertedMedias(MediaContainerModel)public java.util.Collection<MediaModel> getConvertedMedias(MediaContainerModel container)
MediaContainerModel, i.e. all medias within this container
which have a parent and a format set.getConvertedMedias in interface MediaConversionServicecontainer - the MediaContainerModel in question.MediaContainerModel.MediaConversionService.getConvertedMedias(MediaContainerModel)protected java.util.Collection<MediaModel> selectDerivedMedias(MediaContainerModel container)
MediaContainerModel. This method is just used if the
container is not persisted yet, otherwise a query on the database if used.container - the container to determine the derived medias forMediaConversionService.getConvertedMedias(MediaContainerModel)public void convertMedias(MediaContainerModel container)
MediaContainerModel's master media to all formats which are currently not present in the
given MediaContainerModel.convertMedias in interface MediaConversionServicecontainer - the MediaContainerModel to 'fill up'.MediaConversionService.convertMedias(MediaContainerModel)public java.util.Collection<ConversionMediaFormatModel> getAllConversionFormats()
ConversionMediaFormatModel from database.getAllConversionFormats in interface MediaConversionServiceConversionMediaFormatModels.MediaConversionService.getAllConversionFormats()public ConversionStatus getConversionStatus(MediaContainerModel model)
ConversionStatus for the given MediaContainerModel. The conversion status is
ConversionStatus.EMPTY, if the container has no master, orConversionStatus.UNCONVERTED, if there are none of the target formats available,ConversionStatus.PARTIALLY_CONVERTED, if there are some of the target formats available, orConversionStatus.CONVERTED, if all of the target formats are available.supportedFormat of the assigned ConversionGroupModel orConversionMediaFormatModel instances in the system, if no ConversionGroupModel is set on
the given MediaContainerModelgetConversionStatus in interface MediaConversionServicemodel - the MediaContainerModel to compute the conversion status forConversionStatus for the given MediaContainerModelMediaConversionService.getConversionStatus(MediaContainerModel)public MediaModel getMaster(MediaContainerModel model)
MediaModel of the given MediaContainerModel. The master media is
defined as the MediaModel within the MediaContainerModel which has no original and no original
data pk set (attributes MediaModel.ORIGINAL and MediaModel.ORIGINALDATAPK).getMaster in interface MediaConversionServicemodel - the MediaContainerModel in questionnull if no such media exists.MediaConversionService.getMaster(MediaContainerModel)protected MediaModel selectMasterFromUnsavedContainer(MediaContainerModel model)
MediaContainerModel. This method is just used if the
container is not persisted yet, otherwise a query on the database if used.model - the container to determine the master fornull if none could be determinedMediaConversionService.getMaster(MediaContainerModel)public MediaModel getOrConvert(MediaContainerModel container, MediaFormatModel format)
MediaConversionServiceMediaModel in the specified MediaFormatModel associated with the given
MediaContainerModel. If no such media exists the service will try to convert the media to that format
automatically (synchronous). The conversion will also be performed if the converted media is outdated, i.e. if the
binary data of the converted media's original is not the same anymore.getOrConvert in interface MediaConversionServicecontainer - the MediaContainerModel to search.format - the MediaFormatModel to retrieve.MediaModel of the given MediaContainerModel in the given MediaFormatModel.protected MediaModel getUpToDateMediaByFormat(MediaContainerModel container, MediaFormatModel format)
ModelNotFoundException - if the media does not exist or is not up to date.protected boolean isUpToDate(MediaModel ret)
ret - the media to checktrue if the given MediaModel is up to date and needs no conversionprotected MediaModel doConvert(MediaContainerModel container, ConversionMediaFormatModel format) throws MediaConversionException
MediaConversionExceptionprotected MediaConversionStrategy getMediaConversionStrategy(ConversionMediaFormatModel format) throws NoSuchBeanDefinitionException
NoSuchBeanDefinitionExceptionpublic MediaService getMediaService()
public void setMediaService(MediaService mediaService)
public ModelService getModelService()
public void setModelService(ModelService modelService)
public MediaConversionServiceDao getDao()
public void setDao(MediaConversionServiceDao dao)
public ApplicationContext getApplicationContext()
public void setApplicationContext(ApplicationContext applicationContext)
ApplicationContextAware#setApplicationContext(ApplicationContext)public LockRowInTransactionStrategy getLockRowInTransactionStrategy()
public void setLockRowInTransactionStrategy(LockRowInTransactionStrategy strategy)
public ConversionErrorLogStrategy getConversionErrorLogStrategy()
public void setConversionErrorLogStrategy(ConversionErrorLogStrategy whoToDoIt)
Copyright © 2018 SAP SE. All Rights Reserved.