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     * The utility for the user group role local service. This utility wraps {@link com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
021     *
022     * <p>
023     * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
024     * </p>
025     *
026     * <p>
027     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see UserGroupRoleLocalService
032     * @see com.liferay.portal.service.base.UserGroupRoleLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.UserGroupRoleLocalServiceImpl
034     * @generated
035     */
036    public class UserGroupRoleLocalServiceUtil {
037            /**
038            * Adds the user group role to the database. Also notifies the appropriate model listeners.
039            *
040            * @param userGroupRole the user group role to add
041            * @return the user group role that was added
042            * @throws SystemException if a system exception occurred
043            */
044            public static com.liferay.portal.model.UserGroupRole addUserGroupRole(
045                    com.liferay.portal.model.UserGroupRole userGroupRole)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getService().addUserGroupRole(userGroupRole);
048            }
049    
050            /**
051            * Creates a new user group role with the primary key. Does not add the user group role to the database.
052            *
053            * @param userGroupRolePK the primary key for the new user group role
054            * @return the new user group role
055            */
056            public static com.liferay.portal.model.UserGroupRole createUserGroupRole(
057                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK) {
058                    return getService().createUserGroupRole(userGroupRolePK);
059            }
060    
061            /**
062            * Deletes the user group role with the primary key from the database. Also notifies the appropriate model listeners.
063            *
064            * @param userGroupRolePK the primary key of the user group role to delete
065            * @throws PortalException if a user group role with the primary key could not be found
066            * @throws SystemException if a system exception occurred
067            */
068            public static void deleteUserGroupRole(
069                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
070                    throws com.liferay.portal.kernel.exception.PortalException,
071                            com.liferay.portal.kernel.exception.SystemException {
072                    getService().deleteUserGroupRole(userGroupRolePK);
073            }
074    
075            /**
076            * Deletes the user group role from the database. Also notifies the appropriate model listeners.
077            *
078            * @param userGroupRole the user group role to delete
079            * @throws SystemException if a system exception occurred
080            */
081            public static void deleteUserGroupRole(
082                    com.liferay.portal.model.UserGroupRole userGroupRole)
083                    throws com.liferay.portal.kernel.exception.SystemException {
084                    getService().deleteUserGroupRole(userGroupRole);
085            }
086    
087            /**
088            * Performs a dynamic query on the database and returns the matching rows.
089            *
090            * @param dynamicQuery the dynamic query to search with
091            * @return the matching rows
092            * @throws SystemException if a system exception occurred
093            */
094            @SuppressWarnings("rawtypes")
095            public static java.util.List dynamicQuery(
096                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
097                    throws com.liferay.portal.kernel.exception.SystemException {
098                    return getService().dynamicQuery(dynamicQuery);
099            }
100    
101            /**
102            * Performs a dynamic query on the database and returns a range of the matching rows.
103            *
104            * <p>
105            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
106            * </p>
107            *
108            * @param dynamicQuery the dynamic query to search with
109            * @param start the lower bound of the range of model instances to return
110            * @param end the upper bound of the range of model instances to return (not inclusive)
111            * @return the range of matching rows
112            * @throws SystemException if a system exception occurred
113            */
114            @SuppressWarnings("rawtypes")
115            public static java.util.List dynamicQuery(
116                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
117                    int end) throws com.liferay.portal.kernel.exception.SystemException {
118                    return getService().dynamicQuery(dynamicQuery, start, end);
119            }
120    
121            /**
122            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
123            *
124            * <p>
125            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
126            * </p>
127            *
128            * @param dynamicQuery the dynamic query to search with
129            * @param start the lower bound of the range of model instances to return
130            * @param end the upper bound of the range of model instances to return (not inclusive)
131            * @param orderByComparator the comparator to order the results by
132            * @return the ordered range of matching rows
133            * @throws SystemException if a system exception occurred
134            */
135            @SuppressWarnings("rawtypes")
136            public static java.util.List dynamicQuery(
137                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
138                    int end,
139                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
140                    throws com.liferay.portal.kernel.exception.SystemException {
141                    return getService()
142                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
143            }
144    
145            /**
146            * Counts the number of rows that match the dynamic query.
147            *
148            * @param dynamicQuery the dynamic query to search with
149            * @return the number of rows that match the dynamic query
150            * @throws SystemException if a system exception occurred
151            */
152            public static long dynamicQueryCount(
153                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
154                    throws com.liferay.portal.kernel.exception.SystemException {
155                    return getService().dynamicQueryCount(dynamicQuery);
156            }
157    
158            /**
159            * Gets the user group role with the primary key.
160            *
161            * @param userGroupRolePK the primary key of the user group role to get
162            * @return the user group role
163            * @throws PortalException if a user group role with the primary key could not be found
164            * @throws SystemException if a system exception occurred
165            */
166            public static com.liferay.portal.model.UserGroupRole getUserGroupRole(
167                    com.liferay.portal.service.persistence.UserGroupRolePK userGroupRolePK)
168                    throws com.liferay.portal.kernel.exception.PortalException,
169                            com.liferay.portal.kernel.exception.SystemException {
170                    return getService().getUserGroupRole(userGroupRolePK);
171            }
172    
173            /**
174            * Gets a range of all the user group roles.
175            *
176            * <p>
177            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
178            * </p>
179            *
180            * @param start the lower bound of the range of user group roles to return
181            * @param end the upper bound of the range of user group roles to return (not inclusive)
182            * @return the range of user group roles
183            * @throws SystemException if a system exception occurred
184            */
185            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
186                    int start, int end)
187                    throws com.liferay.portal.kernel.exception.SystemException {
188                    return getService().getUserGroupRoles(start, end);
189            }
190    
191            /**
192            * Gets the number of user group roles.
193            *
194            * @return the number of user group roles
195            * @throws SystemException if a system exception occurred
196            */
197            public static int getUserGroupRolesCount()
198                    throws com.liferay.portal.kernel.exception.SystemException {
199                    return getService().getUserGroupRolesCount();
200            }
201    
202            /**
203            * Updates the user group role in the database. Also notifies the appropriate model listeners.
204            *
205            * @param userGroupRole the user group role to update
206            * @return the user group role that was updated
207            * @throws SystemException if a system exception occurred
208            */
209            public static com.liferay.portal.model.UserGroupRole updateUserGroupRole(
210                    com.liferay.portal.model.UserGroupRole userGroupRole)
211                    throws com.liferay.portal.kernel.exception.SystemException {
212                    return getService().updateUserGroupRole(userGroupRole);
213            }
214    
215            /**
216            * Updates the user group role in the database. Also notifies the appropriate model listeners.
217            *
218            * @param userGroupRole the user group role to update
219            * @param merge whether to merge the user group role with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
220            * @return the user group role that was updated
221            * @throws SystemException if a system exception occurred
222            */
223            public static com.liferay.portal.model.UserGroupRole updateUserGroupRole(
224                    com.liferay.portal.model.UserGroupRole userGroupRole, boolean merge)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getService().updateUserGroupRole(userGroupRole, merge);
227            }
228    
229            public static void addUserGroupRoles(long userId, long groupId,
230                    long[] roleIds)
231                    throws com.liferay.portal.kernel.exception.PortalException,
232                            com.liferay.portal.kernel.exception.SystemException {
233                    getService().addUserGroupRoles(userId, groupId, roleIds);
234            }
235    
236            public static void addUserGroupRoles(long[] userIds, long groupId,
237                    long roleId)
238                    throws com.liferay.portal.kernel.exception.PortalException,
239                            com.liferay.portal.kernel.exception.SystemException {
240                    getService().addUserGroupRoles(userIds, groupId, roleId);
241            }
242    
243            public static void deleteUserGroupRoles(long userId, long groupId,
244                    long[] roleIds)
245                    throws com.liferay.portal.kernel.exception.SystemException {
246                    getService().deleteUserGroupRoles(userId, groupId, roleIds);
247            }
248    
249            public static void deleteUserGroupRoles(long userId, long[] groupIds)
250                    throws com.liferay.portal.kernel.exception.SystemException {
251                    getService().deleteUserGroupRoles(userId, groupIds);
252            }
253    
254            public static void deleteUserGroupRoles(long[] userIds, long groupId)
255                    throws com.liferay.portal.kernel.exception.SystemException {
256                    getService().deleteUserGroupRoles(userIds, groupId);
257            }
258    
259            public static void deleteUserGroupRoles(long[] userIds, long groupId,
260                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
261                    getService().deleteUserGroupRoles(userIds, groupId, roleId);
262            }
263    
264            public static void deleteUserGroupRolesByGroupId(long groupId)
265                    throws com.liferay.portal.kernel.exception.SystemException {
266                    getService().deleteUserGroupRolesByGroupId(groupId);
267            }
268    
269            public static void deleteUserGroupRolesByRoleId(long roleId)
270                    throws com.liferay.portal.kernel.exception.SystemException {
271                    getService().deleteUserGroupRolesByRoleId(roleId);
272            }
273    
274            public static void deleteUserGroupRolesByUserId(long userId)
275                    throws com.liferay.portal.kernel.exception.SystemException {
276                    getService().deleteUserGroupRolesByUserId(userId);
277            }
278    
279            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
280                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
281                    return getService().getUserGroupRoles(userId);
282            }
283    
284            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRoles(
285                    long userId, long groupId)
286                    throws com.liferay.portal.kernel.exception.SystemException {
287                    return getService().getUserGroupRoles(userId, groupId);
288            }
289    
290            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByGroupAndRole(
291                    long groupId, long roleId)
292                    throws com.liferay.portal.kernel.exception.SystemException {
293                    return getService().getUserGroupRolesByGroupAndRole(groupId, roleId);
294            }
295    
296            public static java.util.List<com.liferay.portal.model.UserGroupRole> getUserGroupRolesByUserUserGroupAndGroup(
297                    long userId, long groupId)
298                    throws com.liferay.portal.kernel.exception.SystemException {
299                    return getService()
300                                       .getUserGroupRolesByUserUserGroupAndGroup(userId, groupId);
301            }
302    
303            public static boolean hasUserGroupRole(long userId, long groupId,
304                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
305                    return getService().hasUserGroupRole(userId, groupId, roleId);
306            }
307    
308            public static boolean hasUserGroupRole(long userId, long groupId,
309                    long roleId, boolean inherit)
310                    throws com.liferay.portal.kernel.exception.SystemException {
311                    return getService().hasUserGroupRole(userId, groupId, roleId, inherit);
312            }
313    
314            public static boolean hasUserGroupRole(long userId, long groupId,
315                    java.lang.String roleName)
316                    throws com.liferay.portal.kernel.exception.PortalException,
317                            com.liferay.portal.kernel.exception.SystemException {
318                    return getService().hasUserGroupRole(userId, groupId, roleName);
319            }
320    
321            public static boolean hasUserGroupRole(long userId, long groupId,
322                    java.lang.String roleName, boolean inherit)
323                    throws com.liferay.portal.kernel.exception.PortalException,
324                            com.liferay.portal.kernel.exception.SystemException {
325                    return getService().hasUserGroupRole(userId, groupId, roleName, inherit);
326            }
327    
328            public static UserGroupRoleLocalService getService() {
329                    if (_service == null) {
330                            _service = (UserGroupRoleLocalService)PortalBeanLocatorUtil.locate(UserGroupRoleLocalService.class.getName());
331                    }
332    
333                    return _service;
334            }
335    
336            public void setService(UserGroupRoleLocalService service) {
337                    _service = service;
338            }
339    
340            private static UserGroupRoleLocalService _service;
341    }