001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.search.IndexableType;
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.model.SystemEventConstants;
026    
027    /**
028     * Provides the local service interface for UserGroup. Methods of this
029     * service will not have security checks based on the propagated JAAS
030     * credentials because this service can only be accessed from within the same
031     * VM.
032     *
033     * @author Brian Wing Shun Chan
034     * @see UserGroupLocalServiceUtil
035     * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl
036     * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl
037     * @generated
038     */
039    @ProviderType
040    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface UserGroupLocalService extends BaseLocalService,
043            PersistedModelLocalService {
044            /*
045             * NOTE FOR DEVELOPERS:
046             *
047             * 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.
048             */
049            public void addGroupUserGroup(long groupId,
050                    com.liferay.portal.model.UserGroup userGroup);
051    
052            public void addGroupUserGroup(long groupId, long userGroupId);
053    
054            public void addGroupUserGroups(long groupId,
055                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
056    
057            public void addGroupUserGroups(long groupId, long[] userGroupIds);
058    
059            public void addTeamUserGroup(long teamId,
060                    com.liferay.portal.model.UserGroup userGroup);
061    
062            public void addTeamUserGroup(long teamId, long userGroupId);
063    
064            public void addTeamUserGroups(long teamId,
065                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
066    
067            public void addTeamUserGroups(long teamId, long[] userGroupIds);
068    
069            /**
070            * Adds the user group to the database. Also notifies the appropriate model listeners.
071            *
072            * @param userGroup the user group
073            * @return the user group that was added
074            */
075            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
076            public com.liferay.portal.model.UserGroup addUserGroup(
077                    com.liferay.portal.model.UserGroup userGroup);
078    
079            /**
080            * Adds a user group.
081            *
082            * <p>
083            * This method handles the creation and bookkeeping of the user group,
084            * including its resources, metadata, and internal data structures. It is
085            * not necessary to make subsequent calls to setup default groups and
086            * resources for the user group.
087            * </p>
088            *
089            * @param userId the primary key of the user
090            * @param companyId the primary key of the user group's company
091            * @param name the user group's name
092            * @param description the user group's description
093            * @return the user group
094            * @throws PortalException if the user group's information was invalid
095            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(long, long,
096            String, String, ServiceContext)}
097            */
098            @java.lang.Deprecated
099            public com.liferay.portal.model.UserGroup addUserGroup(long userId,
100                    long companyId, java.lang.String name, java.lang.String description)
101                    throws com.liferay.portal.kernel.exception.PortalException;
102    
103            /**
104            * Adds a user group.
105            *
106            * <p>
107            * This method handles the creation and bookkeeping of the user group,
108            * including its resources, metadata, and internal data structures. It is
109            * not necessary to make subsequent calls to setup default groups and
110            * resources for the user group.
111            * </p>
112            *
113            * @param userId the primary key of the user
114            * @param companyId the primary key of the user group's company
115            * @param name the user group's name
116            * @param description the user group's description
117            * @param serviceContext the service context to be applied (optionally
118            <code>null</code>). Can set expando bridge attributes for the
119            user group.
120            * @return the user group
121            * @throws PortalException if the user group's information was invalid
122            */
123            public com.liferay.portal.model.UserGroup addUserGroup(long userId,
124                    long companyId, java.lang.String name, java.lang.String description,
125                    com.liferay.portal.service.ServiceContext serviceContext)
126                    throws com.liferay.portal.kernel.exception.PortalException;
127    
128            public void addUserUserGroup(long userId,
129                    com.liferay.portal.model.UserGroup userGroup);
130    
131            public void addUserUserGroup(long userId, long userGroupId);
132    
133            public void addUserUserGroups(long userId,
134                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
135    
136            public void addUserUserGroups(long userId, long[] userGroupIds);
137    
138            public void clearGroupUserGroups(long groupId);
139    
140            public void clearTeamUserGroups(long teamId);
141    
142            public void clearUserUserGroups(long userId);
143    
144            /**
145            * Copies the user group's layout to the user.
146            *
147            * @param userGroupId the primary key of the user group
148            * @param userId the primary key of the user
149            * @throws PortalException if a user with the primary key could not be
150            found or if a portal exception occurred
151            * @deprecated As of 6.2.0
152            */
153            @java.lang.Deprecated
154            public void copyUserGroupLayouts(long userGroupId, long userId)
155                    throws com.liferay.portal.kernel.exception.PortalException;
156    
157            /**
158            * Copies the user group's layouts to the users who are not already members
159            * of the user group.
160            *
161            * @param userGroupId the primary key of the user group
162            * @param userIds the primary keys of the users
163            * @throws PortalException if any one of the users could not be found or
164            if a portal exception occurred
165            * @deprecated As of 6.1.0
166            */
167            @java.lang.Deprecated
168            public void copyUserGroupLayouts(long userGroupId, long[] userIds)
169                    throws com.liferay.portal.kernel.exception.PortalException;
170    
171            /**
172            * Copies the user groups' layouts to the user.
173            *
174            * @param userGroupIds the primary keys of the user groups
175            * @param userId the primary key of the user
176            * @throws PortalException if a user with the primary key could not be
177            found or if a portal exception occurred
178            * @deprecated As of 6.1.0
179            */
180            @java.lang.Deprecated
181            public void copyUserGroupLayouts(long[] userGroupIds, long userId)
182                    throws com.liferay.portal.kernel.exception.PortalException;
183    
184            /**
185            * Creates a new user group with the primary key. Does not add the user group to the database.
186            *
187            * @param userGroupId the primary key for the new user group
188            * @return the new user group
189            */
190            public com.liferay.portal.model.UserGroup createUserGroup(long userGroupId);
191    
192            public void deleteGroupUserGroup(long groupId,
193                    com.liferay.portal.model.UserGroup userGroup);
194    
195            public void deleteGroupUserGroup(long groupId, long userGroupId);
196    
197            public void deleteGroupUserGroups(long groupId,
198                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
199    
200            public void deleteGroupUserGroups(long groupId, long[] userGroupIds);
201    
202            /**
203            * @throws PortalException
204            */
205            @Override
206            public com.liferay.portal.model.PersistedModel deletePersistedModel(
207                    com.liferay.portal.model.PersistedModel persistedModel)
208                    throws com.liferay.portal.kernel.exception.PortalException;
209    
210            public void deleteTeamUserGroup(long teamId,
211                    com.liferay.portal.model.UserGroup userGroup);
212    
213            public void deleteTeamUserGroup(long teamId, long userGroupId);
214    
215            public void deleteTeamUserGroups(long teamId,
216                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
217    
218            public void deleteTeamUserGroups(long teamId, long[] userGroupIds);
219    
220            /**
221            * Deletes the user group from the database. Also notifies the appropriate model listeners.
222            *
223            * @param userGroup the user group
224            * @return the user group that was removed
225            * @throws PortalException
226            */
227            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
228            @com.liferay.portal.kernel.systemevent.SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
229            public com.liferay.portal.model.UserGroup deleteUserGroup(
230                    com.liferay.portal.model.UserGroup userGroup)
231                    throws com.liferay.portal.kernel.exception.PortalException;
232    
233            /**
234            * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners.
235            *
236            * @param userGroupId the primary key of the user group
237            * @return the user group that was removed
238            * @throws PortalException if a user group with the primary key could not be found
239            */
240            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
241            public com.liferay.portal.model.UserGroup deleteUserGroup(long userGroupId)
242                    throws com.liferay.portal.kernel.exception.PortalException;
243    
244            public void deleteUserGroups(long companyId)
245                    throws com.liferay.portal.kernel.exception.PortalException;
246    
247            public void deleteUserUserGroup(long userId,
248                    com.liferay.portal.model.UserGroup userGroup);
249    
250            public void deleteUserUserGroup(long userId, long userGroupId);
251    
252            public void deleteUserUserGroups(long userId,
253                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
254    
255            public void deleteUserUserGroups(long userId, long[] userGroupIds);
256    
257            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
258    
259            /**
260            * Performs a dynamic query on the database and returns the matching rows.
261            *
262            * @param dynamicQuery the dynamic query
263            * @return the matching rows
264            */
265            public <T> java.util.List<T> dynamicQuery(
266                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
267    
268            /**
269            * Performs a dynamic query on the database and returns a range of the matching rows.
270            *
271            * <p>
272            * 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.
273            * </p>
274            *
275            * @param dynamicQuery the dynamic query
276            * @param start the lower bound of the range of model instances
277            * @param end the upper bound of the range of model instances (not inclusive)
278            * @return the range of matching rows
279            */
280            public <T> java.util.List<T> dynamicQuery(
281                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
282                    int end);
283    
284            /**
285            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
286            *
287            * <p>
288            * 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.
289            * </p>
290            *
291            * @param dynamicQuery the dynamic query
292            * @param start the lower bound of the range of model instances
293            * @param end the upper bound of the range of model instances (not inclusive)
294            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
295            * @return the ordered range of matching rows
296            */
297            public <T> java.util.List<T> dynamicQuery(
298                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
299                    int end,
300                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
301    
302            /**
303            * Returns the number of rows matching the dynamic query.
304            *
305            * @param dynamicQuery the dynamic query
306            * @return the number of rows matching the dynamic query
307            */
308            public long dynamicQueryCount(
309                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
310    
311            /**
312            * Returns the number of rows matching the dynamic query.
313            *
314            * @param dynamicQuery the dynamic query
315            * @param projection the projection to apply to the query
316            * @return the number of rows matching the dynamic query
317            */
318            public long dynamicQueryCount(
319                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
320                    com.liferay.portal.kernel.dao.orm.Projection projection);
321    
322            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323            public com.liferay.portal.model.UserGroup fetchUserGroup(long companyId,
324                    java.lang.String name);
325    
326            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
327            public com.liferay.portal.model.UserGroup fetchUserGroup(long userGroupId);
328    
329            /**
330            * Returns the user group with the matching UUID and company.
331            *
332            * @param uuid the user group's UUID
333            * @param companyId the primary key of the company
334            * @return the matching user group, or <code>null</code> if a matching user group could not be found
335            */
336            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
337            public com.liferay.portal.model.UserGroup fetchUserGroupByUuidAndCompanyId(
338                    java.lang.String uuid, long companyId);
339    
340            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
341            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
342    
343            /**
344            * Returns the Spring bean ID for this bean.
345            *
346            * @return the Spring bean ID for this bean
347            */
348            public java.lang.String getBeanIdentifier();
349    
350            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
351            public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
352                    com.liferay.portal.kernel.lar.PortletDataContext portletDataContext);
353    
354            /**
355            * Returns the groupIds of the groups associated with the user group.
356            *
357            * @param userGroupId the userGroupId of the user group
358            * @return long[] the groupIds of groups associated with the user group
359            */
360            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361            public long[] getGroupPrimaryKeys(long userGroupId);
362    
363            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
364            public java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
365                    long groupId);
366    
367            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
368            public java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
369                    long groupId, int start, int end);
370    
371            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
372            public java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
373                    long groupId, int start, int end,
374                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator);
375    
376            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
377            public int getGroupUserGroupsCount(long groupId);
378    
379            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
380            public java.util.List<com.liferay.portal.model.UserGroup> getGroupUserUserGroups(
381                    long groupId, long userId)
382                    throws com.liferay.portal.kernel.exception.PortalException;
383    
384            @Override
385            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
386            public com.liferay.portal.model.PersistedModel getPersistedModel(
387                    java.io.Serializable primaryKeyObj)
388                    throws com.liferay.portal.kernel.exception.PortalException;
389    
390            /**
391            * Returns the teamIds of the teams associated with the user group.
392            *
393            * @param userGroupId the userGroupId of the user group
394            * @return long[] the teamIds of teams associated with the user group
395            */
396            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
397            public long[] getTeamPrimaryKeys(long userGroupId);
398    
399            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
400            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
401                    long teamId);
402    
403            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
404            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
405                    long teamId, int start, int end);
406    
407            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
408            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
409                    long teamId, int start, int end,
410                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator);
411    
412            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
413            public int getTeamUserGroupsCount(long teamId);
414    
415            /**
416            * Returns the user group with the name.
417            *
418            * @param companyId the primary key of the user group's company
419            * @param name the user group's name
420            * @return Returns the user group with the name
421            * @throws PortalException if a user group with the name could not be found
422            */
423            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
424            public com.liferay.portal.model.UserGroup getUserGroup(long companyId,
425                    java.lang.String name)
426                    throws com.liferay.portal.kernel.exception.PortalException;
427    
428            /**
429            * Returns the user group with the primary key.
430            *
431            * @param userGroupId the primary key of the user group
432            * @return the user group
433            * @throws PortalException if a user group with the primary key could not be found
434            */
435            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
436            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
437                    throws com.liferay.portal.kernel.exception.PortalException;
438    
439            /**
440            * Returns the user group with the matching UUID and company.
441            *
442            * @param uuid the user group's UUID
443            * @param companyId the primary key of the company
444            * @return the matching user group
445            * @throws PortalException if a matching user group could not be found
446            */
447            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
448            public com.liferay.portal.model.UserGroup getUserGroupByUuidAndCompanyId(
449                    java.lang.String uuid, long companyId)
450                    throws com.liferay.portal.kernel.exception.PortalException;
451    
452            /**
453            * Returns all the user groups belonging to the company.
454            *
455            * @param companyId the primary key of the user groups' company
456            * @return the user groups belonging to the company
457            */
458            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
459            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
460                    long companyId);
461    
462            /**
463            * Returns a range of all the user groups.
464            *
465            * <p>
466            * 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.
467            * </p>
468            *
469            * @param start the lower bound of the range of user groups
470            * @param end the upper bound of the range of user groups (not inclusive)
471            * @return the range of user groups
472            */
473            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
474            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
475                    int start, int end);
476    
477            /**
478            * Returns all the user groups with the primary keys.
479            *
480            * @param userGroupIds the primary keys of the user groups
481            * @return the user groups with the primary keys
482            * @throws PortalException if any one of the user groups could not be found
483            */
484            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
485            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
486                    long[] userGroupIds)
487                    throws com.liferay.portal.kernel.exception.PortalException;
488    
489            /**
490            * Returns the number of user groups.
491            *
492            * @return the number of user groups
493            */
494            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
495            public int getUserGroupsCount();
496    
497            /**
498            * Returns the userIds of the users associated with the user group.
499            *
500            * @param userGroupId the userGroupId of the user group
501            * @return long[] the userIds of users associated with the user group
502            */
503            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
504            public long[] getUserPrimaryKeys(long userGroupId);
505    
506            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
507            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
508                    long userId);
509    
510            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
511            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
512                    long userId, int start, int end);
513    
514            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
515            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
516                    long userId, int start, int end,
517                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator);
518    
519            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
520            public int getUserUserGroupsCount(long userId);
521    
522            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
523            public boolean hasGroupUserGroup(long groupId, long userGroupId);
524    
525            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
526            public boolean hasGroupUserGroups(long groupId);
527    
528            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
529            public boolean hasTeamUserGroup(long teamId, long userGroupId);
530    
531            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
532            public boolean hasTeamUserGroups(long teamId);
533    
534            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
535            public boolean hasUserUserGroup(long userId, long userGroupId);
536    
537            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
538            public boolean hasUserUserGroups(long userId);
539    
540            /**
541            * Returns an ordered range of all the user groups that match the keywords.
542            *
543            * <p>
544            * Useful when paginating results. Returns a maximum of <code>end -
545            * start</code> instances. <code>start</code> and <code>end</code> are not
546            * primary keys, they are indexes in the result set. Thus, <code>0</code>
547            * refers to the first result in the set. Setting both <code>start</code>
548            * and <code>end</code> to {@link
549            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
550            * result set.
551            * </p>
552            *
553            * @param companyId the primary key of the user group's company
554            * @param keywords the keywords (space separated), which may occur in the
555            user group's name or description (optionally <code>null</code>)
556            * @param params the finder params (optionally <code>null</code>). For more
557            information see {@link
558            com.liferay.portal.service.persistence.UserGroupFinder}
559            * @param start the lower bound of the range of user groups to return
560            * @param end the upper bound of the range of user groups to return (not
561            inclusive)
562            * @param obc the comparator to order the user groups (optionally
563            <code>null</code>)
564            * @return the matching user groups ordered by comparator <code>obc</code>
565            * @see com.liferay.portal.service.persistence.UserGroupFinder
566            */
567            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
568            public java.util.List<com.liferay.portal.model.UserGroup> search(
569                    long companyId, java.lang.String keywords,
570                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
571                    int start, int end,
572                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> obc);
573    
574            /**
575            * Returns an ordered range of all the user groups that match the keywords,
576            * using the indexer. It is preferable to use this method instead of the
577            * non-indexed version whenever possible for performance reasons.
578            *
579            * <p>
580            * Useful when paginating results. Returns a maximum of <code>end -
581            * start</code> instances. <code>start</code> and <code>end</code> are not
582            * primary keys, they are indexes in the result set. Thus, <code>0</code>
583            * refers to the first result in the set. Setting both <code>start</code>
584            * and <code>end</code> to {@link
585            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
586            * result set.
587            * </p>
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.portlet.usergroupsadmin.util.UserGroupIndexer}
595            * @param start the lower bound of the range of user groups to return
596            * @param end the upper bound of the range of user groups to return (not
597            inclusive)
598            * @param sort the field and direction by which to sort (optionally
599            <code>null</code>)
600            * @return the matching user groups ordered by sort
601            * @see com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer
602            */
603            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
604            public com.liferay.portal.kernel.search.Hits search(long companyId,
605                    java.lang.String keywords,
606                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
607                    int start, int end, com.liferay.portal.kernel.search.Sort sort);
608    
609            /**
610            * Returns an ordered range of all the user groups that match the name and
611            * description.
612            *
613            * <p>
614            * Useful when paginating results. Returns a maximum of <code>end -
615            * start</code> instances. <code>start</code> and <code>end</code> are not
616            * primary keys, they are indexes in the result set. Thus, <code>0</code>
617            * refers to the first result in the set. Setting both <code>start</code>
618            * and <code>end</code> to {@link
619            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
620            * result set.
621            * </p>
622            *
623            * @param companyId the primary key of the user group's company
624            * @param name the user group's name (optionally <code>null</code>)
625            * @param description the user group's description (optionally
626            <code>null</code>)
627            * @param params the finder params (optionally <code>null</code>). For more
628            information see {@link
629            com.liferay.portal.service.persistence.UserGroupFinder}
630            * @param andOperator whether every field must match its keywords or just
631            one field
632            * @param start the lower bound of the range of user groups to return
633            * @param end the upper bound of the range of user groups to return (not
634            inclusive)
635            * @param obc the comparator to order the user groups (optionally
636            <code>null</code>)
637            * @return the matching user groups ordered by comparator <code>obc</code>
638            * @see com.liferay.portal.service.persistence.UserGroupFinder
639            */
640            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
641            public java.util.List<com.liferay.portal.model.UserGroup> search(
642                    long companyId, java.lang.String name, java.lang.String description,
643                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
644                    boolean andOperator, int start, int end,
645                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> obc);
646    
647            /**
648            * Returns an ordered range of all the user groups that match the name and
649            * description. It is preferable to use this method instead of the
650            * non-indexed version whenever possible for performance reasons.
651            *
652            * <p>
653            * Useful when paginating results. Returns a maximum of <code>end -
654            * start</code> instances. <code>start</code> and <code>end</code> are not
655            * primary keys, they are indexes in the result set. Thus, <code>0</code>
656            * refers to the first result in the set. Setting both <code>start</code>
657            * and <code>end</code> to {@link
658            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
659            * result set.
660            * </p>
661            *
662            * @param companyId the primary key of the user group's company
663            * @param name the user group's name (optionally <code>null</code>)
664            * @param description the user group's description (optionally
665            <code>null</code>)
666            * @param params the finder params (optionally <code>null</code>). For more
667            information see {@link
668            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
669            * @param andSearch whether every field must match its keywords or just one
670            field
671            * @param start the lower bound of the range of user groups to return
672            * @param end the upper bound of the range of user groups to return (not
673            inclusive)
674            * @param sort the field and direction by which to sort (optionally
675            <code>null</code>)
676            * @return the matching user groups ordered by sort
677            * @see com.liferay.portal.service.persistence.UserGroupFinder
678            */
679            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
680            public com.liferay.portal.kernel.search.Hits search(long companyId,
681                    java.lang.String name, java.lang.String description,
682                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
683                    boolean andSearch, int start, int end,
684                    com.liferay.portal.kernel.search.Sort sort);
685    
686            /**
687            * Returns the number of user groups that match the keywords
688            *
689            * @param companyId the primary key of the user group's company
690            * @param keywords the keywords (space separated), which may occur in the
691            user group's name or description (optionally <code>null</code>)
692            * @param params the finder params (optionally <code>null</code>). For more
693            information see {@link
694            com.liferay.portal.service.persistence.UserGroupFinder}
695            * @return the number of matching user groups
696            * @see com.liferay.portal.service.persistence.UserGroupFinder
697            */
698            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
699            public int searchCount(long companyId, java.lang.String keywords,
700                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params);
701    
702            /**
703            * Returns the number of user groups that match the name and description.
704            *
705            * @param companyId the primary key of the user group's company
706            * @param name the user group's name (optionally <code>null</code>)
707            * @param description the user group's description (optionally
708            <code>null</code>)
709            * @param params the finder params (optionally <code>null</code>). For more
710            information see {@link
711            com.liferay.portal.service.persistence.UserGroupFinder}
712            * @param andOperator whether every field must match its keywords or just
713            one field
714            * @return the number of matching user groups
715            * @see com.liferay.portal.service.persistence.UserGroupFinder
716            */
717            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
718            public int searchCount(long companyId, java.lang.String name,
719                    java.lang.String description,
720                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
721                    boolean andOperator);
722    
723            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
724            public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.UserGroup> searchUserGroups(
725                    long companyId, java.lang.String keywords,
726                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
727                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
728                    throws com.liferay.portal.kernel.exception.PortalException;
729    
730            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
731            public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.UserGroup> searchUserGroups(
732                    long companyId, java.lang.String name, java.lang.String description,
733                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
734                    boolean andSearch, int start, int end,
735                    com.liferay.portal.kernel.search.Sort sort)
736                    throws com.liferay.portal.kernel.exception.PortalException;
737    
738            /**
739            * Sets the Spring bean ID for this bean.
740            *
741            * @param beanIdentifier the Spring bean ID for this bean
742            */
743            public void setBeanIdentifier(java.lang.String beanIdentifier);
744    
745            public void setGroupUserGroups(long groupId, long[] userGroupIds);
746    
747            public void setTeamUserGroups(long teamId, long[] userGroupIds);
748    
749            /**
750            * @throws PortalException
751            */
752            public void setUserUserGroups(long userId, long[] userGroupIds)
753                    throws com.liferay.portal.kernel.exception.PortalException;
754    
755            /**
756            * Removes the user groups from the group.
757            *
758            * @param groupId the primary key of the group
759            * @param userGroupIds the primary keys of the user groups
760            */
761            public void unsetGroupUserGroups(long groupId, long[] userGroupIds);
762    
763            /**
764            * Removes the user groups from the team.
765            *
766            * @param teamId the primary key of the team
767            * @param userGroupIds the primary keys of the user groups
768            */
769            public void unsetTeamUserGroups(long teamId, long[] userGroupIds);
770    
771            /**
772            * Updates the user group.
773            *
774            * @param companyId the primary key of the user group's company
775            * @param userGroupId the primary key of the user group
776            * @param name the user group's name
777            * @param description the user group's description
778            * @return the user group
779            * @throws PortalException if a user group with the primary key could
780            not be found or if the new information was invalid
781            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, long,
782            String, String, ServiceContext)}
783            */
784            @java.lang.Deprecated
785            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
786                    long userGroupId, java.lang.String name, java.lang.String description)
787                    throws com.liferay.portal.kernel.exception.PortalException;
788    
789            /**
790            * Updates the user group.
791            *
792            * @param companyId the primary key of the user group's company
793            * @param userGroupId the primary key of the user group
794            * @param name the user group's name
795            * @param description the user group's description
796            * @param serviceContext the service context to be applied (optionally
797            <code>null</code>). Can set expando bridge attributes for the
798            user group.
799            * @return the user group
800            * @throws PortalException if a user group with the primary key could not be
801            found or if the new information was invalid
802            */
803            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
804                    long userGroupId, java.lang.String name, java.lang.String description,
805                    com.liferay.portal.service.ServiceContext serviceContext)
806                    throws com.liferay.portal.kernel.exception.PortalException;
807    
808            /**
809            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
810            *
811            * @param userGroup the user group
812            * @return the user group that was updated
813            */
814            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
815            public com.liferay.portal.model.UserGroup updateUserGroup(
816                    com.liferay.portal.model.UserGroup userGroup);
817    }