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