Class DefaultMediaMetaDataService
java.lang.Object
de.hybris.platform.mediaconversion.metadata.DefaultMediaMetaDataService
- All Implemented Interfaces:
MediaMetaDataService,org.springframework.beans.factory.Aware,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationContextAware
public class DefaultMediaMetaDataService
extends Object
implements MediaMetaDataService, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
Default implementation of the
MediaMetaDataService. This implementation delegates metadata extraction to all
MediaMetaDataProvider instances registered in the Spring Application Context. It furthermore maintains the
MediaModel.METADATADATAPK flag whether meta data was extracted from the media or not.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidScans the application context for all registeredMediaMetaDataProviderto be used later on for extraction.voiddeleteAllMetaData(MediaModel media) Deletes allMediaMetaDataModelinstances associated with the givenmodel.voidextractAllMetaData(MediaModel media) Extracts the given medias metadata and stores it to database.getAllMetaData(MediaModel media) Fetches all (currently persisted) properties mapped by group.protected Collection<MediaMetaDataProvider>Accesses aMediaMetaDataProviderinstances to be used to extract meta data.org.springframework.context.ApplicationContextgetDao()getMetaData(MediaModel media, String group) Fetches all (currently persisted) meta data of one group.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidvoidsetModelService(ModelService modelService)
-
Constructor Details
-
DefaultMediaMetaDataService
public DefaultMediaMetaDataService()
-
-
Method Details
-
afterPropertiesSet
Scans the application context for all registeredMediaMetaDataProviderto be used later on for extraction.- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- See Also:
-
InitializingBean.afterPropertiesSet()
-
extractAllMetaData
Extracts the given medias metadata and stores it to database.The implementation should call all
MediaMetaDataProvider.extractMetaData(MediaModel)methods to do this.- Specified by:
extractAllMetaDatain interfaceMediaMetaDataService- Parameters:
media- The MediaModel for which the MetaData is to be extracted.- See Also:
-
getAllProviders
Accesses aMediaMetaDataProviderinstances to be used to extract meta data. The default implementation return aCollectionof beans queries from theApplicationContextafter bean initialization.- Returns:
- all
MediaMetaDataProviderinstances to be used for meta data extraction.
-
deleteAllMetaData
Deletes allMediaMetaDataModelinstances associated with the givenmodel.- Specified by:
deleteAllMetaDatain interfaceMediaMetaDataService- Parameters:
media- theMediaModelto delete the metadata from.- See Also:
-
getMetaData
Description copied from interface:MediaMetaDataServiceFetches all (currently persisted) meta data of one group.- Specified by:
getMetaDatain interfaceMediaMetaDataService- Returns:
- a
Mapof key value pairs.
-
getAllMetaData
Description copied from interface:MediaMetaDataServiceFetches all (currently persisted) properties mapped by group.- Specified by:
getAllMetaDatain interfaceMediaMetaDataService- Returns:
- a
Map(key = group name) ofMaps (key = code; value = value) of Metadata entries attached to the givenMediaModel
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext() -
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
getModelService
-
setModelService
-
getDao
-
setDao
-