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.PortalException,
73              com.liferay.portal.SystemException {
74          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
75  
76          mbThreadLocalService.deleteMBThread(mbThread);
77      }
78  
79      public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> dynamicQuery(
80          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
81          throws com.liferay.portal.SystemException {
82          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
83  
84          return mbThreadLocalService.dynamicQuery(queryInitializer);
85      }
86  
87      public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> dynamicQuery(
88          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
89          int begin, int end) throws com.liferay.portal.SystemException {
90          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
91  
92          return mbThreadLocalService.dynamicQuery(queryInitializer, begin, end);
93      }
94  
95      public static com.liferay.portlet.messageboards.model.MBThread updateMBThread(
96          com.liferay.portlet.messageboards.model.MBThread mbThread)
97          throws com.liferay.portal.SystemException {
98          MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
99  
100         return mbThreadLocalService.updateMBThread(mbThread);
101     }
102 
103     public static void deleteThread(long threadId)
104         throws com.liferay.portal.PortalException,
105             com.liferay.portal.SystemException {
106         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
107 
108         mbThreadLocalService.deleteThread(threadId);
109     }
110 
111     public static void deleteThread(
112         com.liferay.portlet.messageboards.model.MBThread thread)
113         throws com.liferay.portal.PortalException,
114             com.liferay.portal.SystemException {
115         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
116 
117         mbThreadLocalService.deleteThread(thread);
118     }
119 
120     public static void deleteThreads(long categoryId)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException {
123         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
124 
125         mbThreadLocalService.deleteThreads(categoryId);
126     }
127 
128     public static int getCategoriesThreadsCount(
129         java.util.List<Long> categoryIds)
130         throws com.liferay.portal.SystemException {
131         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
132 
133         return mbThreadLocalService.getCategoriesThreadsCount(categoryIds);
134     }
135 
136     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
137         long groupId, int begin, int end)
138         throws com.liferay.portal.SystemException {
139         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
140 
141         return mbThreadLocalService.getGroupThreads(groupId, begin, end);
142     }
143 
144     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
145         long groupId, long userId, int begin, int end)
146         throws com.liferay.portal.SystemException {
147         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
148 
149         return mbThreadLocalService.getGroupThreads(groupId, userId, begin, end);
150     }
151 
152     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
153         long groupId, long userId, boolean subscribed, int begin, int end)
154         throws com.liferay.portal.SystemException {
155         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
156 
157         return mbThreadLocalService.getGroupThreads(groupId, userId,
158             subscribed, begin, end);
159     }
160 
161     public static int getGroupThreadsCount(long groupId)
162         throws com.liferay.portal.SystemException {
163         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
164 
165         return mbThreadLocalService.getGroupThreadsCount(groupId);
166     }
167 
168     public static int getGroupThreadsCount(long groupId, long userId)
169         throws com.liferay.portal.SystemException {
170         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
171 
172         return mbThreadLocalService.getGroupThreadsCount(groupId, userId);
173     }
174 
175     public static int getGroupThreadsCount(long groupId, long userId,
176         boolean subscribed) throws com.liferay.portal.SystemException {
177         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
178 
179         return mbThreadLocalService.getGroupThreadsCount(groupId, userId,
180             subscribed);
181     }
182 
183     public static com.liferay.portlet.messageboards.model.MBThread getThread(
184         long threadId)
185         throws com.liferay.portal.PortalException,
186             com.liferay.portal.SystemException {
187         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
188 
189         return mbThreadLocalService.getThread(threadId);
190     }
191 
192     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getThreads(
193         long categoryId, int begin, int end)
194         throws com.liferay.portal.SystemException {
195         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
196 
197         return mbThreadLocalService.getThreads(categoryId, begin, end);
198     }
199 
200     public static int getThreadsCount(long categoryId)
201         throws com.liferay.portal.SystemException {
202         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
203 
204         return mbThreadLocalService.getThreadsCount(categoryId);
205     }
206 
207     public static boolean hasReadThread(long userId, long threadId)
208         throws com.liferay.portal.PortalException,
209             com.liferay.portal.SystemException {
210         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
211 
212         return mbThreadLocalService.hasReadThread(userId, threadId);
213     }
214 
215     public static com.liferay.portlet.messageboards.model.MBThread moveThread(
216         long categoryId, long threadId)
217         throws com.liferay.portal.PortalException,
218             com.liferay.portal.SystemException {
219         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
220 
221         return mbThreadLocalService.moveThread(categoryId, threadId);
222     }
223 
224     public static com.liferay.portlet.messageboards.model.MBThread splitThread(
225         long messageId, javax.portlet.PortletPreferences prefs,
226         com.liferay.portal.theme.ThemeDisplay themeDisplay)
227         throws com.liferay.portal.PortalException,
228             com.liferay.portal.SystemException {
229         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
230 
231         return mbThreadLocalService.splitThread(messageId, prefs, themeDisplay);
232     }
233 
234     public static com.liferay.portlet.messageboards.model.MBThread updateThread(
235         long threadId, int viewCount)
236         throws com.liferay.portal.PortalException,
237             com.liferay.portal.SystemException {
238         MBThreadLocalService mbThreadLocalService = MBThreadLocalServiceFactory.getService();
239 
240         return mbThreadLocalService.updateThread(threadId, viewCount);
241     }
242 }