1
22
23 package com.liferay.portlet.softwarecatalog.service.impl;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portlet.softwarecatalog.model.SCProductScreenshot;
28 import com.liferay.portlet.softwarecatalog.service.base.SCProductScreenshotLocalServiceBaseImpl;
29
30 import java.util.List;
31
32
38 public class SCProductScreenshotLocalServiceImpl
39 extends SCProductScreenshotLocalServiceBaseImpl {
40
41 public void deleteProductScreenshot(SCProductScreenshot productScreenshot)
42 throws PortalException, SystemException {
43
44 imageLocalService.deleteImage(productScreenshot.getThumbnailId());
45 imageLocalService.deleteImage(productScreenshot.getFullImageId());
46
47 scProductScreenshotPersistence.remove(productScreenshot);
48 }
49
50 public void deleteProductScreenshots(long productEntryId)
51 throws PortalException, SystemException {
52
53 List<SCProductScreenshot> productScreenshots =
54 scProductScreenshotPersistence.findByProductEntryId(productEntryId);
55
56 for (SCProductScreenshot productScreenshot : productScreenshots) {
57 deleteProductScreenshot(productScreenshot);
58 }
59 }
60
61 public SCProductScreenshot getProductScreenshot(
62 long productEntryId, int priority)
63 throws PortalException, SystemException {
64
65 return scProductScreenshotPersistence.findByP_P(
66 productEntryId, priority);
67 }
68
69 public List<SCProductScreenshot> getProductScreenshots(long productEntryId)
70 throws SystemException {
71
72 return scProductScreenshotPersistence.findByProductEntryId(
73 productEntryId);
74 }
75
76 public SCProductScreenshot getProductScreenshotByFullImageId(
77 long fullImageId)
78 throws PortalException, SystemException {
79
80 return scProductScreenshotPersistence.findByFullImageId(fullImageId);
81 }
82
83 public SCProductScreenshot getProductScreenshotByThumbnailId(
84 long thumbnailId)
85 throws PortalException, SystemException {
86
87 return scProductScreenshotPersistence.findByThumbnailId(thumbnailId);
88 }
89
90 }