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="MBMessageServiceUtil.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.MBMessageService</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.MBMessageService
45   *
46   */
47  public class MBMessageServiceUtil {
48      public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
49          java.lang.String className, long classPK, long threadId,
50          long parentMessageId, java.lang.String subject, java.lang.String body,
51          com.liferay.portal.service.ServiceContext serviceContext)
52          throws com.liferay.portal.PortalException,
53              com.liferay.portal.SystemException {
54          return getService()
55                     .addDiscussionMessage(className, classPK, threadId,
56              parentMessageId, subject, body, serviceContext);
57      }
58  
59      public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
60          long categoryId, java.lang.String subject, java.lang.String body,
61          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
62          boolean anonymous, double priority,
63          com.liferay.portal.service.ServiceContext serviceContext)
64          throws com.liferay.portal.PortalException,
65              com.liferay.portal.SystemException {
66          return getService()
67                     .addMessage(categoryId, subject, body, files, anonymous,
68              priority, serviceContext);
69      }
70  
71      public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
72          long categoryId, long threadId, long parentMessageId,
73          java.lang.String subject, java.lang.String body,
74          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
75          boolean anonymous, double priority,
76          com.liferay.portal.service.ServiceContext serviceContext)
77          throws com.liferay.portal.PortalException,
78              com.liferay.portal.SystemException {
79          return getService()
80                     .addMessage(categoryId, threadId, parentMessageId, subject,
81              body, files, anonymous, priority, serviceContext);
82      }
83  
84      public static void deleteDiscussionMessage(long groupId,
85          java.lang.String className, long classPK, long messageId)
86          throws com.liferay.portal.PortalException,
87              com.liferay.portal.SystemException {
88          getService()
89              .deleteDiscussionMessage(groupId, className, classPK, messageId);
90      }
91  
92      public static void deleteMessage(long messageId)
93          throws com.liferay.portal.PortalException,
94              com.liferay.portal.SystemException {
95          getService().deleteMessage(messageId);
96      }
97  
98      public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
99          long categoryId, int start, int end)
100         throws com.liferay.portal.PortalException,
101             com.liferay.portal.SystemException {
102         return getService().getCategoryMessages(categoryId, start, end);
103     }
104 
105     public static int getCategoryMessagesCount(long categoryId)
106         throws com.liferay.portal.SystemException {
107         return getService().getCategoryMessagesCount(categoryId);
108     }
109 
110     public static java.lang.String getCategoryMessagesRSS(long categoryId,
111         int max, java.lang.String type, double version,
112         java.lang.String displayStyle, java.lang.String feedURL,
113         java.lang.String entryURL,
114         com.liferay.portal.theme.ThemeDisplay themeDisplay)
115         throws com.liferay.portal.PortalException,
116             com.liferay.portal.SystemException {
117         return getService()
118                    .getCategoryMessagesRSS(categoryId, max, type, version,
119             displayStyle, feedURL, entryURL, themeDisplay);
120     }
121 
122     public static java.lang.String getCompanyMessagesRSS(long companyId,
123         int max, java.lang.String type, double version,
124         java.lang.String displayStyle, java.lang.String feedURL,
125         java.lang.String entryURL,
126         com.liferay.portal.theme.ThemeDisplay themeDisplay)
127         throws com.liferay.portal.PortalException,
128             com.liferay.portal.SystemException {
129         return getService()
130                    .getCompanyMessagesRSS(companyId, max, type, version,
131             displayStyle, feedURL, entryURL, themeDisplay);
132     }
133 
134     public static java.lang.String getGroupMessagesRSS(long groupId, int max,
135         java.lang.String type, double version, java.lang.String displayStyle,
136         java.lang.String feedURL, java.lang.String entryURL,
137         com.liferay.portal.theme.ThemeDisplay themeDisplay)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException {
140         return getService()
141                    .getGroupMessagesRSS(groupId, max, type, version,
142             displayStyle, feedURL, entryURL, themeDisplay);
143     }
144 
145     public static java.lang.String getGroupMessagesRSS(long groupId,
146         long userId, int max, java.lang.String type, double version,
147         java.lang.String displayStyle, java.lang.String feedURL,
148         java.lang.String entryURL,
149         com.liferay.portal.theme.ThemeDisplay themeDisplay)
150         throws com.liferay.portal.PortalException,
151             com.liferay.portal.SystemException {
152         return getService()
153                    .getGroupMessagesRSS(groupId, userId, max, type, version,
154             displayStyle, feedURL, entryURL, themeDisplay);
155     }
156 
157     public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
158         long messageId)
159         throws com.liferay.portal.PortalException,
160             com.liferay.portal.SystemException {
161         return getService().getMessage(messageId);
162     }
163 
164     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
165         long messageId)
166         throws com.liferay.portal.PortalException,
167             com.liferay.portal.SystemException {
168         return getService().getMessageDisplay(messageId);
169     }
170 
171     public static java.lang.String getThreadMessagesRSS(long threadId, int max,
172         java.lang.String type, double version, java.lang.String displayStyle,
173         java.lang.String feedURL, java.lang.String entryURL,
174         com.liferay.portal.theme.ThemeDisplay themeDisplay)
175         throws com.liferay.portal.PortalException,
176             com.liferay.portal.SystemException {
177         return getService()
178                    .getThreadMessagesRSS(threadId, max, type, version,
179             displayStyle, feedURL, entryURL, themeDisplay);
180     }
181 
182     public static void subscribeMessage(long messageId)
183         throws com.liferay.portal.PortalException,
184             com.liferay.portal.SystemException {
185         getService().subscribeMessage(messageId);
186     }
187 
188     public static void unsubscribeMessage(long messageId)
189         throws com.liferay.portal.PortalException,
190             com.liferay.portal.SystemException {
191         getService().unsubscribeMessage(messageId);
192     }
193 
194     public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
195         java.lang.String className, long classPK, long messageId,
196         java.lang.String subject, java.lang.String body,
197         com.liferay.portal.service.ServiceContext serviceContext)
198         throws com.liferay.portal.PortalException,
199             com.liferay.portal.SystemException {
200         return getService()
201                    .updateDiscussionMessage(className, classPK, messageId,
202             subject, body, serviceContext);
203     }
204 
205     public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
206         long messageId, java.lang.String subject, java.lang.String body,
207         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
208         java.util.List<String> existingFiles, double priority,
209         com.liferay.portal.service.ServiceContext serviceContext)
210         throws com.liferay.portal.PortalException,
211             com.liferay.portal.SystemException {
212         return getService()
213                    .updateMessage(messageId, subject, body, files,
214             existingFiles, priority, serviceContext);
215     }
216 
217     public static MBMessageService getService() {
218         if (_service == null) {
219             throw new RuntimeException("MBMessageService is not set");
220         }
221 
222         return _service;
223     }
224 
225     public void setService(MBMessageService service) {
226         _service = service;
227     }
228 
229     private static MBMessageService _service;
230 }