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> getRoles(
168         long[] roleIds)
169         throws com.liferay.portal.PortalException,
170             com.liferay.portal.SystemException {
171         return getService().getRoles(roleIds);
172     }
173 
174     public static java.util.List<com.liferay.portal.model.Role> getRoles(
175         int type, java.lang.String subtype)
176         throws com.liferay.portal.SystemException {
177         return getService().getRoles(type, subtype);
178     }
179 
180     public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
181         long userId, long groupId) throws com.liferay.portal.SystemException {
182         return getService().getUserGroupRoles(userId, groupId);
183     }
184 
185     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
186         long userId, long groupId) throws com.liferay.portal.SystemException {
187         return getService().getUserRelatedRoles(userId, groupId);
188     }
189 
190     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
191         long userId, long[] groupIds) throws com.liferay.portal.SystemException {
192         return getService().getUserRelatedRoles(userId, groupIds);
193     }
194 
195     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
196         long userId, java.util.List<com.liferay.portal.model.Group> groups)
197         throws com.liferay.portal.SystemException {
198         return getService().getUserRelatedRoles(userId, groups);
199     }
200 
201     public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
202         long userId) throws com.liferay.portal.SystemException {
203         return getService().getUserRoles(userId);
204     }
205 
206     public static boolean hasUserRole(long userId, long roleId)
207         throws com.liferay.portal.SystemException {
208         return getService().hasUserRole(userId, roleId);
209     }
210 
211     public static boolean hasUserRole(long userId, long companyId,
212         java.lang.String name, boolean inherited)
213         throws com.liferay.portal.PortalException,
214             com.liferay.portal.SystemException {
215         return getService().hasUserRole(userId, companyId, name, inherited);
216     }
217 
218     public static boolean hasUserRoles(long userId, long companyId,
219         java.lang.String[] names, boolean inherited)
220         throws com.liferay.portal.PortalException,
221             com.liferay.portal.SystemException {
222         return getService().hasUserRoles(userId, companyId, names, inherited);
223     }
224 
225     public static java.util.List<com.liferay.portal.model.Role> search(
226         long companyId, java.lang.String name, java.lang.String description,
227         java.lang.Integer type, int start, int end,
228         com.liferay.portal.kernel.util.OrderByComparator obc)
229         throws com.liferay.portal.SystemException {
230         return getService()
231                    .search(companyId, name, description, type, start, end, obc);
232     }
233 
234     public static java.util.List<com.liferay.portal.model.Role> search(
235         long companyId, java.lang.String name, java.lang.String description,
236         java.lang.Integer type, java.util.LinkedHashMap<String, Object> params,
237         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
238         throws com.liferay.portal.SystemException {
239         return getService()
240                    .search(companyId, name, description, type, params, start,
241             end, obc);
242     }
243 
244     public static int searchCount(long companyId, java.lang.String name,
245         java.lang.String description, java.lang.Integer type)
246         throws com.liferay.portal.SystemException {
247         return getService().searchCount(companyId, name, description, type);
248     }
249 
250     public static int searchCount(long companyId, java.lang.String name,
251         java.lang.String description, java.lang.Integer type,
252         java.util.LinkedHashMap<String, Object> params)
253         throws com.liferay.portal.SystemException {
254         return getService()
255                    .searchCount(companyId, name, description, type, params);
256     }
257 
258     public static void setUserRoles(long userId, long[] roleIds)
259         throws com.liferay.portal.PortalException,
260             com.liferay.portal.SystemException {
261         getService().setUserRoles(userId, roleIds);
262     }
263 
264     public static void unsetUserRoles(long userId, long[] roleIds)
265         throws com.liferay.portal.PortalException,
266             com.liferay.portal.SystemException {
267         getService().unsetUserRoles(userId, roleIds);
268     }
269 
270     public static com.liferay.portal.model.Role updateRole(long roleId,
271         java.lang.String name,
272         java.util.Map<java.util.Locale, String> localeTitlesMap,
273         java.lang.String description, java.lang.String subtype)
274         throws com.liferay.portal.PortalException,
275             com.liferay.portal.SystemException {
276         return getService()
277                    .updateRole(roleId, name, localeTitlesMap, description,
278             subtype);
279     }
280 
281     public static RoleLocalService getService() {
282         if (_service == null) {
283             throw new RuntimeException("RoleLocalService is not set");
284         }
285 
286         return _service;
287     }
288 
289     public void setService(RoleLocalService service) {
290         _service = service;
291     }
292 
293     private static RoleLocalService _service;
294 }