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