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