001
014
015 package com.liferay.portlet.softwarecatalog.service.impl;
016
017 import com.liferay.portal.kernel.exception.PortalException;
018 import com.liferay.portal.kernel.exception.SystemException;
019 import com.liferay.portal.security.permission.ActionKeys;
020 import com.liferay.portal.service.ServiceContext;
021 import com.liferay.portlet.softwarecatalog.model.SCProductEntry;
022 import com.liferay.portlet.softwarecatalog.service.base.SCProductEntryServiceBaseImpl;
023 import com.liferay.portlet.softwarecatalog.service.permission.SCPermission;
024 import com.liferay.portlet.softwarecatalog.service.permission.SCProductEntryPermission;
025
026 import java.util.List;
027
028
032 public class SCProductEntryServiceImpl extends SCProductEntryServiceBaseImpl {
033
034 public SCProductEntry addProductEntry(
035 String name, String type, String tags, String shortDescription,
036 String longDescription, String pageURL, String author,
037 String repoGroupId, String repoArtifactId, long[] licenseIds,
038 List<byte[]> thumbnails, List<byte[]> fullImages,
039 ServiceContext serviceContext)
040 throws PortalException, SystemException {
041
042 SCPermission.check(
043 getPermissionChecker(), serviceContext.getScopeGroupId(),
044 ActionKeys.ADD_PRODUCT_ENTRY);
045
046 return scProductEntryLocalService.addProductEntry(
047 getUserId(), name, type, tags, shortDescription,
048 longDescription, pageURL, author, repoGroupId, repoArtifactId,
049 licenseIds, thumbnails, fullImages, serviceContext);
050 }
051
052 public void deleteProductEntry(long productEntryId)
053 throws PortalException, SystemException {
054
055 SCProductEntryPermission.check(
056 getPermissionChecker(), productEntryId, ActionKeys.DELETE);
057
058 scProductEntryLocalService.deleteProductEntry(productEntryId);
059 }
060
061 public SCProductEntry getProductEntry(long productEntryId)
062 throws PortalException, SystemException {
063
064 SCProductEntryPermission.check(
065 getPermissionChecker(), productEntryId, ActionKeys.VIEW);
066
067 return scProductEntryLocalService.getProductEntry(productEntryId);
068 }
069
070 public SCProductEntry updateProductEntry(
071 long productEntryId, String name, String type, String tags,
072 String shortDescription, String longDescription, String pageURL,
073 String author, String repoGroupId, String repoArtifactId,
074 long[] licenseIds, List<byte[]> thumbnails, List<byte[]> fullImages)
075 throws PortalException, SystemException {
076
077 SCProductEntryPermission.check(
078 getPermissionChecker(), productEntryId, ActionKeys.UPDATE);
079
080 return scProductEntryLocalService.updateProductEntry(
081 productEntryId, name, type, tags, shortDescription, longDescription,
082 pageURL, author, repoGroupId, repoArtifactId, licenseIds,
083 thumbnails, fullImages);
084 }
085
086 }