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