1   /**
2    * Copyright (c) 2000-2007 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   * <a href="MBCategoryLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be overwritten
30   * the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides static methods for the <code>com.liferay.portlet.messageboards.service.MBCategoryLocalService</code>
35   * bean. The static methods of this class calls the same methods of the bean instance.
36   * It's convenient to be able to just write one line to call a method on a bean
37   * instead of writing a lookup call and a method call.
38   * </p>
39   *
40   * <p>
41   * <code>com.liferay.portlet.messageboards.service.MBCategoryLocalServiceFactory</code>
42   * is responsible for the lookup of the bean.
43   * </p>
44   *
45   * @author Brian Wing Shun Chan
46   *
47   * @see com.liferay.portlet.messageboards.service.MBCategoryLocalService
48   * @see com.liferay.portlet.messageboards.service.MBCategoryLocalServiceFactory
49   *
50   */
51  public class MBCategoryLocalServiceUtil {
52      public static com.liferay.portlet.messageboards.model.MBCategory addMBCategory(
53          com.liferay.portlet.messageboards.model.MBCategory model)
54          throws com.liferay.portal.SystemException {
55          MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
56  
57          return mbCategoryLocalService.addMBCategory(model);
58      }
59  
60      public static java.util.List dynamicQuery(
61          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
62          throws com.liferay.portal.SystemException {
63          MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
64  
65          return mbCategoryLocalService.dynamicQuery(queryInitializer);
66      }
67  
68      public static java.util.List dynamicQuery(
69          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
70          int begin, int end) throws com.liferay.portal.SystemException {
71          MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
72  
73          return mbCategoryLocalService.dynamicQuery(queryInitializer, begin, end);
74      }
75  
76      public static com.liferay.portlet.messageboards.model.MBCategory updateMBCategory(
77          com.liferay.portlet.messageboards.model.MBCategory model)
78          throws com.liferay.portal.SystemException {
79          MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
80  
81          return mbCategoryLocalService.updateMBCategory(model);
82      }
83  
84      public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
85          long userId, long plid, long parentCategoryId, java.lang.String name,
86          java.lang.String description, boolean addCommunityPermissions,
87          boolean addGuestPermissions)
88          throws com.liferay.portal.PortalException, 
89              com.liferay.portal.SystemException {
90          MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
91  
92          return mbCategoryLocalService.addCategory(userId, plid,
93              parentCategoryId, name, description, addCommunityPermissions,
94              addGuestPermissions);
95      }
96  
97      public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
98          long userId, long plid, long parentCategoryId, java.lang.String name,
99          java.lang.String description, java.lang.String[] communityPermissions,
100         java.lang.String[] guestPermissions)
101         throws com.liferay.portal.PortalException, 
102             com.liferay.portal.SystemException {
103         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
104 
105         return mbCategoryLocalService.addCategory(userId, plid,
106             parentCategoryId, name, description, communityPermissions,
107             guestPermissions);
108     }
109 
110     public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
111         long userId, long plid, long parentCategoryId, java.lang.String name,
112         java.lang.String description,
113         java.lang.Boolean addCommunityPermissions,
114         java.lang.Boolean addGuestPermissions,
115         java.lang.String[] communityPermissions,
116         java.lang.String[] guestPermissions)
117         throws com.liferay.portal.PortalException, 
118             com.liferay.portal.SystemException {
119         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
120 
121         return mbCategoryLocalService.addCategory(userId, plid,
122             parentCategoryId, name, description, addCommunityPermissions,
123             addGuestPermissions, communityPermissions, guestPermissions);
124     }
125 
126     public static void addCategoryResources(long categoryId,
127         boolean addCommunityPermissions, boolean addGuestPermissions)
128         throws com.liferay.portal.PortalException, 
129             com.liferay.portal.SystemException {
130         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
131         mbCategoryLocalService.addCategoryResources(categoryId,
132             addCommunityPermissions, addGuestPermissions);
133     }
134 
135     public static void addCategoryResources(
136         com.liferay.portlet.messageboards.model.MBCategory category,
137         boolean addCommunityPermissions, boolean addGuestPermissions)
138         throws com.liferay.portal.PortalException, 
139             com.liferay.portal.SystemException {
140         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
141         mbCategoryLocalService.addCategoryResources(category,
142             addCommunityPermissions, addGuestPermissions);
143     }
144 
145     public static void addCategoryResources(long categoryId,
146         java.lang.String[] communityPermissions,
147         java.lang.String[] guestPermissions)
148         throws com.liferay.portal.PortalException, 
149             com.liferay.portal.SystemException {
150         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
151         mbCategoryLocalService.addCategoryResources(categoryId,
152             communityPermissions, guestPermissions);
153     }
154 
155     public static void addCategoryResources(
156         com.liferay.portlet.messageboards.model.MBCategory category,
157         java.lang.String[] communityPermissions,
158         java.lang.String[] guestPermissions)
159         throws com.liferay.portal.PortalException, 
160             com.liferay.portal.SystemException {
161         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
162         mbCategoryLocalService.addCategoryResources(category,
163             communityPermissions, guestPermissions);
164     }
165 
166     public static void deleteCategories(long groupId)
167         throws com.liferay.portal.PortalException, 
168             com.liferay.portal.SystemException {
169         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
170         mbCategoryLocalService.deleteCategories(groupId);
171     }
172 
173     public static void deleteCategory(long categoryId)
174         throws com.liferay.portal.PortalException, 
175             com.liferay.portal.SystemException {
176         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
177         mbCategoryLocalService.deleteCategory(categoryId);
178     }
179 
180     public static void deleteCategory(
181         com.liferay.portlet.messageboards.model.MBCategory category)
182         throws com.liferay.portal.PortalException, 
183             com.liferay.portal.SystemException {
184         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
185         mbCategoryLocalService.deleteCategory(category);
186     }
187 
188     public static java.util.List getCategories(long groupId,
189         long parentCategoryId, int begin, int end)
190         throws com.liferay.portal.SystemException {
191         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
192 
193         return mbCategoryLocalService.getCategories(groupId, parentCategoryId,
194             begin, end);
195     }
196 
197     public static int getCategoriesCount(long groupId)
198         throws com.liferay.portal.SystemException {
199         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
200 
201         return mbCategoryLocalService.getCategoriesCount(groupId);
202     }
203 
204     public static int getCategoriesCount(long groupId, long parentCategoryId)
205         throws com.liferay.portal.SystemException {
206         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
207 
208         return mbCategoryLocalService.getCategoriesCount(groupId,
209             parentCategoryId);
210     }
211 
212     public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
213         long categoryId)
214         throws com.liferay.portal.PortalException, 
215             com.liferay.portal.SystemException {
216         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
217 
218         return mbCategoryLocalService.getCategory(categoryId);
219     }
220 
221     public static void getSubcategoryIds(java.util.List categoryIds,
222         long groupId, long categoryId)
223         throws com.liferay.portal.SystemException {
224         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
225         mbCategoryLocalService.getSubcategoryIds(categoryIds, groupId,
226             categoryId);
227     }
228 
229     public static java.util.List getSubscribedCategories(long groupId,
230         long userId, int begin, int end)
231         throws com.liferay.portal.SystemException {
232         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
233 
234         return mbCategoryLocalService.getSubscribedCategories(groupId, userId,
235             begin, end);
236     }
237 
238     public static int getSubscribedCategoriesCount(long groupId, long userId)
239         throws com.liferay.portal.SystemException {
240         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
241 
242         return mbCategoryLocalService.getSubscribedCategoriesCount(groupId,
243             userId);
244     }
245 
246     public static com.liferay.portlet.messageboards.model.MBCategory getSystemCategory()
247         throws com.liferay.portal.PortalException, 
248             com.liferay.portal.SystemException {
249         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
250 
251         return mbCategoryLocalService.getSystemCategory();
252     }
253 
254     public static void reIndex(java.lang.String[] ids)
255         throws com.liferay.portal.SystemException {
256         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
257         mbCategoryLocalService.reIndex(ids);
258     }
259 
260     public static com.liferay.portal.kernel.search.Hits search(long companyId,
261         long groupId, long[] categoryIds, long threadId,
262         java.lang.String keywords) throws com.liferay.portal.SystemException {
263         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
264 
265         return mbCategoryLocalService.search(companyId, groupId, categoryIds,
266             threadId, keywords);
267     }
268 
269     public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
270         long categoryId, long parentCategoryId, java.lang.String name,
271         java.lang.String description, boolean mergeWithParentCategory)
272         throws com.liferay.portal.PortalException, 
273             com.liferay.portal.SystemException {
274         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
275 
276         return mbCategoryLocalService.updateCategory(categoryId,
277             parentCategoryId, name, description, mergeWithParentCategory);
278     }
279 
280     public static void subscribeCategory(long userId, long categoryId)
281         throws com.liferay.portal.PortalException, 
282             com.liferay.portal.SystemException {
283         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
284         mbCategoryLocalService.subscribeCategory(userId, categoryId);
285     }
286 
287     public static void unsubscribeCategory(long userId, long categoryId)
288         throws com.liferay.portal.PortalException, 
289             com.liferay.portal.SystemException {
290         MBCategoryLocalService mbCategoryLocalService = MBCategoryLocalServiceFactory.getService();
291         mbCategoryLocalService.unsubscribeCategory(userId, categoryId);
292     }
293 }