Class DefaultMediaContainerService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.servicelayer.media.impl.DefaultMediaContainerService
-
- All Implemented Interfaces:
MediaContainerService
,java.io.Serializable
,org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanNameAware
,org.springframework.beans.factory.InitializingBean
public class DefaultMediaContainerService extends AbstractBusinessService implements MediaContainerService
Default implementation ofMediaContainerService
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultMediaContainerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addMediaToContainer(MediaContainerModel mediaContainerModel, java.util.List<MediaModel> mediaModels)
Adds the medias to the given container.protected MediaContainerDao
getMediaContainerDao()
Deprecated.since 4.4MediaContainerModel
getMediaContainerForQualifier(java.lang.String qualifier)
Gets the media container for qualifier.MediaContextModel
getMediaContextForQualifier(java.lang.String qualifier)
Gets the media context for the specified qualifier.MediaModel
getMediaForFormat(MediaContainerModel mediaContainerModel, MediaFormatModel mediaFormatModel)
Gets the media for the given format from the given container.MediaFormatModel
getMediaFormatForSourceFormat(MediaContextModel contextModel, MediaFormatModel sourceFormatModel)
Gets the media format for source format from the given media context.MediaService
getMediaService()
void
removeMediaFromContainer(MediaContainerModel mediaContainerModel, java.util.List<MediaModel> mediaModels)
Removes the medias from given container.void
setMediaContainerDao(MediaContainerDao mediaContainerDao)
void
setMediaService(MediaService mediaService)
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
getMediaForFormat
public MediaModel getMediaForFormat(MediaContainerModel mediaContainerModel, MediaFormatModel mediaFormatModel)
Gets the media for the given format from the given container. Returns null if the container does not contain given format.- Specified by:
getMediaForFormat
in interfaceMediaContainerService
- Parameters:
mediaContainerModel
- the media container object to look given formatmediaFormatModel
- the media format that we are looking for in the container- Returns:
- the media for the specified format or null if no media in given format found
- See Also:
MediaService.getMediaByFormat(MediaContainerModel, MediaFormatModel)
-
addMediaToContainer
public void addMediaToContainer(MediaContainerModel mediaContainerModel, java.util.List<MediaModel> mediaModels)
Adds the medias to the given container. If the media with the same format already exists in the container the existent media will be replaced.- Specified by:
addMediaToContainer
in interfaceMediaContainerService
- Parameters:
mediaContainerModel
- the media container object that we will add media tomediaModels
- the media list that will be added to the container. If media has no format specifiedIllegalArgumentException
will be thrown
-
removeMediaFromContainer
public void removeMediaFromContainer(MediaContainerModel mediaContainerModel, java.util.List<MediaModel> mediaModels)
Removes the medias from given container.- Specified by:
removeMediaFromContainer
in interfaceMediaContainerService
- Parameters:
mediaContainerModel
- the media containermediaModels
- the medias that will be removed from the container
-
getMediaFormatForSourceFormat
public MediaFormatModel getMediaFormatForSourceFormat(MediaContextModel contextModel, MediaFormatModel sourceFormatModel)
Gets the media format for source format from the given media context. Returns null if the required source media format does not exist in the context.- Specified by:
getMediaFormatForSourceFormat
in interfaceMediaContainerService
- Parameters:
contextModel
- the context model that should contain target media format we are looking forsourceFormatModel
- the source format model that we are looking for target- Returns:
- the media format for source format or null if the specified source format has no target mapping assigned
-
getMediaContextForQualifier
public MediaContextModel getMediaContextForQualifier(java.lang.String qualifier)
Gets the media context for the specified qualifier.- Specified by:
getMediaContextForQualifier
in interfaceMediaContainerService
- Parameters:
qualifier
- the qualifier- Returns:
- the media context for qualifier
-
getMediaContainerForQualifier
public MediaContainerModel getMediaContainerForQualifier(java.lang.String qualifier)
Gets the media container for qualifier.- Specified by:
getMediaContainerForQualifier
in interfaceMediaContainerService
- Parameters:
qualifier
- the qualifier- Returns:
- the media container for qualifier
-
getMediaContainerDao
@Deprecated protected MediaContainerDao getMediaContainerDao()
Deprecated.since 4.4
-
setMediaContainerDao
public void setMediaContainerDao(MediaContainerDao mediaContainerDao)
-
getMediaService
public MediaService getMediaService()
- Returns:
- the mediaService
-
setMediaService
public void setMediaService(MediaService mediaService)
- Parameters:
mediaService
- the mediaService to set
-
-