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.portal.security.permission.ActionKeys;
20 import com.liferay.portal.service.ServiceContext;
21 import com.liferay.portlet.softwarecatalog.model.SCProductEntry;
22 import com.liferay.portlet.softwarecatalog.service.base.SCProductEntryServiceBaseImpl;
23 import com.liferay.portlet.softwarecatalog.service.permission.SCPermission;
24 import com.liferay.portlet.softwarecatalog.service.permission.SCProductEntryPermission;
25
26 import java.util.List;
27
28
34 public class SCProductEntryServiceImpl extends SCProductEntryServiceBaseImpl {
35
36 public SCProductEntry addProductEntry(
37 String name, String type, String tags, String shortDescription,
38 String longDescription, String pageURL, String author,
39 String repoGroupId, String repoArtifactId, long[] licenseIds,
40 List<byte[]> thumbnails, List<byte[]> fullImages,
41 ServiceContext serviceContext)
42 throws PortalException, SystemException {
43
44 SCPermission.check(
45 getPermissionChecker(), serviceContext.getScopeGroupId(),
46 ActionKeys.ADD_PRODUCT_ENTRY);
47
48 return scProductEntryLocalService.addProductEntry(
49 getUserId(), name, type, tags, shortDescription,
50 longDescription, pageURL, author, repoGroupId, repoArtifactId,
51 licenseIds, thumbnails, fullImages, serviceContext);
52 }
53
54 public void deleteProductEntry(long productEntryId)
55 throws PortalException, SystemException {
56
57 SCProductEntryPermission.check(
58 getPermissionChecker(), productEntryId, ActionKeys.DELETE);
59
60 scProductEntryLocalService.deleteProductEntry(productEntryId);
61 }
62
63 public SCProductEntry getProductEntry(long productEntryId)
64 throws PortalException, SystemException {
65
66 SCProductEntryPermission.check(
67 getPermissionChecker(), productEntryId, ActionKeys.VIEW);
68
69 return scProductEntryLocalService.getProductEntry(productEntryId);
70 }
71
72 public SCProductEntry updateProductEntry(
73 long productEntryId, String name, String type, String tags,
74 String shortDescription, String longDescription, String pageURL,
75 String author, String repoGroupId, String repoArtifactId,
76 long[] licenseIds, List<byte[]> thumbnails, List<byte[]> fullImages)
77 throws PortalException, SystemException {
78
79 SCProductEntryPermission.check(
80 getPermissionChecker(), productEntryId, ActionKeys.UPDATE);
81
82 return scProductEntryLocalService.updateProductEntry(
83 productEntryId, name, type, tags, shortDescription, longDescription,
84 pageURL, author, repoGroupId, repoArtifactId, licenseIds,
85 thumbnails, fullImages);
86 }
87
88 }