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,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 of
MediaContainerService- See Also:
-
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, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMediaToContainer(MediaContainerModel mediaContainerModel, List<MediaModel> mediaModels) Adds the medias to the given container.protected MediaContainerDaoDeprecated, for removal: This API element is subject to removal in a future version.since 4.4getMediaContainerForQualifier(String qualifier) Gets the media container for qualifier.getMediaContextForQualifier(String qualifier) Gets the media context for the specified qualifier.getMediaForFormat(MediaContainerModel mediaContainerModel, MediaFormatModel mediaFormatModel) Gets the media for the given format from the given container.getMediaFormatForSourceFormat(MediaContextModel contextModel, MediaFormatModel sourceFormatModel) Gets the media format for source format from the given media context.voidremoveMediaFromContainer(MediaContainerModel mediaContainerModel, List<MediaModel> mediaModels) Removes the medias from given container.voidsetMediaContainerDao(MediaContainerDao mediaContainerDao) voidsetMediaService(MediaService mediaService) Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultMediaContainerService
public DefaultMediaContainerService()
-
-
Method Details
-
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:
getMediaForFormatin 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:
-
addMediaToContainer
public void addMediaToContainer(MediaContainerModel mediaContainerModel, 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:
addMediaToContainerin 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 specifiedIllegalArgumentExceptionwill be thrown
-
removeMediaFromContainer
public void removeMediaFromContainer(MediaContainerModel mediaContainerModel, List<MediaModel> mediaModels) Removes the medias from given container.- Specified by:
removeMediaFromContainerin 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:
getMediaFormatForSourceFormatin 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
Gets the media context for the specified qualifier.- Specified by:
getMediaContextForQualifierin interfaceMediaContainerService- Parameters:
qualifier- the qualifier- Returns:
- the media context for qualifier
-
getMediaContainerForQualifier
Gets the media container for qualifier.- Specified by:
getMediaContainerForQualifierin interfaceMediaContainerService- Parameters:
qualifier- the qualifier- Returns:
- the media container for qualifier
-
getMediaContainerDao
Deprecated, for removal: This API element is subject to removal in a future version.since 4.4 -
setMediaContainerDao
-
getMediaService
- Returns:
- the mediaService
-
setMediaService
- Parameters:
mediaService- the mediaService to set
-