1
22
23 package com.liferay.portlet.expando.service.impl;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.security.permission.ActionKeys;
28 import com.liferay.portal.service.permission.PortletPermissionUtil;
29 import com.liferay.portal.util.PortletKeys;
30 import com.liferay.portlet.expando.model.ExpandoColumn;
31 import com.liferay.portlet.expando.service.base.ExpandoColumnServiceBaseImpl;
32 import com.liferay.portlet.expando.service.permission.ExpandoColumnPermission;
33
34
39 public class ExpandoColumnServiceImpl extends ExpandoColumnServiceBaseImpl {
40
41 public ExpandoColumn addColumn(long tableId, String name, int type)
42 throws PortalException, SystemException {
43
44 PortletPermissionUtil.check(
45 getPermissionChecker(), PortletKeys.EXPANDO,
46 ActionKeys.ADD_EXPANDO);
47
48 return expandoColumnLocalService.addColumn(tableId, name, type);
49 }
50
51 public ExpandoColumn addColumn(
52 long tableId, String name, int type, Object defaultData)
53 throws PortalException, SystemException {
54
55 PortletPermissionUtil.check(
56 getPermissionChecker(), PortletKeys.EXPANDO,
57 ActionKeys.ADD_EXPANDO);
58
59 return expandoColumnLocalService.addColumn(
60 tableId, name, type, defaultData);
61 }
62
63 public void deleteColumn(long columnId)
64 throws PortalException, SystemException {
65
66 ExpandoColumnPermission.check(
67 getPermissionChecker(), columnId, ActionKeys.DELETE);
68
69 expandoColumnLocalService.deleteColumn(columnId);
70 }
71
72 public ExpandoColumn updateColumn(long columnId, String name, int type)
73 throws PortalException, SystemException {
74
75 ExpandoColumnPermission.check(
76 getPermissionChecker(), columnId, ActionKeys.UPDATE);
77
78 return expandoColumnLocalService.updateColumn(columnId, name, type);
79 }
80
81 public ExpandoColumn updateColumn(
82 long columnId, String name, int type, Object defaultData)
83 throws PortalException, SystemException {
84
85 ExpandoColumnPermission.check(
86 getPermissionChecker(), columnId, ActionKeys.UPDATE);
87
88 return expandoColumnLocalService.updateColumn(
89 columnId, name, type, defaultData);
90 }
91
92 public ExpandoColumn updateTypeSettings(long columnId, String typeSettings)
93 throws PortalException, SystemException {
94
95 ExpandoColumnPermission.check(
96 getPermissionChecker(), columnId, ActionKeys.UPDATE);
97
98 return expandoColumnLocalService.updateTypeSettings(
99 columnId, typeSettings);
100 }
101
102 }