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