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