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="MBCategoryLocalServiceUtil.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.MBCategoryLocalService</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.MBCategoryLocalService
45   *
46   */
47  public class MBCategoryLocalServiceUtil {
48      public static com.liferay.portlet.messageboards.model.MBCategory addMBCategory(
49          com.liferay.portlet.messageboards.model.MBCategory mbCategory)
50          throws com.liferay.portal.SystemException {
51          return getService().addMBCategory(mbCategory);
52      }
53  
54      public static com.liferay.portlet.messageboards.model.MBCategory createMBCategory(
55          long categoryId) {
56          return getService().createMBCategory(categoryId);
57      }
58  
59      public static void deleteMBCategory(long categoryId)
60          throws com.liferay.portal.PortalException,
61              com.liferay.portal.SystemException {
62          getService().deleteMBCategory(categoryId);
63      }
64  
65      public static void deleteMBCategory(
66          com.liferay.portlet.messageboards.model.MBCategory mbCategory)
67          throws com.liferay.portal.SystemException {
68          getService().deleteMBCategory(mbCategory);
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.MBCategory getMBCategory(
84          long categoryId)
85          throws com.liferay.portal.PortalException,
86              com.liferay.portal.SystemException {
87          return getService().getMBCategory(categoryId);
88      }
89  
90      public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getMBCategories(
91          int start, int end) throws com.liferay.portal.SystemException {
92          return getService().getMBCategories(start, end);
93      }
94  
95      public static int getMBCategoriesCount()
96          throws com.liferay.portal.SystemException {
97          return getService().getMBCategoriesCount();
98      }
99  
100     public static com.liferay.portlet.messageboards.model.MBCategory updateMBCategory(
101         com.liferay.portlet.messageboards.model.MBCategory mbCategory)
102         throws com.liferay.portal.SystemException {
103         return getService().updateMBCategory(mbCategory);
104     }
105 
106     public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
107         long userId, long plid, long parentCategoryId, java.lang.String name,
108         java.lang.String description, boolean addCommunityPermissions,
109         boolean addGuestPermissions)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         return getService()
113                    .addCategory(userId, plid, parentCategoryId, name,
114             description, addCommunityPermissions, addGuestPermissions);
115     }
116 
117     public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
118         java.lang.String uuid, long userId, long plid, long parentCategoryId,
119         java.lang.String name, java.lang.String description,
120         boolean addCommunityPermissions, boolean addGuestPermissions)
121         throws com.liferay.portal.PortalException,
122             com.liferay.portal.SystemException {
123         return getService()
124                    .addCategory(uuid, userId, plid, parentCategoryId, name,
125             description, addCommunityPermissions, addGuestPermissions);
126     }
127 
128     public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
129         long userId, long plid, long parentCategoryId, java.lang.String name,
130         java.lang.String description, java.lang.String[] communityPermissions,
131         java.lang.String[] guestPermissions)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException {
134         return getService()
135                    .addCategory(userId, plid, parentCategoryId, name,
136             description, communityPermissions, guestPermissions);
137     }
138 
139     public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
140         java.lang.String uuid, long userId, long plid, long parentCategoryId,
141         java.lang.String name, java.lang.String description,
142         java.lang.Boolean addCommunityPermissions,
143         java.lang.Boolean addGuestPermissions,
144         java.lang.String[] communityPermissions,
145         java.lang.String[] guestPermissions)
146         throws com.liferay.portal.PortalException,
147             com.liferay.portal.SystemException {
148         return getService()
149                    .addCategory(uuid, userId, plid, parentCategoryId, name,
150             description, addCommunityPermissions, addGuestPermissions,
151             communityPermissions, guestPermissions);
152     }
153 
154     public static void addCategoryResources(long categoryId,
155         boolean addCommunityPermissions, boolean addGuestPermissions)
156         throws com.liferay.portal.PortalException,
157             com.liferay.portal.SystemException {
158         getService()
159             .addCategoryResources(categoryId, addCommunityPermissions,
160             addGuestPermissions);
161     }
162 
163     public static void addCategoryResources(
164         com.liferay.portlet.messageboards.model.MBCategory category,
165         boolean addCommunityPermissions, boolean addGuestPermissions)
166         throws com.liferay.portal.PortalException,
167             com.liferay.portal.SystemException {
168         getService()
169             .addCategoryResources(category, addCommunityPermissions,
170             addGuestPermissions);
171     }
172 
173     public static void addCategoryResources(long categoryId,
174         java.lang.String[] communityPermissions,
175         java.lang.String[] guestPermissions)
176         throws com.liferay.portal.PortalException,
177             com.liferay.portal.SystemException {
178         getService()
179             .addCategoryResources(categoryId, communityPermissions,
180             guestPermissions);
181     }
182 
183     public static void addCategoryResources(
184         com.liferay.portlet.messageboards.model.MBCategory category,
185         java.lang.String[] communityPermissions,
186         java.lang.String[] guestPermissions)
187         throws com.liferay.portal.PortalException,
188             com.liferay.portal.SystemException {
189         getService()
190             .addCategoryResources(category, communityPermissions,
191             guestPermissions);
192     }
193 
194     public static void deleteCategories(long groupId)
195         throws com.liferay.portal.PortalException,
196             com.liferay.portal.SystemException {
197         getService().deleteCategories(groupId);
198     }
199 
200     public static void deleteCategory(long categoryId)
201         throws com.liferay.portal.PortalException,
202             com.liferay.portal.SystemException {
203         getService().deleteCategory(categoryId);
204     }
205 
206     public static void deleteCategory(
207         com.liferay.portlet.messageboards.model.MBCategory category)
208         throws com.liferay.portal.PortalException,
209             com.liferay.portal.SystemException {
210         getService().deleteCategory(category);
211     }
212 
213     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
214         long groupId, long parentCategoryId)
215         throws com.liferay.portal.SystemException {
216         return getService().getCategories(groupId, parentCategoryId);
217     }
218 
219     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
220         long groupId, long parentCategoryId, int start, int end)
221         throws com.liferay.portal.SystemException {
222         return getService().getCategories(groupId, parentCategoryId, start, end);
223     }
224 
225     public static int getCategoriesCount(long groupId)
226         throws com.liferay.portal.SystemException {
227         return getService().getCategoriesCount(groupId);
228     }
229 
230     public static int getCategoriesCount(long groupId, long parentCategoryId)
231         throws com.liferay.portal.SystemException {
232         return getService().getCategoriesCount(groupId, parentCategoryId);
233     }
234 
235     public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
236         long categoryId)
237         throws com.liferay.portal.PortalException,
238             com.liferay.portal.SystemException {
239         return getService().getCategory(categoryId);
240     }
241 
242     public static void getSubcategoryIds(java.util.List<Long> categoryIds,
243         long groupId, long categoryId)
244         throws com.liferay.portal.SystemException {
245         getService().getSubcategoryIds(categoryIds, groupId, categoryId);
246     }
247 
248     public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getSubscribedCategories(
249         long groupId, long userId, int start, int end)
250         throws com.liferay.portal.SystemException {
251         return getService().getSubscribedCategories(groupId, userId, start, end);
252     }
253 
254     public static int getSubscribedCategoriesCount(long groupId, long userId)
255         throws com.liferay.portal.SystemException {
256         return getService().getSubscribedCategoriesCount(groupId, userId);
257     }
258 
259     public static com.liferay.portlet.messageboards.model.MBCategory getSystemCategory()
260         throws com.liferay.portal.SystemException {
261         return getService().getSystemCategory();
262     }
263 
264     public static void reIndex(java.lang.String[] ids)
265         throws com.liferay.portal.SystemException {
266         getService().reIndex(ids);
267     }
268 
269     public static com.liferay.portal.kernel.search.Hits search(long companyId,
270         long groupId, long[] categoryIds, long threadId,
271         java.lang.String keywords, int start, int end)
272         throws com.liferay.portal.SystemException {
273         return getService()
274                    .search(companyId, groupId, categoryIds, threadId, keywords,
275             start, end);
276     }
277 
278     public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
279         long categoryId, long parentCategoryId, java.lang.String name,
280         java.lang.String description, boolean mergeWithParentCategory)
281         throws com.liferay.portal.PortalException,
282             com.liferay.portal.SystemException {
283         return getService()
284                    .updateCategory(categoryId, parentCategoryId, name,
285             description, mergeWithParentCategory);
286     }
287 
288     public static void subscribeCategory(long userId, long categoryId)
289         throws com.liferay.portal.PortalException,
290             com.liferay.portal.SystemException {
291         getService().subscribeCategory(userId, categoryId);
292     }
293 
294     public static void unsubscribeCategory(long userId, long categoryId)
295         throws com.liferay.portal.PortalException,
296             com.liferay.portal.SystemException {
297         getService().unsubscribeCategory(userId, categoryId);
298     }
299 
300     public static MBCategoryLocalService getService() {
301         if (_service == null) {
302             throw new RuntimeException("MBCategoryLocalService is not set");
303         }
304 
305         return _service;
306     }
307 
308     public void setService(MBCategoryLocalService service) {
309         _service = service;
310     }
311 
312     private static MBCategoryLocalService _service;
313 }