001    /**
002     * Copyright (c) 2000-present 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.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for UserGroup. This utility wraps
024     * {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see UserGroupLocalService
032     * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class UserGroupLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static void addGroupUserGroup(long groupId,
044                    com.liferay.portal.kernel.model.UserGroup userGroup) {
045                    getService().addGroupUserGroup(groupId, userGroup);
046            }
047    
048            public static void addGroupUserGroup(long groupId, long userGroupId) {
049                    getService().addGroupUserGroup(groupId, userGroupId);
050            }
051    
052            public static void addGroupUserGroups(long groupId,
053                    java.util.List<com.liferay.portal.kernel.model.UserGroup> UserGroups) {
054                    getService().addGroupUserGroups(groupId, UserGroups);
055            }
056    
057            public static void addGroupUserGroups(long groupId, long[] userGroupIds) {
058                    getService().addGroupUserGroups(groupId, userGroupIds);
059            }
060    
061            public static void addTeamUserGroup(long teamId,
062                    com.liferay.portal.kernel.model.UserGroup userGroup) {
063                    getService().addTeamUserGroup(teamId, userGroup);
064            }
065    
066            public static void addTeamUserGroup(long teamId, long userGroupId) {
067                    getService().addTeamUserGroup(teamId, userGroupId);
068            }
069    
070            public static void addTeamUserGroups(long teamId,
071                    java.util.List<com.liferay.portal.kernel.model.UserGroup> UserGroups) {
072                    getService().addTeamUserGroups(teamId, UserGroups);
073            }
074    
075            public static void addTeamUserGroups(long teamId, long[] userGroupIds) {
076                    getService().addTeamUserGroups(teamId, userGroupIds);
077            }
078    
079            /**
080            * Adds the user group to the database. Also notifies the appropriate model listeners.
081            *
082            * @param userGroup the user group
083            * @return the user group that was added
084            */
085            public static com.liferay.portal.kernel.model.UserGroup addUserGroup(
086                    com.liferay.portal.kernel.model.UserGroup userGroup) {
087                    return getService().addUserGroup(userGroup);
088            }
089    
090            /**
091            * Adds a user group.
092            *
093            * <p>
094            * This method handles the creation and bookkeeping of the user group,
095            * including its resources, metadata, and internal data structures. It is
096            * not necessary to make subsequent calls to setup default groups and
097            * resources for the user group.
098            * </p>
099            *
100            * @param userId the primary key of the user
101            * @param companyId the primary key of the user group's company
102            * @param name the user group's name
103            * @param description the user group's description
104            * @return the user group
105            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(long, long,
106            String, String, ServiceContext)}
107            */
108            @Deprecated
109            public static com.liferay.portal.kernel.model.UserGroup addUserGroup(
110                    long userId, long companyId, java.lang.String name,
111                    java.lang.String description)
112                    throws com.liferay.portal.kernel.exception.PortalException {
113                    return getService().addUserGroup(userId, companyId, name, description);
114            }
115    
116            /**
117            * Adds a user group.
118            *
119            * <p>
120            * This method handles the creation and bookkeeping of the user group,
121            * including its resources, metadata, and internal data structures. It is
122            * not necessary to make subsequent calls to setup default groups and
123            * resources for the user group.
124            * </p>
125            *
126            * @param userId the primary key of the user
127            * @param companyId the primary key of the user group's company
128            * @param name the user group's name
129            * @param description the user group's description
130            * @param serviceContext the service context to be applied (optionally
131            <code>null</code>). Can set expando bridge attributes for the
132            user group.
133            * @return the user group
134            */
135            public static com.liferay.portal.kernel.model.UserGroup addUserGroup(
136                    long userId, long companyId, java.lang.String name,
137                    java.lang.String description,
138                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
139                    throws com.liferay.portal.kernel.exception.PortalException {
140                    return getService()
141                                       .addUserGroup(userId, companyId, name, description,
142                            serviceContext);
143            }
144    
145            public static void addUserUserGroup(long userId,
146                    com.liferay.portal.kernel.model.UserGroup userGroup) {
147                    getService().addUserUserGroup(userId, userGroup);
148            }
149    
150            public static void addUserUserGroup(long userId, long userGroupId) {
151                    getService().addUserUserGroup(userId, userGroupId);
152            }
153    
154            public static void addUserUserGroups(long userId,
155                    java.util.List<com.liferay.portal.kernel.model.UserGroup> UserGroups) {
156                    getService().addUserUserGroups(userId, UserGroups);
157            }
158    
159            public static void addUserUserGroups(long userId, long[] userGroupIds) {
160                    getService().addUserUserGroups(userId, userGroupIds);
161            }
162    
163            public static void clearGroupUserGroups(long groupId) {
164                    getService().clearGroupUserGroups(groupId);
165            }
166    
167            public static void clearTeamUserGroups(long teamId) {
168                    getService().clearTeamUserGroups(teamId);
169            }
170    
171            public static void clearUserUserGroups(long userId) {
172                    getService().clearUserUserGroups(userId);
173            }
174    
175            /**
176            * Copies the user group's layout to the user.
177            *
178            * @param userGroupId the primary key of the user group
179            * @param userId the primary key of the user
180            * @deprecated As of 6.2.0
181            */
182            @Deprecated
183            public static void copyUserGroupLayouts(long userGroupId, long userId)
184                    throws com.liferay.portal.kernel.exception.PortalException {
185                    getService().copyUserGroupLayouts(userGroupId, userId);
186            }
187    
188            /**
189            * Copies the user group's layouts to the users who are not already members
190            * of the user group.
191            *
192            * @param userGroupId the primary key of the user group
193            * @param userIds the primary keys of the users
194            * @deprecated As of 6.1.0
195            */
196            @Deprecated
197            public static void copyUserGroupLayouts(long userGroupId, long[] userIds)
198                    throws com.liferay.portal.kernel.exception.PortalException {
199                    getService().copyUserGroupLayouts(userGroupId, userIds);
200            }
201    
202            /**
203            * Copies the user groups' layouts to the user.
204            *
205            * @param userGroupIds the primary keys of the user groups
206            * @param userId the primary key of the user
207            * @deprecated As of 6.1.0
208            */
209            @Deprecated
210            public static void copyUserGroupLayouts(long[] userGroupIds, long userId)
211                    throws com.liferay.portal.kernel.exception.PortalException {
212                    getService().copyUserGroupLayouts(userGroupIds, userId);
213            }
214    
215            /**
216            * Creates a new user group with the primary key. Does not add the user group to the database.
217            *
218            * @param userGroupId the primary key for the new user group
219            * @return the new user group
220            */
221            public static com.liferay.portal.kernel.model.UserGroup createUserGroup(
222                    long userGroupId) {
223                    return getService().createUserGroup(userGroupId);
224            }
225    
226            public static void deleteGroupUserGroup(long groupId,
227                    com.liferay.portal.kernel.model.UserGroup userGroup) {
228                    getService().deleteGroupUserGroup(groupId, userGroup);
229            }
230    
231            public static void deleteGroupUserGroup(long groupId, long userGroupId) {
232                    getService().deleteGroupUserGroup(groupId, userGroupId);
233            }
234    
235            public static void deleteGroupUserGroups(long groupId,
236                    java.util.List<com.liferay.portal.kernel.model.UserGroup> UserGroups) {
237                    getService().deleteGroupUserGroups(groupId, UserGroups);
238            }
239    
240            public static void deleteGroupUserGroups(long groupId, long[] userGroupIds) {
241                    getService().deleteGroupUserGroups(groupId, userGroupIds);
242            }
243    
244            /**
245            * @throws PortalException
246            */
247            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
248                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
249                    throws com.liferay.portal.kernel.exception.PortalException {
250                    return getService().deletePersistedModel(persistedModel);
251            }
252    
253            public static void deleteTeamUserGroup(long teamId,
254                    com.liferay.portal.kernel.model.UserGroup userGroup) {
255                    getService().deleteTeamUserGroup(teamId, userGroup);
256            }
257    
258            public static void deleteTeamUserGroup(long teamId, long userGroupId) {
259                    getService().deleteTeamUserGroup(teamId, userGroupId);
260            }
261    
262            public static void deleteTeamUserGroups(long teamId,
263                    java.util.List<com.liferay.portal.kernel.model.UserGroup> UserGroups) {
264                    getService().deleteTeamUserGroups(teamId, UserGroups);
265            }
266    
267            public static void deleteTeamUserGroups(long teamId, long[] userGroupIds) {
268                    getService().deleteTeamUserGroups(teamId, userGroupIds);
269            }
270    
271            /**
272            * Deletes the user group from the database. Also notifies the appropriate model listeners.
273            *
274            * @param userGroup the user group
275            * @return the user group that was removed
276            * @throws PortalException
277            */
278            public static com.liferay.portal.kernel.model.UserGroup deleteUserGroup(
279                    com.liferay.portal.kernel.model.UserGroup userGroup)
280                    throws com.liferay.portal.kernel.exception.PortalException {
281                    return getService().deleteUserGroup(userGroup);
282            }
283    
284            /**
285            * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners.
286            *
287            * @param userGroupId the primary key of the user group
288            * @return the user group that was removed
289            * @throws PortalException if a user group with the primary key could not be found
290            */
291            public static com.liferay.portal.kernel.model.UserGroup deleteUserGroup(
292                    long userGroupId)
293                    throws com.liferay.portal.kernel.exception.PortalException {
294                    return getService().deleteUserGroup(userGroupId);
295            }
296    
297            public static void deleteUserGroups(long companyId)
298                    throws com.liferay.portal.kernel.exception.PortalException {
299                    getService().deleteUserGroups(companyId);
300            }
301    
302            public static void deleteUserUserGroup(long userId,
303                    com.liferay.portal.kernel.model.UserGroup userGroup) {
304                    getService().deleteUserUserGroup(userId, userGroup);
305            }
306    
307            public static void deleteUserUserGroup(long userId, long userGroupId) {
308                    getService().deleteUserUserGroup(userId, userGroupId);
309            }
310    
311            public static void deleteUserUserGroups(long userId,
312                    java.util.List<com.liferay.portal.kernel.model.UserGroup> UserGroups) {
313                    getService().deleteUserUserGroups(userId, UserGroups);
314            }
315    
316            public static void deleteUserUserGroups(long userId, long[] userGroupIds) {
317                    getService().deleteUserUserGroups(userId, userGroupIds);
318            }
319    
320            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
321                    return getService().dynamicQuery();
322            }
323    
324            /**
325            * Performs a dynamic query on the database and returns the matching rows.
326            *
327            * @param dynamicQuery the dynamic query
328            * @return the matching rows
329            */
330            public static <T> java.util.List<T> dynamicQuery(
331                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
332                    return getService().dynamicQuery(dynamicQuery);
333            }
334    
335            /**
336            * Performs a dynamic query on the database and returns a range of the matching rows.
337            *
338            * <p>
339            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
340            * </p>
341            *
342            * @param dynamicQuery the dynamic query
343            * @param start the lower bound of the range of model instances
344            * @param end the upper bound of the range of model instances (not inclusive)
345            * @return the range of matching rows
346            */
347            public static <T> java.util.List<T> dynamicQuery(
348                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
349                    int end) {
350                    return getService().dynamicQuery(dynamicQuery, start, end);
351            }
352    
353            /**
354            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
355            *
356            * <p>
357            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
358            * </p>
359            *
360            * @param dynamicQuery the dynamic query
361            * @param start the lower bound of the range of model instances
362            * @param end the upper bound of the range of model instances (not inclusive)
363            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
364            * @return the ordered range of matching rows
365            */
366            public static <T> java.util.List<T> dynamicQuery(
367                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
368                    int end,
369                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
370                    return getService()
371                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
372            }
373    
374            /**
375            * Returns the number of rows matching the dynamic query.
376            *
377            * @param dynamicQuery the dynamic query
378            * @return the number of rows matching the dynamic query
379            */
380            public static long dynamicQueryCount(
381                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
382                    return getService().dynamicQueryCount(dynamicQuery);
383            }
384    
385            /**
386            * Returns the number of rows matching the dynamic query.
387            *
388            * @param dynamicQuery the dynamic query
389            * @param projection the projection to apply to the query
390            * @return the number of rows matching the dynamic query
391            */
392            public static long dynamicQueryCount(
393                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
394                    com.liferay.portal.kernel.dao.orm.Projection projection) {
395                    return getService().dynamicQueryCount(dynamicQuery, projection);
396            }
397    
398            public static com.liferay.portal.kernel.model.UserGroup fetchUserGroup(
399                    long companyId, java.lang.String name) {
400                    return getService().fetchUserGroup(companyId, name);
401            }
402    
403            public static com.liferay.portal.kernel.model.UserGroup fetchUserGroup(
404                    long userGroupId) {
405                    return getService().fetchUserGroup(userGroupId);
406            }
407    
408            /**
409            * Returns the user group with the matching UUID and company.
410            *
411            * @param uuid the user group's UUID
412            * @param companyId the primary key of the company
413            * @return the matching user group, or <code>null</code> if a matching user group could not be found
414            */
415            public static com.liferay.portal.kernel.model.UserGroup fetchUserGroupByUuidAndCompanyId(
416                    java.lang.String uuid, long companyId) {
417                    return getService().fetchUserGroupByUuidAndCompanyId(uuid, companyId);
418            }
419    
420            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
421                    return getService().getActionableDynamicQuery();
422            }
423    
424            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
425                    com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) {
426                    return getService().getExportActionableDynamicQuery(portletDataContext);
427            }
428    
429            /**
430            * Returns the groupIds of the groups associated with the user group.
431            *
432            * @param userGroupId the userGroupId of the user group
433            * @return long[] the groupIds of groups associated with the user group
434            */
435            public static long[] getGroupPrimaryKeys(long userGroupId) {
436                    return getService().getGroupPrimaryKeys(userGroupId);
437            }
438    
439            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getGroupUserGroups(
440                    long groupId) {
441                    return getService().getGroupUserGroups(groupId);
442            }
443    
444            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getGroupUserGroups(
445                    long groupId, int start, int end) {
446                    return getService().getGroupUserGroups(groupId, start, end);
447            }
448    
449            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getGroupUserGroups(
450                    long groupId, int start, int end,
451                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.UserGroup> orderByComparator) {
452                    return getService()
453                                       .getGroupUserGroups(groupId, start, end, orderByComparator);
454            }
455    
456            public static int getGroupUserGroupsCount(long groupId) {
457                    return getService().getGroupUserGroupsCount(groupId);
458            }
459    
460            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getGroupUserUserGroups(
461                    long groupId, long userId)
462                    throws com.liferay.portal.kernel.exception.PortalException {
463                    return getService().getGroupUserUserGroups(groupId, userId);
464            }
465    
466            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
467                    return getService().getIndexableActionableDynamicQuery();
468            }
469    
470            /**
471            * Returns the OSGi service identifier.
472            *
473            * @return the OSGi service identifier
474            */
475            public static java.lang.String getOSGiServiceIdentifier() {
476                    return getService().getOSGiServiceIdentifier();
477            }
478    
479            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
480                    java.io.Serializable primaryKeyObj)
481                    throws com.liferay.portal.kernel.exception.PortalException {
482                    return getService().getPersistedModel(primaryKeyObj);
483            }
484    
485            /**
486            * Returns the teamIds of the teams associated with the user group.
487            *
488            * @param userGroupId the userGroupId of the user group
489            * @return long[] the teamIds of teams associated with the user group
490            */
491            public static long[] getTeamPrimaryKeys(long userGroupId) {
492                    return getService().getTeamPrimaryKeys(userGroupId);
493            }
494    
495            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getTeamUserGroups(
496                    long teamId) {
497                    return getService().getTeamUserGroups(teamId);
498            }
499    
500            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getTeamUserGroups(
501                    long teamId, int start, int end) {
502                    return getService().getTeamUserGroups(teamId, start, end);
503            }
504    
505            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getTeamUserGroups(
506                    long teamId, int start, int end,
507                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.UserGroup> orderByComparator) {
508                    return getService()
509                                       .getTeamUserGroups(teamId, start, end, orderByComparator);
510            }
511    
512            public static int getTeamUserGroupsCount(long teamId) {
513                    return getService().getTeamUserGroupsCount(teamId);
514            }
515    
516            /**
517            * Returns the user group with the name.
518            *
519            * @param companyId the primary key of the user group's company
520            * @param name the user group's name
521            * @return Returns the user group with the name
522            */
523            public static com.liferay.portal.kernel.model.UserGroup getUserGroup(
524                    long companyId, java.lang.String name)
525                    throws com.liferay.portal.kernel.exception.PortalException {
526                    return getService().getUserGroup(companyId, name);
527            }
528    
529            /**
530            * Returns the user group with the primary key.
531            *
532            * @param userGroupId the primary key of the user group
533            * @return the user group
534            * @throws PortalException if a user group with the primary key could not be found
535            */
536            public static com.liferay.portal.kernel.model.UserGroup getUserGroup(
537                    long userGroupId)
538                    throws com.liferay.portal.kernel.exception.PortalException {
539                    return getService().getUserGroup(userGroupId);
540            }
541    
542            /**
543            * Returns the user group with the matching UUID and company.
544            *
545            * @param uuid the user group's UUID
546            * @param companyId the primary key of the company
547            * @return the matching user group
548            * @throws PortalException if a matching user group could not be found
549            */
550            public static com.liferay.portal.kernel.model.UserGroup getUserGroupByUuidAndCompanyId(
551                    java.lang.String uuid, long companyId)
552                    throws com.liferay.portal.kernel.exception.PortalException {
553                    return getService().getUserGroupByUuidAndCompanyId(uuid, companyId);
554            }
555    
556            /**
557            * Returns all the user groups belonging to the company.
558            *
559            * @param companyId the primary key of the user groups' company
560            * @return the user groups belonging to the company
561            */
562            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserGroups(
563                    long companyId) {
564                    return getService().getUserGroups(companyId);
565            }
566    
567            /**
568            * Returns a range of all the user groups.
569            *
570            * <p>
571            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
572            * </p>
573            *
574            * @param start the lower bound of the range of user groups
575            * @param end the upper bound of the range of user groups (not inclusive)
576            * @return the range of user groups
577            */
578            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserGroups(
579                    int start, int end) {
580                    return getService().getUserGroups(start, end);
581            }
582    
583            /**
584            * Returns all the user groups with the primary keys.
585            *
586            * @param userGroupIds the primary keys of the user groups
587            * @return the user groups with the primary keys
588            */
589            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserGroups(
590                    long[] userGroupIds)
591                    throws com.liferay.portal.kernel.exception.PortalException {
592                    return getService().getUserGroups(userGroupIds);
593            }
594    
595            /**
596            * Returns the number of user groups.
597            *
598            * @return the number of user groups
599            */
600            public static int getUserGroupsCount() {
601                    return getService().getUserGroupsCount();
602            }
603    
604            /**
605            * Returns the userIds of the users associated with the user group.
606            *
607            * @param userGroupId the userGroupId of the user group
608            * @return long[] the userIds of users associated with the user group
609            */
610            public static long[] getUserPrimaryKeys(long userGroupId) {
611                    return getService().getUserPrimaryKeys(userGroupId);
612            }
613    
614            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserUserGroups(
615                    long userId) {
616                    return getService().getUserUserGroups(userId);
617            }
618    
619            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserUserGroups(
620                    long userId, int start, int end) {
621                    return getService().getUserUserGroups(userId, start, end);
622            }
623    
624            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> getUserUserGroups(
625                    long userId, int start, int end,
626                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.UserGroup> orderByComparator) {
627                    return getService()
628                                       .getUserUserGroups(userId, start, end, orderByComparator);
629            }
630    
631            public static int getUserUserGroupsCount(long userId) {
632                    return getService().getUserUserGroupsCount(userId);
633            }
634    
635            public static boolean hasGroupUserGroup(long groupId, long userGroupId) {
636                    return getService().hasGroupUserGroup(groupId, userGroupId);
637            }
638    
639            public static boolean hasGroupUserGroups(long groupId) {
640                    return getService().hasGroupUserGroups(groupId);
641            }
642    
643            public static boolean hasTeamUserGroup(long teamId, long userGroupId) {
644                    return getService().hasTeamUserGroup(teamId, userGroupId);
645            }
646    
647            public static boolean hasTeamUserGroups(long teamId) {
648                    return getService().hasTeamUserGroups(teamId);
649            }
650    
651            public static boolean hasUserUserGroup(long userId, long userGroupId) {
652                    return getService().hasUserUserGroup(userId, userGroupId);
653            }
654    
655            public static boolean hasUserUserGroups(long userId) {
656                    return getService().hasUserUserGroups(userId);
657            }
658    
659            /**
660            * Returns an ordered range of all the user groups that match the keywords.
661            *
662            * <p>
663            * Useful when paginating results. Returns a maximum of <code>end -
664            * start</code> instances. <code>start</code> and <code>end</code> are not
665            * primary keys, they are indexes in the result set. Thus, <code>0</code>
666            * refers to the first result in the set. Setting both <code>start</code>
667            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
668            * result set.
669            * </p>
670            *
671            * @param companyId the primary key of the user group's company
672            * @param keywords the keywords (space separated), which may occur in the
673            user group's name or description (optionally <code>null</code>)
674            * @param params the finder params (optionally <code>null</code>). For more
675            information see {@link
676            com.liferay.portal.kernel.service.persistence.UserGroupFinder}
677            * @param start the lower bound of the range of user groups to return
678            * @param end the upper bound of the range of user groups to return (not
679            inclusive)
680            * @param obc the comparator to order the user groups (optionally
681            <code>null</code>)
682            * @return the matching user groups ordered by comparator <code>obc</code>
683            * @see com.liferay.portal.kernel.service.persistence.UserGroupFinder
684            */
685            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> search(
686                    long companyId, java.lang.String keywords,
687                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
688                    int start, int end,
689                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.UserGroup> obc) {
690                    return getService().search(companyId, keywords, params, start, end, obc);
691            }
692    
693            /**
694            * Returns an ordered range of all the user groups that match the keywords,
695            * using the indexer. It is preferable to use this method instead of the
696            * non-indexed version whenever possible for performance reasons.
697            *
698            * <p>
699            * Useful when paginating results. Returns a maximum of <code>end -
700            * start</code> instances. <code>start</code> and <code>end</code> are not
701            * primary keys, they are indexes in the result set. Thus, <code>0</code>
702            * refers to the first result in the set. Setting both <code>start</code>
703            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
704            * result set.
705            * </p>
706            *
707            * @param companyId the primary key of the user group's company
708            * @param keywords the keywords (space separated), which may occur in the
709            user group's name or description (optionally <code>null</code>)
710            * @param params the finder params (optionally <code>null</code>). For more
711            information see {@link
712            com.liferay.user.groups.admin.web.search.UserGroupIndexer}
713            * @param start the lower bound of the range of user groups to return
714            * @param end the upper bound of the range of user groups to return (not
715            inclusive)
716            * @param sort the field and direction by which to sort (optionally
717            <code>null</code>)
718            * @return the matching user groups ordered by sort
719            * @see com.liferay.user.groups.admin.web.search.UserGroupIndexer
720            */
721            public static com.liferay.portal.kernel.search.Hits search(long companyId,
722                    java.lang.String keywords,
723                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
724                    int start, int end, com.liferay.portal.kernel.search.Sort sort) {
725                    return getService().search(companyId, keywords, params, start, end, sort);
726            }
727    
728            /**
729            * Returns an ordered range of all the user groups that match the name and
730            * description.
731            *
732            * <p>
733            * Useful when paginating results. Returns a maximum of <code>end -
734            * start</code> instances. <code>start</code> and <code>end</code> are not
735            * primary keys, they are indexes in the result set. Thus, <code>0</code>
736            * refers to the first result in the set. Setting both <code>start</code>
737            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
738            * result set.
739            * </p>
740            *
741            * @param companyId the primary key of the user group's company
742            * @param name the user group's name (optionally <code>null</code>)
743            * @param description the user group's description (optionally
744            <code>null</code>)
745            * @param params the finder params (optionally <code>null</code>). For more
746            information see {@link
747            com.liferay.portal.kernel.service.persistence.UserGroupFinder}
748            * @param andOperator whether every field must match its keywords or just
749            one field
750            * @param start the lower bound of the range of user groups to return
751            * @param end the upper bound of the range of user groups to return (not
752            inclusive)
753            * @param obc the comparator to order the user groups (optionally
754            <code>null</code>)
755            * @return the matching user groups ordered by comparator <code>obc</code>
756            * @see com.liferay.portal.kernel.service.persistence.UserGroupFinder
757            */
758            public static java.util.List<com.liferay.portal.kernel.model.UserGroup> search(
759                    long companyId, java.lang.String name, java.lang.String description,
760                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
761                    boolean andOperator, int start, int end,
762                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.UserGroup> obc) {
763                    return getService()
764                                       .search(companyId, name, description, params, andOperator,
765                            start, end, obc);
766            }
767    
768            /**
769            * Returns an ordered range of all the user groups that match the name and
770            * description. It is preferable to use this method instead of the
771            * non-indexed version whenever possible for performance reasons.
772            *
773            * <p>
774            * Useful when paginating results. Returns a maximum of <code>end -
775            * start</code> instances. <code>start</code> and <code>end</code> are not
776            * primary keys, they are indexes in the result set. Thus, <code>0</code>
777            * refers to the first result in the set. Setting both <code>start</code>
778            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
779            * result set.
780            * </p>
781            *
782            * @param companyId the primary key of the user group's company
783            * @param name the user group's name (optionally <code>null</code>)
784            * @param description the user group's description (optionally
785            <code>null</code>)
786            * @param params the finder params (optionally <code>null</code>). For more
787            information see {@link
788            com.liferay.user.groups.admin.web.search.UserGroupIndexer}
789            * @param andSearch whether every field must match its keywords or just one
790            field
791            * @param start the lower bound of the range of user groups to return
792            * @param end the upper bound of the range of user groups to return (not
793            inclusive)
794            * @param sort the field and direction by which to sort (optionally
795            <code>null</code>)
796            * @return the matching user groups ordered by sort
797            * @see com.liferay.portal.kernel.service.persistence.UserGroupFinder
798            */
799            public static com.liferay.portal.kernel.search.Hits search(long companyId,
800                    java.lang.String name, java.lang.String description,
801                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
802                    boolean andSearch, int start, int end,
803                    com.liferay.portal.kernel.search.Sort sort) {
804                    return getService()
805                                       .search(companyId, name, description, params, andSearch,
806                            start, end, sort);
807            }
808    
809            /**
810            * Returns the number of user groups that match the keywords
811            *
812            * @param companyId the primary key of the user group's company
813            * @param keywords the keywords (space separated), which may occur in the
814            user group's name or description (optionally <code>null</code>)
815            * @param params the finder params (optionally <code>null</code>). For more
816            information see {@link
817            com.liferay.portal.kernel.service.persistence.UserGroupFinder}
818            * @return the number of matching user groups
819            * @see com.liferay.portal.kernel.service.persistence.UserGroupFinder
820            */
821            public static int searchCount(long companyId, java.lang.String keywords,
822                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) {
823                    return getService().searchCount(companyId, keywords, params);
824            }
825    
826            /**
827            * Returns the number of user groups that match the name and description.
828            *
829            * @param companyId the primary key of the user group's company
830            * @param name the user group's name (optionally <code>null</code>)
831            * @param description the user group's description (optionally
832            <code>null</code>)
833            * @param params the finder params (optionally <code>null</code>). For more
834            information see {@link
835            com.liferay.portal.kernel.service.persistence.UserGroupFinder}
836            * @param andOperator whether every field must match its keywords or just
837            one field
838            * @return the number of matching user groups
839            * @see com.liferay.portal.kernel.service.persistence.UserGroupFinder
840            */
841            public static int searchCount(long companyId, java.lang.String name,
842                    java.lang.String description,
843                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
844                    boolean andOperator) {
845                    return getService()
846                                       .searchCount(companyId, name, description, params,
847                            andOperator);
848            }
849    
850            public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.kernel.model.UserGroup> searchUserGroups(
851                    long companyId, java.lang.String keywords,
852                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
853                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
854                    throws com.liferay.portal.kernel.exception.PortalException {
855                    return getService()
856                                       .searchUserGroups(companyId, keywords, params, start, end,
857                            sort);
858            }
859    
860            public static com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.kernel.model.UserGroup> searchUserGroups(
861                    long companyId, java.lang.String name, java.lang.String description,
862                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
863                    boolean andSearch, int start, int end,
864                    com.liferay.portal.kernel.search.Sort sort)
865                    throws com.liferay.portal.kernel.exception.PortalException {
866                    return getService()
867                                       .searchUserGroups(companyId, name, description, params,
868                            andSearch, start, end, sort);
869            }
870    
871            public static void setGroupUserGroups(long groupId, long[] userGroupIds) {
872                    getService().setGroupUserGroups(groupId, userGroupIds);
873            }
874    
875            public static void setTeamUserGroups(long teamId, long[] userGroupIds) {
876                    getService().setTeamUserGroups(teamId, userGroupIds);
877            }
878    
879            /**
880            * @throws PortalException
881            */
882            public static void setUserUserGroups(long userId, long[] userGroupIds)
883                    throws com.liferay.portal.kernel.exception.PortalException {
884                    getService().setUserUserGroups(userId, userGroupIds);
885            }
886    
887            /**
888            * Removes the user groups from the group.
889            *
890            * @param groupId the primary key of the group
891            * @param userGroupIds the primary keys of the user groups
892            */
893            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds) {
894                    getService().unsetGroupUserGroups(groupId, userGroupIds);
895            }
896    
897            /**
898            * Removes the user groups from the team.
899            *
900            * @param teamId the primary key of the team
901            * @param userGroupIds the primary keys of the user groups
902            */
903            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds) {
904                    getService().unsetTeamUserGroups(teamId, userGroupIds);
905            }
906    
907            /**
908            * Updates the user group.
909            *
910            * @param companyId the primary key of the user group's company
911            * @param userGroupId the primary key of the user group
912            * @param name the user group's name
913            * @param description the user group's description
914            * @return the user group
915            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, long,
916            String, String, ServiceContext)}
917            */
918            @Deprecated
919            public static com.liferay.portal.kernel.model.UserGroup updateUserGroup(
920                    long companyId, long userGroupId, java.lang.String name,
921                    java.lang.String description)
922                    throws com.liferay.portal.kernel.exception.PortalException {
923                    return getService()
924                                       .updateUserGroup(companyId, userGroupId, name, description);
925            }
926    
927            /**
928            * Updates the user group.
929            *
930            * @param companyId the primary key of the user group's company
931            * @param userGroupId the primary key of the user group
932            * @param name the user group's name
933            * @param description the user group's description
934            * @param serviceContext the service context to be applied (optionally
935            <code>null</code>). Can set expando bridge attributes for the
936            user group.
937            * @return the user group
938            */
939            public static com.liferay.portal.kernel.model.UserGroup updateUserGroup(
940                    long companyId, long userGroupId, java.lang.String name,
941                    java.lang.String description,
942                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
943                    throws com.liferay.portal.kernel.exception.PortalException {
944                    return getService()
945                                       .updateUserGroup(companyId, userGroupId, name, description,
946                            serviceContext);
947            }
948    
949            /**
950            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
951            *
952            * @param userGroup the user group
953            * @return the user group that was updated
954            */
955            public static com.liferay.portal.kernel.model.UserGroup updateUserGroup(
956                    com.liferay.portal.kernel.model.UserGroup userGroup) {
957                    return getService().updateUserGroup(userGroup);
958            }
959    
960            public static UserGroupLocalService getService() {
961                    if (_service == null) {
962                            _service = (UserGroupLocalService)PortalBeanLocatorUtil.locate(UserGroupLocalService.class.getName());
963    
964                            ReferenceRegistry.registerReference(UserGroupLocalServiceUtil.class,
965                                    "_service");
966                    }
967    
968                    return _service;
969            }
970    
971            private static UserGroupLocalService _service;
972    }