1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.messageboards.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="MBMessageLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link MBMessageLocalService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       MBMessageLocalService
39   * @generated
40   */
41  public class MBMessageLocalServiceUtil {
42      public static com.liferay.portlet.messageboards.model.MBMessage addMBMessage(
43          com.liferay.portlet.messageboards.model.MBMessage mbMessage)
44          throws com.liferay.portal.SystemException {
45          return getService().addMBMessage(mbMessage);
46      }
47  
48      public static com.liferay.portlet.messageboards.model.MBMessage createMBMessage(
49          long messageId) {
50          return getService().createMBMessage(messageId);
51      }
52  
53      public static void deleteMBMessage(long messageId)
54          throws com.liferay.portal.PortalException,
55              com.liferay.portal.SystemException {
56          getService().deleteMBMessage(messageId);
57      }
58  
59      public static void deleteMBMessage(
60          com.liferay.portlet.messageboards.model.MBMessage mbMessage)
61          throws com.liferay.portal.SystemException {
62          getService().deleteMBMessage(mbMessage);
63      }
64  
65      @SuppressWarnings("rawtypes")
66      public static java.util.List dynamicQuery(
67          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
68          throws com.liferay.portal.SystemException {
69          return getService().dynamicQuery(dynamicQuery);
70      }
71  
72      @SuppressWarnings("rawtypes")
73      public static java.util.List dynamicQuery(
74          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
75          int end) throws com.liferay.portal.SystemException {
76          return getService().dynamicQuery(dynamicQuery, start, end);
77      }
78  
79      @SuppressWarnings("rawtypes")
80      public static java.util.List dynamicQuery(
81          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
82          int end,
83          com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
84          throws com.liferay.portal.SystemException {
85          return getService()
86                     .dynamicQuery(dynamicQuery, start, end, orderByComparator);
87      }
88  
89      public static int dynamicQueryCount(
90          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
91          throws com.liferay.portal.SystemException {
92          return getService().dynamicQueryCount(dynamicQuery);
93      }
94  
95      public static com.liferay.portlet.messageboards.model.MBMessage getMBMessage(
96          long messageId)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException {
99          return getService().getMBMessage(messageId);
100     }
101 
102     public static com.liferay.portlet.messageboards.model.MBMessage getMBMessageByUuidAndGroupId(
103         java.lang.String uuid, long groupId)
104         throws com.liferay.portal.PortalException,
105             com.liferay.portal.SystemException {
106         return getService().getMBMessageByUuidAndGroupId(uuid, groupId);
107     }
108 
109     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getMBMessages(
110         int start, int end) throws com.liferay.portal.SystemException {
111         return getService().getMBMessages(start, end);
112     }
113 
114     public static int getMBMessagesCount()
115         throws com.liferay.portal.SystemException {
116         return getService().getMBMessagesCount();
117     }
118 
119     public static com.liferay.portlet.messageboards.model.MBMessage updateMBMessage(
120         com.liferay.portlet.messageboards.model.MBMessage mbMessage)
121         throws com.liferay.portal.SystemException {
122         return getService().updateMBMessage(mbMessage);
123     }
124 
125     public static com.liferay.portlet.messageboards.model.MBMessage updateMBMessage(
126         com.liferay.portlet.messageboards.model.MBMessage mbMessage,
127         boolean merge) throws com.liferay.portal.SystemException {
128         return getService().updateMBMessage(mbMessage, merge);
129     }
130 
131     public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
132         long userId, java.lang.String userName, java.lang.String className,
133         long classPK)
134         throws com.liferay.portal.PortalException,
135             com.liferay.portal.SystemException {
136         return getService()
137                    .addDiscussionMessage(userId, userName, className, classPK);
138     }
139 
140     public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
141         long userId, java.lang.String userName, java.lang.String className,
142         long classPK, long threadId, long parentMessageId,
143         java.lang.String subject, java.lang.String body,
144         com.liferay.portal.service.ServiceContext serviceContext)
145         throws com.liferay.portal.PortalException,
146             com.liferay.portal.SystemException {
147         return getService()
148                    .addDiscussionMessage(userId, userName, className, classPK,
149             threadId, parentMessageId, subject, body, serviceContext);
150     }
151 
152     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
153         long userId, java.lang.String userName, long categoryId, long threadId,
154         long parentMessageId, java.lang.String subject, java.lang.String body,
155         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
156         boolean anonymous, double priority,
157         com.liferay.portal.service.ServiceContext serviceContext)
158         throws com.liferay.portal.PortalException,
159             com.liferay.portal.SystemException {
160         return getService()
161                    .addMessage(userId, userName, categoryId, threadId,
162             parentMessageId, subject, body, files, anonymous, priority,
163             serviceContext);
164     }
165 
166     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
167         long userId, java.lang.String userName, long categoryId,
168         java.lang.String subject, java.lang.String body,
169         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
170         boolean anonymous, double priority,
171         com.liferay.portal.service.ServiceContext serviceContext)
172         throws com.liferay.portal.PortalException,
173             com.liferay.portal.SystemException {
174         return getService()
175                    .addMessage(userId, userName, categoryId, subject, body,
176             files, anonymous, priority, serviceContext);
177     }
178 
179     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
180         java.lang.String uuid, long userId, java.lang.String userName,
181         long categoryId, long threadId, long parentMessageId,
182         java.lang.String subject, java.lang.String body,
183         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
184         boolean anonymous, double priority,
185         com.liferay.portal.service.ServiceContext serviceContext)
186         throws com.liferay.portal.PortalException,
187             com.liferay.portal.SystemException {
188         return getService()
189                    .addMessage(uuid, userId, userName, categoryId, threadId,
190             parentMessageId, subject, body, files, anonymous, priority,
191             serviceContext);
192     }
193 
194     public static void addMessageResources(long messageId,
195         boolean addCommunityPermissions, boolean addGuestPermissions)
196         throws com.liferay.portal.PortalException,
197             com.liferay.portal.SystemException {
198         getService()
199             .addMessageResources(messageId, addCommunityPermissions,
200             addGuestPermissions);
201     }
202 
203     public static void addMessageResources(long messageId,
204         java.lang.String[] communityPermissions,
205         java.lang.String[] guestPermissions)
206         throws com.liferay.portal.PortalException,
207             com.liferay.portal.SystemException {
208         getService()
209             .addMessageResources(messageId, communityPermissions,
210             guestPermissions);
211     }
212 
213     public static void addMessageResources(
214         com.liferay.portlet.messageboards.model.MBMessage message,
215         boolean addCommunityPermissions, boolean addGuestPermissions)
216         throws com.liferay.portal.PortalException,
217             com.liferay.portal.SystemException {
218         getService()
219             .addMessageResources(message, addCommunityPermissions,
220             addGuestPermissions);
221     }
222 
223     public static void addMessageResources(
224         com.liferay.portlet.messageboards.model.MBMessage message,
225         java.lang.String[] communityPermissions,
226         java.lang.String[] guestPermissions)
227         throws com.liferay.portal.PortalException,
228             com.liferay.portal.SystemException {
229         getService()
230             .addMessageResources(message, communityPermissions, guestPermissions);
231     }
232 
233     public static void deleteDiscussionMessage(long messageId)
234         throws com.liferay.portal.PortalException,
235             com.liferay.portal.SystemException {
236         getService().deleteDiscussionMessage(messageId);
237     }
238 
239     public static void deleteDiscussionMessages(java.lang.String className,
240         long classPK)
241         throws com.liferay.portal.PortalException,
242             com.liferay.portal.SystemException {
243         getService().deleteDiscussionMessages(className, classPK);
244     }
245 
246     public static void deleteMessage(long messageId)
247         throws com.liferay.portal.PortalException,
248             com.liferay.portal.SystemException {
249         getService().deleteMessage(messageId);
250     }
251 
252     public static void deleteMessage(
253         com.liferay.portlet.messageboards.model.MBMessage message)
254         throws com.liferay.portal.PortalException,
255             com.liferay.portal.SystemException {
256         getService().deleteMessage(message);
257     }
258 
259     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
260         long categoryId, int start, int end)
261         throws com.liferay.portal.SystemException {
262         return getService().getCategoryMessages(categoryId, start, end);
263     }
264 
265     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
266         long categoryId, int start, int end,
267         com.liferay.portal.kernel.util.OrderByComparator obc)
268         throws com.liferay.portal.SystemException {
269         return getService().getCategoryMessages(categoryId, start, end, obc);
270     }
271 
272     public static int getCategoryMessagesCount(long categoryId)
273         throws com.liferay.portal.SystemException {
274         return getService().getCategoryMessagesCount(categoryId);
275     }
276 
277     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCompanyMessages(
278         long companyId, int start, int end)
279         throws com.liferay.portal.SystemException {
280         return getService().getCompanyMessages(companyId, start, end);
281     }
282 
283     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCompanyMessages(
284         long companyId, int start, int end,
285         com.liferay.portal.kernel.util.OrderByComparator obc)
286         throws com.liferay.portal.SystemException {
287         return getService().getCompanyMessages(companyId, start, end, obc);
288     }
289 
290     public static int getCompanyMessagesCount(long companyId)
291         throws com.liferay.portal.SystemException {
292         return getService().getCompanyMessagesCount(companyId);
293     }
294 
295     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getDiscussionMessageDisplay(
296         long userId, java.lang.String className, long classPK)
297         throws com.liferay.portal.PortalException,
298             com.liferay.portal.SystemException {
299         return getService()
300                    .getDiscussionMessageDisplay(userId, className, classPK);
301     }
302 
303     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getDiscussionMessageDisplay(
304         long userId, java.lang.String className, long classPK,
305         java.lang.String threadView)
306         throws com.liferay.portal.PortalException,
307             com.liferay.portal.SystemException {
308         return getService()
309                    .getDiscussionMessageDisplay(userId, className, classPK,
310             threadView);
311     }
312 
313     public static int getDiscussionMessagesCount(long classNameId, long classPK)
314         throws com.liferay.portal.SystemException {
315         return getService().getDiscussionMessagesCount(classNameId, classPK);
316     }
317 
318     public static int getDiscussionMessagesCount(java.lang.String className,
319         long classPK) throws com.liferay.portal.SystemException {
320         return getService().getDiscussionMessagesCount(className, classPK);
321     }
322 
323     public static java.util.List<com.liferay.portlet.messageboards.model.MBDiscussion> getDiscussions(
324         java.lang.String className) throws com.liferay.portal.SystemException {
325         return getService().getDiscussions(className);
326     }
327 
328     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getGroupMessages(
329         long groupId, int start, int end)
330         throws com.liferay.portal.SystemException {
331         return getService().getGroupMessages(groupId, start, end);
332     }
333 
334     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getGroupMessages(
335         long groupId, int start, int end,
336         com.liferay.portal.kernel.util.OrderByComparator obc)
337         throws com.liferay.portal.SystemException {
338         return getService().getGroupMessages(groupId, start, end, obc);
339     }
340 
341     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getGroupMessages(
342         long groupId, long userId, int start, int end)
343         throws com.liferay.portal.SystemException {
344         return getService().getGroupMessages(groupId, userId, start, end);
345     }
346 
347     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getGroupMessages(
348         long groupId, long userId, int start, int end,
349         com.liferay.portal.kernel.util.OrderByComparator obc)
350         throws com.liferay.portal.SystemException {
351         return getService().getGroupMessages(groupId, userId, start, end, obc);
352     }
353 
354     public static int getGroupMessagesCount(long groupId)
355         throws com.liferay.portal.SystemException {
356         return getService().getGroupMessagesCount(groupId);
357     }
358 
359     public static int getGroupMessagesCount(long groupId, long userId)
360         throws com.liferay.portal.SystemException {
361         return getService().getGroupMessagesCount(groupId, userId);
362     }
363 
364     public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
365         long messageId)
366         throws com.liferay.portal.PortalException,
367             com.liferay.portal.SystemException {
368         return getService().getMessage(messageId);
369     }
370 
371     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
372         long messageId, java.lang.String threadView)
373         throws com.liferay.portal.PortalException,
374             com.liferay.portal.SystemException {
375         return getService().getMessageDisplay(messageId, threadView);
376     }
377 
378     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
379         long messageId, java.lang.String threadView, boolean includePrevAndNext)
380         throws com.liferay.portal.PortalException,
381             com.liferay.portal.SystemException {
382         return getService()
383                    .getMessageDisplay(messageId, threadView, includePrevAndNext);
384     }
385 
386     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
387         com.liferay.portlet.messageboards.model.MBMessage message,
388         java.lang.String threadView)
389         throws com.liferay.portal.PortalException,
390             com.liferay.portal.SystemException {
391         return getService().getMessageDisplay(message, threadView);
392     }
393 
394     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
395         com.liferay.portlet.messageboards.model.MBMessage message,
396         java.lang.String threadView, boolean includePrevAndNext)
397         throws com.liferay.portal.PortalException,
398             com.liferay.portal.SystemException {
399         return getService()
400                    .getMessageDisplay(message, threadView, includePrevAndNext);
401     }
402 
403     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getMessages(
404         java.lang.String className, long classPK)
405         throws com.liferay.portal.SystemException {
406         return getService().getMessages(className, classPK);
407     }
408 
409     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getNoAssetMessages()
410         throws com.liferay.portal.SystemException {
411         return getService().getNoAssetMessages();
412     }
413 
414     public static int getPositionInThread(long messageId)
415         throws com.liferay.portal.PortalException,
416             com.liferay.portal.SystemException {
417         return getService().getPositionInThread(messageId);
418     }
419 
420     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
421         long threadId) throws com.liferay.portal.SystemException {
422         return getService().getThreadMessages(threadId);
423     }
424 
425     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
426         long threadId,
427         java.util.Comparator<com.liferay.portlet.messageboards.model.MBMessage> comparator)
428         throws com.liferay.portal.SystemException {
429         return getService().getThreadMessages(threadId, comparator);
430     }
431 
432     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
433         long threadId, int start, int end)
434         throws com.liferay.portal.SystemException {
435         return getService().getThreadMessages(threadId, start, end);
436     }
437 
438     public static int getThreadMessagesCount(long threadId)
439         throws com.liferay.portal.SystemException {
440         return getService().getThreadMessagesCount(threadId);
441     }
442 
443     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadRepliesMessages(
444         long threadId, int start, int end)
445         throws com.liferay.portal.SystemException {
446         return getService().getThreadRepliesMessages(threadId, start, end);
447     }
448 
449     public static void reIndex(long messageId)
450         throws com.liferay.portal.SystemException {
451         getService().reIndex(messageId);
452     }
453 
454     public static void reIndex(
455         com.liferay.portlet.messageboards.model.MBMessage message)
456         throws com.liferay.portal.SystemException {
457         getService().reIndex(message);
458     }
459 
460     public static void subscribeMessage(long userId, long messageId)
461         throws com.liferay.portal.PortalException,
462             com.liferay.portal.SystemException {
463         getService().subscribeMessage(userId, messageId);
464     }
465 
466     public static void unsubscribeMessage(long userId, long messageId)
467         throws com.liferay.portal.PortalException,
468             com.liferay.portal.SystemException {
469         getService().unsubscribeMessage(userId, messageId);
470     }
471 
472     public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
473         long userId, long messageId, java.lang.String subject,
474         java.lang.String body)
475         throws com.liferay.portal.PortalException,
476             com.liferay.portal.SystemException {
477         return getService()
478                    .updateDiscussionMessage(userId, messageId, subject, body);
479     }
480 
481     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
482         long messageId, java.util.Date createDate, java.util.Date modifiedDate)
483         throws com.liferay.portal.PortalException,
484             com.liferay.portal.SystemException {
485         return getService().updateMessage(messageId, createDate, modifiedDate);
486     }
487 
488     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
489         long userId, long messageId, java.lang.String subject,
490         java.lang.String body,
491         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
492         java.util.List<java.lang.String> existingFiles, double priority,
493         com.liferay.portal.service.ServiceContext serviceContext)
494         throws com.liferay.portal.PortalException,
495             com.liferay.portal.SystemException {
496         return getService()
497                    .updateMessage(userId, messageId, subject, body, files,
498             existingFiles, priority, serviceContext);
499     }
500 
501     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
502         long messageId, java.lang.String body)
503         throws com.liferay.portal.PortalException,
504             com.liferay.portal.SystemException {
505         return getService().updateMessage(messageId, body);
506     }
507 
508     public static void updateTagsAsset(long userId,
509         com.liferay.portlet.messageboards.model.MBMessage message,
510         java.lang.String[] tagsEntries)
511         throws com.liferay.portal.PortalException,
512             com.liferay.portal.SystemException {
513         getService().updateTagsAsset(userId, message, tagsEntries);
514     }
515 
516     public static MBMessageLocalService getService() {
517         if (_service == null) {
518             _service = (MBMessageLocalService)PortalBeanLocatorUtil.locate(MBMessageLocalService.class.getName());
519 
520             ReferenceRegistry.registerReference(MBMessageLocalServiceUtil.class,
521                 "_service");
522             MethodCache.remove(MBMessageLocalService.class);
523         }
524 
525         return _service;
526     }
527 
528     public void setService(MBMessageLocalService service) {
529         MethodCache.remove(MBMessageLocalService.class);
530 
531         _service = service;
532 
533         ReferenceRegistry.registerReference(MBMessageLocalServiceUtil.class,
534             "_service");
535         MethodCache.remove(MBMessageLocalService.class);
536     }
537 
538     private static MBMessageLocalService _service;
539 }