1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.messageboards.service;
21  
22  
23  /**
24   * <a href="MBThreadLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portlet.messageboards.service.MBThreadLocalService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portlet.messageboards.service.MBThreadLocalService
42   *
43   */
44  public class MBThreadLocalServiceUtil {
45      public static com.liferay.portlet.messageboards.model.MBThread addMBThread(
46          com.liferay.portlet.messageboards.model.MBThread mbThread)
47          throws com.liferay.portal.SystemException {
48          return getService().addMBThread(mbThread);
49      }
50  
51      public static com.liferay.portlet.messageboards.model.MBThread createMBThread(
52          long threadId) {
53          return getService().createMBThread(threadId);
54      }
55  
56      public static void deleteMBThread(long threadId)
57          throws com.liferay.portal.PortalException,
58              com.liferay.portal.SystemException {
59          getService().deleteMBThread(threadId);
60      }
61  
62      public static void deleteMBThread(
63          com.liferay.portlet.messageboards.model.MBThread mbThread)
64          throws com.liferay.portal.SystemException {
65          getService().deleteMBThread(mbThread);
66      }
67  
68      public static java.util.List<Object> dynamicQuery(
69          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
70          throws com.liferay.portal.SystemException {
71          return getService().dynamicQuery(dynamicQuery);
72      }
73  
74      public static java.util.List<Object> dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end) throws com.liferay.portal.SystemException {
77          return getService().dynamicQuery(dynamicQuery, start, end);
78      }
79  
80      public static com.liferay.portlet.messageboards.model.MBThread getMBThread(
81          long threadId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService().getMBThread(threadId);
85      }
86  
87      public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getMBThreads(
88          int start, int end) throws com.liferay.portal.SystemException {
89          return getService().getMBThreads(start, end);
90      }
91  
92      public static int getMBThreadsCount()
93          throws com.liferay.portal.SystemException {
94          return getService().getMBThreadsCount();
95      }
96  
97      public static com.liferay.portlet.messageboards.model.MBThread updateMBThread(
98          com.liferay.portlet.messageboards.model.MBThread mbThread)
99          throws com.liferay.portal.SystemException {
100         return getService().updateMBThread(mbThread);
101     }
102 
103     public static com.liferay.portlet.messageboards.model.MBThread updateMBThread(
104         com.liferay.portlet.messageboards.model.MBThread mbThread, boolean merge)
105         throws com.liferay.portal.SystemException {
106         return getService().updateMBThread(mbThread, merge);
107     }
108 
109     public static void deleteThread(long threadId)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         getService().deleteThread(threadId);
113     }
114 
115     public static void deleteThread(
116         com.liferay.portlet.messageboards.model.MBThread thread)
117         throws com.liferay.portal.PortalException,
118             com.liferay.portal.SystemException {
119         getService().deleteThread(thread);
120     }
121 
122     public static void deleteThreads(long categoryId)
123         throws com.liferay.portal.PortalException,
124             com.liferay.portal.SystemException {
125         getService().deleteThreads(categoryId);
126     }
127 
128     public static int getCategoriesThreadsCount(
129         java.util.List<Long> categoryIds)
130         throws com.liferay.portal.SystemException {
131         return getService().getCategoriesThreadsCount(categoryIds);
132     }
133 
134     public static int getCategoryThreadsCount(long categoryId)
135         throws com.liferay.portal.SystemException {
136         return getService().getCategoryThreadsCount(categoryId);
137     }
138 
139     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
140         long groupId, int start, int end)
141         throws com.liferay.portal.SystemException {
142         return getService().getGroupThreads(groupId, start, end);
143     }
144 
145     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
146         long groupId, long userId, int start, int end)
147         throws com.liferay.portal.PortalException,
148             com.liferay.portal.SystemException {
149         return getService().getGroupThreads(groupId, userId, start, end);
150     }
151 
152     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
153         long groupId, long userId, boolean subscribed, int start, int end)
154         throws com.liferay.portal.PortalException,
155             com.liferay.portal.SystemException {
156         return getService()
157                    .getGroupThreads(groupId, userId, subscribed, start, end);
158     }
159 
160     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
161         long groupId, long userId, boolean subscribed,
162         boolean includeAnonymous, int start, int end)
163         throws com.liferay.portal.PortalException,
164             com.liferay.portal.SystemException {
165         return getService()
166                    .getGroupThreads(groupId, userId, subscribed,
167             includeAnonymous, start, end);
168     }
169 
170     public static int getGroupThreadsCount(long groupId)
171         throws com.liferay.portal.SystemException {
172         return getService().getGroupThreadsCount(groupId);
173     }
174 
175     public static int getGroupThreadsCount(long groupId, long userId)
176         throws com.liferay.portal.SystemException {
177         return getService().getGroupThreadsCount(groupId, userId);
178     }
179 
180     public static int getGroupThreadsCount(long groupId, long userId,
181         boolean subscribed) throws com.liferay.portal.SystemException {
182         return getService().getGroupThreadsCount(groupId, userId, subscribed);
183     }
184 
185     public static int getGroupThreadsCount(long groupId, long userId,
186         boolean subscribed, boolean includeAnonymous)
187         throws com.liferay.portal.SystemException {
188         return getService()
189                    .getGroupThreadsCount(groupId, userId, subscribed,
190             includeAnonymous);
191     }
192 
193     public static com.liferay.portlet.messageboards.model.MBThread getThread(
194         long threadId)
195         throws com.liferay.portal.PortalException,
196             com.liferay.portal.SystemException {
197         return getService().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         return getService().getThreads(categoryId, start, end);
204     }
205 
206     public static int getThreadsCount(long categoryId)
207         throws com.liferay.portal.SystemException {
208         return getService().getThreadsCount(categoryId);
209     }
210 
211     public static boolean hasReadThread(long userId, long threadId)
212         throws com.liferay.portal.PortalException,
213             com.liferay.portal.SystemException {
214         return getService().hasReadThread(userId, threadId);
215     }
216 
217     public static com.liferay.portlet.messageboards.model.MBThread moveThread(
218         long categoryId, long threadId)
219         throws com.liferay.portal.PortalException,
220             com.liferay.portal.SystemException {
221         return getService().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         return getService().splitThread(messageId, prefs, themeDisplay);
230     }
231 
232     public static com.liferay.portlet.messageboards.model.MBThread updateThread(
233         long threadId, int viewCount)
234         throws com.liferay.portal.PortalException,
235             com.liferay.portal.SystemException {
236         return getService().updateThread(threadId, viewCount);
237     }
238 
239     public static MBThreadLocalService getService() {
240         if (_service == null) {
241             throw new RuntimeException("MBThreadLocalService is not set");
242         }
243 
244         return _service;
245     }
246 
247     public void setService(MBThreadLocalService service) {
248         _service = service;
249     }
250 
251     private static MBThreadLocalService _service;
252 }