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