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