1   /**
2    * Copyright (c) 2000-2009 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.portal.service;
24  
25  
26  /**
27   * <a href="RoleLocalServiceUtil.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.portal.service.RoleLocalService</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.portal.service.RoleLocalService
45   *
46   */
47  public class RoleLocalServiceUtil {
48      public static com.liferay.portal.model.Role addRole(
49          com.liferay.portal.model.Role role)
50          throws com.liferay.portal.SystemException {
51          return getService().addRole(role);
52      }
53  
54      public static com.liferay.portal.model.Role createRole(long roleId) {
55          return getService().createRole(roleId);
56      }
57  
58      public static void deleteRole(long roleId)
59          throws com.liferay.portal.PortalException,
60              com.liferay.portal.SystemException {
61          getService().deleteRole(roleId);
62      }
63  
64      public static void deleteRole(com.liferay.portal.model.Role role)
65          throws com.liferay.portal.SystemException {
66          getService().deleteRole(role);
67      }
68  
69      public static java.util.List<Object> dynamicQuery(
70          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
71          throws com.liferay.portal.SystemException {
72          return getService().dynamicQuery(dynamicQuery);
73      }
74  
75      public static java.util.List<Object> dynamicQuery(
76          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
77          int end) throws com.liferay.portal.SystemException {
78          return getService().dynamicQuery(dynamicQuery, start, end);
79      }
80  
81      public static com.liferay.portal.model.Role getRole(long roleId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService().getRole(roleId);
85      }
86  
87      public static java.util.List<com.liferay.portal.model.Role> getRoles(
88          int start, int end) throws com.liferay.portal.SystemException {
89          return getService().getRoles(start, end);
90      }
91  
92      public static int getRolesCount() throws com.liferay.portal.SystemException {
93          return getService().getRolesCount();
94      }
95  
96      public static com.liferay.portal.model.Role updateRole(
97          com.liferay.portal.model.Role role)
98          throws com.liferay.portal.SystemException {
99          return getService().updateRole(role);
100     }
101 
102     public static com.liferay.portal.model.Role updateRole(
103         com.liferay.portal.model.Role role, boolean merge)
104         throws com.liferay.portal.SystemException {
105         return getService().updateRole(role, merge);
106     }
107 
108     public static com.liferay.portal.model.Role addRole(long userId,
109         long companyId, java.lang.String name, java.lang.String description,
110         int type)
111         throws com.liferay.portal.PortalException,
112             com.liferay.portal.SystemException {
113         return getService().addRole(userId, companyId, name, description, type);
114     }
115 
116     public static com.liferay.portal.model.Role addRole(long userId,
117         long companyId, java.lang.String name, java.lang.String description,
118         int type, java.lang.String className, long classPK)
119         throws com.liferay.portal.PortalException,
120             com.liferay.portal.SystemException {
121         return getService()
122                    .addRole(userId, companyId, name, description, type,
123             className, classPK);
124     }
125 
126     public static void addUserRoles(long userId, long[] roleIds)
127         throws com.liferay.portal.SystemException {
128         getService().addUserRoles(userId, roleIds);
129     }
130 
131     public static void checkSystemRoles(long companyId)
132         throws com.liferay.portal.PortalException,
133             com.liferay.portal.SystemException {
134         getService().checkSystemRoles(companyId);
135     }
136 
137     public static com.liferay.portal.model.Role getGroupRole(long companyId,
138         long groupId)
139         throws com.liferay.portal.PortalException,
140             com.liferay.portal.SystemException {
141         return getService().getGroupRole(companyId, groupId);
142     }
143 
144     public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
145         long groupId) throws com.liferay.portal.SystemException {
146         return getService().getGroupRoles(groupId);
147     }
148 
149     public static java.util.Map<String, java.util.List<String>> getResourceRoles(
150         long companyId, java.lang.String name, int scope,
151         java.lang.String primKey) throws com.liferay.portal.SystemException {
152         return getService().getResourceRoles(companyId, name, scope, primKey);
153     }
154 
155     public static com.liferay.portal.model.Role getRole(long companyId,
156         java.lang.String name)
157         throws com.liferay.portal.PortalException,
158             com.liferay.portal.SystemException {
159         return getService().getRole(companyId, name);
160     }
161 
162     public static java.util.List<com.liferay.portal.model.Role> getRoles(
163         long companyId) throws com.liferay.portal.SystemException {
164         return getService().getRoles(companyId);
165     }
166 
167     public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
168         long userId, long groupId) throws com.liferay.portal.SystemException {
169         return getService().getUserGroupRoles(userId, groupId);
170     }
171 
172     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
173         long userId, long groupId) throws com.liferay.portal.SystemException {
174         return getService().getUserRelatedRoles(userId, groupId);
175     }
176 
177     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
178         long userId, long[] groupIds) throws com.liferay.portal.SystemException {
179         return getService().getUserRelatedRoles(userId, groupIds);
180     }
181 
182     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
183         long userId, java.util.List<com.liferay.portal.model.Group> groups)
184         throws com.liferay.portal.SystemException {
185         return getService().getUserRelatedRoles(userId, groups);
186     }
187 
188     public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
189         long userId) throws com.liferay.portal.SystemException {
190         return getService().getUserRoles(userId);
191     }
192 
193     public static boolean hasUserRole(long userId, long roleId)
194         throws com.liferay.portal.SystemException {
195         return getService().hasUserRole(userId, roleId);
196     }
197 
198     public static boolean hasUserRole(long userId, long companyId,
199         java.lang.String name, boolean inherited)
200         throws com.liferay.portal.PortalException,
201             com.liferay.portal.SystemException {
202         return getService().hasUserRole(userId, companyId, name, inherited);
203     }
204 
205     public static boolean hasUserRoles(long userId, long companyId,
206         java.lang.String[] names, boolean inherited)
207         throws com.liferay.portal.PortalException,
208             com.liferay.portal.SystemException {
209         return getService().hasUserRoles(userId, companyId, names, inherited);
210     }
211 
212     public static java.util.List<com.liferay.portal.model.Role> search(
213         long companyId, java.lang.String name, java.lang.String description,
214         java.lang.Integer type, int start, int end,
215         com.liferay.portal.kernel.util.OrderByComparator obc)
216         throws com.liferay.portal.SystemException {
217         return getService()
218                    .search(companyId, name, description, type, start, end, obc);
219     }
220 
221     public static java.util.List<com.liferay.portal.model.Role> search(
222         long companyId, java.lang.String name, java.lang.String description,
223         java.lang.Integer type, java.util.LinkedHashMap<String, Object> params,
224         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
225         throws com.liferay.portal.SystemException {
226         return getService()
227                    .search(companyId, name, description, type, params, start,
228             end, obc);
229     }
230 
231     public static int searchCount(long companyId, java.lang.String name,
232         java.lang.String description, java.lang.Integer type)
233         throws com.liferay.portal.SystemException {
234         return getService().searchCount(companyId, name, description, type);
235     }
236 
237     public static int searchCount(long companyId, java.lang.String name,
238         java.lang.String description, java.lang.Integer type,
239         java.util.LinkedHashMap<String, Object> params)
240         throws com.liferay.portal.SystemException {
241         return getService()
242                    .searchCount(companyId, name, description, type, params);
243     }
244 
245     public static void setUserRoles(long userId, long[] roleIds)
246         throws com.liferay.portal.SystemException {
247         getService().setUserRoles(userId, roleIds);
248     }
249 
250     public static void unsetUserRoles(long userId, long[] roleIds)
251         throws com.liferay.portal.SystemException {
252         getService().unsetUserRoles(userId, roleIds);
253     }
254 
255     public static com.liferay.portal.model.Role updateRole(long roleId,
256         java.lang.String name, java.lang.String description)
257         throws com.liferay.portal.PortalException,
258             com.liferay.portal.SystemException {
259         return getService().updateRole(roleId, name, description);
260     }
261 
262     public static RoleLocalService getService() {
263         if (_service == null) {
264             throw new RuntimeException("RoleLocalService is not set");
265         }
266 
267         return _service;
268     }
269 
270     public void setService(RoleLocalService service) {
271         _service = service;
272     }
273 
274     private static RoleLocalService _service;
275 }