001
014
015 package com.liferay.portlet.asset.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.portlet.asset.model.AssetCategoryProperty;
021 import com.liferay.portlet.asset.service.base.AssetCategoryPropertyServiceBaseImpl;
022 import com.liferay.portlet.asset.service.permission.AssetCategoryPermission;
023
024 import java.util.List;
025
026
030 public class AssetCategoryPropertyServiceImpl
031 extends AssetCategoryPropertyServiceBaseImpl {
032
033 @Override
034 public AssetCategoryProperty addCategoryProperty(
035 long entryId, String key, String value)
036 throws PortalException, SystemException {
037
038 AssetCategoryPermission.check(
039 getPermissionChecker(), entryId, ActionKeys.UPDATE);
040
041 return assetCategoryPropertyLocalService.addCategoryProperty(
042 getUserId(), entryId, key, value);
043 }
044
045 @Override
046 public void deleteCategoryProperty(long categoryPropertyId)
047 throws PortalException, SystemException {
048
049 AssetCategoryProperty assetCategoryProperty =
050 assetCategoryPropertyLocalService.getAssetCategoryProperty(
051 categoryPropertyId);
052
053 AssetCategoryPermission.check(
054 getPermissionChecker(), assetCategoryProperty.getCategoryId(),
055 ActionKeys.UPDATE);
056
057 assetCategoryPropertyLocalService.deleteCategoryProperty(
058 categoryPropertyId);
059 }
060
061 @Override
062 public List<AssetCategoryProperty> getCategoryProperties(long entryId)
063 throws SystemException {
064
065 return assetCategoryPropertyLocalService.getCategoryProperties(entryId);
066 }
067
068 @Override
069 public List<AssetCategoryProperty> getCategoryPropertyValues(
070 long companyId, String key)
071 throws SystemException {
072
073 return assetCategoryPropertyLocalService.getCategoryPropertyValues(
074 companyId, key);
075 }
076
077 @Override
078 public AssetCategoryProperty updateCategoryProperty(
079 long categoryPropertyId, String key, String value)
080 throws PortalException, SystemException {
081
082 AssetCategoryProperty assetCategoryProperty =
083 assetCategoryPropertyLocalService.getAssetCategoryProperty(
084 categoryPropertyId);
085
086 AssetCategoryPermission.check(
087 getPermissionChecker(), assetCategoryProperty.getCategoryId(),
088 ActionKeys.UPDATE);
089
090 return assetCategoryPropertyLocalService.updateCategoryProperty(
091 categoryPropertyId, key, value);
092 }
093
094 }