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, 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            public static java.lang.String getGroupDisplayURL(long groupId,
244                    boolean privateLayout, boolean secureConnection)
245                    throws com.liferay.portal.kernel.exception.PortalException {
246                    return getService()
247                                       .getGroupDisplayURL(groupId, privateLayout, secureConnection);
248            }
249    
250            /**
251            * Returns all the groups that are direct children of the parent group.
252            *
253            * @param companyId the primary key of the company
254            * @param parentGroupId the primary key of the parent group
255            * @param site whether the group is to be associated with a main site
256            * @return the matching groups, or <code>null</code> if no matches were
257            found
258            */
259            public static java.util.List<com.liferay.portal.model.Group> getGroups(
260                    long companyId, long parentGroupId, boolean site)
261                    throws com.liferay.portal.kernel.exception.PortalException {
262                    return getService().getGroups(companyId, parentGroupId, site);
263            }
264    
265            /**
266            * Returns a range of all the site groups for which the user has control
267            * panel access.
268            *
269            * @param portlets the portlets to manage
270            * @param max the upper bound of the range of groups to consider (not
271            inclusive)
272            * @return the range of site groups for which the user has Control Panel
273            access
274            */
275            public static java.util.List<com.liferay.portal.model.Group> getManageableSiteGroups(
276                    java.util.Collection<com.liferay.portal.model.Portlet> portlets, int max)
277                    throws com.liferay.portal.kernel.exception.PortalException {
278                    return getService().getManageableSiteGroups(portlets, max);
279            }
280    
281            /**
282            * Returns a range of all the site groups for which the user has control
283            * panel access.
284            *
285            * @param portlets the portlets to manage
286            * @param max the upper bound of the range of groups to consider (not
287            inclusive)
288            * @return the range of site groups for which the user has Control Panel
289            access
290            * @deprecated As of 6.2.0, replaced by {@link
291            #getManageableSiteGroups(Collection, int)}
292            */
293            @Deprecated
294            public static java.util.List<com.liferay.portal.model.Group> getManageableSites(
295                    java.util.Collection<com.liferay.portal.model.Portlet> portlets, int max)
296                    throws com.liferay.portal.kernel.exception.PortalException {
297                    return getService().getManageableSites(portlets, max);
298            }
299    
300            /**
301            * Returns the OSGi service identifier.
302            *
303            * @return the OSGi service identifier
304            */
305            public static java.lang.String getOSGiServiceIdentifier() {
306                    return getService().getOSGiServiceIdentifier();
307            }
308    
309            /**
310            * Returns the groups associated with the organizations.
311            *
312            * @param organizations the organizations
313            * @return the groups associated with the organizations
314            */
315            public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
316                    java.util.List<com.liferay.portal.model.Organization> organizations)
317                    throws com.liferay.portal.kernel.exception.PortalException {
318                    return getService().getOrganizationsGroups(organizations);
319            }
320    
321            /**
322            * Returns the group directly associated with the user.
323            *
324            * @param companyId the primary key of the company
325            * @param userId the primary key of the user
326            * @return the group directly associated with the user
327            */
328            public static com.liferay.portal.model.Group getUserGroup(long companyId,
329                    long userId) throws com.liferay.portal.kernel.exception.PortalException {
330                    return getService().getUserGroup(companyId, userId);
331            }
332    
333            /**
334            * Returns the groups associated with the user groups.
335            *
336            * @param userGroups the user groups
337            * @return the groups associated with the user groups
338            */
339            public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
340                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
341                    throws com.liferay.portal.kernel.exception.PortalException {
342                    return getService().getUserGroupsGroups(userGroups);
343            }
344    
345            /**
346            * Returns the range of all groups associated with the user's organization
347            * groups, including the ancestors of the organization groups, unless portal
348            * property <code>organizations.membership.strict</code> is set to
349            * <code>true</code>.
350            *
351            * <p>
352            * Useful when paginating results. Returns a maximum of <code>end -
353            * start</code> instances. <code>start</code> and <code>end</code> are not
354            * primary keys, they are indexes in the result set. Thus, <code>0</code>
355            * refers to the first result in the set. Setting both <code>start</code>
356            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
357            * result set.
358            * </p>
359            *
360            * @param userId the primary key of the user
361            * @param start the lower bound of the range of groups to consider
362            * @param end the upper bound of the range of groups to consider (not
363            inclusive)
364            * @return the range of groups associated with the user's organizations
365            */
366            public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
367                    long userId, int start, int end)
368                    throws com.liferay.portal.kernel.exception.PortalException {
369                    return getService().getUserOrganizationsGroups(userId, start, end);
370            }
371    
372            /**
373            * Returns the guest or current user's groups &quot;sites&quot; associated
374            * with the group entity class names, including the Control Panel group if
375            * the user is permitted to view the Control Panel.
376            *
377            * <ul>
378            * <li>
379            * Class name &quot;User&quot; includes the user's layout set
380            * group.
381            * </li>
382            * <li>
383            * Class name &quot;Organization&quot; includes the user's
384            * immediate organization groups and inherited organization groups.
385            * </li>
386            * <li>
387            * Class name &quot;Group&quot; includes the user's immediate
388            * organization groups and site groups.
389            * </li>
390            * <li>
391            * A <code>classNames</code>
392            * value of <code>null</code> includes the user's layout set group,
393            * organization groups, inherited organization groups, and site groups.
394            * </li>
395            * </ul>
396            *
397            * @param classNames the group entity class names (optionally
398            <code>null</code>). For more information see {@link
399            #getUserSitesGroups(String[], int)}.
400            * @param max the maximum number of groups to return
401            * @return the user's groups &quot;sites&quot;
402            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(String[],
403            int)}
404            */
405            @Deprecated
406            public static java.util.List<com.liferay.portal.model.Group> getUserPlaces(
407                    java.lang.String[] classNames, int max)
408                    throws com.liferay.portal.kernel.exception.PortalException {
409                    return getService().getUserPlaces(classNames, max);
410            }
411    
412            /**
413            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long,
414            String[], int)}
415            */
416            @Deprecated
417            public static java.util.List<com.liferay.portal.model.Group> getUserPlaces(
418                    long userId, java.lang.String[] classNames,
419                    boolean includeControlPanel, int max)
420                    throws com.liferay.portal.kernel.exception.PortalException {
421                    return getService()
422                                       .getUserPlaces(userId, classNames, includeControlPanel, max);
423            }
424    
425            /**
426            * Returns the user's groups &quot;sites&quot; associated with the group
427            * entity class names, including the Control Panel group if the user is
428            * permitted to view the Control Panel.
429            *
430            * <ul>
431            * <li>
432            * Class name &quot;User&quot; includes the user's layout set
433            * group.
434            * </li>
435            * <li>
436            * Class name &quot;Organization&quot; includes the user's
437            * immediate organization groups and inherited organization groups.
438            * </li>
439            * <li>
440            * Class name &quot;Group&quot; includes the user's immediate
441            * organization groups and site groups.
442            * </li>
443            * <li>
444            * A <code>classNames</code>
445            * value of <code>null</code> includes the user's layout set group,
446            * organization groups, inherited organization groups, and site groups.
447            * </li>
448            * </ul>
449            *
450            * @param userId the primary key of the user
451            * @param classNames the group entity class names (optionally
452            <code>null</code>). For more information see {@link
453            #getUserSitesGroups(long, String[], int)}.
454            * @param max the maximum number of groups to return
455            * @return the user's groups &quot;sites&quot;
456            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups(long,
457            String[], int)}
458            */
459            @Deprecated
460            public static java.util.List<com.liferay.portal.model.Group> getUserPlaces(
461                    long userId, java.lang.String[] classNames, int max)
462                    throws com.liferay.portal.kernel.exception.PortalException {
463                    return getService().getUserPlaces(userId, classNames, max);
464            }
465    
466            /**
467            * Returns the number of the guest or current user's groups
468            * &quot;sites&quot; associated with the group entity class names, including
469            * the Control Panel group if the user is permitted to view the Control
470            * Panel.
471            *
472            * @return the number of user's groups &quot;sites&quot;
473            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroupsCount()}
474            */
475            @Deprecated
476            public static int getUserPlacesCount()
477                    throws com.liferay.portal.kernel.exception.PortalException {
478                    return getService().getUserPlacesCount();
479            }
480    
481            /**
482            * Returns the guest or current user's layout set group, organization
483            * groups, inherited organization groups, and site groups.
484            *
485            * @return the user's layout set group, organization groups, and
486            inherited organization groups, and site groups
487            * @deprecated As of 6.2.0, replaced by {@link #getUserSitesGroups}
488            */
489            @Deprecated
490            public static java.util.List<com.liferay.portal.model.Group> getUserSites()
491                    throws com.liferay.portal.kernel.exception.PortalException {
492                    return getService().getUserSites();
493            }
494    
495            public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups()
496                    throws com.liferay.portal.kernel.exception.PortalException {
497                    return getService().getUserSitesGroups();
498            }
499    
500            /**
501            * Returns the guest or current user's groups &quot;sites&quot; associated
502            * with the group entity class names, including the Control Panel group if
503            * the user is permitted to view the Control Panel.
504            *
505            * <ul>
506            * <li>
507            * Class name &quot;User&quot; includes the user's layout set
508            * group.
509            * </li>
510            * <li>
511            * Class name &quot;Organization&quot; includes the user's
512            * immediate organization groups and inherited organization groups.
513            * </li>
514            * <li>
515            * Class name &quot;Group&quot; includes the user's immediate
516            * organization groups and site groups.
517            * </li>
518            * <li>
519            * A <code>classNames</code>
520            * value of <code>null</code> includes the user's layout set group,
521            * organization groups, inherited organization groups, and site groups.
522            * </li>
523            * </ul>
524            *
525            * @param classNames the group entity class names (optionally
526            <code>null</code>). For more information see {@link
527            #getUserSitesGroups(long, String[], int)}.
528            * @param max the maximum number of groups to return
529            * @return the user's groups &quot;sites&quot;
530            */
531            public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups(
532                    java.lang.String[] classNames, int max)
533                    throws com.liferay.portal.kernel.exception.PortalException {
534                    return getService().getUserSitesGroups(classNames, max);
535            }
536    
537            /**
538            * Returns the user's groups &quot;sites&quot; associated with the group
539            * entity class names, including the Control Panel group if the user is
540            * permitted to view the Control Panel.
541            *
542            * <ul>
543            * <li>
544            * Class name &quot;User&quot; includes the user's layout set
545            * group.
546            * </li>
547            * <li>
548            * Class name &quot;Organization&quot; includes the user's
549            * immediate organization groups and inherited organization groups.
550            * </li>
551            * <li>
552            * Class name &quot;Group&quot; includes the user's immediate
553            * organization groups and site groups.
554            * </li>
555            * <li>
556            * A <code>classNames</code>
557            * value of <code>null</code> includes the user's layout set group,
558            * organization groups, inherited organization groups, and site groups.
559            * </li>
560            * </ul>
561            *
562            * @param userId the primary key of the user
563            * @param classNames the group entity class names (optionally
564            <code>null</code>). For more information see {@link
565            #getUserSitesGroups(long, String[], int)}.
566            * @param max the maximum number of groups to return
567            * @return the user's groups &quot;sites&quot;
568            */
569            public static java.util.List<com.liferay.portal.model.Group> getUserSitesGroups(
570                    long userId, java.lang.String[] classNames, int max)
571                    throws com.liferay.portal.kernel.exception.PortalException {
572                    return getService().getUserSitesGroups(userId, classNames, max);
573            }
574    
575            /**
576            * Returns the number of the guest or current user's groups
577            * &quot;sites&quot; associated with the group entity class names, including
578            * the Control Panel group if the user is permitted to view the Control
579            * Panel.
580            *
581            * @return the number of user's groups &quot;sites&quot;
582            */
583            public static int getUserSitesGroupsCount()
584                    throws com.liferay.portal.kernel.exception.PortalException {
585                    return getService().getUserSitesGroupsCount();
586            }
587    
588            /**
589            * Returns <code>true</code> if the user is associated with the group,
590            * including the user's inherited organizations and user groups. System and
591            * staged groups are not included.
592            *
593            * @param userId the primary key of the user
594            * @param groupId the primary key of the group
595            * @return <code>true</code> if the user is associated with the group;
596            <code>false</code> otherwise
597            */
598            public static boolean hasUserGroup(long userId, long groupId)
599                    throws com.liferay.portal.kernel.exception.PortalException {
600                    return getService().hasUserGroup(userId, groupId);
601            }
602    
603            public static java.util.List<com.liferay.portal.model.Group> search(
604                    long companyId, long[] classNameIds, java.lang.String keywords,
605                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
606                    int start, int end,
607                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Group> obc)
608                    throws com.liferay.portal.kernel.exception.PortalException {
609                    return getService()
610                                       .search(companyId, classNameIds, keywords, params, start,
611                            end, obc);
612            }
613    
614            public static java.util.List<com.liferay.portal.model.Group> search(
615                    long companyId, long[] classNameIds, java.lang.String name,
616                    java.lang.String description,
617                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
618                    boolean andOperator, int start, int end,
619                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Group> obc)
620                    throws com.liferay.portal.kernel.exception.PortalException {
621                    return getService()
622                                       .search(companyId, classNameIds, name, description, params,
623                            andOperator, start, end, obc);
624            }
625    
626            /**
627            * Returns an ordered range of all the site groups and organization groups
628            * that match the name and description, optionally including the user's
629            * inherited organization groups and user groups. System and staged groups
630            * are not included.
631            *
632            * <p>
633            * Useful when paginating results. Returns a maximum of <code>end -
634            * start</code> instances. <code>start</code> and <code>end</code> are not
635            * primary keys, they are indexes in the result set. Thus, <code>0</code>
636            * refers to the first result in the set. Setting both <code>start</code>
637            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
638            * result set.
639            * </p>
640            *
641            * @param companyId the primary key of the company
642            * @param name the group's name (optionally <code>null</code>)
643            * @param description the group's description (optionally
644            <code>null</code>)
645            * @param params the finder params (optionally <code>null</code>). To
646            include the user's inherited organizations and user groups in the
647            search, add entries having &quot;usersGroups&quot; and
648            &quot;inherit&quot; as keys mapped to the the user's ID. For more
649            information see {@link
650            com.liferay.portal.service.persistence.GroupFinder}.
651            * @param start the lower bound of the range of groups to return
652            * @param end the upper bound of the range of groups to return (not
653            inclusive)
654            * @return the matching groups ordered by name
655            */
656            public static java.util.List<com.liferay.portal.model.Group> search(
657                    long companyId, java.lang.String name, java.lang.String description,
658                    java.lang.String[] params, int start, int end)
659                    throws com.liferay.portal.kernel.exception.PortalException {
660                    return getService()
661                                       .search(companyId, name, description, params, start, end);
662            }
663    
664            /**
665            * Returns the number of groups and organization groups that match the name
666            * and description, optionally including the user's inherited organizations
667            * and user groups. System and staged groups are not included.
668            *
669            * @param companyId the primary key of the company
670            * @param name the group's name (optionally <code>null</code>)
671            * @param description the group's description (optionally
672            <code>null</code>)
673            * @param params the finder params (optionally <code>null</code>). To
674            include the user's inherited organizations and user groups in the
675            search, add entries having &quot;usersGroups&quot; and
676            &quot;inherit&quot; as keys mapped to the the user's ID. For more
677            information see {@link
678            com.liferay.portal.service.persistence.GroupFinder}.
679            * @return the number of matching groups
680            */
681            public static int searchCount(long companyId, java.lang.String name,
682                    java.lang.String description, java.lang.String[] params) {
683                    return getService().searchCount(companyId, name, description, params);
684            }
685    
686            /**
687            * Sets the groups associated with the role, removing and adding
688            * associations as necessary.
689            *
690            * @param roleId the primary key of the role
691            * @param groupIds the primary keys of the groups
692            */
693            public static void setRoleGroups(long roleId, long[] groupIds)
694                    throws com.liferay.portal.kernel.exception.PortalException {
695                    getService().setRoleGroups(roleId, groupIds);
696            }
697    
698            /**
699            * Removes the groups from the role.
700            *
701            * @param roleId the primary key of the role
702            * @param groupIds the primary keys of the groups
703            */
704            public static void unsetRoleGroups(long roleId, long[] groupIds)
705                    throws com.liferay.portal.kernel.exception.PortalException {
706                    getService().unsetRoleGroups(roleId, groupIds);
707            }
708    
709            /**
710            * Updates the group's friendly URL.
711            *
712            * @param groupId the primary key of the group
713            * @param friendlyURL the group's new friendlyURL (optionally
714            <code>null</code>)
715            * @return the group
716            */
717            public static com.liferay.portal.model.Group updateFriendlyURL(
718                    long groupId, java.lang.String friendlyURL)
719                    throws com.liferay.portal.kernel.exception.PortalException {
720                    return getService().updateFriendlyURL(groupId, friendlyURL);
721            }
722    
723            /**
724            * Updates the group.
725            *
726            * @param groupId the primary key of the group
727            * @param parentGroupId the primary key of the parent group
728            * @param name the group's name
729            * @param description the group's new description (optionally
730            <code>null</code>)
731            * @param type the group's new type. For more information see {@link
732            GroupConstants}.
733            * @param manualMembership whether manual membership is allowed for the
734            group
735            * @param membershipRestriction the group's membership restriction. For
736            more information see {@link GroupConstants}.
737            * @param friendlyURL the group's new friendlyURL (optionally
738            <code>null</code>)
739            * @param active whether the group is active
740            * @param serviceContext the service context to be applied (optionally
741            <code>null</code>). Can set the asset category IDs and asset
742            tag names for the group.
743            * @return the group
744            * @deprecated As of 7.0.0, replaced by {@link #updateGroup(long, long, Map,
745            Map, int, boolean, int, String, boolean, boolean,
746            ServiceContext)}
747            */
748            @Deprecated
749            public static com.liferay.portal.model.Group updateGroup(long groupId,
750                    long parentGroupId, java.lang.String name,
751                    java.lang.String description, int type, boolean manualMembership,
752                    int membershipRestriction, java.lang.String friendlyURL,
753                    boolean inheritContent, boolean active,
754                    com.liferay.portal.service.ServiceContext serviceContext)
755                    throws com.liferay.portal.kernel.exception.PortalException {
756                    return getService()
757                                       .updateGroup(groupId, parentGroupId, name, description,
758                            type, manualMembership, membershipRestriction, friendlyURL,
759                            inheritContent, active, serviceContext);
760            }
761    
762            public static com.liferay.portal.model.Group updateGroup(long groupId,
763                    long parentGroupId,
764                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
765                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
766                    int type, boolean manualMembership, int membershipRestriction,
767                    java.lang.String friendlyURL, boolean inheritContent, boolean active,
768                    com.liferay.portal.service.ServiceContext serviceContext)
769                    throws com.liferay.portal.kernel.exception.PortalException {
770                    return getService()
771                                       .updateGroup(groupId, parentGroupId, nameMap,
772                            descriptionMap, type, manualMembership, membershipRestriction,
773                            friendlyURL, inheritContent, active, serviceContext);
774            }
775    
776            /**
777            * Updates the group's type settings.
778            *
779            * @param groupId the primary key of the group
780            * @param typeSettings the group's new type settings (optionally
781            <code>null</code>)
782            * @return the group
783            */
784            public static com.liferay.portal.model.Group updateGroup(long groupId,
785                    java.lang.String typeSettings)
786                    throws com.liferay.portal.kernel.exception.PortalException {
787                    return getService().updateGroup(groupId, typeSettings);
788            }
789    
790            public static void updateStagedPortlets(long groupId,
791                    java.util.Map<java.lang.String, java.lang.String> stagedPortletIds)
792                    throws com.liferay.portal.kernel.exception.PortalException {
793                    getService().updateStagedPortlets(groupId, stagedPortletIds);
794            }
795    
796            public static GroupService getService() {
797                    if (_service == null) {
798                            _service = (GroupService)PortalBeanLocatorUtil.locate(GroupService.class.getName());
799    
800                            ReferenceRegistry.registerReference(GroupServiceUtil.class,
801                                    "_service");
802                    }
803    
804                    return _service;
805            }
806    
807            private static GroupService _service;
808    }