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