1   /**
2    * Copyright (c) 2000-2010 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   *
12   * 
13   */
14  
15  package com.liferay.portlet.messageboards.service;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  
19  /**
20   * <a href="MBCategoryServiceUtil.java.html"><b><i>View Source</i></b></a>
21   *
22   * <p>
23   * ServiceBuilder generated this class. Modifications in this class will be
24   * overwritten the next time is generated.
25   * </p>
26   *
27   * <p>
28   * This class provides static methods for the
29   * {@link MBCategoryService} bean. The static methods of
30   * this class calls the same methods of the bean instance. It's convenient to be
31   * able to just write one line to call a method on a bean instead of writing a
32   * lookup call and a method call.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       MBCategoryService
37   * @generated
38   */
39  public class MBCategoryServiceUtil {
40      public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
41          long plid, long parentCategoryId, java.lang.String name,
42          java.lang.String description, boolean addCommunityPermissions,
43          boolean addGuestPermissions)
44          throws com.liferay.portal.PortalException,
45              com.liferay.portal.SystemException, java.rmi.RemoteException {
46          return getService()
47                     .addCategory(plid, parentCategoryId, name, description,
48              addCommunityPermissions, addGuestPermissions);
49      }
50  
51      public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
52          long plid, long parentCategoryId, java.lang.String name,
53          java.lang.String description, java.lang.String[] communityPermissions,
54          java.lang.String[] guestPermissions)
55          throws com.liferay.portal.PortalException,
56              com.liferay.portal.SystemException, java.rmi.RemoteException {
57          return getService()
58                     .addCategory(plid, parentCategoryId, name, description,
59              communityPermissions, guestPermissions);
60      }
61  
62      public static void deleteCategory(long categoryId)
63          throws com.liferay.portal.PortalException,
64              com.liferay.portal.SystemException, java.rmi.RemoteException {
65          getService().deleteCategory(categoryId);
66      }
67  
68      public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
69          long groupId, long parentCategoryId, int start, int end)
70          throws com.liferay.portal.PortalException,
71              com.liferay.portal.SystemException, java.rmi.RemoteException {
72          return getService().getCategories(groupId, parentCategoryId, start, end);
73      }
74  
75      public static int getCategoriesCount(long groupId, long parentCategoryId)
76          throws com.liferay.portal.SystemException, java.rmi.RemoteException {
77          return getService().getCategoriesCount(groupId, parentCategoryId);
78      }
79  
80      public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
81          long categoryId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException, java.rmi.RemoteException {
84          return getService().getCategory(categoryId);
85      }
86  
87      public static void subscribeCategory(long categoryId)
88          throws com.liferay.portal.PortalException,
89              com.liferay.portal.SystemException, java.rmi.RemoteException {
90          getService().subscribeCategory(categoryId);
91      }
92  
93      public static void unsubscribeCategory(long categoryId)
94          throws com.liferay.portal.PortalException,
95              com.liferay.portal.SystemException, java.rmi.RemoteException {
96          getService().unsubscribeCategory(categoryId);
97      }
98  
99      public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
100         long categoryId, long parentCategoryId, java.lang.String name,
101         java.lang.String description, boolean mergeWithParentCategory)
102         throws com.liferay.portal.PortalException,
103             com.liferay.portal.SystemException, java.rmi.RemoteException {
104         return getService()
105                    .updateCategory(categoryId, parentCategoryId, name,
106             description, mergeWithParentCategory);
107     }
108 
109     public static MBCategoryService getService() {
110         if (_service == null) {
111             _service = (MBCategoryService)PortalBeanLocatorUtil.locate(MBCategoryService.class.getName());
112         }
113 
114         return _service;
115     }
116 
117     public void setService(MBCategoryService service) {
118         _service = service;
119     }
120 
121     private static MBCategoryService _service;
122 }