001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the user group local service. This utility wraps {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * 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.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see UserGroupLocalService
030     * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl
032     * @generated
033     */
034    public class UserGroupLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the user group to the database. Also notifies the appropriate model listeners.
043            *
044            * @param userGroup the user group
045            * @return the user group that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.UserGroup addUserGroup(
049                    com.liferay.portal.model.UserGroup userGroup)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addUserGroup(userGroup);
052            }
053    
054            /**
055            * Creates a new user group with the primary key. Does not add the user group to the database.
056            *
057            * @param userGroupId the primary key for the new user group
058            * @return the new user group
059            */
060            public static com.liferay.portal.model.UserGroup createUserGroup(
061                    long userGroupId) {
062                    return getService().createUserGroup(userGroupId);
063            }
064    
065            /**
066            * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param userGroupId the primary key of the user group
069            * @throws PortalException if a user group with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteUserGroup(long userGroupId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteUserGroup(userGroupId);
076            }
077    
078            /**
079            * Deletes the user group from the database. Also notifies the appropriate model listeners.
080            *
081            * @param userGroup the user group
082            * @throws PortalException
083            * @throws SystemException if a system exception occurred
084            */
085            public static void deleteUserGroup(
086                    com.liferay.portal.model.UserGroup userGroup)
087                    throws com.liferay.portal.kernel.exception.PortalException,
088                            com.liferay.portal.kernel.exception.SystemException {
089                    getService().deleteUserGroup(userGroup);
090            }
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public static java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException {
103                    return getService().dynamicQuery(dynamicQuery);
104            }
105    
106            /**
107            * Performs a dynamic query on the database and returns a range of the matching rows.
108            *
109            * <p>
110            * 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.
111            * </p>
112            *
113            * @param dynamicQuery the dynamic query
114            * @param start the lower bound of the range of model instances
115            * @param end the upper bound of the range of model instances (not inclusive)
116            * @return the range of matching rows
117            * @throws SystemException if a system exception occurred
118            */
119            @SuppressWarnings("rawtypes")
120            public static java.util.List dynamicQuery(
121                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
122                    int end) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getService().dynamicQuery(dynamicQuery, start, end);
124            }
125    
126            /**
127            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
128            *
129            * <p>
130            * 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.
131            * </p>
132            *
133            * @param dynamicQuery the dynamic query
134            * @param start the lower bound of the range of model instances
135            * @param end the upper bound of the range of model instances (not inclusive)
136            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
137            * @return the ordered range of matching rows
138            * @throws SystemException if a system exception occurred
139            */
140            @SuppressWarnings("rawtypes")
141            public static java.util.List dynamicQuery(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
143                    int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
148            }
149    
150            /**
151            * Returns the number of rows that match the dynamic query.
152            *
153            * @param dynamicQuery the dynamic query
154            * @return the number of rows that match the dynamic query
155            * @throws SystemException if a system exception occurred
156            */
157            public static long dynamicQueryCount(
158                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getService().dynamicQueryCount(dynamicQuery);
161            }
162    
163            /**
164            * Returns the user group with the primary key.
165            *
166            * @param userGroupId the primary key of the user group
167            * @return the user group
168            * @throws PortalException if a user group with the primary key could not be found
169            * @throws SystemException if a system exception occurred
170            */
171            public static com.liferay.portal.model.UserGroup getUserGroup(
172                    long userGroupId)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    return getService().getUserGroup(userGroupId);
176            }
177    
178            public static com.liferay.portal.model.PersistedModel getPersistedModel(
179                    java.io.Serializable primaryKeyObj)
180                    throws com.liferay.portal.kernel.exception.PortalException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    return getService().getPersistedModel(primaryKeyObj);
183            }
184    
185            /**
186            * Returns a range of all the user groups.
187            *
188            * <p>
189            * 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.
190            * </p>
191            *
192            * @param start the lower bound of the range of user groups
193            * @param end the upper bound of the range of user groups (not inclusive)
194            * @return the range of user groups
195            * @throws SystemException if a system exception occurred
196            */
197            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
198                    int start, int end)
199                    throws com.liferay.portal.kernel.exception.SystemException {
200                    return getService().getUserGroups(start, end);
201            }
202    
203            /**
204            * Returns the number of user groups.
205            *
206            * @return the number of user groups
207            * @throws SystemException if a system exception occurred
208            */
209            public static int getUserGroupsCount()
210                    throws com.liferay.portal.kernel.exception.SystemException {
211                    return getService().getUserGroupsCount();
212            }
213    
214            /**
215            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
216            *
217            * @param userGroup the user group
218            * @return the user group that was updated
219            * @throws SystemException if a system exception occurred
220            */
221            public static com.liferay.portal.model.UserGroup updateUserGroup(
222                    com.liferay.portal.model.UserGroup userGroup)
223                    throws com.liferay.portal.kernel.exception.SystemException {
224                    return getService().updateUserGroup(userGroup);
225            }
226    
227            /**
228            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
229            *
230            * @param userGroup the user group
231            * @param merge whether to merge the user group 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.
232            * @return the user group that was updated
233            * @throws SystemException if a system exception occurred
234            */
235            public static com.liferay.portal.model.UserGroup updateUserGroup(
236                    com.liferay.portal.model.UserGroup userGroup, boolean merge)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getService().updateUserGroup(userGroup, merge);
239            }
240    
241            /**
242            * Returns the Spring bean ID for this bean.
243            *
244            * @return the Spring bean ID for this bean
245            */
246            public static java.lang.String getBeanIdentifier() {
247                    return getService().getBeanIdentifier();
248            }
249    
250            /**
251            * Sets the Spring bean ID for this bean.
252            *
253            * @param beanIdentifier the Spring bean ID for this bean
254            */
255            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
256                    getService().setBeanIdentifier(beanIdentifier);
257            }
258    
259            public static void addGroupUserGroups(long groupId, long[] userGroupIds)
260                    throws com.liferay.portal.kernel.exception.SystemException {
261                    getService().addGroupUserGroups(groupId, userGroupIds);
262            }
263    
264            public static void addTeamUserGroups(long teamId, long[] userGroupIds)
265                    throws com.liferay.portal.kernel.exception.SystemException {
266                    getService().addTeamUserGroups(teamId, userGroupIds);
267            }
268    
269            public static com.liferay.portal.model.UserGroup addUserGroup(long userId,
270                    long companyId, java.lang.String name, java.lang.String description)
271                    throws com.liferay.portal.kernel.exception.PortalException,
272                            com.liferay.portal.kernel.exception.SystemException {
273                    return getService().addUserGroup(userId, companyId, name, description);
274            }
275    
276            public static void clearUserUserGroups(long userId)
277                    throws com.liferay.portal.kernel.exception.SystemException {
278                    getService().clearUserUserGroups(userId);
279            }
280    
281            public static void copyUserGroupLayouts(long userGroupId, long[] userIds)
282                    throws com.liferay.portal.kernel.exception.PortalException,
283                            com.liferay.portal.kernel.exception.SystemException {
284                    getService().copyUserGroupLayouts(userGroupId, userIds);
285            }
286    
287            public static void copyUserGroupLayouts(long[] userGroupIds, long userId)
288                    throws com.liferay.portal.kernel.exception.PortalException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    getService().copyUserGroupLayouts(userGroupIds, userId);
291            }
292    
293            public static void copyUserGroupLayouts(long userGroupId, long userId)
294                    throws com.liferay.portal.kernel.exception.PortalException,
295                            com.liferay.portal.kernel.exception.SystemException {
296                    getService().copyUserGroupLayouts(userGroupId, userId);
297            }
298    
299            public static com.liferay.portal.model.UserGroup getUserGroup(
300                    long companyId, java.lang.String name)
301                    throws com.liferay.portal.kernel.exception.PortalException,
302                            com.liferay.portal.kernel.exception.SystemException {
303                    return getService().getUserGroup(companyId, name);
304            }
305    
306            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
307                    long companyId)
308                    throws com.liferay.portal.kernel.exception.SystemException {
309                    return getService().getUserGroups(companyId);
310            }
311    
312            public static java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
313                    long[] userGroupIds)
314                    throws com.liferay.portal.kernel.exception.PortalException,
315                            com.liferay.portal.kernel.exception.SystemException {
316                    return getService().getUserGroups(userGroupIds);
317            }
318    
319            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
320                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
321                    return getService().getUserUserGroups(userId);
322            }
323    
324            public static boolean hasGroupUserGroup(long groupId, long userGroupId)
325                    throws com.liferay.portal.kernel.exception.SystemException {
326                    return getService().hasGroupUserGroup(groupId, userGroupId);
327            }
328    
329            public static boolean hasTeamUserGroup(long teamId, long userGroupId)
330                    throws com.liferay.portal.kernel.exception.SystemException {
331                    return getService().hasTeamUserGroup(teamId, userGroupId);
332            }
333    
334            public static java.util.List<com.liferay.portal.model.UserGroup> search(
335                    long companyId, java.lang.String name, java.lang.String description,
336                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
337                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
338                    throws com.liferay.portal.kernel.exception.SystemException {
339                    return getService()
340                                       .search(companyId, name, description, params, start, end, obc);
341            }
342    
343            public static int searchCount(long companyId, java.lang.String name,
344                    java.lang.String description,
345                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
346                    throws com.liferay.portal.kernel.exception.SystemException {
347                    return getService().searchCount(companyId, name, description, params);
348            }
349    
350            public static void setUserUserGroups(long userId, long[] userGroupIds)
351                    throws com.liferay.portal.kernel.exception.PortalException,
352                            com.liferay.portal.kernel.exception.SystemException {
353                    getService().setUserUserGroups(userId, userGroupIds);
354            }
355    
356            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    getService().unsetGroupUserGroups(groupId, userGroupIds);
359            }
360    
361            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
362                    throws com.liferay.portal.kernel.exception.SystemException {
363                    getService().unsetTeamUserGroups(teamId, userGroupIds);
364            }
365    
366            public static com.liferay.portal.model.UserGroup updateUserGroup(
367                    long companyId, long userGroupId, java.lang.String name,
368                    java.lang.String description)
369                    throws com.liferay.portal.kernel.exception.PortalException,
370                            com.liferay.portal.kernel.exception.SystemException {
371                    return getService()
372                                       .updateUserGroup(companyId, userGroupId, name, description);
373            }
374    
375            public static UserGroupLocalService getService() {
376                    if (_service == null) {
377                            _service = (UserGroupLocalService)PortalBeanLocatorUtil.locate(UserGroupLocalService.class.getName());
378    
379                            ReferenceRegistry.registerReference(UserGroupLocalServiceUtil.class,
380                                    "_service");
381                            MethodCache.remove(UserGroupLocalService.class);
382                    }
383    
384                    return _service;
385            }
386    
387            public void setService(UserGroupLocalService service) {
388                    MethodCache.remove(UserGroupLocalService.class);
389    
390                    _service = service;
391    
392                    ReferenceRegistry.registerReference(UserGroupLocalServiceUtil.class,
393                            "_service");
394                    MethodCache.remove(UserGroupLocalService.class);
395            }
396    
397            private static UserGroupLocalService _service;
398    }