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  import com.liferay.portal.kernel.util.MethodCache;
19  import com.liferay.portal.kernel.util.ReferenceRegistry;
20  
21  /**
22   * <a href="MBCategoryServiceUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * <p>
25   * ServiceBuilder generated this class. Modifications in this class will be
26   * overwritten the next time is generated.
27   * </p>
28   *
29   * <p>
30   * This class provides static methods for the
31   * {@link MBCategoryService} bean. The static methods of
32   * this class calls the same methods of the bean instance. It's convenient to be
33   * able to just write one line to call a method on a bean instead of writing a
34   * lookup call and a method call.
35   * </p>
36   *
37   * @author    Brian Wing Shun Chan
38   * @see       MBCategoryService
39   * @generated
40   */
41  public class MBCategoryServiceUtil {
42      public static com.liferay.portlet.messageboards.model.MBCategory addCategory(
43          long parentCategoryId, java.lang.String name,
44          java.lang.String description, java.lang.String emailAddress,
45          java.lang.String inProtocol, java.lang.String inServerName,
46          int inServerPort, boolean inUseSSL, java.lang.String inUserName,
47          java.lang.String inPassword, int inReadInterval,
48          java.lang.String outEmailAddress, boolean outCustom,
49          java.lang.String outServerName, int outServerPort, boolean outUseSSL,
50          java.lang.String outUserName, java.lang.String outPassword,
51          boolean mailingListActive,
52          com.liferay.portal.service.ServiceContext serviceContext)
53          throws com.liferay.portal.PortalException,
54              com.liferay.portal.SystemException {
55          return getService()
56                     .addCategory(parentCategoryId, name, description,
57              emailAddress, inProtocol, inServerName, inServerPort, inUseSSL,
58              inUserName, inPassword, inReadInterval, outEmailAddress, outCustom,
59              outServerName, outServerPort, outUseSSL, outUserName, outPassword,
60              mailingListActive, serviceContext);
61      }
62  
63      public static void deleteCategory(long categoryId)
64          throws com.liferay.portal.PortalException,
65              com.liferay.portal.SystemException {
66          getService().deleteCategory(categoryId);
67      }
68  
69      public static java.util.List<com.liferay.portlet.messageboards.model.MBCategory> getCategories(
70          long groupId, long parentCategoryId, int start, int end)
71          throws com.liferay.portal.PortalException,
72              com.liferay.portal.SystemException {
73          return getService().getCategories(groupId, parentCategoryId, start, end);
74      }
75  
76      public static int getCategoriesCount(long groupId, long parentCategoryId)
77          throws com.liferay.portal.SystemException {
78          return getService().getCategoriesCount(groupId, parentCategoryId);
79      }
80  
81      public static com.liferay.portlet.messageboards.model.MBCategory getCategory(
82          long categoryId)
83          throws com.liferay.portal.PortalException,
84              com.liferay.portal.SystemException {
85          return getService().getCategory(categoryId);
86      }
87  
88      public static void subscribeCategory(long categoryId)
89          throws com.liferay.portal.PortalException,
90              com.liferay.portal.SystemException {
91          getService().subscribeCategory(categoryId);
92      }
93  
94      public static void unsubscribeCategory(long categoryId)
95          throws com.liferay.portal.PortalException,
96              com.liferay.portal.SystemException {
97          getService().unsubscribeCategory(categoryId);
98      }
99  
100     public static com.liferay.portlet.messageboards.model.MBCategory updateCategory(
101         long categoryId, long parentCategoryId, java.lang.String name,
102         java.lang.String description, java.lang.String emailAddress,
103         java.lang.String inProtocol, java.lang.String inServerName,
104         int inServerPort, boolean inUseSSL, java.lang.String inUserName,
105         java.lang.String inPassword, int inReadInterval,
106         java.lang.String outEmailAddress, boolean outCustom,
107         java.lang.String outServerName, int outServerPort, boolean outUseSSL,
108         java.lang.String outUserName, java.lang.String outPassword,
109         boolean mailingListActive, boolean mergeWithParentCategory)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         return getService()
113                    .updateCategory(categoryId, parentCategoryId, name,
114             description, emailAddress, inProtocol, inServerName, inServerPort,
115             inUseSSL, inUserName, inPassword, inReadInterval, outEmailAddress,
116             outCustom, outServerName, outServerPort, outUseSSL, outUserName,
117             outPassword, mailingListActive, mergeWithParentCategory);
118     }
119 
120     public static MBCategoryService getService() {
121         if (_service == null) {
122             _service = (MBCategoryService)PortalBeanLocatorUtil.locate(MBCategoryService.class.getName());
123 
124             ReferenceRegistry.registerReference(MBCategoryServiceUtil.class,
125                 "_service");
126             MethodCache.remove(MBCategoryService.class);
127         }
128 
129         return _service;
130     }
131 
132     public void setService(MBCategoryService service) {
133         MethodCache.remove(MBCategoryService.class);
134 
135         _service = service;
136 
137         ReferenceRegistry.registerReference(MBCategoryServiceUtil.class,
138             "_service");
139         MethodCache.remove(MBCategoryService.class);
140     }
141 
142     private static MBCategoryService _service;
143 }