1   /**
2    * Copyright (c) 2000-2008 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="MBThreadLocalServiceUtil.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.MBThreadLocalService</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   * <p>
43   * <code>com.liferay.portlet.messageboards.service.MBThreadLocalServiceFactory</code>
44   * is responsible for the lookup of the bean.
45   * </p>
46   *
47   * @author Brian Wing Shun Chan
48   *
49   * @see com.liferay.portlet.messageboards.service.MBThreadLocalService
50   * @see com.liferay.portlet.messageboards.service.MBThreadLocalServiceFactory
51   *
52   */
53  public class MBThreadLocalServiceUtil {
54      public static com.liferay.portlet.messageboards.model.MBThread addMBThread(
55          com.liferay.portlet.messageboards.model.MBThread mbThread)
56          throws com.liferay.portal.SystemException {
57          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
58  
59          return mbThreadLocalService.addMBThread(mbThread);
60      }
61  
62      public static void deleteMBThread(long threadId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException {
65          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
66  
67          mbThreadLocalService.deleteMBThread(threadId);
68      }
69  
70      public static void deleteMBThread(
71          com.liferay.portlet.messageboards.model.MBThread mbThread)
72          throws com.liferay.portal.SystemException {
73          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
74  
75          mbThreadLocalService.deleteMBThread(mbThread);
76      }
77  
78      public static java.util.List<Object> dynamicQuery(
79          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
80          throws com.liferay.portal.SystemException {
81          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
82  
83          return mbThreadLocalService.dynamicQuery(dynamicQuery);
84      }
85  
86      public static java.util.List<Object> dynamicQuery(
87          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
88          int end) throws com.liferay.portal.SystemException {
89          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
90  
91          return mbThreadLocalService.dynamicQuery(dynamicQuery, start, end);
92      }
93  
94      public static com.liferay.portlet.messageboards.model.MBThread getMBThread(
95          long threadId)
96          throws com.liferay.portal.PortalException,
97              com.liferay.portal.SystemException {
98          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
99  
100         return mbThreadLocalService.getMBThread(threadId);
101     }
102 
103     public static com.liferay.portlet.messageboards.model.MBThread updateMBThread(
104         com.liferay.portlet.messageboards.model.MBThread mbThread)
105         throws com.liferay.portal.SystemException {
106         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
107 
108         return mbThreadLocalService.updateMBThread(mbThread);
109     }
110 
111     public static void deleteThread(long threadId)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException {
114         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
115 
116         mbThreadLocalService.deleteThread(threadId);
117     }
118 
119     public static void deleteThread(
120         com.liferay.portlet.messageboards.model.MBThread thread)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException {
123         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
124 
125         mbThreadLocalService.deleteThread(thread);
126     }
127 
128     public static void deleteThreads(long categoryId)
129         throws com.liferay.portal.PortalException,
130             com.liferay.portal.SystemException {
131         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
132 
133         mbThreadLocalService.deleteThreads(categoryId);
134     }
135 
136     public static int getCategoriesThreadsCount(
137         java.util.List<Long> categoryIds)
138         throws com.liferay.portal.SystemException {
139         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
140 
141         return mbThreadLocalService.getCategoriesThreadsCount(categoryIds);
142     }
143 
144     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
145         long groupId, int start, int end)
146         throws com.liferay.portal.SystemException {
147         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
148 
149         return mbThreadLocalService.getGroupThreads(groupId, start, end);
150     }
151 
152     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
153         long groupId, long userId, int start, int end)
154         throws com.liferay.portal.SystemException {
155         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
156 
157         return mbThreadLocalService.getGroupThreads(groupId, userId, start, end);
158     }
159 
160     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
161         long groupId, long userId, boolean subscribed, int start, int end)
162         throws com.liferay.portal.SystemException {
163         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
164 
165         return mbThreadLocalService.getGroupThreads(groupId, userId,
166             subscribed, start, end);
167     }
168 
169     public static int getGroupThreadsCount(long groupId)
170         throws com.liferay.portal.SystemException {
171         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
172 
173         return mbThreadLocalService.getGroupThreadsCount(groupId);
174     }
175 
176     public static int getGroupThreadsCount(long groupId, long userId)
177         throws com.liferay.portal.SystemException {
178         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
179 
180         return mbThreadLocalService.getGroupThreadsCount(groupId, userId);
181     }
182 
183     public static int getGroupThreadsCount(long groupId, long userId,
184         boolean subscribed) throws com.liferay.portal.SystemException {
185         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
186 
187         return mbThreadLocalService.getGroupThreadsCount(groupId, userId,
188             subscribed);
189     }
190 
191     public static com.liferay.portlet.messageboards.model.MBThread getThread(
192         long threadId)
193         throws com.liferay.portal.PortalException,
194             com.liferay.portal.SystemException {
195         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
196 
197         return mbThreadLocalService.getThread(threadId);
198     }
199 
200     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getThreads(
201         long categoryId, int start, int end)
202         throws com.liferay.portal.SystemException {
203         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
204 
205         return mbThreadLocalService.getThreads(categoryId, start, end);
206     }
207 
208     public static int getThreadsCount(long categoryId)
209         throws com.liferay.portal.SystemException {
210         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
211 
212         return mbThreadLocalService.getThreadsCount(categoryId);
213     }
214 
215     public static boolean hasReadThread(long userId, long threadId)
216         throws com.liferay.portal.PortalException,
217             com.liferay.portal.SystemException {
218         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
219 
220         return mbThreadLocalService.hasReadThread(userId, threadId);
221     }
222 
223     public static com.liferay.portlet.messageboards.model.MBThread moveThread(
224         long categoryId, long threadId)
225         throws com.liferay.portal.PortalException,
226             com.liferay.portal.SystemException {
227         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
228 
229         return mbThreadLocalService.moveThread(categoryId, threadId);
230     }
231 
232     public static com.liferay.portlet.messageboards.model.MBThread splitThread(
233         long messageId, javax.portlet.PortletPreferences prefs,
234         com.liferay.portal.theme.ThemeDisplay themeDisplay)
235         throws com.liferay.portal.PortalException,
236             com.liferay.portal.SystemException {
237         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
238 
239         return mbThreadLocalService.splitThread(messageId, prefs, themeDisplay);
240     }
241 
242     public static com.liferay.portlet.messageboards.model.MBThread updateThread(
243         long threadId, int viewCount)
244         throws com.liferay.portal.PortalException,
245             com.liferay.portal.SystemException {
246         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
247 
248         return mbThreadLocalService.updateThread(threadId, viewCount);
249     }
250 }