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 public AssetCategoryProperty addCategoryProperty(
034 long entryId, String key, String value)
035 throws PortalException, SystemException {
036
037 AssetCategoryPermission.check(
038 getPermissionChecker(), entryId, ActionKeys.UPDATE);
039
040 return assetCategoryPropertyLocalService.addCategoryProperty(
041 getUserId(), entryId, key, value);
042 }
043
044 public void deleteCategoryProperty(long categoryPropertyId)
045 throws PortalException, SystemException {
046
047 AssetCategoryProperty assetCategoryProperty =
048 assetCategoryPropertyLocalService.getAssetCategoryProperty(
049 categoryPropertyId);
050
051 AssetCategoryPermission.check(
052 getPermissionChecker(), assetCategoryProperty.getCategoryId(),
053 ActionKeys.UPDATE);
054
055 assetCategoryPropertyLocalService.deleteCategoryProperty(
056 categoryPropertyId);
057 }
058
059 public List<AssetCategoryProperty> getCategoryProperties(long entryId)
060 throws SystemException {
061
062 return assetCategoryPropertyLocalService.getCategoryProperties(entryId);
063 }
064
065 public List<AssetCategoryProperty> getCategoryPropertyValues(
066 long companyId, String key)
067 throws SystemException {
068
069 return assetCategoryPropertyLocalService.getCategoryPropertyValues(
070 companyId, key);
071 }
072
073 public AssetCategoryProperty updateCategoryProperty(
074 long categoryPropertyId, String key, String value)
075 throws PortalException, SystemException {
076
077 AssetCategoryProperty assetCategoryProperty =
078 assetCategoryPropertyLocalService.getAssetCategoryProperty(
079 categoryPropertyId);
080
081 AssetCategoryPermission.check(
082 getPermissionChecker(), assetCategoryProperty.getCategoryId(),
083 ActionKeys.UPDATE);
084
085 return assetCategoryPropertyLocalService.updateCategoryProperty(
086 categoryPropertyId, key, value);
087 }
088
089 }