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