1   /**
2    * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.messageboards.service;
24  
25  /**
26   * <a href="MBMessageLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portlet.messageboards.service.MBMessageLocalService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portlet.messageboards.service.MBMessageLocalServiceFactory</code>
42   * is responsible for the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portlet.messageboards.service.MBMessageLocalService
48   * @see com.liferay.portlet.messageboards.service.MBMessageLocalServiceFactory
49   *
50   */
51  public class MBMessageLocalServiceUtil {
52      public static com.liferay.portlet.messageboards.model.MBMessage addMBMessage(
53          com.liferay.portlet.messageboards.model.MBMessage model)
54          throws com.liferay.portal.SystemException {
55          MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
56  
57          return mbMessageLocalService.addMBMessage(model);
58      }
59  
60      public static java.util.List dynamicQuery(
61          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
62          throws com.liferay.portal.SystemException {
63          MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
64  
65          return mbMessageLocalService.dynamicQuery(queryInitializer);
66      }
67  
68      public static java.util.List dynamicQuery(
69          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
70          int begin, int end) throws com.liferay.portal.SystemException {
71          MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
72  
73          return mbMessageLocalService.dynamicQuery(queryInitializer, begin, end);
74      }
75  
76      public static com.liferay.portlet.messageboards.model.MBMessage updateMBMessage(
77          com.liferay.portlet.messageboards.model.MBMessage model)
78          throws com.liferay.portal.SystemException {
79          MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
80  
81          return mbMessageLocalService.updateMBMessage(model);
82      }
83  
84      public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
85          long userId, java.lang.String subject, java.lang.String body)
86          throws com.liferay.portal.PortalException, 
87              com.liferay.portal.SystemException {
88          MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
89  
90          return mbMessageLocalService.addDiscussionMessage(userId, subject, body);
91      }
92  
93      public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
94          long userId, long groupId, java.lang.String className, long classPK,
95          long threadId, long parentMessageId, java.lang.String subject,
96          java.lang.String body,
97          com.liferay.portal.theme.ThemeDisplay themeDisplay)
98          throws com.liferay.portal.PortalException, 
99              com.liferay.portal.SystemException {
100         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
101 
102         return mbMessageLocalService.addDiscussionMessage(userId, groupId,
103             className, classPK, threadId, parentMessageId, subject, body,
104             themeDisplay);
105     }
106 
107     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
108         long userId, long categoryId, java.lang.String subject,
109         java.lang.String body, java.util.List files, boolean anonymous,
110         double priority, java.lang.String[] tagsEntries,
111         javax.portlet.PortletPreferences prefs,
112         boolean addCommunityPermissions, boolean addGuestPermissions)
113         throws com.liferay.portal.PortalException, 
114             com.liferay.portal.SystemException {
115         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
116 
117         return mbMessageLocalService.addMessage(userId, categoryId, subject,
118             body, files, anonymous, priority, tagsEntries, prefs,
119             addCommunityPermissions, addGuestPermissions);
120     }
121 
122     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
123         long userId, long categoryId, java.lang.String subject,
124         java.lang.String body, java.util.List files, boolean anonymous,
125         double priority, java.lang.String[] tagsEntries,
126         javax.portlet.PortletPreferences prefs,
127         java.lang.String[] communityPermissions,
128         java.lang.String[] guestPermissions)
129         throws com.liferay.portal.PortalException, 
130             com.liferay.portal.SystemException {
131         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
132 
133         return mbMessageLocalService.addMessage(userId, categoryId, subject,
134             body, files, anonymous, priority, tagsEntries, prefs,
135             communityPermissions, guestPermissions);
136     }
137 
138     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
139         long userId, long categoryId, java.lang.String subject,
140         java.lang.String body, java.util.List files, boolean anonymous,
141         double priority, java.lang.String[] tagsEntries,
142         javax.portlet.PortletPreferences prefs,
143         java.lang.Boolean addCommunityPermissions,
144         java.lang.Boolean addGuestPermissions,
145         java.lang.String[] communityPermissions,
146         java.lang.String[] guestPermissions)
147         throws com.liferay.portal.PortalException, 
148             com.liferay.portal.SystemException {
149         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
150 
151         return mbMessageLocalService.addMessage(userId, categoryId, subject,
152             body, files, anonymous, priority, tagsEntries, prefs,
153             addCommunityPermissions, addGuestPermissions, communityPermissions,
154             guestPermissions);
155     }
156 
157     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
158         long userId, long categoryId, long threadId, long parentMessageId,
159         java.lang.String subject, java.lang.String body, java.util.List files,
160         boolean anonymous, double priority, java.lang.String[] tagsEntries,
161         javax.portlet.PortletPreferences prefs,
162         boolean addCommunityPermissions, boolean addGuestPermissions)
163         throws com.liferay.portal.PortalException, 
164             com.liferay.portal.SystemException {
165         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
166 
167         return mbMessageLocalService.addMessage(userId, categoryId, threadId,
168             parentMessageId, subject, body, files, anonymous, priority,
169             tagsEntries, prefs, addCommunityPermissions, addGuestPermissions);
170     }
171 
172     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
173         long userId, long categoryId, long threadId, long parentMessageId,
174         java.lang.String subject, java.lang.String body, java.util.List files,
175         boolean anonymous, double priority, java.lang.String[] tagsEntries,
176         javax.portlet.PortletPreferences prefs,
177         java.lang.String[] communityPermissions,
178         java.lang.String[] guestPermissions)
179         throws com.liferay.portal.PortalException, 
180             com.liferay.portal.SystemException {
181         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
182 
183         return mbMessageLocalService.addMessage(userId, categoryId, threadId,
184             parentMessageId, subject, body, files, anonymous, priority,
185             tagsEntries, prefs, communityPermissions, guestPermissions);
186     }
187 
188     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
189         long userId, long categoryId, long threadId, long parentMessageId,
190         java.lang.String subject, java.lang.String body, java.util.List files,
191         boolean anonymous, double priority, java.lang.String[] tagsEntries,
192         javax.portlet.PortletPreferences prefs,
193         java.lang.Boolean addCommunityPermissions,
194         java.lang.Boolean addGuestPermissions,
195         java.lang.String[] communityPermissions,
196         java.lang.String[] guestPermissions)
197         throws com.liferay.portal.PortalException, 
198             com.liferay.portal.SystemException {
199         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
200 
201         return mbMessageLocalService.addMessage(userId, categoryId, threadId,
202             parentMessageId, subject, body, files, anonymous, priority,
203             tagsEntries, prefs, addCommunityPermissions, addGuestPermissions,
204             communityPermissions, guestPermissions);
205     }
206 
207     public static void addMessageResources(long categoryId, long messageId,
208         boolean addCommunityPermissions, boolean addGuestPermissions)
209         throws com.liferay.portal.PortalException, 
210             com.liferay.portal.SystemException {
211         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
212         mbMessageLocalService.addMessageResources(categoryId, messageId,
213             addCommunityPermissions, addGuestPermissions);
214     }
215 
216     public static void addMessageResources(long categoryId,
217         java.lang.String topicId, long messageId,
218         boolean addCommunityPermissions, boolean addGuestPermissions)
219         throws com.liferay.portal.PortalException, 
220             com.liferay.portal.SystemException {
221         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
222         mbMessageLocalService.addMessageResources(categoryId, topicId,
223             messageId, addCommunityPermissions, addGuestPermissions);
224     }
225 
226     public static void addMessageResources(
227         com.liferay.portlet.messageboards.model.MBCategory category,
228         com.liferay.portlet.messageboards.model.MBMessage message,
229         boolean addCommunityPermissions, boolean addGuestPermissions)
230         throws com.liferay.portal.PortalException, 
231             com.liferay.portal.SystemException {
232         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
233         mbMessageLocalService.addMessageResources(category, message,
234             addCommunityPermissions, addGuestPermissions);
235     }
236 
237     public static void addMessageResources(long categoryId, long messageId,
238         java.lang.String[] communityPermissions,
239         java.lang.String[] guestPermissions)
240         throws com.liferay.portal.PortalException, 
241             com.liferay.portal.SystemException {
242         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
243         mbMessageLocalService.addMessageResources(categoryId, messageId,
244             communityPermissions, guestPermissions);
245     }
246 
247     public static void addMessageResources(long categoryId,
248         java.lang.String topicId, long messageId,
249         java.lang.String[] communityPermissions,
250         java.lang.String[] guestPermissions)
251         throws com.liferay.portal.PortalException, 
252             com.liferay.portal.SystemException {
253         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
254         mbMessageLocalService.addMessageResources(categoryId, topicId,
255             messageId, communityPermissions, guestPermissions);
256     }
257 
258     public static void addMessageResources(
259         com.liferay.portlet.messageboards.model.MBCategory category,
260         com.liferay.portlet.messageboards.model.MBMessage message,
261         java.lang.String[] communityPermissions,
262         java.lang.String[] guestPermissions)
263         throws com.liferay.portal.PortalException, 
264             com.liferay.portal.SystemException {
265         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
266         mbMessageLocalService.addMessageResources(category, message,
267             communityPermissions, guestPermissions);
268     }
269 
270     public static void deleteDiscussionMessage(long messageId)
271         throws com.liferay.portal.PortalException, 
272             com.liferay.portal.SystemException {
273         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
274         mbMessageLocalService.deleteDiscussionMessage(messageId);
275     }
276 
277     public static void deleteDiscussionMessages(java.lang.String className,
278         long classPK)
279         throws com.liferay.portal.PortalException, 
280             com.liferay.portal.SystemException {
281         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
282         mbMessageLocalService.deleteDiscussionMessages(className, classPK);
283     }
284 
285     public static void deleteMessage(long messageId)
286         throws com.liferay.portal.PortalException, 
287             com.liferay.portal.SystemException {
288         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
289         mbMessageLocalService.deleteMessage(messageId);
290     }
291 
292     public static void deleteMessage(
293         com.liferay.portlet.messageboards.model.MBMessage message)
294         throws com.liferay.portal.PortalException, 
295             com.liferay.portal.SystemException {
296         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
297         mbMessageLocalService.deleteMessage(message);
298     }
299 
300     public static java.util.List getCategoryMessages(long categoryId,
301         int begin, int end) throws com.liferay.portal.SystemException {
302         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
303 
304         return mbMessageLocalService.getCategoryMessages(categoryId, begin, end);
305     }
306 
307     public static java.util.List getCategoryMessages(long categoryId,
308         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
309         throws com.liferay.portal.SystemException {
310         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
311 
312         return mbMessageLocalService.getCategoryMessages(categoryId, begin,
313             end, obc);
314     }
315 
316     public static int getCategoryMessagesCount(long categoryId)
317         throws com.liferay.portal.SystemException {
318         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
319 
320         return mbMessageLocalService.getCategoryMessagesCount(categoryId);
321     }
322 
323     public static int getCategoriesMessagesCount(java.util.List categoryIds)
324         throws com.liferay.portal.SystemException {
325         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
326 
327         return mbMessageLocalService.getCategoriesMessagesCount(categoryIds);
328     }
329 
330     public static java.util.List getCompanyMessages(long companyId, int begin,
331         int end) throws com.liferay.portal.SystemException {
332         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
333 
334         return mbMessageLocalService.getCompanyMessages(companyId, begin, end);
335     }
336 
337     public static java.util.List getCompanyMessages(long companyId, int begin,
338         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
339         throws com.liferay.portal.SystemException {
340         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
341 
342         return mbMessageLocalService.getCompanyMessages(companyId, begin, end,
343             obc);
344     }
345 
346     public static int getCompanyMessagesCount(long companyId)
347         throws com.liferay.portal.SystemException {
348         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
349 
350         return mbMessageLocalService.getCompanyMessagesCount(companyId);
351     }
352 
353     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getDiscussionMessageDisplay(
354         long userId, java.lang.String className, long classPK)
355         throws com.liferay.portal.PortalException, 
356             com.liferay.portal.SystemException {
357         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
358 
359         return mbMessageLocalService.getDiscussionMessageDisplay(userId,
360             className, classPK);
361     }
362 
363     public static int getDiscussionMessagesCount(long classNameId, long classPK)
364         throws com.liferay.portal.SystemException {
365         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
366 
367         return mbMessageLocalService.getDiscussionMessagesCount(classNameId,
368             classPK);
369     }
370 
371     public static java.util.List getGroupMessages(long groupId, int begin,
372         int end) throws com.liferay.portal.SystemException {
373         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
374 
375         return mbMessageLocalService.getGroupMessages(groupId, begin, end);
376     }
377 
378     public static java.util.List getGroupMessages(long groupId, int begin,
379         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
380         throws com.liferay.portal.SystemException {
381         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
382 
383         return mbMessageLocalService.getGroupMessages(groupId, begin, end, obc);
384     }
385 
386     public static int getGroupMessagesCount(long groupId)
387         throws com.liferay.portal.SystemException {
388         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
389 
390         return mbMessageLocalService.getGroupMessagesCount(groupId);
391     }
392 
393     public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
394         long messageId)
395         throws com.liferay.portal.PortalException, 
396             com.liferay.portal.SystemException {
397         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
398 
399         return mbMessageLocalService.getMessage(messageId);
400     }
401 
402     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
403         long messageId)
404         throws com.liferay.portal.PortalException, 
405             com.liferay.portal.SystemException {
406         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
407 
408         return mbMessageLocalService.getMessageDisplay(messageId);
409     }
410 
411     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
412         com.liferay.portlet.messageboards.model.MBMessage message)
413         throws com.liferay.portal.PortalException, 
414             com.liferay.portal.SystemException {
415         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
416 
417         return mbMessageLocalService.getMessageDisplay(message);
418     }
419 
420     public static java.util.List getThreadMessages(long threadId)
421         throws com.liferay.portal.SystemException {
422         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
423 
424         return mbMessageLocalService.getThreadMessages(threadId);
425     }
426 
427     public static java.util.List getThreadMessages(long threadId,
428         java.util.Comparator comparator)
429         throws com.liferay.portal.SystemException {
430         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
431 
432         return mbMessageLocalService.getThreadMessages(threadId, comparator);
433     }
434 
435     public static int getThreadMessagesCount(long threadId)
436         throws com.liferay.portal.SystemException {
437         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
438 
439         return mbMessageLocalService.getThreadMessagesCount(threadId);
440     }
441 
442     public static void subscribeMessage(long userId, long messageId)
443         throws com.liferay.portal.PortalException, 
444             com.liferay.portal.SystemException {
445         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
446         mbMessageLocalService.subscribeMessage(userId, messageId);
447     }
448 
449     public static void unsubscribeMessage(long userId, long messageId)
450         throws com.liferay.portal.PortalException, 
451             com.liferay.portal.SystemException {
452         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
453         mbMessageLocalService.unsubscribeMessage(userId, messageId);
454     }
455 
456     public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
457         long messageId, java.lang.String subject, java.lang.String body)
458         throws com.liferay.portal.PortalException, 
459             com.liferay.portal.SystemException {
460         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
461 
462         return mbMessageLocalService.updateDiscussionMessage(messageId,
463             subject, body);
464     }
465 
466     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
467         long messageId, long categoryId, java.lang.String subject,
468         java.lang.String body, java.util.List files, double priority,
469         java.lang.String[] tagsEntries, javax.portlet.PortletPreferences prefs)
470         throws com.liferay.portal.PortalException, 
471             com.liferay.portal.SystemException {
472         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
473 
474         return mbMessageLocalService.updateMessage(messageId, categoryId,
475             subject, body, files, priority, tagsEntries, prefs);
476     }
477 
478     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
479         long messageId, java.util.Date createDate, java.util.Date modifiedDate)
480         throws com.liferay.portal.PortalException, 
481             com.liferay.portal.SystemException {
482         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
483 
484         return mbMessageLocalService.updateMessage(messageId, createDate,
485             modifiedDate);
486     }
487 
488     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
489         long messageId, java.lang.String body)
490         throws com.liferay.portal.PortalException, 
491             com.liferay.portal.SystemException {
492         MBMessageLocalService mbMessageLocalService = MBMessageLocalServiceFactory.getService();
493 
494         return mbMessageLocalService.updateMessage(messageId, body);
495     }
496 }