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.portal.security.permission.ActionKeys;
28 import com.liferay.portal.service.permission.PortletPermissionUtil;
29 import com.liferay.portal.util.PortletKeys;
30 import com.liferay.portlet.softwarecatalog.model.SCProductEntry;
31 import com.liferay.portlet.softwarecatalog.service.base.SCProductEntryServiceBaseImpl;
32 import com.liferay.portlet.softwarecatalog.service.permission.SCProductEntryPermission;
33
34 import java.util.List;
35
36
43 public class SCProductEntryServiceImpl extends SCProductEntryServiceBaseImpl {
44
45 public SCProductEntry addProductEntry(
46 long plid, String name, String type, String tags,
47 String shortDescription, String longDescription, String pageURL,
48 String author, String repoGroupId, String repoArtifactId,
49 long[] licenseIds, List<byte[]> thumbnails, List<byte[]> fullImages,
50 boolean addCommunityPermissions, boolean addGuestPermissions)
51 throws PortalException, SystemException {
52
53 PortletPermissionUtil.check(
54 getPermissionChecker(), plid, PortletKeys.SOFTWARE_CATALOG,
55 ActionKeys.ADD_PRODUCT_ENTRY);
56
57 return scProductEntryLocalService.addProductEntry(
58 getUserId(), plid, name, type, tags, shortDescription,
59 longDescription, pageURL, author, repoGroupId, repoArtifactId,
60 licenseIds, thumbnails, fullImages, addCommunityPermissions,
61 addGuestPermissions);
62 }
63
64 public SCProductEntry addProductEntry(
65 long plid, String name, String type, String tags,
66 String shortDescription, String longDescription, String pageURL,
67 String author, String repoGroupId, String repoArtifactId,
68 long[] licenseIds, List<byte[]> thumbnails, List<byte[]> fullImages,
69 String[] communityPermissions, String[] guestPermissions)
70 throws PortalException, SystemException {
71
72 PortletPermissionUtil.check(
73 getPermissionChecker(), plid, PortletKeys.SOFTWARE_CATALOG,
74 ActionKeys.ADD_PRODUCT_ENTRY);
75
76 return scProductEntryLocalService.addProductEntry(
77 getUserId(), plid, name, type, tags, shortDescription,
78 longDescription, pageURL, author, repoGroupId, repoArtifactId,
79 licenseIds, thumbnails, fullImages, communityPermissions,
80 guestPermissions);
81 }
82
83 public void deleteProductEntry(long productEntryId)
84 throws PortalException, SystemException {
85
86 SCProductEntryPermission.check(
87 getPermissionChecker(), productEntryId, ActionKeys.DELETE);
88
89 scProductEntryLocalService.deleteProductEntry(productEntryId);
90 }
91
92 public SCProductEntry getProductEntry(long productEntryId)
93 throws PortalException, SystemException {
94
95 SCProductEntryPermission.check(
96 getPermissionChecker(), productEntryId, ActionKeys.VIEW);
97
98 return scProductEntryLocalService.getProductEntry(productEntryId);
99 }
100
101 public SCProductEntry updateProductEntry(
102 long productEntryId, String name, String type, String tags,
103 String shortDescription, String longDescription, String pageURL,
104 String author, String repoGroupId, String repoArtifactId,
105 long[] licenseIds, List<byte[]> thumbnails, List<byte[]> fullImages)
106 throws PortalException, SystemException {
107
108 SCProductEntryPermission.check(
109 getPermissionChecker(), productEntryId, ActionKeys.UPDATE);
110
111 return scProductEntryLocalService.updateProductEntry(
112 productEntryId, name, type, tags, shortDescription, longDescription,
113 pageURL, author, repoGroupId, repoArtifactId, licenseIds,
114 thumbnails, fullImages);
115 }
116
117 }