1
14
15 package com.liferay.portlet.messageboards.service;
16
17 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18
19
39 public class MBMessageServiceUtil {
40 public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
41 java.lang.String className, long classPK,
42 java.lang.String permissionClassName, long permissionClassPK,
43 long threadId, long parentMessageId, java.lang.String subject,
44 java.lang.String body,
45 com.liferay.portal.service.ServiceContext serviceContext)
46 throws com.liferay.portal.kernel.exception.PortalException,
47 com.liferay.portal.kernel.exception.SystemException {
48 return getService()
49 .addDiscussionMessage(className, classPK,
50 permissionClassName, permissionClassPK, threadId, parentMessageId,
51 subject, body, serviceContext);
52 }
53
54 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
55 long groupId, long categoryId, java.lang.String subject,
56 java.lang.String body,
57 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
58 boolean anonymous, double priority, boolean allowPingbacks,
59 com.liferay.portal.service.ServiceContext serviceContext)
60 throws com.liferay.portal.kernel.exception.PortalException,
61 com.liferay.portal.kernel.exception.SystemException {
62 return getService()
63 .addMessage(groupId, categoryId, subject, body, files,
64 anonymous, priority, allowPingbacks, serviceContext);
65 }
66
67 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
68 long groupId, long categoryId, long threadId, long parentMessageId,
69 java.lang.String subject, java.lang.String body,
70 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
71 boolean anonymous, double priority, boolean allowPingbacks,
72 com.liferay.portal.service.ServiceContext serviceContext)
73 throws com.liferay.portal.kernel.exception.PortalException,
74 com.liferay.portal.kernel.exception.SystemException {
75 return getService()
76 .addMessage(groupId, categoryId, threadId, parentMessageId,
77 subject, body, files, anonymous, priority, allowPingbacks,
78 serviceContext);
79 }
80
81 public static void deleteDiscussionMessage(long groupId,
82 java.lang.String className, long classPK,
83 java.lang.String permissionClassName, long permissionClassPK,
84 long messageId)
85 throws com.liferay.portal.kernel.exception.PortalException,
86 com.liferay.portal.kernel.exception.SystemException {
87 getService()
88 .deleteDiscussionMessage(groupId, className, classPK,
89 permissionClassName, permissionClassPK, messageId);
90 }
91
92 public static void deleteMessage(long messageId)
93 throws com.liferay.portal.kernel.exception.PortalException,
94 com.liferay.portal.kernel.exception.SystemException {
95 getService().deleteMessage(messageId);
96 }
97
98 public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
99 long groupId, long categoryId, int status, int start, int end)
100 throws com.liferay.portal.kernel.exception.PortalException,
101 com.liferay.portal.kernel.exception.SystemException {
102 return getService()
103 .getCategoryMessages(groupId, categoryId, status, start, end);
104 }
105
106 public static int getCategoryMessagesCount(long groupId, long categoryId,
107 int status) throws com.liferay.portal.kernel.exception.SystemException {
108 return getService().getCategoryMessagesCount(groupId, categoryId, status);
109 }
110
111 public static java.lang.String getCategoryMessagesRSS(long groupId,
112 long categoryId, int status, int max, java.lang.String type,
113 double version, java.lang.String displayStyle,
114 java.lang.String feedURL, java.lang.String entryURL,
115 com.liferay.portal.theme.ThemeDisplay themeDisplay)
116 throws com.liferay.portal.kernel.exception.PortalException,
117 com.liferay.portal.kernel.exception.SystemException {
118 return getService()
119 .getCategoryMessagesRSS(groupId, categoryId, status, max,
120 type, version, displayStyle, feedURL, entryURL, themeDisplay);
121 }
122
123 public static java.lang.String getCompanyMessagesRSS(long companyId,
124 int status, int max, java.lang.String type, double version,
125 java.lang.String displayStyle, java.lang.String feedURL,
126 java.lang.String entryURL,
127 com.liferay.portal.theme.ThemeDisplay themeDisplay)
128 throws com.liferay.portal.kernel.exception.PortalException,
129 com.liferay.portal.kernel.exception.SystemException {
130 return getService()
131 .getCompanyMessagesRSS(companyId, status, max, type,
132 version, displayStyle, feedURL, entryURL, themeDisplay);
133 }
134
135 public static java.lang.String getGroupMessagesRSS(long groupId,
136 int status, int max, java.lang.String type, double version,
137 java.lang.String displayStyle, java.lang.String feedURL,
138 java.lang.String entryURL,
139 com.liferay.portal.theme.ThemeDisplay themeDisplay)
140 throws com.liferay.portal.kernel.exception.PortalException,
141 com.liferay.portal.kernel.exception.SystemException {
142 return getService()
143 .getGroupMessagesRSS(groupId, status, max, type, version,
144 displayStyle, feedURL, entryURL, themeDisplay);
145 }
146
147 public static java.lang.String getGroupMessagesRSS(long groupId,
148 long userId, int status, int max, java.lang.String type,
149 double version, java.lang.String displayStyle,
150 java.lang.String feedURL, java.lang.String entryURL,
151 com.liferay.portal.theme.ThemeDisplay themeDisplay)
152 throws com.liferay.portal.kernel.exception.PortalException,
153 com.liferay.portal.kernel.exception.SystemException {
154 return getService()
155 .getGroupMessagesRSS(groupId, userId, status, max, type,
156 version, displayStyle, feedURL, entryURL, themeDisplay);
157 }
158
159 public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
160 long messageId)
161 throws com.liferay.portal.kernel.exception.PortalException,
162 com.liferay.portal.kernel.exception.SystemException {
163 return getService().getMessage(messageId);
164 }
165
166 public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
167 long messageId, int status, java.lang.String threadView)
168 throws com.liferay.portal.kernel.exception.PortalException,
169 com.liferay.portal.kernel.exception.SystemException {
170 return getService().getMessageDisplay(messageId, status, threadView);
171 }
172
173 public static java.lang.String getThreadMessagesRSS(long threadId,
174 int status, int max, java.lang.String type, double version,
175 java.lang.String displayStyle, java.lang.String feedURL,
176 java.lang.String entryURL,
177 com.liferay.portal.theme.ThemeDisplay themeDisplay)
178 throws com.liferay.portal.kernel.exception.PortalException,
179 com.liferay.portal.kernel.exception.SystemException {
180 return getService()
181 .getThreadMessagesRSS(threadId, status, max, type, version,
182 displayStyle, feedURL, entryURL, themeDisplay);
183 }
184
185 public static void subscribeMessage(long messageId)
186 throws com.liferay.portal.kernel.exception.PortalException,
187 com.liferay.portal.kernel.exception.SystemException {
188 getService().subscribeMessage(messageId);
189 }
190
191 public static void unsubscribeMessage(long messageId)
192 throws com.liferay.portal.kernel.exception.PortalException,
193 com.liferay.portal.kernel.exception.SystemException {
194 getService().unsubscribeMessage(messageId);
195 }
196
197 public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
198 java.lang.String className, long classPK,
199 java.lang.String permissionClassName, long permissionClassPK,
200 long messageId, java.lang.String subject, java.lang.String body,
201 com.liferay.portal.service.ServiceContext serviceContext)
202 throws com.liferay.portal.kernel.exception.PortalException,
203 com.liferay.portal.kernel.exception.SystemException {
204 return getService()
205 .updateDiscussionMessage(className, classPK,
206 permissionClassName, permissionClassPK, messageId, subject, body,
207 serviceContext);
208 }
209
210 public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
211 long messageId, java.lang.String subject, java.lang.String body,
212 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
213 java.util.List<String> existingFiles, double priority,
214 boolean allowPingbacks,
215 com.liferay.portal.service.ServiceContext serviceContext)
216 throws com.liferay.portal.kernel.exception.PortalException,
217 com.liferay.portal.kernel.exception.SystemException {
218 return getService()
219 .updateMessage(messageId, subject, body, files,
220 existingFiles, priority, allowPingbacks, serviceContext);
221 }
222
223 public static MBMessageService getService() {
224 if (_service == null) {
225 _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
226 }
227
228 return _service;
229 }
230
231 public void setService(MBMessageService service) {
232 _service = service;
233 }
234
235 private static MBMessageService _service;
236 }