1
14
15 package com.liferay.portlet.expando.service.impl;
16
17 import com.liferay.portal.kernel.exception.PortalException;
18 import com.liferay.portal.kernel.exception.SystemException;
19 import com.liferay.portal.security.permission.ActionKeys;
20 import com.liferay.portlet.expando.model.ExpandoColumn;
21 import com.liferay.portlet.expando.model.ExpandoValue;
22 import com.liferay.portlet.expando.service.base.ExpandoValueServiceBaseImpl;
23 import com.liferay.portlet.expando.service.permission.ExpandoColumnPermission;
24
25 import java.io.Serializable;
26
27
32 public class ExpandoValueServiceImpl extends ExpandoValueServiceBaseImpl {
33
34 public ExpandoValue addValue(
35 long companyId, String className, String tableName,
36 String columnName, long classPK, Object data)
37 throws PortalException, SystemException {
38
39 ExpandoColumn column = expandoColumnLocalService.getColumn(
40 companyId, className, tableName, columnName);
41
42 ExpandoColumnPermission.check(
43 getPermissionChecker(), column, ActionKeys.UPDATE);
44
45 return expandoValueLocalService.addValue(
46 companyId, className, tableName, columnName, classPK, data);
47 }
48
49 public Serializable getData(
50 long companyId, String className, String tableName,
51 String columnName, long classPK)
52 throws PortalException, SystemException {
53
54 ExpandoColumn column = expandoColumnLocalService.getColumn(
55 companyId, className, tableName, columnName);
56
57 if (ExpandoColumnPermission.contains(
58 getPermissionChecker(), column, ActionKeys.VIEW)) {
59
60 return expandoValueLocalService.getData(
61 companyId, className, tableName, columnName, classPK);
62 }
63 else {
64 return null;
65 }
66 }
67
68 }