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