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 public void deleteProductScreenshot(SCProductScreenshot productScreenshot)
031 throws PortalException, SystemException {
032
033
034
035 scProductScreenshotPersistence.remove(productScreenshot);
036
037
038
039 imageLocalService.deleteImage(productScreenshot.getThumbnailId());
040 imageLocalService.deleteImage(productScreenshot.getFullImageId());
041 }
042
043 public void deleteProductScreenshots(long productEntryId)
044 throws PortalException, SystemException {
045
046 List<SCProductScreenshot> productScreenshots =
047 scProductScreenshotPersistence.findByProductEntryId(productEntryId);
048
049 for (SCProductScreenshot productScreenshot : productScreenshots) {
050 deleteProductScreenshot(productScreenshot);
051 }
052 }
053
054 public SCProductScreenshot getProductScreenshot(
055 long productEntryId, int priority)
056 throws PortalException, SystemException {
057
058 return scProductScreenshotPersistence.findByP_P(
059 productEntryId, priority);
060 }
061
062 public SCProductScreenshot getProductScreenshotByFullImageId(
063 long fullImageId)
064 throws PortalException, SystemException {
065
066 return scProductScreenshotPersistence.findByFullImageId(fullImageId);
067 }
068
069 public SCProductScreenshot getProductScreenshotByThumbnailId(
070 long thumbnailId)
071 throws PortalException, SystemException {
072
073 return scProductScreenshotPersistence.findByThumbnailId(thumbnailId);
074 }
075
076 public List<SCProductScreenshot> getProductScreenshots(long productEntryId)
077 throws SystemException {
078
079 return scProductScreenshotPersistence.findByProductEntryId(
080 productEntryId);
081 }
082
083 }