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