001
014
015 package com.liferay.portlet.messageboards.service;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020 import com.liferay.portal.kernel.util.ReferenceRegistry;
021
022
036 @ProviderType
037 public class MBMessageServiceUtil {
038
043 public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
044 long groupId, java.lang.String className, long classPK, long threadId,
045 long parentMessageId, java.lang.String subject, java.lang.String body,
046 com.liferay.portal.service.ServiceContext serviceContext)
047 throws com.liferay.portal.kernel.exception.PortalException {
048 return getService()
049 .addDiscussionMessage(groupId, className, classPK, threadId,
050 parentMessageId, subject, body, serviceContext);
051 }
052
053 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
054 long categoryId, java.lang.String subject, java.lang.String body,
055 com.liferay.portal.service.ServiceContext serviceContext)
056 throws com.liferay.portal.kernel.exception.PortalException {
057 return getService().addMessage(categoryId, subject, body, serviceContext);
058 }
059
060 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
061 long groupId, long categoryId, java.lang.String subject,
062 java.lang.String body, java.lang.String format,
063 java.lang.String fileName, java.io.File file, boolean anonymous,
064 double priority, boolean allowPingbacks,
065 com.liferay.portal.service.ServiceContext serviceContext)
066 throws com.liferay.portal.kernel.exception.PortalException,
067 java.io.FileNotFoundException {
068 return getService()
069 .addMessage(groupId, categoryId, subject, body, format,
070 fileName, file, anonymous, priority, allowPingbacks, serviceContext);
071 }
072
073 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
074 long groupId, long categoryId, java.lang.String subject,
075 java.lang.String body, java.lang.String format,
076 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
077 boolean anonymous, double priority, boolean allowPingbacks,
078 com.liferay.portal.service.ServiceContext serviceContext)
079 throws com.liferay.portal.kernel.exception.PortalException {
080 return getService()
081 .addMessage(groupId, categoryId, subject, body, format,
082 inputStreamOVPs, anonymous, priority, allowPingbacks, serviceContext);
083 }
084
085
090 @Deprecated
091 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
092 long groupId, long categoryId, long threadId, long parentMessageId,
093 java.lang.String subject, java.lang.String body,
094 java.lang.String format,
095 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
096 boolean anonymous, double priority, boolean allowPingbacks,
097 com.liferay.portal.service.ServiceContext serviceContext)
098 throws com.liferay.portal.kernel.exception.PortalException {
099 return getService()
100 .addMessage(groupId, categoryId, threadId, parentMessageId,
101 subject, body, format, inputStreamOVPs, anonymous, priority,
102 allowPingbacks, serviceContext);
103 }
104
105 public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
106 long parentMessageId, java.lang.String subject, java.lang.String body,
107 java.lang.String format,
108 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
109 boolean anonymous, double priority, boolean allowPingbacks,
110 com.liferay.portal.service.ServiceContext serviceContext)
111 throws com.liferay.portal.kernel.exception.PortalException {
112 return getService()
113 .addMessage(parentMessageId, subject, body, format,
114 inputStreamOVPs, anonymous, priority, allowPingbacks, serviceContext);
115 }
116
117 public static void addMessageAttachment(long messageId,
118 java.lang.String fileName, java.io.File file, java.lang.String mimeType)
119 throws com.liferay.portal.kernel.exception.PortalException {
120 getService().addMessageAttachment(messageId, fileName, file, mimeType);
121 }
122
123
127 @Deprecated
128 public static void deleteDiscussionMessage(long groupId,
129 java.lang.String className, long classPK,
130 java.lang.String permissionClassName, long permissionClassPK,
131 long permissionOwnerId, long messageId)
132 throws com.liferay.portal.kernel.exception.PortalException {
133 getService()
134 .deleteDiscussionMessage(groupId, className, classPK,
135 permissionClassName, permissionClassPK, permissionOwnerId, messageId);
136 }
137
138 public static void deleteDiscussionMessage(long messageId)
139 throws com.liferay.portal.kernel.exception.PortalException {
140 getService().deleteDiscussionMessage(messageId);
141 }
142
143 public static void deleteMessage(long messageId)
144 throws com.liferay.portal.kernel.exception.PortalException {
145 getService().deleteMessage(messageId);
146 }
147
148 public static void deleteMessageAttachment(long messageId,
149 java.lang.String fileName)
150 throws com.liferay.portal.kernel.exception.PortalException {
151 getService().deleteMessageAttachment(messageId, fileName);
152 }
153
154 public static void deleteMessageAttachments(long messageId)
155 throws com.liferay.portal.kernel.exception.PortalException {
156 getService().deleteMessageAttachments(messageId);
157 }
158
159 public static void emptyMessageAttachments(long messageId)
160 throws com.liferay.portal.kernel.exception.PortalException {
161 getService().emptyMessageAttachments(messageId);
162 }
163
164 public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
165 long groupId, long categoryId, int status, int start, int end)
166 throws com.liferay.portal.kernel.exception.PortalException {
167 return getService()
168 .getCategoryMessages(groupId, categoryId, status, start, end);
169 }
170
171 public static int getCategoryMessagesCount(long groupId, long categoryId,
172 int status) {
173 return getService().getCategoryMessagesCount(groupId, categoryId, status);
174 }
175
176 public static java.lang.String getCategoryMessagesRSS(long groupId,
177 long categoryId, int status, int max, java.lang.String type,
178 double version, java.lang.String displayStyle,
179 java.lang.String feedURL, java.lang.String entryURL,
180 com.liferay.portal.theme.ThemeDisplay themeDisplay)
181 throws com.liferay.portal.kernel.exception.PortalException {
182 return getService()
183 .getCategoryMessagesRSS(groupId, categoryId, status, max,
184 type, version, displayStyle, feedURL, entryURL, themeDisplay);
185 }
186
187 public static java.lang.String getCompanyMessagesRSS(long companyId,
188 int status, int max, java.lang.String type, double version,
189 java.lang.String displayStyle, java.lang.String feedURL,
190 java.lang.String entryURL,
191 com.liferay.portal.theme.ThemeDisplay themeDisplay)
192 throws com.liferay.portal.kernel.exception.PortalException {
193 return getService()
194 .getCompanyMessagesRSS(companyId, status, max, type,
195 version, displayStyle, feedURL, entryURL, themeDisplay);
196 }
197
198 public static int getGroupMessagesCount(long groupId, int status) {
199 return getService().getGroupMessagesCount(groupId, status);
200 }
201
202 public static java.lang.String getGroupMessagesRSS(long groupId,
203 int status, int max, java.lang.String type, double version,
204 java.lang.String displayStyle, java.lang.String feedURL,
205 java.lang.String entryURL,
206 com.liferay.portal.theme.ThemeDisplay themeDisplay)
207 throws com.liferay.portal.kernel.exception.PortalException {
208 return getService()
209 .getGroupMessagesRSS(groupId, status, max, type, version,
210 displayStyle, feedURL, entryURL, themeDisplay);
211 }
212
213 public static java.lang.String getGroupMessagesRSS(long groupId,
214 long userId, int status, int max, java.lang.String type,
215 double version, java.lang.String displayStyle,
216 java.lang.String feedURL, java.lang.String entryURL,
217 com.liferay.portal.theme.ThemeDisplay themeDisplay)
218 throws com.liferay.portal.kernel.exception.PortalException {
219 return getService()
220 .getGroupMessagesRSS(groupId, userId, status, max, type,
221 version, displayStyle, feedURL, entryURL, themeDisplay);
222 }
223
224 public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
225 long messageId)
226 throws com.liferay.portal.kernel.exception.PortalException {
227 return getService().getMessage(messageId);
228 }
229
230 public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
231 long messageId, int status, boolean includePrevAndNext)
232 throws com.liferay.portal.kernel.exception.PortalException {
233 return getService()
234 .getMessageDisplay(messageId, status, includePrevAndNext);
235 }
236
237
241 @Deprecated
242 public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
243 long messageId, int status, java.lang.String threadView,
244 boolean includePrevAndNext)
245 throws com.liferay.portal.kernel.exception.PortalException {
246 return getService()
247 .getMessageDisplay(messageId, status, threadView,
248 includePrevAndNext);
249 }
250
251
256 public static java.lang.String getOSGiServiceIdentifier() {
257 return getService().getOSGiServiceIdentifier();
258 }
259
260 public static int getThreadAnswersCount(long groupId, long categoryId,
261 long threadId) {
262 return getService().getThreadAnswersCount(groupId, categoryId, threadId);
263 }
264
265 public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
266 long groupId, long categoryId, long threadId, int status, int start,
267 int end) {
268 return getService()
269 .getThreadMessages(groupId, categoryId, threadId, status,
270 start, end);
271 }
272
273 public static int getThreadMessagesCount(long groupId, long categoryId,
274 long threadId, int status) {
275 return getService()
276 .getThreadMessagesCount(groupId, categoryId, threadId, status);
277 }
278
279 public static java.lang.String getThreadMessagesRSS(long threadId,
280 int status, int max, java.lang.String type, double version,
281 java.lang.String displayStyle, java.lang.String feedURL,
282 java.lang.String entryURL,
283 com.liferay.portal.theme.ThemeDisplay themeDisplay)
284 throws com.liferay.portal.kernel.exception.PortalException {
285 return getService()
286 .getThreadMessagesRSS(threadId, status, max, type, version,
287 displayStyle, feedURL, entryURL, themeDisplay);
288 }
289
290 public static void restoreMessageAttachmentFromTrash(long messageId,
291 java.lang.String fileName)
292 throws com.liferay.portal.kernel.exception.PortalException {
293 getService().restoreMessageAttachmentFromTrash(messageId, fileName);
294 }
295
296 public static void subscribeMessage(long messageId)
297 throws com.liferay.portal.kernel.exception.PortalException {
298 getService().subscribeMessage(messageId);
299 }
300
301 public static void unsubscribeMessage(long messageId)
302 throws com.liferay.portal.kernel.exception.PortalException {
303 getService().unsubscribeMessage(messageId);
304 }
305
306 public static void updateAnswer(long messageId, boolean answer,
307 boolean cascade)
308 throws com.liferay.portal.kernel.exception.PortalException {
309 getService().updateAnswer(messageId, answer, cascade);
310 }
311
312 public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
313 java.lang.String className, long classPK, long messageId,
314 java.lang.String subject, java.lang.String body,
315 com.liferay.portal.service.ServiceContext serviceContext)
316 throws com.liferay.portal.kernel.exception.PortalException {
317 return getService()
318 .updateDiscussionMessage(className, classPK, messageId,
319 subject, body, serviceContext);
320 }
321
322 public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
323 long messageId, java.lang.String subject, java.lang.String body,
324 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
325 java.util.List<java.lang.String> existingFiles, double priority,
326 boolean allowPingbacks,
327 com.liferay.portal.service.ServiceContext serviceContext)
328 throws com.liferay.portal.kernel.exception.PortalException {
329 return getService()
330 .updateMessage(messageId, subject, body, inputStreamOVPs,
331 existingFiles, priority, allowPingbacks, serviceContext);
332 }
333
334 public static MBMessageService getService() {
335 if (_service == null) {
336 _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
337
338 ReferenceRegistry.registerReference(MBMessageServiceUtil.class,
339 "_service");
340 }
341
342 return _service;
343 }
344
345 private static MBMessageService _service;
346 }