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