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