1
22
23 package com.liferay.portlet.journal.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.journal.model.JournalFeed;
31 import com.liferay.portlet.journal.service.base.JournalFeedServiceBaseImpl;
32 import com.liferay.portlet.journal.service.permission.JournalFeedPermission;
33
34
40 public class JournalFeedServiceImpl extends JournalFeedServiceBaseImpl {
41
42 public JournalFeed addFeed(
43 long plid, String feedId, boolean autoFeedId, String name,
44 String description, String type, String structureId,
45 String templateId, String rendererTemplateId, int delta,
46 String orderByCol, String orderByType,
47 String targetLayoutFriendlyUrl, String targetPortletId,
48 String contentField, String feedType, double feedVersion,
49 boolean addCommunityPermissions, boolean addGuestPermissions)
50 throws PortalException, SystemException {
51
52 PortletPermissionUtil.check(
53 getPermissionChecker(), plid, PortletKeys.JOURNAL,
54 ActionKeys.ADD_FEED);
55
56 return journalFeedLocalService.addFeed(
57 getUserId(), plid, feedId, autoFeedId, name, description, type,
58 structureId, templateId, rendererTemplateId, delta, orderByCol,
59 orderByType, targetLayoutFriendlyUrl, targetPortletId, contentField,
60 feedType, feedVersion, addCommunityPermissions,
61 addGuestPermissions);
62 }
63
64 public JournalFeed addFeed(
65 long plid, String feedId, boolean autoFeedId, String name,
66 String description, String type, String structureId,
67 String templateId, String rendererTemplateId, int delta,
68 String orderByCol, String orderByType,
69 String targetLayoutFriendlyUrl, String targetPortletId,
70 String contentField, String feedType, double feedVersion,
71 String[] communityPermissions, String[] guestPermissions)
72 throws PortalException, SystemException {
73
74 PortletPermissionUtil.check(
75 getPermissionChecker(), plid, PortletKeys.JOURNAL,
76 ActionKeys.ADD_FEED);
77
78 return journalFeedLocalService.addFeed(
79 getUserId(), plid, feedId, autoFeedId, name, description, type,
80 structureId, templateId, rendererTemplateId, delta, orderByCol,
81 orderByType, targetLayoutFriendlyUrl, targetPortletId, contentField,
82 feedType, feedVersion, communityPermissions, guestPermissions);
83 }
84
85 public void deleteFeed(long groupId, long feedId)
86 throws PortalException, SystemException {
87
88 JournalFeedPermission.check(
89 getPermissionChecker(), feedId, ActionKeys.DELETE);
90
91 journalFeedLocalService.deleteFeed(feedId);
92 }
93
94 public void deleteFeed(long groupId, String feedId)
95 throws PortalException, SystemException {
96
97 JournalFeedPermission.check(
98 getPermissionChecker(), groupId, feedId, ActionKeys.DELETE);
99
100 journalFeedLocalService.deleteFeed(groupId, feedId);
101 }
102
103 public JournalFeed getFeed(long groupId, long feedId)
104 throws PortalException, SystemException {
105
106 JournalFeedPermission.check(
107 getPermissionChecker(), feedId, ActionKeys.VIEW);
108
109 return journalFeedLocalService.getFeed(feedId);
110 }
111
112 public JournalFeed getFeed(long groupId, String feedId)
113 throws PortalException, SystemException {
114
115 JournalFeedPermission.check(
116 getPermissionChecker(), groupId, feedId, ActionKeys.VIEW);
117
118 return journalFeedLocalService.getFeed(groupId, feedId);
119 }
120
121 public JournalFeed updateFeed(
122 long groupId, String feedId, String name, String description,
123 String type, String structureId, String templateId,
124 String rendererTemplateId, int delta, String orderByCol,
125 String orderByType, String targetLayoutFriendlyUrl,
126 String targetPortletId, String contentField, String feedType,
127 double feedVersion)
128 throws PortalException, SystemException {
129
130 JournalFeedPermission.check(
131 getPermissionChecker(), groupId, feedId, ActionKeys.UPDATE);
132
133 return journalFeedLocalService.updateFeed(
134 groupId, feedId, name, description, type, structureId, templateId,
135 rendererTemplateId, delta, orderByCol, orderByType,
136 targetLayoutFriendlyUrl, targetPortletId, contentField, feedType,
137 feedVersion);
138 }
139
140 }