001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * <p>
021     * This class provides static methods for the
022     * {@link RoleLocalService} bean. The static methods of
023     * this class calls the same methods of the bean instance. It's convenient to be
024     * able to just write one line to call a method on a bean instead of writing a
025     * lookup call and a method call.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       RoleLocalService
030     * @generated
031     */
032    public class RoleLocalServiceUtil {
033            public static com.liferay.portal.model.Role addRole(
034                    com.liferay.portal.model.Role role)
035                    throws com.liferay.portal.kernel.exception.SystemException {
036                    return getService().addRole(role);
037            }
038    
039            public static com.liferay.portal.model.Role createRole(long roleId) {
040                    return getService().createRole(roleId);
041            }
042    
043            public static void deleteRole(long roleId)
044                    throws com.liferay.portal.kernel.exception.PortalException,
045                            com.liferay.portal.kernel.exception.SystemException {
046                    getService().deleteRole(roleId);
047            }
048    
049            public static void deleteRole(com.liferay.portal.model.Role role)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    getService().deleteRole(role);
052            }
053    
054            @SuppressWarnings("unchecked")
055            public static java.util.List dynamicQuery(
056                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
057                    throws com.liferay.portal.kernel.exception.SystemException {
058                    return getService().dynamicQuery(dynamicQuery);
059            }
060    
061            @SuppressWarnings("unchecked")
062            public static java.util.List dynamicQuery(
063                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
064                    int end) throws com.liferay.portal.kernel.exception.SystemException {
065                    return getService().dynamicQuery(dynamicQuery, start, end);
066            }
067    
068            @SuppressWarnings("unchecked")
069            public static java.util.List dynamicQuery(
070                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
071                    int end,
072                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
073                    throws com.liferay.portal.kernel.exception.SystemException {
074                    return getService()
075                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
076            }
077    
078            public static long dynamicQueryCount(
079                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
080                    throws com.liferay.portal.kernel.exception.SystemException {
081                    return getService().dynamicQueryCount(dynamicQuery);
082            }
083    
084            public static com.liferay.portal.model.Role getRole(long roleId)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    return getService().getRole(roleId);
088            }
089    
090            public static java.util.List<com.liferay.portal.model.Role> getRoles(
091                    int start, int end)
092                    throws com.liferay.portal.kernel.exception.SystemException {
093                    return getService().getRoles(start, end);
094            }
095    
096            public static int getRolesCount()
097                    throws com.liferay.portal.kernel.exception.SystemException {
098                    return getService().getRolesCount();
099            }
100    
101            public static com.liferay.portal.model.Role updateRole(
102                    com.liferay.portal.model.Role role)
103                    throws com.liferay.portal.kernel.exception.SystemException {
104                    return getService().updateRole(role);
105            }
106    
107            public static com.liferay.portal.model.Role updateRole(
108                    com.liferay.portal.model.Role role, boolean merge)
109                    throws com.liferay.portal.kernel.exception.SystemException {
110                    return getService().updateRole(role, merge);
111            }
112    
113            public static com.liferay.portal.model.Role addRole(long userId,
114                    long companyId, java.lang.String name,
115                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
116                    java.lang.String description, int type)
117                    throws com.liferay.portal.kernel.exception.PortalException,
118                            com.liferay.portal.kernel.exception.SystemException {
119                    return getService()
120                                       .addRole(userId, companyId, name, titleMap, description, type);
121            }
122    
123            public static com.liferay.portal.model.Role addRole(long userId,
124                    long companyId, java.lang.String name,
125                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
126                    java.lang.String description, int type, java.lang.String className,
127                    long classPK)
128                    throws com.liferay.portal.kernel.exception.PortalException,
129                            com.liferay.portal.kernel.exception.SystemException {
130                    return getService()
131                                       .addRole(userId, companyId, name, titleMap, description,
132                            type, className, classPK);
133            }
134    
135            public static void addUserRoles(long userId, long[] roleIds)
136                    throws com.liferay.portal.kernel.exception.PortalException,
137                            com.liferay.portal.kernel.exception.SystemException {
138                    getService().addUserRoles(userId, roleIds);
139            }
140    
141            public static void checkSystemRoles(long companyId)
142                    throws com.liferay.portal.kernel.exception.PortalException,
143                            com.liferay.portal.kernel.exception.SystemException {
144                    getService().checkSystemRoles(companyId);
145            }
146    
147            public static com.liferay.portal.model.Role getDefaultGroupRole(
148                    long groupId)
149                    throws com.liferay.portal.kernel.exception.PortalException,
150                            com.liferay.portal.kernel.exception.SystemException {
151                    return getService().getDefaultGroupRole(groupId);
152            }
153    
154            public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
155                    long groupId)
156                    throws com.liferay.portal.kernel.exception.SystemException {
157                    return getService().getGroupRoles(groupId);
158            }
159    
160            public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
161                    long companyId, java.lang.String name, int scope,
162                    java.lang.String primKey)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().getResourceRoles(companyId, name, scope, primKey);
165            }
166    
167            public static com.liferay.portal.model.Role getRole(long companyId,
168                    java.lang.String name)
169                    throws com.liferay.portal.kernel.exception.PortalException,
170                            com.liferay.portal.kernel.exception.SystemException {
171                    return getService().getRole(companyId, name);
172            }
173    
174            public static java.util.List<com.liferay.portal.model.Role> getRoles(
175                    long companyId)
176                    throws com.liferay.portal.kernel.exception.SystemException {
177                    return getService().getRoles(companyId);
178            }
179    
180            public static java.util.List<com.liferay.portal.model.Role> getRoles(
181                    long[] roleIds)
182                    throws com.liferay.portal.kernel.exception.PortalException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    return getService().getRoles(roleIds);
185            }
186    
187            public static java.util.List<com.liferay.portal.model.Role> getRoles(
188                    int type, java.lang.String subtype)
189                    throws com.liferay.portal.kernel.exception.SystemException {
190                    return getService().getRoles(type, subtype);
191            }
192    
193            public static java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
194                    java.lang.String subtype)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getService().getSubtypeRoles(subtype);
197            }
198    
199            public static int getSubtypeRolesCount(java.lang.String subtype)
200                    throws com.liferay.portal.kernel.exception.SystemException {
201                    return getService().getSubtypeRolesCount(subtype);
202            }
203    
204            public static com.liferay.portal.model.Role getTeamRole(long companyId,
205                    long teamId)
206                    throws com.liferay.portal.kernel.exception.PortalException,
207                            com.liferay.portal.kernel.exception.SystemException {
208                    return getService().getTeamRole(companyId, teamId);
209            }
210    
211            public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
212                    long userId, long groupId)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getService().getUserGroupGroupRoles(userId, groupId);
215            }
216    
217            public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
218                    long userId, long groupId)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getService().getUserGroupRoles(userId, groupId);
221            }
222    
223            public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
224                    long userId, long groupId)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getService().getUserRelatedRoles(userId, groupId);
227            }
228    
229            public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
230                    long userId, long[] groupIds)
231                    throws com.liferay.portal.kernel.exception.SystemException {
232                    return getService().getUserRelatedRoles(userId, groupIds);
233            }
234    
235            public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
236                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getService().getUserRelatedRoles(userId, groups);
239            }
240    
241            public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
242                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
243                    return getService().getUserRoles(userId);
244            }
245    
246            public static boolean hasUserRole(long userId, long roleId)
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return getService().hasUserRole(userId, roleId);
249            }
250    
251            /**
252            * Returns <code>true</code> if the user has the regular role.
253            *
254            * @return <code>true</code> if the user has the regular role
255            */
256            public static boolean hasUserRole(long userId, long companyId,
257                    java.lang.String name, boolean inherited)
258                    throws com.liferay.portal.kernel.exception.PortalException,
259                            com.liferay.portal.kernel.exception.SystemException {
260                    return getService().hasUserRole(userId, companyId, name, inherited);
261            }
262    
263            /**
264            * Returns <code>true</code> if the user has any one of the specified
265            * regular roles.
266            *
267            * @return <code>true</code> if the user has the regular role
268            */
269            public static boolean hasUserRoles(long userId, long companyId,
270                    java.lang.String[] names, boolean inherited)
271                    throws com.liferay.portal.kernel.exception.PortalException,
272                            com.liferay.portal.kernel.exception.SystemException {
273                    return getService().hasUserRoles(userId, companyId, names, inherited);
274            }
275    
276            public static java.util.List<com.liferay.portal.model.Role> search(
277                    long companyId, java.lang.String name, java.lang.String description,
278                    java.lang.Integer[] types, int start, int end,
279                    com.liferay.portal.kernel.util.OrderByComparator obc)
280                    throws com.liferay.portal.kernel.exception.SystemException {
281                    return getService()
282                                       .search(companyId, name, description, types, start, end, obc);
283            }
284    
285            public static java.util.List<com.liferay.portal.model.Role> search(
286                    long companyId, java.lang.String name, java.lang.String description,
287                    java.lang.Integer[] types,
288                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
289                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
290                    throws com.liferay.portal.kernel.exception.SystemException {
291                    return getService()
292                                       .search(companyId, name, description, types, params, start,
293                            end, obc);
294            }
295    
296            public static int searchCount(long companyId, java.lang.String name,
297                    java.lang.String description, java.lang.Integer[] types)
298                    throws com.liferay.portal.kernel.exception.SystemException {
299                    return getService().searchCount(companyId, name, description, types);
300            }
301    
302            public static int searchCount(long companyId, java.lang.String name,
303                    java.lang.String description, java.lang.Integer[] types,
304                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
305                    throws com.liferay.portal.kernel.exception.SystemException {
306                    return getService()
307                                       .searchCount(companyId, name, description, types, params);
308            }
309    
310            public static void setUserRoles(long userId, long[] roleIds)
311                    throws com.liferay.portal.kernel.exception.PortalException,
312                            com.liferay.portal.kernel.exception.SystemException {
313                    getService().setUserRoles(userId, roleIds);
314            }
315    
316            public static void unsetUserRoles(long userId, long[] roleIds)
317                    throws com.liferay.portal.kernel.exception.PortalException,
318                            com.liferay.portal.kernel.exception.SystemException {
319                    getService().unsetUserRoles(userId, roleIds);
320            }
321    
322            public static com.liferay.portal.model.Role updateRole(long roleId,
323                    java.lang.String name,
324                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
325                    java.lang.String description, java.lang.String subtype)
326                    throws com.liferay.portal.kernel.exception.PortalException,
327                            com.liferay.portal.kernel.exception.SystemException {
328                    return getService()
329                                       .updateRole(roleId, name, titleMap, description, subtype);
330            }
331    
332            public static RoleLocalService getService() {
333                    if (_service == null) {
334                            _service = (RoleLocalService)PortalBeanLocatorUtil.locate(RoleLocalService.class.getName());
335                    }
336    
337                    return _service;
338            }
339    
340            public void setService(RoleLocalService service) {
341                    _service = service;
342            }
343    
344            private static RoleLocalService _service;
345    }