1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.messageboards.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="MBMessageServiceUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * <p>
23   * ServiceBuilder generated this class. Modifications in this class will be
24   * overwritten the next time is generated.
25   * </p>
26   *
27   * <p>
28   * This class provides static methods for the
29   * {@link MBMessageService} bean. The static methods of
30   * this class calls the same methods of the bean instance. It's convenient to be
31   * able to just write one line to call a method on a bean instead of writing a
32   * lookup call and a method call.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       MBMessageService
37   * @generated
38   */
39  public class MBMessageServiceUtil {
40      public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
41          long groupId, java.lang.String className, long classPK,
42          java.lang.String permissionClassName, long permissionClassPK,
43          long threadId, long parentMessageId, java.lang.String subject,
44          java.lang.String body,
45          com.liferay.portal.service.ServiceContext serviceContext)
46          throws com.liferay.portal.kernel.exception.PortalException,
47              com.liferay.portal.kernel.exception.SystemException {
48          return getService()
49                     .addDiscussionMessage(groupId, className, classPK,
50              permissionClassName, permissionClassPK, threadId, parentMessageId,
51              subject, body, serviceContext);
52      }
53  
54      public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
55          long groupId, long categoryId, java.lang.String subject,
56          java.lang.String body,
57          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
58          boolean anonymous, double priority, boolean allowPingbacks,
59          com.liferay.portal.service.ServiceContext serviceContext)
60          throws com.liferay.portal.kernel.exception.PortalException,
61              com.liferay.portal.kernel.exception.SystemException {
62          return getService()
63                     .addMessage(groupId, categoryId, subject, body, files,
64              anonymous, priority, allowPingbacks, serviceContext);
65      }
66  
67      public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
68          long groupId, long categoryId, long threadId, long parentMessageId,
69          java.lang.String subject, java.lang.String body,
70          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
71          boolean anonymous, double priority, boolean allowPingbacks,
72          com.liferay.portal.service.ServiceContext serviceContext)
73          throws com.liferay.portal.kernel.exception.PortalException,
74              com.liferay.portal.kernel.exception.SystemException {
75          return getService()
76                     .addMessage(groupId, categoryId, threadId, parentMessageId,
77              subject, body, files, anonymous, priority, allowPingbacks,
78              serviceContext);
79      }
80  
81      public static void deleteDiscussionMessage(long groupId,
82          java.lang.String className, long classPK,
83          java.lang.String permissionClassName, long permissionClassPK,
84          long messageId)
85          throws com.liferay.portal.kernel.exception.PortalException,
86              com.liferay.portal.kernel.exception.SystemException {
87          getService()
88              .deleteDiscussionMessage(groupId, className, classPK,
89              permissionClassName, permissionClassPK, messageId);
90      }
91  
92      public static void deleteMessage(long messageId)
93          throws com.liferay.portal.kernel.exception.PortalException,
94              com.liferay.portal.kernel.exception.SystemException {
95          getService().deleteMessage(messageId);
96      }
97  
98      public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
99          long groupId, long categoryId, int status, int start, int end)
100         throws com.liferay.portal.kernel.exception.PortalException,
101             com.liferay.portal.kernel.exception.SystemException {
102         return getService()
103                    .getCategoryMessages(groupId, categoryId, status, start, end);
104     }
105 
106     public static int getCategoryMessagesCount(long groupId, long categoryId,
107         int status) throws com.liferay.portal.kernel.exception.SystemException {
108         return getService().getCategoryMessagesCount(groupId, categoryId, status);
109     }
110 
111     public static java.lang.String getCategoryMessagesRSS(long groupId,
112         long categoryId, int status, int max, java.lang.String type,
113         double version, java.lang.String displayStyle,
114         java.lang.String feedURL, java.lang.String entryURL,
115         com.liferay.portal.theme.ThemeDisplay themeDisplay)
116         throws com.liferay.portal.kernel.exception.PortalException,
117             com.liferay.portal.kernel.exception.SystemException {
118         return getService()
119                    .getCategoryMessagesRSS(groupId, categoryId, status, max,
120             type, version, displayStyle, feedURL, entryURL, themeDisplay);
121     }
122 
123     public static java.lang.String getCompanyMessagesRSS(long companyId,
124         int status, int max, java.lang.String type, double version,
125         java.lang.String displayStyle, java.lang.String feedURL,
126         java.lang.String entryURL,
127         com.liferay.portal.theme.ThemeDisplay themeDisplay)
128         throws com.liferay.portal.kernel.exception.PortalException,
129             com.liferay.portal.kernel.exception.SystemException {
130         return getService()
131                    .getCompanyMessagesRSS(companyId, status, max, type,
132             version, displayStyle, feedURL, entryURL, themeDisplay);
133     }
134 
135     public static java.lang.String getGroupMessagesRSS(long groupId,
136         int status, int max, java.lang.String type, double version,
137         java.lang.String displayStyle, java.lang.String feedURL,
138         java.lang.String entryURL,
139         com.liferay.portal.theme.ThemeDisplay themeDisplay)
140         throws com.liferay.portal.kernel.exception.PortalException,
141             com.liferay.portal.kernel.exception.SystemException {
142         return getService()
143                    .getGroupMessagesRSS(groupId, status, max, type, version,
144             displayStyle, feedURL, entryURL, themeDisplay);
145     }
146 
147     public static java.lang.String getGroupMessagesRSS(long groupId,
148         long userId, int status, int max, java.lang.String type,
149         double version, java.lang.String displayStyle,
150         java.lang.String feedURL, java.lang.String entryURL,
151         com.liferay.portal.theme.ThemeDisplay themeDisplay)
152         throws com.liferay.portal.kernel.exception.PortalException,
153             com.liferay.portal.kernel.exception.SystemException {
154         return getService()
155                    .getGroupMessagesRSS(groupId, userId, status, max, type,
156             version, displayStyle, feedURL, entryURL, themeDisplay);
157     }
158 
159     public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
160         long messageId)
161         throws com.liferay.portal.kernel.exception.PortalException,
162             com.liferay.portal.kernel.exception.SystemException {
163         return getService().getMessage(messageId);
164     }
165 
166     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
167         long messageId, int status, java.lang.String threadView,
168         boolean includePrevAndNext)
169         throws com.liferay.portal.kernel.exception.PortalException,
170             com.liferay.portal.kernel.exception.SystemException {
171         return getService()
172                    .getMessageDisplay(messageId, status, threadView,
173             includePrevAndNext);
174     }
175 
176     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getThreadMessages(
177         long groupId, long categoryId, long threadId, int status, int start,
178         int end) throws com.liferay.portal.kernel.exception.SystemException {
179         return getService()
180                    .getThreadMessages(groupId, categoryId, threadId, status,
181             start, end);
182     }
183 
184     public static int getThreadMessagesCount(long groupId, long categoryId,
185         long threadId, int status)
186         throws com.liferay.portal.kernel.exception.SystemException {
187         return getService()
188                    .getThreadMessagesCount(groupId, categoryId, threadId, status);
189     }
190 
191     public static java.lang.String getThreadMessagesRSS(long threadId,
192         int status, int max, java.lang.String type, double version,
193         java.lang.String displayStyle, java.lang.String feedURL,
194         java.lang.String entryURL,
195         com.liferay.portal.theme.ThemeDisplay themeDisplay)
196         throws com.liferay.portal.kernel.exception.PortalException,
197             com.liferay.portal.kernel.exception.SystemException {
198         return getService()
199                    .getThreadMessagesRSS(threadId, status, max, type, version,
200             displayStyle, feedURL, entryURL, themeDisplay);
201     }
202 
203     public static void subscribeMessage(long messageId)
204         throws com.liferay.portal.kernel.exception.PortalException,
205             com.liferay.portal.kernel.exception.SystemException {
206         getService().subscribeMessage(messageId);
207     }
208 
209     public static void unsubscribeMessage(long messageId)
210         throws com.liferay.portal.kernel.exception.PortalException,
211             com.liferay.portal.kernel.exception.SystemException {
212         getService().unsubscribeMessage(messageId);
213     }
214 
215     public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
216         java.lang.String className, long classPK,
217         java.lang.String permissionClassName, long permissionClassPK,
218         long messageId, java.lang.String subject, java.lang.String body,
219         com.liferay.portal.service.ServiceContext serviceContext)
220         throws com.liferay.portal.kernel.exception.PortalException,
221             com.liferay.portal.kernel.exception.SystemException {
222         return getService()
223                    .updateDiscussionMessage(className, classPK,
224             permissionClassName, permissionClassPK, messageId, subject, body,
225             serviceContext);
226     }
227 
228     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
229         long messageId, java.lang.String subject, java.lang.String body,
230         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
231         java.util.List<java.lang.String> existingFiles, double priority,
232         boolean allowPingbacks,
233         com.liferay.portal.service.ServiceContext serviceContext)
234         throws com.liferay.portal.kernel.exception.PortalException,
235             com.liferay.portal.kernel.exception.SystemException {
236         return getService()
237                    .updateMessage(messageId, subject, body, files,
238             existingFiles, priority, allowPingbacks, serviceContext);
239     }
240 
241     public static MBMessageService getService() {
242         if (_service == null) {
243             _service = (MBMessageService)PortalBeanLocatorUtil.locate(MBMessageService.class.getName());
244         }
245 
246         return _service;
247     }
248 
249     public void setService(MBMessageService service) {
250         _service = service;
251     }
252 
253     private static MBMessageService _service;
254 }