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