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