public class DefaultProductImageMediaService extends java.lang.Object implements ProductImageMediaService
ProductImageMediaService interface.| Constructor and Description |
|---|
DefaultProductImageMediaService() |
| Modifier and Type | Method and Description |
|---|---|
void |
attachContainerToProductModel(java.util.Collection<MediaContainerModel> container,
ProductModel currentProduct)
Attach a given container to a product
|
MediaModel |
getGalleryImage(MediaContainerModel container)
Retrieve a gallery image from a given media container
|
protected ImageResizePlugin |
getImageResizePlugin() |
protected MediaModel |
getImageWithProperFormatIfPossible(MediaModel model) |
MediaModel |
getMainImage(MediaContainerModel container)
Retrieve a main image from a given media container
|
MediaModel |
getMediaForFormat(MediaContainerModel container,
java.lang.String format)
Find a media within a given container which has a given media format
|
MediaService |
getMediaService()
Getter
|
ModelService |
getModelService()
Getter
|
SynchronizationServiceImpl |
getSynchronizationService()
Getter
|
boolean |
isResizePluginIncluded()
Determine if a resize plugin is included
|
boolean |
isSynchronizationNeeded(ProductModel currentProduct)
Determine if a given product needs to be synchronized
|
protected java.util.List<TypedObject> |
prepareItemsToSynchronize(ProductModel currentProduct,
java.util.Collection<MediaModel> medias) |
void |
removeGalleryContainer(ProductModel currentProduct,
MediaModel media)
Remove gallery container for a given product
|
void |
removeMediaFromGalleryImages(ProductModel currentProduct,
MediaModel media)
Remove a media from a given product's images gallery
|
void |
setBestMediaToMainPicture(MediaModel model,
ProductModel currentProduct)
Set the best media to the main picture to a given product
|
MediaModel |
setImageWithFormat(byte[] bytes,
ProductModel currentProduct,
java.lang.String format,
MediaContainerModel tempContainer)
Set an image with a given format
|
void |
setMediaService(MediaService mediaService)
Setter
|
void |
setModelService(ModelService modelService)
Setter
|
void |
setSynchronizationService(SynchronizationServiceImpl synchronizationService)
Setter
|
void |
switchProductImageContainer(MediaContainerModel toRemove,
MediaContainerModel toAdd,
ProductModel currentProduct)
Update the media container for a given product
|
void |
synchronize(ProductModel currentProduct,
java.util.Collection<MediaModel> medias)
Synchronize a collection of media for a given product
|
MediaContainerModel |
updateMediaContainerModels(MediaModel uploadedMediaModel,
ProductModel currentProduct,
java.lang.String siteUid,
java.util.List<MediaContainerModel> tempContainers)
Update media containers
|
MediaModel |
updateMediaModels(byte[] bytes,
ProductModel currentProduct)
Update media for the given product
|
public MediaModel updateMediaModels(byte[] bytes, ProductModel currentProduct)
ProductImageMediaServiceupdateMediaModels in interface ProductImageMediaServicepublic MediaContainerModel updateMediaContainerModels(MediaModel uploadedMediaModel, ProductModel currentProduct, java.lang.String siteUid, java.util.List<MediaContainerModel> tempContainers)
ProductImageMediaServiceupdateMediaContainerModels in interface ProductImageMediaServicepublic void attachContainerToProductModel(java.util.Collection<MediaContainerModel> container, ProductModel currentProduct)
ProductImageMediaServiceattachContainerToProductModel in interface ProductImageMediaServicepublic void switchProductImageContainer(MediaContainerModel toRemove, MediaContainerModel toAdd, ProductModel currentProduct)
ProductImageMediaServiceswitchProductImageContainer in interface ProductImageMediaServicetoRemove - source media container which the product should be removed fromtoAdd - target media container which the product should be added topublic MediaModel setImageWithFormat(byte[] bytes, ProductModel currentProduct, java.lang.String format, MediaContainerModel tempContainer)
ProductImageMediaServicesetImageWithFormat in interface ProductImageMediaServicepublic boolean isSynchronizationNeeded(ProductModel currentProduct)
ProductImageMediaServiceisSynchronizationNeeded in interface ProductImageMediaServicepublic MediaModel getMediaForFormat(MediaContainerModel container, java.lang.String format)
container - format - public MediaModel getGalleryImage(MediaContainerModel container)
ProductImageMediaServicegetGalleryImage in interface ProductImageMediaServicepublic MediaModel getMainImage(MediaContainerModel container)
ProductImageMediaServicegetMainImage in interface ProductImageMediaServiceprotected MediaModel getImageWithProperFormatIfPossible(MediaModel model)
public void setBestMediaToMainPicture(MediaModel model, ProductModel currentProduct)
ProductImageMediaServicesetBestMediaToMainPicture in interface ProductImageMediaServicepublic void synchronize(ProductModel currentProduct, java.util.Collection<MediaModel> medias)
ProductImageMediaServicesynchronize in interface ProductImageMediaServiceprotected java.util.List<TypedObject> prepareItemsToSynchronize(ProductModel currentProduct, java.util.Collection<MediaModel> medias)
public void removeMediaFromGalleryImages(ProductModel currentProduct, MediaModel media)
ProductImageMediaServiceremoveMediaFromGalleryImages in interface ProductImageMediaServicepublic void removeGalleryContainer(ProductModel currentProduct, MediaModel media)
ProductImageMediaServiceremoveGalleryContainer in interface ProductImageMediaServicepublic SynchronizationServiceImpl getSynchronizationService()
ProductImageMediaServicegetSynchronizationService in interface ProductImageMediaServicepublic void setSynchronizationService(SynchronizationServiceImpl synchronizationService)
ProductImageMediaServicesetSynchronizationService in interface ProductImageMediaServicepublic ModelService getModelService()
ProductImageMediaServicegetModelService in interface ProductImageMediaServicepublic void setModelService(ModelService modelService)
ProductImageMediaServicesetModelService in interface ProductImageMediaServicepublic MediaService getMediaService()
ProductImageMediaServicegetMediaService in interface ProductImageMediaServicepublic void setMediaService(MediaService mediaService)
ProductImageMediaServicesetMediaService in interface ProductImageMediaServiceprotected ImageResizePlugin getImageResizePlugin()
public boolean isResizePluginIncluded()
ProductImageMediaServiceisResizePluginIncluded in interface ProductImageMediaServiceCopyright © 2018 SAP SE. All Rights Reserved.