001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import 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 remote service utility for Group. This utility wraps
024     * {@link com.liferay.portal.service.impl.GroupServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on a remote server. Methods of this service are expected to have security
027     * checks based on the propagated JAAS credentials because this service can be
028     * accessed remotely.
029     *
030     * @author Brian Wing Shun Chan
031     * @see GroupService
032     * @see com.liferay.portal.service.base.GroupServiceBaseImpl
033     * @see com.liferay.portal.service.impl.GroupServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class GroupServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.GroupServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Returns the Spring bean ID for this bean.
046            *
047            * @return the Spring bean ID for this bean
048            */
049            public static java.lang.String getBeanIdentifier() {
050                    return getService().getBeanIdentifier();
051            }
052    
053            /**
054            * Sets the Spring bean ID for this bean.
055            *
056            * @param beanIdentifier the Spring bean ID for this bean
057            */
058            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
059                    getService().setBeanIdentifier(beanIdentifier);
060            }
061    
062            /**
063            * Adds a group.
064            *
065            * @param parentGroupId the primary key of the parent group
066            * @param liveGroupId the primary key of the live group
067            * @param name the entity's name
068            * @param description the group's description (optionally
069            <code>null</code>)
070            * @param type the group's type. For more information see {@link
071            com.liferay.portal.model.GroupConstants}
072            * @param friendlyURL the group's friendlyURL (optionally
073            <code>null</code>)
074            * @param site whether the group is to be associated with a main site
075            * @param active whether the group is active
076            * @param serviceContext the service context to be applied (optionally
077            <code>null</code>). Can set the asset category IDs and asset tag
078            names for the group, and can set whether the group is for staging
079            * @return the group
080            * @throws PortalException if the user did not have permission to add the
081            group, if a creator could not be found, if the group's
082            information was invalid, if a layout could not be found, or if a
083            valid friendly URL could not be created for the group
084            * @throws SystemException if a system exception occurred
085            */
086            public static com.liferay.portal.model.Group addGroup(long parentGroupId,
087                    long liveGroupId, java.lang.String name, java.lang.String description,
088                    int type, boolean manualMembership, int membershipRestriction,
089                    java.lang.String friendlyURL, boolean site, boolean active,
090                    com.liferay.portal.service.ServiceContext serviceContext)
091                    throws com.liferay.portal.kernel.exception.PortalException,
092                            com.liferay.portal.kernel.exception.SystemException {
093                    return getService()
094                                       .addGroup(parentGroupId, liveGroupId, name, description,
095                            type, manualMembership, membershipRestriction, friendlyURL, site,
096                            active, serviceContext);
097            }
098    
099            /**
100            * Adds the group using the group default live group ID.
101            *
102            * @param parentGroupId the primary key of the parent group
103            * @param name the entity's name
104            * @param description the group's description (optionally
105            <code>null</code>)
106            * @param type the group's type. For more information see {@link
107            com.liferay.portal.model.GroupConstants}
108            * @param friendlyURL the group's friendlyURL
109            * @param site whether the group is to be associated with a main site
110            * @param active whether the group is active
111            * @param serviceContext the service context to be applied (optionally
112            <code>null</code>). Can set asset category IDs and asset tag
113            names for the group, and can set whether the group is for
114            staging
115            * @return the group
116            * @throws PortalException if the user did not have permission to add
117            the group, if a creator could not be found, if the group's
118            information was invalid, if a layout could not be found, or
119            if a valid friendly URL could not be created for the group
120            * @throws SystemException if a system exception occurred
121            * @deprecated As of 6.2.0, replaced by {@link #addGroup(long, long, String,
122            String, int, boolean, int, String, boolean, boolean,
123            ServiceContext)}
124            */
125            public static com.liferay.portal.model.Group addGroup(long parentGroupId,
126                    java.lang.String name, java.lang.String description, int type,
127                    java.lang.String friendlyURL, boolean site, boolean active,
128                    com.liferay.portal.service.ServiceContext serviceContext)
129                    throws com.liferay.portal.kernel.exception.PortalException,
130                            com.liferay.portal.kernel.exception.SystemException {
131                    return getService()
132                                       .addGroup(parentGroupId, name, description, type,
133                            friendlyURL, site, active, serviceContext);
134            }
135    
136            /**
137            * @deprecated As of 6.2.0, replaced by {@link #addGroup(long, String,
138            String, int, String, boolean, boolean, ServiceContext)}
139            */
140            public static com.liferay.portal.model.Group addGroup(
141                    java.lang.String name, java.lang.String description, int type,
142                    java.lang.String friendlyURL, boolean site, boolean active,
143                    com.liferay.portal.service.ServiceContext serviceContext)
144                    throws com.liferay.portal.kernel.exception.PortalException,
145                            com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .addGroup(name, description, type, friendlyURL, site,
148                            active, serviceContext);
149            }
150    
151            /**
152            * Adds the groups to the role.
153            *
154            * @param roleId the primary key of the role
155            * @param groupIds the primary keys of the groups
156            * @throws PortalException if the user did not have permission to update the
157            role
158            * @throws SystemException if a system exception occurred
159            */
160            public static void addRoleGroups(long roleId, long[] groupIds)
161                    throws com.liferay.portal.kernel.exception.PortalException,
162                            com.liferay.portal.kernel.exception.SystemException {
163                    getService().addRoleGroups(roleId, groupIds);
164            }
165    
166            /**
167            * Checks that the current user is permitted to use the group for Remote
168            * Staging.
169            *
170            * @param groupId the primary key of the group
171            * @throws PortalException if a group with the primary key could not be
172            found, if the current user did not have permission to view the
173            group, or if the group's company was different from the current
174            user's company
175            * @throws SystemException if a system exception occurred
176            */
177            public static void checkRemoteStagingGroup(long groupId)
178                    throws com.liferay.portal.kernel.exception.PortalException,
179                            com.liferay.portal.kernel.exception.SystemException {
180                    getService().checkRemoteStagingGroup(groupId);
181            }
182    
183            /**
184            * Deletes the group.
185            *
186            * <p>
187            * The group is unstaged and its assets and resources including layouts,
188            * membership requests, subscriptions, teams, blogs, bookmarks, calendar
189            * events, image gallery, journals, message boards, polls, shopping related
190            * entities, software catalog, and wikis are also deleted.
191            * </p>
192            *
193            * @param groupId the primary key of the group
194            * @throws PortalException if the user did not have permission to delete the
195            group or its assets or resources, if a group with the primary key
196            could not be found, or if the group was a system group
197            * @throws SystemException if a system exception occurred
198            */
199            public static void deleteGroup(long groupId)
200                    throws com.liferay.portal.kernel.exception.PortalException,
201                            com.liferay.portal.kernel.exception.SystemException {
202                    getService().deleteGroup(groupId);
203            }
204    
205            public static void disableStaging(long groupId)
206                    throws com.liferay.portal.kernel.exception.PortalException,
207                            com.liferay.portal.kernel.exception.SystemException {
208                    getService().disableStaging(groupId);
209            }
210    
211            public static void enableStaging(long groupId)
212                    throws com.liferay.portal.kernel.exception.PortalException,
213                            com.liferay.portal.kernel.exception.SystemException {
214                    getService().enableStaging(groupId);
215            }
216    
217            /**
218            * Returns the company group.
219            *
220            * @param companyId the primary key of the company
221            * @return the group associated with the company
222            * @throws PortalException if a matching group could not be found
223            * @throws SystemException if a system exception occurred
224            */
225            public static com.liferay.portal.model.Group getCompanyGroup(long companyId)
226                    throws com.liferay.portal.kernel.exception.PortalException,
227                            com.liferay.portal.kernel.exception.SystemException {
228                    return getService().getCompanyGroup(companyId);
229            }
230    
231            /**
232            * Returns the group with the primary key.
233            *
234            * @param groupId the primary key of the group
235            * @return the group with the primary key
236            * @throws PortalException if a group with the primary key could not be
237            found or if the current user did not have permission to view the
238            group
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portal.model.Group getGroup(long groupId)
242                    throws com.liferay.portal.kernel.exception.PortalException,
243                            com.liferay.portal.kernel.exception.SystemException {
244                    return getService().getGroup(groupId);
245            }
246    
247            /**
248            * Returns the group with the name.
249            *
250            * @param companyId the primary key of the company
251            * @param name the group's name
252            * @return the group with the name
253            * @throws PortalException if a matching group could not be found or if the
254            current user did not have permission to view the group
255            * @throws SystemException if a system exception occurred
256            */
257            public static com.liferay.portal.model.Group getGroup(long companyId,
258                    java.lang.String name)
259                    throws com.liferay.portal.kernel.exception.PortalException,
260                            com.liferay.portal.kernel.exception.SystemException {
261                    return getService().getGroup(companyId, name);
262            }
263    
264            /**
265            * Returns all the groups that are direct children of the parent group.
266            *
267            * @param companyId the primary key of the company
268            * @param parentGroupId the primary key of the parent group
269            * @param site whether the group is to be associated with a main site
270            * @return the matching groups, or <code>null</code> if no matches were
271            found
272            * @throws PortalException if the user did not have permission to view the
273            group or if a portal exception occurred
274            * @throws SystemException if a system exception occurred
275            */
276            public static java.util.List<com.liferay.portal.model.Group> getGroups(
277                    long companyId, long parentGroupId, boolean site)
278                    throws com.liferay.portal.kernel.exception.PortalException,
279                            com.liferay.portal.kernel.exception.SystemException {
280                    return getService().getGroups(companyId, parentGroupId, site);
281            }
282    
283            /**
284            * Returns a range of all the site groups for which the user has control
285            * panel access.
286            *
287            * @param portlets the portlets to manage
288            * @param max the upper bound of the range of groups to consider (not
289            inclusive)
290            * @return the range of site groups for which the user has Control Panel
291            access
292            * @throws PortalException if a portal exception occurred
293            * @throws SystemException if a system exception occurred
294            */
295            public static java.util.List<com.liferay.portal.model.Group> getManageableSiteGroups(
296                    java.util.Collection<com.liferay.portal.model.Portlet> portlets, int max)
297                    throws com.liferay.portal.kernel.exception.PortalException,
298                            com.liferay.portal.kernel.exception.SystemException {
299                    return getService().getManageableSiteGroups(portlets, max);
300            }
301    
302            /**
303            * Returns a range of all the site groups for which the user has control
304            * panel access.
305            *
306            * @param portlets the portlets to manage
307            * @param max the upper bound of the range of groups to consider (not
308            inclusive)
309            * @return the range of site groups for which the user has Control Panel
310            access
311            * @throws PortalException if a portal exception occurred
312            * @throws SystemException if a system exception occurred
313            * @deprecated As of 6.2.0, replaced by {@link
314            #getManageableSiteGroups(Collection, int)}
315            */
316            public static java.util.List<com.liferay.portal.model.Group> getManageableSites(
317                    java.util.Collection<com.liferay.portal.model.Portlet> portlets, int max)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException {
320                    return getService().getManageableSites(portlets, max);
321            }
322    
323            /**
324            * Returns the groups associated with the organizations.
325            *
326            * @param organizations the organizations
327            * @return the groups associated with the organizations
328            * @throws PortalException if a portal exception occurred
329            * @throws SystemException if a system exception occurred
330            */
331            public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
332                    java.util.List<com.liferay.portal.model.Organization> organizations)
333                    throws com.liferay.portal.kernel.exception.PortalException,
334                            com.liferay.portal.kernel.exception.SystemException {
335                    return getService().getOrganizationsGroups(organizations);
336            }
337    
338            /**
339            * Returns the group associated with the user.
340            *
341            * @param companyId the primary key of the company
342            * @param userId the primary key of the user
343            * @return the group associated with the user
344            * @throws PortalException if a matching group could not be found or if the
345            current user did not have permission to view the group
346            * @throws SystemException if a system exception occurred
347            */
348            public static com.liferay.portal.model.Group getUserGroup(long companyId,
349                    long userId)
350                    throws com.liferay.portal.kernel.exception.PortalException,
351                            com.liferay.portal.kernel.exception.SystemException {
352                    return getService().getUserGroup(companyId, userId);
353            }
354    
355            /**
356            * Returns the groups associated with the user groups.
357            *
358            * @param userGroups the user groups
359            * @return the groups associated with the user groups
360            * @throws PortalException if any one of the user group's group could not be
361            found
362            * @throws SystemException if a system exception occurred
363            */
364            public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
365                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
366                    throws com.liferay.portal.kernel.exception.PortalException,
367                            com.liferay.portal.kernel.exception.SystemException {
368                    return getService().getUserGroupsGroups(userGroups);
369            }
370    
371            /**
372            * Returns the range of all groups associated with the user's organization
373            * groups, including the ancestors of the organization groups, unless portal
374            * property <code>organizations.membership.strict</code> is set to
375            * <code>true</code>.
376            *
377            * <p>
378            * Useful when paginating results. Returns a maximum of <code>end -
379            * start</code> instances. <code>start</code> and <code>end</code> are not
380            * primary keys, they are indexes in the result set. Thus, <code>0</code>
381            * refers to the first result in the set. Setting both <code>start</code>
382            * and <code>end</code> to {@link
383            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
384            * result set.
385            * </p>
386            *
387            * @param userId the primary key of the user
388            * @param start the lower bound of the range of groups to consider
389            * @param end the upper bound of the range of groups to consider (not
390            inclusive)
391            * @return the range of groups associated with the user's organizations
392            * @throws PortalException if a user with the primary key could not be found
393            or if another portal exception occurred
394            * @throws SystemException if a system exception occurred
395            */
396            public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
397                    long userId, int start, int end)
398                    throws com.liferay.portal.kernel.exception.PortalException,
399                            com.liferay.portal.kernel.exception.SystemException {
400                    return getService().getUserOrganizationsGroups(userId, start, end);
401            }
402    
403            /**
404            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long,
405            String[], boolean, int)}
406            */
407            public static java.util.List<com.liferay.portal.model.Group> getUserPlaces(
408                    long userId, java.lang.String[] classNames,
409                    boolean includeControlPanel, int max)
410                    throws com.liferay.portal.kernel.exception.PortalException,
411                            com.liferay.portal.kernel.exception.SystemException {
412                    return getService()
413                                       .getUserPlaces(userId, classNames, includeControlPanel, max);
414            }
415    
416            /**
417            * Returns the user's groups &quot;sites&quot; associated with the group
418            * entity class names, including the Control Panel group if the user is
419            * permitted to view the Control Panel.
420            *
421            * <ul>
422            * <li>
423            * Class name &quot;User&quot; includes the user's layout set
424            * group.
425            * </li>
426            * <li>
427            * Class name &quot;Organization&quot; includes the user's
428            * immediate organization groups and inherited organization groups.
429            * </li>
430            * <li>
431            * Class name &quot;Group&quot; includes the user's immediate
432            * organization groups and site groups.
433            * </li>
434            * <li>
435            * A <code>classNames</code>
436            * value of <code>null</code> includes the user's layout set group,
437            * organization groups, inherited organization groups, and site groups.
438            * </li>
439            * </ul>
440            *
441            * @param userId the primary key of the user
442            * @param classNames the group entity class names (optionally
443            <code>null</code>). For more information see {@link
444            #getUserSitesGroups(long, String[], int)}
445            * @param max the maximum number of groups to return
446            * @return the user's groups &quot;sites&quot;
447            * @throws PortalException if a portal exception occurred
448            * @throws SystemException if a system exception occurred
449            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long,
450            String[], int)}
451            */
452            public static java.util.List<com.liferay.portal.model.Group> getUserPlaces(
453                    long userId, java.lang.String[] classNames, int max)
454                    throws com.liferay.portal.kernel.exception.PortalException,
455                            com.liferay.portal.kernel.exception.SystemException {
456                    return getService().getUserPlaces(userId, classNames, max);
457            }
458    
459            /**
460            * Returns the guest or current user's groups &quot;sites&quot; associated
461            * with the group entity class names, including the Control Panel group if
462            * the user is permitted to view the Control Panel.
463            *
464            * <ul>
465            * <li>
466            * Class name &quot;User&quot; includes the user's layout set
467            * group.
468            * </li>
469            * <li>
470            * Class name &quot;Organization&quot; includes the user's
471            * immediate organization groups and inherited organization groups.
472            * </li>
473            * <li>
474            * Class name &quot;Group&quot; includes the user's immediate
475            * organization groups and site groups.
476            * </li>
477            * <li>
478            * A <code>classNames</code>
479            * value of <code>null</code> includes the user's layout set group,
480            * organization groups, inherited organization groups, and site groups.
481            * </li>
482            * </ul>
483            *
484            * @param classNames the group entity class names (optionally
485            <code>null</code>). For more information see {@link
486            #getUserSitesGroups(String[], int)}
487            * @param max the maximum number of groups to return
488            * @return the user's groups &quot;sites&quot;
489            * @throws PortalException if a portal exception occurred
490            * @throws SystemException if a system exception occurred
491            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(
492            String[], int)}
493            */
494            public static java.util.List<com.liferay.portal.model.Group> getUserPlaces(
495                    java.lang.String[] classNames, int max)
496                    throws com.liferay.portal.kernel.exception.PortalException,
497                            com.liferay.portal.kernel.exception.SystemException {
498                    return getService().getUserPlaces(classNames, max);
499            }
500    
501            /**
502            * Returns the number of the guest or current user's groups
503            * &quot;sites&quot; associated with the group entity class names, including
504            * the Control Panel group if the user is permitted to view the Control
505            * Panel.
506            *
507            * @return the number of user's groups &quot;sites&quot;
508            * @throws PortalException if a portal exception occurred
509            * @throws SystemException if a system exception occurred
510            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroupsCount()}
511            */
512            public static int getUserPlacesCount()
513                    throws com.liferay.portal.kernel.exception.PortalException,
514                            com.liferay.portal.kernel.exception.SystemException {
515                    return getService().getUserPlacesCount();
516            }
517    
518            /**
519            * Returns the guest or current user's layout set group, organization
520            * groups, inherited organization groups, and site groups.
521            *
522            * @return the user's layout set group, organization groups, and
523            inherited organization groups, and site groups
524            * @throws PortalException if a portal exception occurred
525            * @throws SystemException if a system exception occurred
526            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups}
527            */
528            public static java.util.List<com.liferay.portal.model.Group> getUserSites()
529                    throws com.liferay.portal.kernel.exception.PortalException,
530                            com.liferay.portal.kernel.exception.SystemException {
531                    return getService().getUserSites();
532            }
533    
534            public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups()
535                    throws com.liferay.portal.kernel.exception.PortalException,
536                            com.liferay.portal.kernel.exception.SystemException {
537                    return getService().getUserSitesGroups();
538            }
539    
540            public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups(
541                    long userId, java.lang.String[] classNames,
542                    boolean includeControlPanel, int max)
543                    throws com.liferay.portal.kernel.exception.PortalException,
544                            com.liferay.portal.kernel.exception.SystemException {
545                    return getService()
546                                       .getUserSitesGroups(userId, classNames, includeControlPanel,
547                            max);
548            }
549    
550            /**
551            * Returns the user's groups &quot;sites&quot; associated with the group
552            * entity class names, including the Control Panel group if the user is
553            * permitted to view the Control Panel.
554            *
555            * <ul>
556            * <li>
557            * Class name &quot;User&quot; includes the user's layout set
558            * group.
559            * </li>
560            * <li>
561            * Class name &quot;Organization&quot; includes the user's
562            * immediate organization groups and inherited organization groups.
563            * </li>
564            * <li>
565            * Class name &quot;Group&quot; includes the user's immediate
566            * organization groups and site groups.
567            * </li>
568            * <li>
569            * A <code>classNames</code>
570            * value of <code>null</code> includes the user's layout set group,
571            * organization groups, inherited organization groups, and site groups.
572            * </li>
573            * </ul>
574            *
575            * @param userId the primary key of the user
576            * @param classNames the group entity class names (optionally
577            <code>null</code>). For more information see {@link
578            #getUserSitesGroups(long, String[], boolean, int)}
579            * @param max the maximum number of groups to return
580            * @return the user's groups &quot;sites&quot;
581            * @throws PortalException if a portal exception occurred
582            * @throws SystemException if a system exception occurred
583            */
584            public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups(
585                    long userId, java.lang.String[] classNames, int max)
586                    throws com.liferay.portal.kernel.exception.PortalException,
587                            com.liferay.portal.kernel.exception.SystemException {
588                    return getService().getUserSitesGroups(userId, classNames, max);
589            }
590    
591            /**
592            * Returns the guest or current user's groups &quot;sites&quot; associated
593            * with the group entity class names, including the Control Panel group if
594            * the user is permitted to view the Control Panel.
595            *
596            * <ul>
597            * <li>
598            * Class name &quot;User&quot; includes the user's layout set
599            * group.
600            * </li>
601            * <li>
602            * Class name &quot;Organization&quot; includes the user's
603            * immediate organization groups and inherited organization groups.
604            * </li>
605            * <li>
606            * Class name &quot;Group&quot; includes the user's immediate
607            * organization groups and site groups.
608            * </li>
609            * <li>
610            * A <code>classNames</code>
611            * value of <code>null</code> includes the user's layout set group,
612            * organization groups, inherited organization groups, and site groups.
613            * </li>
614            * </ul>
615            *
616            * @param classNames the group entity class names (optionally
617            <code>null</code>). For more information see {@link
618            #getUserSitesGroups(long, String[], boolean, int)}
619            * @param max the maximum number of groups to return
620            * @return the user's groups &quot;sites&quot;
621            * @throws PortalException if a portal exception occurred
622            * @throws SystemException if a system exception occurred
623            */
624            public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups(
625                    java.lang.String[] classNames, int max)
626                    throws com.liferay.portal.kernel.exception.PortalException,
627                            com.liferay.portal.kernel.exception.SystemException {
628                    return getService().getUserSitesGroups(classNames, max);
629            }
630    
631            /**
632            * Returns the number of the guest or current user's groups
633            * &quot;sites&quot; associated with the group entity class names, including
634            * the Control Panel group if the user is permitted to view the Control
635            * Panel.
636            *
637            * @return the number of user's groups &quot;sites&quot;
638            * @throws PortalException if a portal exception occurred
639            * @throws SystemException if a system exception occurred
640            */
641            public static int getUserSitesGroupsCount()
642                    throws com.liferay.portal.kernel.exception.PortalException,
643                            com.liferay.portal.kernel.exception.SystemException {
644                    return getService().getUserSitesGroupsCount();
645            }
646    
647            /**
648            * Returns <code>true</code> if the user is associated with the group,
649            * including the user's inherited organizations and user groups. System and
650            * staged groups are not included.
651            *
652            * @param userId the primary key of the user
653            * @param groupId the primary key of the group
654            * @return <code>true</code> if the user is associated with the group;
655            <code>false</code> otherwise
656            * @throws PortalException if the current user did not have permission to
657            view the user or group members
658            * @throws SystemException if a system exception occurred
659            */
660            public static boolean hasUserGroup(long userId, long groupId)
661                    throws com.liferay.portal.kernel.exception.PortalException,
662                            com.liferay.portal.kernel.exception.SystemException {
663                    return getService().hasUserGroup(userId, groupId);
664            }
665    
666            public static java.util.List<com.liferay.portal.model.Group> search(
667                    long companyId, long[] classNameIds, java.lang.String keywords,
668                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
669                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
670                    throws com.liferay.portal.kernel.exception.PortalException,
671                            com.liferay.portal.kernel.exception.SystemException {
672                    return getService()
673                                       .search(companyId, classNameIds, keywords, params, start,
674                            end, obc);
675            }
676    
677            public static java.util.List<com.liferay.portal.model.Group> search(
678                    long companyId, long[] classNameIds, java.lang.String name,
679                    java.lang.String description,
680                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
681                    boolean andOperator, int start, int end,
682                    com.liferay.portal.kernel.util.OrderByComparator obc)
683                    throws com.liferay.portal.kernel.exception.PortalException,
684                            com.liferay.portal.kernel.exception.SystemException {
685                    return getService()
686                                       .search(companyId, classNameIds, name, description, params,
687                            andOperator, start, end, obc);
688            }
689    
690            /**
691            * Returns an ordered range of all the site groups and organization groups
692            * that match the name and description, optionally including the user's
693            * inherited organization groups and user groups. System and staged groups
694            * are not included.
695            *
696            * <p>
697            * Useful when paginating results. Returns a maximum of <code>end -
698            * start</code> instances. <code>start</code> and <code>end</code> are not
699            * primary keys, they are indexes in the result set. Thus, <code>0</code>
700            * refers to the first result in the set. Setting both <code>start</code>
701            * and <code>end</code> to {@link
702            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
703            * result set.
704            * </p>
705            *
706            * @param companyId the primary key of the company
707            * @param name the group's name (optionally <code>null</code>)
708            * @param description the group's description (optionally
709            <code>null</code>)
710            * @param params the finder params (optionally <code>null</code>). To
711            include the user's inherited organizations and user groups in the
712            search, add entries having &quot;usersGroups&quot; and
713            &quot;inherit&quot; as keys mapped to the the user's ID. For more
714            information see {@link
715            com.liferay.portal.service.persistence.GroupFinder}
716            * @param start the lower bound of the range of groups to return
717            * @param end the upper bound of the range of groups to return (not
718            inclusive)
719            * @return the matching groups ordered by name
720            * @throws PortalException if a portal exception occurred
721            * @throws SystemException if a system exception occurred
722            */
723            public static java.util.List<com.liferay.portal.model.Group> search(
724                    long companyId, java.lang.String name, java.lang.String description,
725                    java.lang.String[] params, int start, int end)
726                    throws com.liferay.portal.kernel.exception.PortalException,
727                            com.liferay.portal.kernel.exception.SystemException {
728                    return getService()
729                                       .search(companyId, name, description, params, start, end);
730            }
731    
732            /**
733            * Returns the number of groups and organization groups that match the name
734            * and description, optionally including the user's inherited organizations
735            * and user groups. System and staged groups are not included.
736            *
737            * @param companyId the primary key of the company
738            * @param name the group's name (optionally <code>null</code>)
739            * @param description the group's description (optionally
740            <code>null</code>)
741            * @param params the finder params (optionally <code>null</code>). To
742            include the user's inherited organizations and user groups in the
743            search, add entries having &quot;usersGroups&quot; and
744            &quot;inherit&quot; as keys mapped to the the user's ID. For more
745            information see {@link
746            com.liferay.portal.service.persistence.GroupFinder}
747            * @return the number of matching groups
748            * @throws SystemException if a system exception occurred
749            */
750            public static int searchCount(long companyId, java.lang.String name,
751                    java.lang.String description, java.lang.String[] params)
752                    throws com.liferay.portal.kernel.exception.SystemException {
753                    return getService().searchCount(companyId, name, description, params);
754            }
755    
756            /**
757            * Sets the groups associated with the role, removing and adding
758            * associations as necessary.
759            *
760            * @param roleId the primary key of the role
761            * @param groupIds the primary keys of the groups
762            * @throws PortalException if the user did not have permission to update
763            update the role
764            * @throws SystemException if a system exception occurred
765            */
766            public static void setRoleGroups(long roleId, long[] groupIds)
767                    throws com.liferay.portal.kernel.exception.PortalException,
768                            com.liferay.portal.kernel.exception.SystemException {
769                    getService().setRoleGroups(roleId, groupIds);
770            }
771    
772            /**
773            * Removes the groups from the role.
774            *
775            * @param roleId the primary key of the role
776            * @param groupIds the primary keys of the groups
777            * @throws PortalException if the user did not have permission to update the
778            role
779            * @throws SystemException if a system exception occurred
780            */
781            public static void unsetRoleGroups(long roleId, long[] groupIds)
782                    throws com.liferay.portal.kernel.exception.PortalException,
783                            com.liferay.portal.kernel.exception.SystemException {
784                    getService().unsetRoleGroups(roleId, groupIds);
785            }
786    
787            /**
788            * Updates the group's friendly URL.
789            *
790            * @param groupId the primary key of the group
791            * @param friendlyURL the group's new friendlyURL (optionally
792            <code>null</code>)
793            * @return the group
794            * @throws PortalException if the user did not have permission to update the
795            group, if a group with the primary key could not be found, or if
796            a valid friendly URL could not be created for the group
797            * @throws SystemException if a system exception occurred
798            */
799            public static com.liferay.portal.model.Group updateFriendlyURL(
800                    long groupId, java.lang.String friendlyURL)
801                    throws com.liferay.portal.kernel.exception.PortalException,
802                            com.liferay.portal.kernel.exception.SystemException {
803                    return getService().updateFriendlyURL(groupId, friendlyURL);
804            }
805    
806            /**
807            * Updates the group.
808            *
809            * @param groupId the primary key of the group
810            * @param parentGroupId the primary key of the parent group
811            * @param name the group's new name
812            * @param description the group's new description (optionally
813            <code>null</code>)
814            * @param type the group's new type. For more information see {@link
815            com.liferay.portal.model.GroupConstants}
816            * @param friendlyURL the group's new friendlyURL (optionally
817            <code>null</code>)
818            * @param active whether the group is active
819            * @param serviceContext the service context to be applied (optionally
820            <code>null</code>). Can set the asset category IDs and asset tag
821            names for the group.
822            * @return the group
823            * @throws PortalException if the user did not have permission to update the
824            group, if a group with the primary key could not be found, if the
825            friendly URL was invalid or could one not be created
826            * @throws SystemException if a system exception occurred
827            */
828            public static com.liferay.portal.model.Group updateGroup(long groupId,
829                    long parentGroupId, java.lang.String name,
830                    java.lang.String description, int type, boolean manualMembership,
831                    int membershipRestriction, java.lang.String friendlyURL,
832                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
833                    throws com.liferay.portal.kernel.exception.PortalException,
834                            com.liferay.portal.kernel.exception.SystemException {
835                    return getService()
836                                       .updateGroup(groupId, parentGroupId, name, description,
837                            type, manualMembership, membershipRestriction, friendlyURL, active,
838                            serviceContext);
839            }
840    
841            /**
842            * Updates the group's type settings.
843            *
844            * @param groupId the primary key of the group
845            * @param typeSettings the group's new type settings (optionally
846            <code>null</code>)
847            * @return the group
848            * @throws PortalException if the user did not have permission to update the
849            group or if a group with the primary key could not be found
850            * @throws SystemException if a system exception occurred
851            */
852            public static com.liferay.portal.model.Group updateGroup(long groupId,
853                    java.lang.String typeSettings)
854                    throws com.liferay.portal.kernel.exception.PortalException,
855                            com.liferay.portal.kernel.exception.SystemException {
856                    return getService().updateGroup(groupId, typeSettings);
857            }
858    
859            public static void updateStagedPortlets(long groupId,
860                    java.util.Map<java.lang.String, java.lang.String> stagedPortletIds)
861                    throws com.liferay.portal.kernel.exception.PortalException,
862                            com.liferay.portal.kernel.exception.SystemException {
863                    getService().updateStagedPortlets(groupId, stagedPortletIds);
864            }
865    
866            public static GroupService getService() {
867                    if (_service == null) {
868                            _service = (GroupService)PortalBeanLocatorUtil.locate(GroupService.class.getName());
869    
870                            ReferenceRegistry.registerReference(GroupServiceUtil.class,
871                                    "_service");
872                    }
873    
874                    return _service;
875            }
876    
877            /**
878             * @deprecated As of 6.2.0
879             */
880            public void setService(GroupService service) {
881            }
882    
883            private static GroupService _service;
884    }