1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.messageboards.service;
21  
22  
23  /**
24   * <a href="MBMessageServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portlet.messageboards.service.MBMessageService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portlet.messageboards.service.MBMessageService
42   *
43   */
44  public class MBMessageServiceUtil {
45      public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
46          java.lang.String className, long classPK, long threadId,
47          long parentMessageId, java.lang.String subject, java.lang.String body,
48          com.liferay.portal.service.ServiceContext serviceContext)
49          throws com.liferay.portal.PortalException,
50              com.liferay.portal.SystemException {
51          return getService()
52                     .addDiscussionMessage(className, classPK, threadId,
53              parentMessageId, subject, body, serviceContext);
54      }
55  
56      public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
57          long categoryId, java.lang.String subject, java.lang.String body,
58          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
59          boolean anonymous, double priority,
60          com.liferay.portal.service.ServiceContext serviceContext)
61          throws com.liferay.portal.PortalException,
62              com.liferay.portal.SystemException {
63          return getService()
64                     .addMessage(categoryId, subject, body, files, anonymous,
65              priority, serviceContext);
66      }
67  
68      public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
69          long categoryId, long threadId, long parentMessageId,
70          java.lang.String subject, java.lang.String body,
71          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
72          boolean anonymous, double priority,
73          com.liferay.portal.service.ServiceContext serviceContext)
74          throws com.liferay.portal.PortalException,
75              com.liferay.portal.SystemException {
76          return getService()
77                     .addMessage(categoryId, threadId, parentMessageId, subject,
78              body, files, anonymous, priority, serviceContext);
79      }
80  
81      public static void deleteDiscussionMessage(long groupId,
82          java.lang.String className, long classPK, long messageId)
83          throws com.liferay.portal.PortalException,
84              com.liferay.portal.SystemException {
85          getService()
86              .deleteDiscussionMessage(groupId, className, classPK, messageId);
87      }
88  
89      public static void deleteMessage(long messageId)
90          throws com.liferay.portal.PortalException,
91              com.liferay.portal.SystemException {
92          getService().deleteMessage(messageId);
93      }
94  
95      public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
96          long categoryId, int start, int end)
97          throws com.liferay.portal.PortalException,
98              com.liferay.portal.SystemException {
99          return getService().getCategoryMessages(categoryId, start, end);
100     }
101 
102     public static int getCategoryMessagesCount(long categoryId)
103         throws com.liferay.portal.SystemException {
104         return getService().getCategoryMessagesCount(categoryId);
105     }
106 
107     public static java.lang.String getCategoryMessagesRSS(long categoryId,
108         int max, java.lang.String type, double version,
109         java.lang.String displayStyle, java.lang.String feedURL,
110         java.lang.String entryURL,
111         com.liferay.portal.theme.ThemeDisplay themeDisplay)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException {
114         return getService()
115                    .getCategoryMessagesRSS(categoryId, max, type, version,
116             displayStyle, feedURL, entryURL, themeDisplay);
117     }
118 
119     public static java.lang.String getCompanyMessagesRSS(long companyId,
120         int max, java.lang.String type, double version,
121         java.lang.String displayStyle, java.lang.String feedURL,
122         java.lang.String entryURL,
123         com.liferay.portal.theme.ThemeDisplay themeDisplay)
124         throws com.liferay.portal.PortalException,
125             com.liferay.portal.SystemException {
126         return getService()
127                    .getCompanyMessagesRSS(companyId, max, type, version,
128             displayStyle, feedURL, entryURL, themeDisplay);
129     }
130 
131     public static java.lang.String getGroupMessagesRSS(long groupId, int max,
132         java.lang.String type, double version, java.lang.String displayStyle,
133         java.lang.String feedURL, java.lang.String entryURL,
134         com.liferay.portal.theme.ThemeDisplay themeDisplay)
135         throws com.liferay.portal.PortalException,
136             com.liferay.portal.SystemException {
137         return getService()
138                    .getGroupMessagesRSS(groupId, max, type, version,
139             displayStyle, feedURL, entryURL, themeDisplay);
140     }
141 
142     public static java.lang.String getGroupMessagesRSS(long groupId,
143         long userId, int max, java.lang.String type, double version,
144         java.lang.String displayStyle, java.lang.String feedURL,
145         java.lang.String entryURL,
146         com.liferay.portal.theme.ThemeDisplay themeDisplay)
147         throws com.liferay.portal.PortalException,
148             com.liferay.portal.SystemException {
149         return getService()
150                    .getGroupMessagesRSS(groupId, userId, max, type, version,
151             displayStyle, feedURL, entryURL, themeDisplay);
152     }
153 
154     public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
155         long messageId)
156         throws com.liferay.portal.PortalException,
157             com.liferay.portal.SystemException {
158         return getService().getMessage(messageId);
159     }
160 
161     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
162         long messageId, java.lang.String threadView)
163         throws com.liferay.portal.PortalException,
164             com.liferay.portal.SystemException {
165         return getService().getMessageDisplay(messageId, threadView);
166     }
167 
168     public static java.lang.String getThreadMessagesRSS(long threadId, int max,
169         java.lang.String type, double version, java.lang.String displayStyle,
170         java.lang.String feedURL, java.lang.String entryURL,
171         com.liferay.portal.theme.ThemeDisplay themeDisplay)
172         throws com.liferay.portal.PortalException,
173             com.liferay.portal.SystemException {
174         return getService()
175                    .getThreadMessagesRSS(threadId, max, type, version,
176             displayStyle, feedURL, entryURL, themeDisplay);
177     }
178 
179     public static void subscribeMessage(long messageId)
180         throws com.liferay.portal.PortalException,
181             com.liferay.portal.SystemException {
182         getService().subscribeMessage(messageId);
183     }
184 
185     public static void unsubscribeMessage(long messageId)
186         throws com.liferay.portal.PortalException,
187             com.liferay.portal.SystemException {
188         getService().unsubscribeMessage(messageId);
189     }
190 
191     public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
192         java.lang.String className, long classPK, long messageId,
193         java.lang.String subject, java.lang.String body,
194         com.liferay.portal.service.ServiceContext serviceContext)
195         throws com.liferay.portal.PortalException,
196             com.liferay.portal.SystemException {
197         return getService()
198                    .updateDiscussionMessage(className, classPK, messageId,
199             subject, body, serviceContext);
200     }
201 
202     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
203         long messageId, java.lang.String subject, java.lang.String body,
204         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
205         java.util.List<String> existingFiles, double priority,
206         com.liferay.portal.service.ServiceContext serviceContext)
207         throws com.liferay.portal.PortalException,
208             com.liferay.portal.SystemException {
209         return getService()
210                    .updateMessage(messageId, subject, body, files,
211             existingFiles, priority, serviceContext);
212     }
213 
214     public static MBMessageService getService() {
215         if (_service == null) {
216             throw new RuntimeException("MBMessageService is not set");
217         }
218 
219         return _service;
220     }
221 
222     public void setService(MBMessageService service) {
223         _service = service;
224     }
225 
226     private static MBMessageService _service;
227 }