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