001
014
015 package com.liferay.portlet.softwarecatalog.service.impl;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
019 import com.liferay.portlet.softwarecatalog.service.base.SCProductScreenshotLocalServiceBaseImpl;
020
021 import java.util.List;
022
023
026 public class SCProductScreenshotLocalServiceImpl
027 extends SCProductScreenshotLocalServiceBaseImpl {
028
029 @Override
030 public void deleteProductScreenshot(SCProductScreenshot productScreenshot)
031 throws PortalException {
032
033
034
035 scProductScreenshotPersistence.remove(productScreenshot);
036
037
038
039 imageLocalService.deleteImage(productScreenshot.getThumbnailId());
040 imageLocalService.deleteImage(productScreenshot.getFullImageId());
041 }
042
043 @Override
044 public void deleteProductScreenshots(long productEntryId)
045 throws PortalException {
046
047 List<SCProductScreenshot> productScreenshots =
048 scProductScreenshotPersistence.findByProductEntryId(productEntryId);
049
050 for (SCProductScreenshot productScreenshot : productScreenshots) {
051 deleteProductScreenshot(productScreenshot);
052 }
053 }
054
055 @Override
056 public SCProductScreenshot getProductScreenshot(
057 long productEntryId, int priority)
058 throws PortalException {
059
060 return scProductScreenshotPersistence.findByP_P(
061 productEntryId, priority);
062 }
063
064 @Override
065 public SCProductScreenshot getProductScreenshotByFullImageId(
066 long fullImageId)
067 throws PortalException {
068
069 return scProductScreenshotPersistence.findByFullImageId(fullImageId);
070 }
071
072 @Override
073 public SCProductScreenshot getProductScreenshotByThumbnailId(
074 long thumbnailId)
075 throws PortalException {
076
077 return scProductScreenshotPersistence.findByThumbnailId(thumbnailId);
078 }
079
080 @Override
081 public List<SCProductScreenshot> getProductScreenshots(
082 long productEntryId) {
083
084 return scProductScreenshotPersistence.findByProductEntryId(
085 productEntryId);
086 }
087
088 }