001    /**
002     * Copyright (c) 2000-2012 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.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * The interface for the user group local service.
025     *
026     * <p>
027     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see UserGroupLocalServiceUtil
032     * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl
034     * @generated
035     */
036    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
037            PortalException.class, SystemException.class})
038    public interface UserGroupLocalService extends BaseLocalService,
039            PersistedModelLocalService {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify or reference this interface directly. Always use {@link UserGroupLocalServiceUtil} to access the user group local service. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
044             */
045    
046            /**
047            * Adds the user group to the database. Also notifies the appropriate model listeners.
048            *
049            * @param userGroup the user group
050            * @return the user group that was added
051            * @throws SystemException if a system exception occurred
052            */
053            public com.liferay.portal.model.UserGroup addUserGroup(
054                    com.liferay.portal.model.UserGroup userGroup)
055                    throws com.liferay.portal.kernel.exception.SystemException;
056    
057            /**
058            * Creates a new user group with the primary key. Does not add the user group to the database.
059            *
060            * @param userGroupId the primary key for the new user group
061            * @return the new user group
062            */
063            public com.liferay.portal.model.UserGroup createUserGroup(long userGroupId);
064    
065            /**
066            * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param userGroupId the primary key of the user group
069            * @return the user group that was removed
070            * @throws PortalException if a user group with the primary key could not be found
071            * @throws SystemException if a system exception occurred
072            */
073            public com.liferay.portal.model.UserGroup deleteUserGroup(long userGroupId)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Deletes the user group from the database. Also notifies the appropriate model listeners.
079            *
080            * @param userGroup the user group
081            * @return the user group that was removed
082            * @throws PortalException
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portal.model.UserGroup deleteUserGroup(
086                    com.liferay.portal.model.UserGroup userGroup)
087                    throws com.liferay.portal.kernel.exception.PortalException,
088                            com.liferay.portal.kernel.exception.SystemException;
089    
090            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException;
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException;
121    
122            /**
123            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
124            *
125            * <p>
126            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
127            * </p>
128            *
129            * @param dynamicQuery the dynamic query
130            * @param start the lower bound of the range of model instances
131            * @param end the upper bound of the range of model instances (not inclusive)
132            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
133            * @return the ordered range of matching rows
134            * @throws SystemException if a system exception occurred
135            */
136            @SuppressWarnings("rawtypes")
137            public java.util.List dynamicQuery(
138                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
139                    int end,
140                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141                    throws com.liferay.portal.kernel.exception.SystemException;
142    
143            /**
144            * Returns the number of rows that match the dynamic query.
145            *
146            * @param dynamicQuery the dynamic query
147            * @return the number of rows that match the dynamic query
148            * @throws SystemException if a system exception occurred
149            */
150            public long dynamicQueryCount(
151                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
152                    throws com.liferay.portal.kernel.exception.SystemException;
153    
154            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155            public com.liferay.portal.model.UserGroup fetchUserGroup(long userGroupId)
156                    throws com.liferay.portal.kernel.exception.SystemException;
157    
158            /**
159            * Returns the user group with the primary key.
160            *
161            * @param userGroupId the primary key of the user group
162            * @return the user group
163            * @throws PortalException if a user group with the primary key could not be found
164            * @throws SystemException if a system exception occurred
165            */
166            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
167            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
168                    throws com.liferay.portal.kernel.exception.PortalException,
169                            com.liferay.portal.kernel.exception.SystemException;
170    
171            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
172            public com.liferay.portal.model.PersistedModel getPersistedModel(
173                    java.io.Serializable primaryKeyObj)
174                    throws com.liferay.portal.kernel.exception.PortalException,
175                            com.liferay.portal.kernel.exception.SystemException;
176    
177            /**
178            * Returns a range of all the user groups.
179            *
180            * <p>
181            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.UserGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
182            * </p>
183            *
184            * @param start the lower bound of the range of user groups
185            * @param end the upper bound of the range of user groups (not inclusive)
186            * @return the range of user groups
187            * @throws SystemException if a system exception occurred
188            */
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
191                    int start, int end)
192                    throws com.liferay.portal.kernel.exception.SystemException;
193    
194            /**
195            * Returns the number of user groups.
196            *
197            * @return the number of user groups
198            * @throws SystemException if a system exception occurred
199            */
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public int getUserGroupsCount()
202                    throws com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
206            *
207            * @param userGroup the user group
208            * @return the user group that was updated
209            * @throws SystemException if a system exception occurred
210            */
211            public com.liferay.portal.model.UserGroup updateUserGroup(
212                    com.liferay.portal.model.UserGroup userGroup)
213                    throws com.liferay.portal.kernel.exception.SystemException;
214    
215            /**
216            * Returns the Spring bean ID for this bean.
217            *
218            * @return the Spring bean ID for this bean
219            */
220            public java.lang.String getBeanIdentifier();
221    
222            /**
223            * Sets the Spring bean ID for this bean.
224            *
225            * @param beanIdentifier the Spring bean ID for this bean
226            */
227            public void setBeanIdentifier(java.lang.String beanIdentifier);
228    
229            /**
230            * Adds the user groups to the group.
231            *
232            * @param groupId the primary key of the group
233            * @param userGroupIds the primary keys of the user groups
234            * @throws SystemException if a system exception occurred
235            */
236            public void addGroupUserGroups(long groupId, long[] userGroupIds)
237                    throws com.liferay.portal.kernel.exception.SystemException;
238    
239            /**
240            * Adds the user groups to the team.
241            *
242            * @param teamId the primary key of the team
243            * @param userGroupIds the primary keys of the user groups
244            * @throws SystemException if a system exception occurred
245            */
246            public void addTeamUserGroups(long teamId, long[] userGroupIds)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Adds a user group.
251            *
252            * <p>
253            * This method handles the creation and bookkeeping of the user group,
254            * including its resources, metadata, and internal data structures. It is
255            * not necessary to make subsequent calls to setup default groups and
256            * resources for the user group.
257            * </p>
258            *
259            * @param userId the primary key of the user
260            * @param companyId the primary key of the user group's company
261            * @param name the user group's name
262            * @param description the user group's description
263            * @return the user group
264            * @throws PortalException if the user group's information was invalid
265            * @throws SystemException if a system exception occurred
266            * @deprecated {@link #addUserGroup(long, long, String, String,
267            ServiceContext)}
268            */
269            public com.liferay.portal.model.UserGroup addUserGroup(long userId,
270                    long companyId, java.lang.String name, java.lang.String description)
271                    throws com.liferay.portal.kernel.exception.PortalException,
272                            com.liferay.portal.kernel.exception.SystemException;
273    
274            /**
275            * Adds a user group.
276            *
277            * <p>
278            * This method handles the creation and bookkeeping of the user group,
279            * including its resources, metadata, and internal data structures. It is
280            * not necessary to make subsequent calls to setup default groups and
281            * resources for the user group.
282            * </p>
283            *
284            * @param userId the primary key of the user
285            * @param companyId the primary key of the user group's company
286            * @param name the user group's name
287            * @param description the user group's description
288            * @param serviceContext the user group's service context (optionally
289            <code>null</code>). Can set expando bridge attributes for the
290            user group.
291            * @return the user group
292            * @throws PortalException if the user group's information was invalid
293            * @throws SystemException if a system exception occurred
294            */
295            public com.liferay.portal.model.UserGroup addUserGroup(long userId,
296                    long companyId, java.lang.String name, java.lang.String description,
297                    com.liferay.portal.service.ServiceContext serviceContext)
298                    throws com.liferay.portal.kernel.exception.PortalException,
299                            com.liferay.portal.kernel.exception.SystemException;
300    
301            /**
302            * Clears all associations between the user and its user groups and clears
303            * the permissions cache.
304            *
305            * <p>
306            * This method is called from {@link #deleteUserGroup(UserGroup)}.
307            * </p>
308            *
309            * @param userId the primary key of the user
310            * @throws SystemException if a system exception occurred
311            */
312            public void clearUserUserGroups(long userId)
313                    throws com.liferay.portal.kernel.exception.SystemException;
314    
315            /**
316            * Copies the user group's layouts to the users who are not already members
317            * of the user group.
318            *
319            * @param userGroupId the primary key of the user group
320            * @param userIds the primary keys of the users
321            * @throws PortalException if any one of the users could not be found or
322            if a portal exception occurred
323            * @throws SystemException if a system exception occurred
324            * @deprecated
325            */
326            public void copyUserGroupLayouts(long userGroupId, long[] userIds)
327                    throws com.liferay.portal.kernel.exception.PortalException,
328                            com.liferay.portal.kernel.exception.SystemException;
329    
330            /**
331            * Copies the user groups' layouts to the user.
332            *
333            * @param userGroupIds the primary keys of the user groups
334            * @param userId the primary key of the user
335            * @throws PortalException if a user with the primary key could not be
336            found or if a portal exception occurred
337            * @throws SystemException if a system exception occurred
338            * @deprecated
339            */
340            public void copyUserGroupLayouts(long[] userGroupIds, long userId)
341                    throws com.liferay.portal.kernel.exception.PortalException,
342                            com.liferay.portal.kernel.exception.SystemException;
343    
344            /**
345            * Copies the user group's layout to the user.
346            *
347            * @param userGroupId the primary key of the user group
348            * @param userId the primary key of the user
349            * @throws PortalException if a user with the primary key could not be
350            found or if a portal exception occurred
351            * @throws SystemException if a system exception occurred
352            * @deprecated
353            */
354            public void copyUserGroupLayouts(long userGroupId, long userId)
355                    throws com.liferay.portal.kernel.exception.PortalException,
356                            com.liferay.portal.kernel.exception.SystemException;
357    
358            /**
359            * Returns the user group with the name.
360            *
361            * @param companyId the primary key of the user group's company
362            * @param name the user group's name
363            * @return Returns the user group with the name
364            * @throws PortalException if a user group with the name could not be found
365            * @throws SystemException if a system exception occurred
366            */
367            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
368            public com.liferay.portal.model.UserGroup getUserGroup(long companyId,
369                    java.lang.String name)
370                    throws com.liferay.portal.kernel.exception.PortalException,
371                            com.liferay.portal.kernel.exception.SystemException;
372    
373            /**
374            * Returns all the user groups belonging to the company.
375            *
376            * @param companyId the primary key of the user groups' company
377            * @return the user groups belonging to the company
378            * @throws SystemException if a system exception occurred
379            */
380            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
381            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
382                    long companyId)
383                    throws com.liferay.portal.kernel.exception.SystemException;
384    
385            /**
386            * Returns all the user groups with the primary keys.
387            *
388            * @param userGroupIds the primary keys of the user groups
389            * @return the user groups with the primary keys
390            * @throws PortalException if any one of the user groups could not be found
391            * @throws SystemException if a system exception occurred
392            */
393            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
394            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
395                    long[] userGroupIds)
396                    throws com.liferay.portal.kernel.exception.PortalException,
397                            com.liferay.portal.kernel.exception.SystemException;
398    
399            /**
400            * Returns all the user groups to which the user belongs.
401            *
402            * @param userId the primary key of the user
403            * @return the user groups to which the user belongs
404            * @throws SystemException if a system exception occurred
405            */
406            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
407            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
408                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
409    
410            /**
411            * Returns <code>true</code> if the user group is associated with the group.
412            *
413            * @param groupId the primary key of the group
414            * @param userGroupId the primary key of the user group
415            * @return <code>true</code> if the user group belongs to the group;
416            <code>false</code> otherwise
417            * @throws SystemException if a system exception occurred
418            */
419            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
420            public boolean hasGroupUserGroup(long groupId, long userGroupId)
421                    throws com.liferay.portal.kernel.exception.SystemException;
422    
423            /**
424            * Returns <code>true</code> if the user group belongs to the team.
425            *
426            * @param teamId the primary key of the team
427            * @param userGroupId the primary key of the user group
428            * @return <code>true</code> if the user group belongs to the team;
429            <code>false</code> otherwise
430            * @throws SystemException if a system exception occurred
431            */
432            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
433            public boolean hasTeamUserGroup(long teamId, long userGroupId)
434                    throws com.liferay.portal.kernel.exception.SystemException;
435    
436            /**
437            * Returns an ordered range of all the user groups that match the keywords.
438            *
439            * <p>
440            * Useful when paginating results. Returns a maximum of <code>end -
441            * start</code> instances. <code>start</code> and <code>end</code> are not
442            * primary keys, they are indexes in the result set. Thus, <code>0</code>
443            * refers to the first result in the set. Setting both <code>start</code>
444            * and <code>end</code> to {@link
445            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
446            * result set.
447            * </p>
448            *
449            * @param companyId the primary key of the user group's company
450            * @param keywords the keywords (space separated), which may occur in the
451            user group's name or description (optionally <code>null</code>)
452            * @param params the finder params (optionally <code>null</code>). For more
453            information see {@link
454            com.liferay.portal.service.persistence.UserGroupFinder}
455            * @param start the lower bound of the range of user groups to return
456            * @param end the upper bound of the range of user groups to return (not
457            inclusive)
458            * @param obc the comparator to order the user groups (optionally
459            <code>null</code>)
460            * @return the matching user groups ordered by comparator <code>obc</code>
461            * @throws SystemException if a system exception occurred
462            * @see com.liferay.portal.service.persistence.UserGroupFinder
463            */
464            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
465            public java.util.List<com.liferay.portal.model.UserGroup> search(
466                    long companyId, java.lang.String keywords,
467                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
468                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
469                    throws com.liferay.portal.kernel.exception.SystemException;
470    
471            /**
472            * Returns an ordered range of all the user groups that match the keywords,
473            * using the indexer. It is preferable to use this method instead of the
474            * non-indexed version whenever possible for performance reasons.
475            *
476            * <p>
477            * Useful when paginating results. Returns a maximum of <code>end -
478            * start</code> instances. <code>start</code> and <code>end</code> are not
479            * primary keys, they are indexes in the result set. Thus, <code>0</code>
480            * refers to the first result in the set. Setting both <code>start</code>
481            * and <code>end</code> to {@link
482            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
483            * result set.
484            * </p>
485            *
486            * @param companyId the primary key of the user group's company
487            * @param keywords the keywords (space separated), which may occur in the
488            user group's name or description (optionally <code>null</code>)
489            * @param params the finder params (optionally <code>null</code>). For more
490            information see {@link
491            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
492            * @param start the lower bound of the range of user groups to return
493            * @param end the upper bound of the range of user groups to return (not
494            inclusive)
495            * @param sort the field and direction by which to sort (optionally
496            <code>null</code>)
497            * @return the matching user groups ordered by sort
498            * @throws SystemException if a system exception occurred
499            * @see com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer
500            */
501            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
502            public com.liferay.portal.kernel.search.Hits search(long companyId,
503                    java.lang.String keywords,
504                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
505                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
506                    throws com.liferay.portal.kernel.exception.SystemException;
507    
508            /**
509            * Returns an ordered range of all the user groups that match the name and
510            * description. It is preferable to use this method instead of the
511            * non-indexed version whenever possible for performance reasons.
512            *
513            * <p>
514            * Useful when paginating results. Returns a maximum of <code>end -
515            * start</code> instances. <code>start</code> and <code>end</code> are not
516            * primary keys, they are indexes in the result set. Thus, <code>0</code>
517            * refers to the first result in the set. Setting both <code>start</code>
518            * and <code>end</code> to {@link
519            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
520            * result set.
521            * </p>
522            *
523            * @param companyId the primary key of the user group's company
524            * @param name the user group's name (optionally <code>null</code>)
525            * @param description the user group's description (optionally
526            <code>null</code>)
527            * @param params the finder params (optionally <code>null</code>). For more
528            information see {@link
529            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
530            * @param andSearch whether every field must match its keywords or just one
531            field
532            * @param start the lower bound of the range of user groups to return
533            * @param end the upper bound of the range of user groups to return (not
534            inclusive)
535            * @param sort the field and direction by which to sort (optionally
536            <code>null</code>)
537            * @return the matching user groups ordered by sort
538            * @throws SystemException if a system exception occurred
539            * @see com.liferay.portal.service.persistence.UserGroupFinder
540            */
541            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
542            public com.liferay.portal.kernel.search.Hits search(long companyId,
543                    java.lang.String name, java.lang.String description,
544                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
545                    boolean andSearch, int start, int end,
546                    com.liferay.portal.kernel.search.Sort sort)
547                    throws com.liferay.portal.kernel.exception.SystemException;
548    
549            /**
550            * Returns an ordered range of all the user groups that match the name and
551            * description.
552            *
553            * <p>
554            * Useful when paginating results. Returns a maximum of <code>end -
555            * start</code> instances. <code>start</code> and <code>end</code> are not
556            * primary keys, they are indexes in the result set. Thus, <code>0</code>
557            * refers to the first result in the set. Setting both <code>start</code>
558            * and <code>end</code> to {@link
559            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
560            * result set.
561            * </p>
562            *
563            * @param companyId the primary key of the user group's company
564            * @param name the user group's name (optionally <code>null</code>)
565            * @param description the user group's description (optionally
566            <code>null</code>)
567            * @param params the finder params (optionally <code>null</code>). For more
568            information see {@link
569            com.liferay.portal.service.persistence.UserGroupFinder}
570            * @param start the lower bound of the range of user groups to return
571            * @param end the upper bound of the range of user groups to return (not
572            inclusive)
573            * @param obc the comparator to order the user groups (optionally
574            <code>null</code>)
575            * @return the matching user groups ordered by comparator <code>obc</code>
576            * @throws SystemException if a system exception occurred
577            * @see com.liferay.portal.service.persistence.UserGroupFinder
578            */
579            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
580            public java.util.List<com.liferay.portal.model.UserGroup> search(
581                    long companyId, java.lang.String name, java.lang.String description,
582                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
583                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
584                    throws com.liferay.portal.kernel.exception.SystemException;
585    
586            /**
587            * Returns the number of user groups that match the keywords
588            *
589            * @param companyId the primary key of the user group's company
590            * @param keywords the keywords (space separated), which may occur in the
591            user group's name or description (optionally <code>null</code>)
592            * @param params the finder params (optionally <code>null</code>). For more
593            information see {@link
594            com.liferay.portal.service.persistence.UserGroupFinder}
595            * @return the number of matching user groups
596            * @throws SystemException if a system exception occurred
597            * @see com.liferay.portal.service.persistence.UserGroupFinder
598            */
599            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
600            public int searchCount(long companyId, java.lang.String keywords,
601                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
602                    throws com.liferay.portal.kernel.exception.SystemException;
603    
604            /**
605            * Returns the number of user groups that match the name and description.
606            *
607            * @param companyId the primary key of the user group's company
608            * @param name the user group's name (optionally <code>null</code>)
609            * @param description the user group's description (optionally
610            <code>null</code>)
611            * @param params the finder params (optionally <code>null</code>). For more
612            information see {@link
613            com.liferay.portal.service.persistence.UserGroupFinder}
614            * @return the number of matching user groups
615            * @throws SystemException if a system exception occurred
616            * @see com.liferay.portal.service.persistence.UserGroupFinder
617            */
618            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
619            public int searchCount(long companyId, java.lang.String name,
620                    java.lang.String description,
621                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
622                    throws com.liferay.portal.kernel.exception.SystemException;
623    
624            /**
625            * Sets the user groups associated with the user copying the user group
626            * layouts and removing and adding user group associations for the user as
627            * necessary.
628            *
629            * @param userId the primary key of the user
630            * @param userGroupIds the primary keys of the user groups
631            * @throws PortalException if a portal exception occurred
632            * @throws SystemException if a system exception occurred
633            */
634            public void setUserUserGroups(long userId, long[] userGroupIds)
635                    throws com.liferay.portal.kernel.exception.PortalException,
636                            com.liferay.portal.kernel.exception.SystemException;
637    
638            /**
639            * Removes the user groups from the group.
640            *
641            * @param groupId the primary key of the group
642            * @param userGroupIds the primary keys of the user groups
643            * @throws SystemException if a system exception occurred
644            */
645            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
646                    throws com.liferay.portal.kernel.exception.SystemException;
647    
648            /**
649            * Removes the user groups from the team.
650            *
651            * @param teamId the primary key of the team
652            * @param userGroupIds the primary keys of the user groups
653            * @throws SystemException if a system exception occurred
654            */
655            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
656                    throws com.liferay.portal.kernel.exception.SystemException;
657    
658            /**
659            * Updates the user group.
660            *
661            * @param companyId the primary key of the user group's company
662            * @param userGroupId the primary key of the user group
663            * @param name the user group's name
664            * @param description the user group's description
665            * @return the user group
666            * @throws PortalException if a user group with the primary key could
667            not be found or if the new information was invalid
668            * @throws SystemException if a system exception occurred
669            * @deprecated {@link #updateUserGroup(long, long, String, String,
670            ServiceContext)}
671            */
672            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
673                    long userGroupId, java.lang.String name, java.lang.String description)
674                    throws com.liferay.portal.kernel.exception.PortalException,
675                            com.liferay.portal.kernel.exception.SystemException;
676    
677            /**
678            * Updates the user group.
679            *
680            * @param companyId the primary key of the user group's company
681            * @param userGroupId the primary key of the user group
682            * @param name the user group's name
683            * @param description the user group's description
684            * @param serviceContext the user group's service context (optionally
685            <code>null</code>). Can set expando bridge attributes for the
686            user group.
687            * @return the user group
688            * @throws PortalException if a user group with the primary key could not be
689            found or if the new information was invalid
690            * @throws SystemException if a system exception occurred
691            */
692            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
693                    long userGroupId, java.lang.String name, java.lang.String description,
694                    com.liferay.portal.service.ServiceContext serviceContext)
695                    throws com.liferay.portal.kernel.exception.PortalException,
696                            com.liferay.portal.kernel.exception.SystemException;
697    }