1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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   * {@link RoleLocalService} bean. The static methods of
37   * this class calls the same methods of the bean instance. It's convenient to be
38   * able to just write one line to call a method on a bean instead of writing a
39   * lookup call and a method call.
40   * </p>
41   *
42   * @author    Brian Wing Shun Chan
43   * @see       RoleLocalService
44   * @generated
45   */
46  public class RoleLocalServiceUtil {
47      public static com.liferay.portal.model.Role addRole(
48          com.liferay.portal.model.Role role)
49          throws com.liferay.portal.SystemException {
50          return getService().addRole(role);
51      }
52  
53      public static com.liferay.portal.model.Role createRole(long roleId) {
54          return getService().createRole(roleId);
55      }
56  
57      public static void deleteRole(long roleId)
58          throws com.liferay.portal.PortalException,
59              com.liferay.portal.SystemException {
60          getService().deleteRole(roleId);
61      }
62  
63      public static void deleteRole(com.liferay.portal.model.Role role)
64          throws com.liferay.portal.SystemException {
65          getService().deleteRole(role);
66      }
67  
68      public static java.util.List<Object> dynamicQuery(
69          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
70          throws com.liferay.portal.SystemException {
71          return getService().dynamicQuery(dynamicQuery);
72      }
73  
74      public static java.util.List<Object> dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end) throws com.liferay.portal.SystemException {
77          return getService().dynamicQuery(dynamicQuery, start, end);
78      }
79  
80      public static com.liferay.portal.model.Role getRole(long roleId)
81          throws com.liferay.portal.PortalException,
82              com.liferay.portal.SystemException {
83          return getService().getRole(roleId);
84      }
85  
86      public static java.util.List<com.liferay.portal.model.Role> getRoles(
87          int start, int end) throws com.liferay.portal.SystemException {
88          return getService().getRoles(start, end);
89      }
90  
91      public static int getRolesCount() throws com.liferay.portal.SystemException {
92          return getService().getRolesCount();
93      }
94  
95      public static com.liferay.portal.model.Role updateRole(
96          com.liferay.portal.model.Role role)
97          throws com.liferay.portal.SystemException {
98          return getService().updateRole(role);
99      }
100 
101     public static com.liferay.portal.model.Role updateRole(
102         com.liferay.portal.model.Role role, boolean merge)
103         throws com.liferay.portal.SystemException {
104         return getService().updateRole(role, merge);
105     }
106 
107     public static com.liferay.portal.model.Role addRole(long userId,
108         long companyId, java.lang.String name, java.lang.String description,
109         int type)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         return getService().addRole(userId, companyId, name, description, type);
113     }
114 
115     public static com.liferay.portal.model.Role addRole(long userId,
116         long companyId, java.lang.String name, java.lang.String description,
117         int type, java.lang.String className, long classPK)
118         throws com.liferay.portal.PortalException,
119             com.liferay.portal.SystemException {
120         return getService()
121                    .addRole(userId, companyId, name, description, type,
122             className, classPK);
123     }
124 
125     public static void addUserRoles(long userId, long[] roleIds)
126         throws com.liferay.portal.SystemException {
127         getService().addUserRoles(userId, roleIds);
128     }
129 
130     public static void checkSystemRoles(long companyId)
131         throws com.liferay.portal.PortalException,
132             com.liferay.portal.SystemException {
133         getService().checkSystemRoles(companyId);
134     }
135 
136     public static com.liferay.portal.model.Role getGroupRole(long companyId,
137         long groupId)
138         throws com.liferay.portal.PortalException,
139             com.liferay.portal.SystemException {
140         return getService().getGroupRole(companyId, groupId);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
144         long groupId) throws com.liferay.portal.SystemException {
145         return getService().getGroupRoles(groupId);
146     }
147 
148     public static java.util.Map<String, java.util.List<String>> getResourceRoles(
149         long companyId, java.lang.String name, int scope,
150         java.lang.String primKey) throws com.liferay.portal.SystemException {
151         return getService().getResourceRoles(companyId, name, scope, primKey);
152     }
153 
154     public static com.liferay.portal.model.Role getRole(long companyId,
155         java.lang.String name)
156         throws com.liferay.portal.PortalException,
157             com.liferay.portal.SystemException {
158         return getService().getRole(companyId, name);
159     }
160 
161     public static java.util.List<com.liferay.portal.model.Role> getRoles(
162         long companyId) throws com.liferay.portal.SystemException {
163         return getService().getRoles(companyId);
164     }
165 
166     public static java.util.List<com.liferay.portal.model.Role> getRoles(
167         long[] roleIds)
168         throws com.liferay.portal.PortalException,
169             com.liferay.portal.SystemException {
170         return getService().getRoles(roleIds);
171     }
172 
173     public static java.util.List<com.liferay.portal.model.Role> getRoles(
174         int type, java.lang.String subtype)
175         throws com.liferay.portal.SystemException {
176         return getService().getRoles(type, subtype);
177     }
178 
179     public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
180         java.lang.String subtype) throws com.liferay.portal.SystemException {
181         return getService().getSubtypeRoles(subtype);
182     }
183 
184     public static int getSubtypeRolesCount(java.lang.String subtype)
185         throws com.liferay.portal.SystemException {
186         return getService().getSubtypeRolesCount(subtype);
187     }
188 
189     public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
190         long userId, long groupId) throws com.liferay.portal.SystemException {
191         return getService().getUserGroupGroupRoles(userId, groupId);
192     }
193 
194     public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
195         long userId, long groupId) throws com.liferay.portal.SystemException {
196         return getService().getUserGroupRoles(userId, groupId);
197     }
198 
199     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
200         long userId, long groupId) throws com.liferay.portal.SystemException {
201         return getService().getUserRelatedRoles(userId, groupId);
202     }
203 
204     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
205         long userId, long[] groupIds) throws com.liferay.portal.SystemException {
206         return getService().getUserRelatedRoles(userId, groupIds);
207     }
208 
209     public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
210         long userId, java.util.List<com.liferay.portal.model.Group> groups)
211         throws com.liferay.portal.SystemException {
212         return getService().getUserRelatedRoles(userId, groups);
213     }
214 
215     public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
216         long userId) throws com.liferay.portal.SystemException {
217         return getService().getUserRoles(userId);
218     }
219 
220     public static boolean hasUserRole(long userId, long roleId)
221         throws com.liferay.portal.SystemException {
222         return getService().hasUserRole(userId, roleId);
223     }
224 
225     public static boolean hasUserRole(long userId, long companyId,
226         java.lang.String name, boolean inherited)
227         throws com.liferay.portal.PortalException,
228             com.liferay.portal.SystemException {
229         return getService().hasUserRole(userId, companyId, name, inherited);
230     }
231 
232     public static boolean hasUserRoles(long userId, long companyId,
233         java.lang.String[] names, boolean inherited)
234         throws com.liferay.portal.PortalException,
235             com.liferay.portal.SystemException {
236         return getService().hasUserRoles(userId, companyId, names, inherited);
237     }
238 
239     public static java.util.List<com.liferay.portal.model.Role> search(
240         long companyId, java.lang.String name, java.lang.String description,
241         java.lang.Integer type, int start, int end,
242         com.liferay.portal.kernel.util.OrderByComparator obc)
243         throws com.liferay.portal.SystemException {
244         return getService()
245                    .search(companyId, name, description, type, start, end, obc);
246     }
247 
248     public static java.util.List<com.liferay.portal.model.Role> search(
249         long companyId, java.lang.String name, java.lang.String description,
250         java.lang.Integer type, java.util.LinkedHashMap<String, Object> params,
251         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
252         throws com.liferay.portal.SystemException {
253         return getService()
254                    .search(companyId, name, description, type, params, start,
255             end, obc);
256     }
257 
258     public static int searchCount(long companyId, java.lang.String name,
259         java.lang.String description, java.lang.Integer type)
260         throws com.liferay.portal.SystemException {
261         return getService().searchCount(companyId, name, description, type);
262     }
263 
264     public static int searchCount(long companyId, java.lang.String name,
265         java.lang.String description, java.lang.Integer type,
266         java.util.LinkedHashMap<String, Object> params)
267         throws com.liferay.portal.SystemException {
268         return getService()
269                    .searchCount(companyId, name, description, type, params);
270     }
271 
272     public static void setUserRoles(long userId, long[] roleIds)
273         throws com.liferay.portal.PortalException,
274             com.liferay.portal.SystemException {
275         getService().setUserRoles(userId, roleIds);
276     }
277 
278     public static void unsetUserRoles(long userId, long[] roleIds)
279         throws com.liferay.portal.PortalException,
280             com.liferay.portal.SystemException {
281         getService().unsetUserRoles(userId, roleIds);
282     }
283 
284     public static com.liferay.portal.model.Role updateRole(long roleId,
285         java.lang.String name,
286         java.util.Map<java.util.Locale, String> localeTitlesMap,
287         java.lang.String description, java.lang.String subtype)
288         throws com.liferay.portal.PortalException,
289             com.liferay.portal.SystemException {
290         return getService()
291                    .updateRole(roleId, name, localeTitlesMap, description,
292             subtype);
293     }
294 
295     public static RoleLocalService getService() {
296         if (_service == null) {
297             throw new RuntimeException("RoleLocalService is not set");
298         }
299 
300         return _service;
301     }
302 
303     public void setService(RoleLocalService service) {
304         _service = service;
305     }
306 
307     private static RoleLocalService _service;
308 }