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, java.lang.String threadView,
232 boolean includePrevAndNext)
233 throws com.liferay.portal.kernel.exception.PortalException {
234 return getService()
235 .getMessageDisplay(messageId, status, threadView,
236 includePrevAndNext);
237 }
238
239
244 public static java.lang.String getOSGiServiceIdentifier() {
245 return getService().getOSGiServiceIdentifier();
246 }
247
248 public static int getThreadAnswersCount(long groupId, long categoryId,
249 long threadId) {
250 return getService().getThreadAnswersCount(groupId, categoryId, threadId);
251 }
252
253 public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
254 long groupId, long categoryId, long threadId, int status, int start,
255 int end) {
256 return getService()
257 .getThreadMessages(groupId, categoryId, threadId, status,
258 start, end);
259 }
260
261 public static int getThreadMessagesCount(long groupId, long categoryId,
262 long threadId, int status) {
263 return getService()
264 .getThreadMessagesCount(groupId, categoryId, threadId, status);
265 }
266
267 public static java.lang.String getThreadMessagesRSS(long threadId,
268 int status, int max, java.lang.String type, double version,
269 java.lang.String displayStyle, java.lang.String feedURL,
270 java.lang.String entryURL,
271 com.liferay.portal.theme.ThemeDisplay themeDisplay)
272 throws com.liferay.portal.kernel.exception.PortalException {
273 return getService()
274 .getThreadMessagesRSS(threadId, status, max, type, version,
275 displayStyle, feedURL, entryURL, themeDisplay);
276 }
277
278 public static void restoreMessageAttachmentFromTrash(long messageId,
279 java.lang.String fileName)
280 throws com.liferay.portal.kernel.exception.PortalException {
281 getService().restoreMessageAttachmentFromTrash(messageId, fileName);
282 }
283
284 public static void subscribeMessage(long messageId)
285 throws com.liferay.portal.kernel.exception.PortalException {
286 getService().subscribeMessage(messageId);
287 }
288
289 public static void unsubscribeMessage(long messageId)
290 throws com.liferay.portal.kernel.exception.PortalException {
291 getService().unsubscribeMessage(messageId);
292 }
293
294 public static void updateAnswer(long messageId, boolean answer,
295 boolean cascade)
296 throws com.liferay.portal.kernel.exception.PortalException {
297 getService().updateAnswer(messageId, answer, cascade);
298 }
299
300 public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
301 java.lang.String className, long classPK, long messageId,
302 java.lang.String subject, java.lang.String body,
303 com.liferay.portal.service.ServiceContext serviceContext)
304 throws com.liferay.portal.kernel.exception.PortalException {
305 return getService()
306 .updateDiscussionMessage(className, classPK, messageId,
307 subject, body, serviceContext);
308 }
309
310 public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
311 long messageId, java.lang.String subject, java.lang.String body,
312 java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, java.io.InputStream>> inputStreamOVPs,
313 java.util.List<java.lang.String> existingFiles, double priority,
314 boolean allowPingbacks,
315 com.liferay.portal.service.ServiceContext serviceContext)
316 throws com.liferay.portal.kernel.exception.PortalException {
317 return getService()
318 .updateMessage(messageId, subject, body, inputStreamOVPs,
319 existingFiles, priority, allowPingbacks, serviceContext);
320 }
321
322 public static MBMessageService getService() {
323 if (_service == null) {
324 _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
325
326 ReferenceRegistry.registerReference(MBMessageServiceUtil.class,
327 "_service");
328 }
329
330 return _service;
331 }
332
333 private static MBMessageService _service;
334 }