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