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            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(long, long,
095            String, String, ServiceContext)}
096            */
097            @java.lang.Deprecated
098            public com.liferay.portal.model.UserGroup addUserGroup(long userId,
099                    long companyId, java.lang.String name, java.lang.String description)
100                    throws PortalException;
101    
102            /**
103            * Adds a user group.
104            *
105            * <p>
106            * This method handles the creation and bookkeeping of the user group,
107            * including its resources, metadata, and internal data structures. It is
108            * not necessary to make subsequent calls to setup default groups and
109            * resources for the user group.
110            * </p>
111            *
112            * @param userId the primary key of the user
113            * @param companyId the primary key of the user group's company
114            * @param name the user group's name
115            * @param description the user group's description
116            * @param serviceContext the service context to be applied (optionally
117            <code>null</code>). Can set expando bridge attributes for the
118            user group.
119            * @return the user group
120            */
121            public com.liferay.portal.model.UserGroup addUserGroup(long userId,
122                    long companyId, java.lang.String name, java.lang.String description,
123                    com.liferay.portal.service.ServiceContext serviceContext)
124                    throws PortalException;
125    
126            public void addUserUserGroup(long userId,
127                    com.liferay.portal.model.UserGroup userGroup);
128    
129            public void addUserUserGroup(long userId, long userGroupId);
130    
131            public void addUserUserGroups(long userId,
132                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
133    
134            public void addUserUserGroups(long userId, long[] userGroupIds);
135    
136            public void clearGroupUserGroups(long groupId);
137    
138            public void clearTeamUserGroups(long teamId);
139    
140            public void clearUserUserGroups(long userId);
141    
142            /**
143            * Copies the user group's layout to the user.
144            *
145            * @param userGroupId the primary key of the user group
146            * @param userId the primary key of the user
147            * @deprecated As of 6.2.0
148            */
149            @java.lang.Deprecated
150            public void copyUserGroupLayouts(long userGroupId, long userId)
151                    throws PortalException;
152    
153            /**
154            * Copies the user group's layouts to the users who are not already members
155            * of the user group.
156            *
157            * @param userGroupId the primary key of the user group
158            * @param userIds the primary keys of the users
159            * @deprecated As of 6.1.0
160            */
161            @java.lang.Deprecated
162            public void copyUserGroupLayouts(long userGroupId, long[] userIds)
163                    throws PortalException;
164    
165            /**
166            * Copies the user groups' layouts to the user.
167            *
168            * @param userGroupIds the primary keys of the user groups
169            * @param userId the primary key of the user
170            * @deprecated As of 6.1.0
171            */
172            @java.lang.Deprecated
173            public void copyUserGroupLayouts(long[] userGroupIds, long userId)
174                    throws PortalException;
175    
176            /**
177            * Creates a new user group with the primary key. Does not add the user group to the database.
178            *
179            * @param userGroupId the primary key for the new user group
180            * @return the new user group
181            */
182            public com.liferay.portal.model.UserGroup createUserGroup(long userGroupId);
183    
184            public void deleteGroupUserGroup(long groupId,
185                    com.liferay.portal.model.UserGroup userGroup);
186    
187            public void deleteGroupUserGroup(long groupId, long userGroupId);
188    
189            public void deleteGroupUserGroups(long groupId,
190                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
191    
192            public void deleteGroupUserGroups(long groupId, long[] userGroupIds);
193    
194            /**
195            * @throws PortalException
196            */
197            @Override
198            public com.liferay.portal.model.PersistedModel deletePersistedModel(
199                    com.liferay.portal.model.PersistedModel persistedModel)
200                    throws PortalException;
201    
202            public void deleteTeamUserGroup(long teamId,
203                    com.liferay.portal.model.UserGroup userGroup);
204    
205            public void deleteTeamUserGroup(long teamId, long userGroupId);
206    
207            public void deleteTeamUserGroups(long teamId,
208                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
209    
210            public void deleteTeamUserGroups(long teamId, long[] userGroupIds);
211    
212            /**
213            * Deletes the user group from the database. Also notifies the appropriate model listeners.
214            *
215            * @param userGroup the user group
216            * @return the user group that was removed
217            * @throws PortalException
218            */
219            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
220            @com.liferay.portal.kernel.systemevent.SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
221            public com.liferay.portal.model.UserGroup deleteUserGroup(
222                    com.liferay.portal.model.UserGroup userGroup) throws PortalException;
223    
224            /**
225            * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners.
226            *
227            * @param userGroupId the primary key of the user group
228            * @return the user group that was removed
229            * @throws PortalException if a user group with the primary key could not be found
230            */
231            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
232            public com.liferay.portal.model.UserGroup deleteUserGroup(long userGroupId)
233                    throws PortalException;
234    
235            public void deleteUserGroups(long companyId) throws PortalException;
236    
237            public void deleteUserUserGroup(long userId,
238                    com.liferay.portal.model.UserGroup userGroup);
239    
240            public void deleteUserUserGroup(long userId, long userGroupId);
241    
242            public void deleteUserUserGroups(long userId,
243                    java.util.List<com.liferay.portal.model.UserGroup> UserGroups);
244    
245            public void deleteUserUserGroups(long userId, long[] userGroupIds);
246    
247            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
248    
249            /**
250            * Performs a dynamic query on the database and returns the matching rows.
251            *
252            * @param dynamicQuery the dynamic query
253            * @return the matching rows
254            */
255            public <T> java.util.List<T> dynamicQuery(
256                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
257    
258            /**
259            * Performs a dynamic query on the database and returns a range of the matching rows.
260            *
261            * <p>
262            * 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.
263            * </p>
264            *
265            * @param dynamicQuery the dynamic query
266            * @param start the lower bound of the range of model instances
267            * @param end the upper bound of the range of model instances (not inclusive)
268            * @return the range of matching rows
269            */
270            public <T> java.util.List<T> dynamicQuery(
271                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
272                    int end);
273    
274            /**
275            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
276            *
277            * <p>
278            * 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.
279            * </p>
280            *
281            * @param dynamicQuery the dynamic query
282            * @param start the lower bound of the range of model instances
283            * @param end the upper bound of the range of model instances (not inclusive)
284            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
285            * @return the ordered range of matching rows
286            */
287            public <T> java.util.List<T> dynamicQuery(
288                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
289                    int end,
290                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
291    
292            /**
293            * Returns the number of rows matching the dynamic query.
294            *
295            * @param dynamicQuery the dynamic query
296            * @return the number of rows matching the dynamic query
297            */
298            public long dynamicQueryCount(
299                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
300    
301            /**
302            * Returns the number of rows matching the dynamic query.
303            *
304            * @param dynamicQuery the dynamic query
305            * @param projection the projection to apply to the 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                    com.liferay.portal.kernel.dao.orm.Projection projection);
311    
312            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
313            public com.liferay.portal.model.UserGroup fetchUserGroup(long companyId,
314                    java.lang.String name);
315    
316            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
317            public com.liferay.portal.model.UserGroup fetchUserGroup(long userGroupId);
318    
319            /**
320            * Returns the user group with the matching UUID and company.
321            *
322            * @param uuid the user group's UUID
323            * @param companyId the primary key of the company
324            * @return the matching user group, or <code>null</code> if a matching user group could not be found
325            */
326            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
327            public com.liferay.portal.model.UserGroup fetchUserGroupByUuidAndCompanyId(
328                    java.lang.String uuid, long companyId);
329    
330            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
331            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
332    
333            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
334            public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
335                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext);
336    
337            /**
338            * Returns the groupIds of the groups associated with the user group.
339            *
340            * @param userGroupId the userGroupId of the user group
341            * @return long[] the groupIds of groups associated with the user group
342            */
343            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
344            public long[] getGroupPrimaryKeys(long userGroupId);
345    
346            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
347            public java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
348                    long groupId);
349    
350            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
351            public java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
352                    long groupId, int start, int end);
353    
354            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
355            public java.util.List<com.liferay.portal.model.UserGroup> getGroupUserGroups(
356                    long groupId, int start, int end,
357                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator);
358    
359            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
360            public int getGroupUserGroupsCount(long groupId);
361    
362            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
363            public java.util.List<com.liferay.portal.model.UserGroup> getGroupUserUserGroups(
364                    long groupId, long userId) throws PortalException;
365    
366            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
367            public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
368    
369            /**
370            * Returns the OSGi service identifier.
371            *
372            * @return the OSGi service identifier
373            */
374            public java.lang.String getOSGiServiceIdentifier();
375    
376            @Override
377            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
378            public com.liferay.portal.model.PersistedModel getPersistedModel(
379                    java.io.Serializable primaryKeyObj) throws PortalException;
380    
381            /**
382            * Returns the teamIds of the teams associated with the user group.
383            *
384            * @param userGroupId the userGroupId of the user group
385            * @return long[] the teamIds of teams associated with the user group
386            */
387            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
388            public long[] getTeamPrimaryKeys(long userGroupId);
389    
390            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
391            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
392                    long teamId);
393    
394            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
395            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
396                    long teamId, int start, int end);
397    
398            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
399            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
400                    long teamId, int start, int end,
401                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator);
402    
403            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
404            public int getTeamUserGroupsCount(long teamId);
405    
406            /**
407            * Returns the user group with the name.
408            *
409            * @param companyId the primary key of the user group's company
410            * @param name the user group's name
411            * @return Returns the user group with the name
412            */
413            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
414            public com.liferay.portal.model.UserGroup getUserGroup(long companyId,
415                    java.lang.String name) throws PortalException;
416    
417            /**
418            * Returns the user group with the primary key.
419            *
420            * @param userGroupId the primary key of the user group
421            * @return the user group
422            * @throws PortalException if a user group with the primary key could not be found
423            */
424            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
425            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
426                    throws PortalException;
427    
428            /**
429            * Returns the user group with the matching UUID and company.
430            *
431            * @param uuid the user group's UUID
432            * @param companyId the primary key of the company
433            * @return the matching user group
434            * @throws PortalException if a matching user group could not be found
435            */
436            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
437            public com.liferay.portal.model.UserGroup getUserGroupByUuidAndCompanyId(
438                    java.lang.String uuid, long companyId) throws PortalException;
439    
440            /**
441            * Returns all the user groups belonging to the company.
442            *
443            * @param companyId the primary key of the user groups' company
444            * @return the user groups belonging to the company
445            */
446            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
447            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
448                    long companyId);
449    
450            /**
451            * Returns a range of all the user groups.
452            *
453            * <p>
454            * 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.
455            * </p>
456            *
457            * @param start the lower bound of the range of user groups
458            * @param end the upper bound of the range of user groups (not inclusive)
459            * @return the range of user groups
460            */
461            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
462            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
463                    int start, int end);
464    
465            /**
466            * Returns all the user groups with the primary keys.
467            *
468            * @param userGroupIds the primary keys of the user groups
469            * @return the user groups with the primary keys
470            */
471            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
472            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
473                    long[] userGroupIds) throws PortalException;
474    
475            /**
476            * Returns the number of user groups.
477            *
478            * @return the number of user groups
479            */
480            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
481            public int getUserGroupsCount();
482    
483            /**
484            * Returns the userIds of the users associated with the user group.
485            *
486            * @param userGroupId the userGroupId of the user group
487            * @return long[] the userIds of users associated with the user group
488            */
489            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
490            public long[] getUserPrimaryKeys(long userGroupId);
491    
492            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
493            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
494                    long userId);
495    
496            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
497            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
498                    long userId, int start, int end);
499    
500            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
501            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
502                    long userId, int start, int end,
503                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator);
504    
505            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
506            public int getUserUserGroupsCount(long userId);
507    
508            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
509            public boolean hasGroupUserGroup(long groupId, long userGroupId);
510    
511            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
512            public boolean hasGroupUserGroups(long groupId);
513    
514            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
515            public boolean hasTeamUserGroup(long teamId, long userGroupId);
516    
517            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
518            public boolean hasTeamUserGroups(long teamId);
519    
520            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
521            public boolean hasUserUserGroup(long userId, long userGroupId);
522    
523            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
524            public boolean hasUserUserGroups(long userId);
525    
526            /**
527            * Returns an ordered range of all the user groups that match the keywords.
528            *
529            * <p>
530            * Useful when paginating results. Returns a maximum of <code>end -
531            * start</code> instances. <code>start</code> and <code>end</code> are not
532            * primary keys, they are indexes in the result set. Thus, <code>0</code>
533            * refers to the first result in the set. Setting both <code>start</code>
534            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
535            * result set.
536            * </p>
537            *
538            * @param companyId the primary key of the user group's company
539            * @param keywords the keywords (space separated), which may occur in the
540            user group's name or description (optionally <code>null</code>)
541            * @param params the finder params (optionally <code>null</code>). For more
542            information see {@link
543            com.liferay.portal.service.persistence.UserGroupFinder}
544            * @param start the lower bound of the range of user groups to return
545            * @param end the upper bound of the range of user groups to return (not
546            inclusive)
547            * @param obc the comparator to order the user groups (optionally
548            <code>null</code>)
549            * @return the matching user groups ordered by comparator <code>obc</code>
550            * @see com.liferay.portal.service.persistence.UserGroupFinder
551            */
552            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
553            public java.util.List<com.liferay.portal.model.UserGroup> search(
554                    long companyId, java.lang.String keywords,
555                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
556                    int start, int end,
557                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> obc);
558    
559            /**
560            * Returns an ordered range of all the user groups that match the keywords,
561            * using the indexer. It is preferable to use this method instead of the
562            * non-indexed version whenever possible for performance reasons.
563            *
564            * <p>
565            * Useful when paginating results. Returns a maximum of <code>end -
566            * start</code> instances. <code>start</code> and <code>end</code> are not
567            * primary keys, they are indexes in the result set. Thus, <code>0</code>
568            * refers to the first result in the set. Setting both <code>start</code>
569            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
570            * result set.
571            * </p>
572            *
573            * @param companyId the primary key of the user group's company
574            * @param keywords the keywords (space separated), which may occur in the
575            user group's name or description (optionally <code>null</code>)
576            * @param params the finder params (optionally <code>null</code>). For more
577            information see {@link
578            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
579            * @param start the lower bound of the range of user groups to return
580            * @param end the upper bound of the range of user groups to return (not
581            inclusive)
582            * @param sort the field and direction by which to sort (optionally
583            <code>null</code>)
584            * @return the matching user groups ordered by sort
585            * @see com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer
586            */
587            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
588            public com.liferay.portal.kernel.search.Hits search(long companyId,
589                    java.lang.String keywords,
590                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
591                    int start, int end, com.liferay.portal.kernel.search.Sort sort);
592    
593            /**
594            * Returns an ordered range of all the user groups that match the name and
595            * description.
596            *
597            * <p>
598            * Useful when paginating results. Returns a maximum of <code>end -
599            * start</code> instances. <code>start</code> and <code>end</code> are not
600            * primary keys, they are indexes in the result set. Thus, <code>0</code>
601            * refers to the first result in the set. Setting both <code>start</code>
602            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
603            * result set.
604            * </p>
605            *
606            * @param companyId the primary key of the user group's company
607            * @param name the user group's name (optionally <code>null</code>)
608            * @param description the user group's description (optionally
609            <code>null</code>)
610            * @param params the finder params (optionally <code>null</code>). For more
611            information see {@link
612            com.liferay.portal.service.persistence.UserGroupFinder}
613            * @param andOperator whether every field must match its keywords or just
614            one field
615            * @param start the lower bound of the range of user groups to return
616            * @param end the upper bound of the range of user groups to return (not
617            inclusive)
618            * @param obc the comparator to order the user groups (optionally
619            <code>null</code>)
620            * @return the matching user groups ordered by comparator <code>obc</code>
621            * @see com.liferay.portal.service.persistence.UserGroupFinder
622            */
623            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
624            public java.util.List<com.liferay.portal.model.UserGroup> search(
625                    long companyId, java.lang.String name, java.lang.String description,
626                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
627                    boolean andOperator, int start, int end,
628                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> obc);
629    
630            /**
631            * Returns an ordered range of all the user groups that match the name and
632            * description. It is preferable to use this method instead of the
633            * non-indexed version whenever possible for performance reasons.
634            *
635            * <p>
636            * Useful when paginating results. Returns a maximum of <code>end -
637            * start</code> instances. <code>start</code> and <code>end</code> are not
638            * primary keys, they are indexes in the result set. Thus, <code>0</code>
639            * refers to the first result in the set. Setting both <code>start</code>
640            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
641            * result set.
642            * </p>
643            *
644            * @param companyId the primary key of the user group's company
645            * @param name the user group's name (optionally <code>null</code>)
646            * @param description the user group's description (optionally
647            <code>null</code>)
648            * @param params the finder params (optionally <code>null</code>). For more
649            information see {@link
650            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
651            * @param andSearch whether every field must match its keywords or just one
652            field
653            * @param start the lower bound of the range of user groups to return
654            * @param end the upper bound of the range of user groups to return (not
655            inclusive)
656            * @param sort the field and direction by which to sort (optionally
657            <code>null</code>)
658            * @return the matching user groups ordered by sort
659            * @see com.liferay.portal.service.persistence.UserGroupFinder
660            */
661            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
662            public com.liferay.portal.kernel.search.Hits search(long companyId,
663                    java.lang.String name, java.lang.String description,
664                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
665                    boolean andSearch, int start, int end,
666                    com.liferay.portal.kernel.search.Sort sort);
667    
668            /**
669            * Returns the number of user groups that match the keywords
670            *
671            * @param companyId the primary key of the user group's company
672            * @param keywords the keywords (space separated), which may occur in the
673            user group's name or description (optionally <code>null</code>)
674            * @param params the finder params (optionally <code>null</code>). For more
675            information see {@link
676            com.liferay.portal.service.persistence.UserGroupFinder}
677            * @return the number of matching user groups
678            * @see com.liferay.portal.service.persistence.UserGroupFinder
679            */
680            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
681            public int searchCount(long companyId, java.lang.String keywords,
682                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params);
683    
684            /**
685            * Returns the number of user groups that match the name and description.
686            *
687            * @param companyId the primary key of the user group's company
688            * @param name the user group's name (optionally <code>null</code>)
689            * @param description the user group's description (optionally
690            <code>null</code>)
691            * @param params the finder params (optionally <code>null</code>). For more
692            information see {@link
693            com.liferay.portal.service.persistence.UserGroupFinder}
694            * @param andOperator whether every field must match its keywords or just
695            one field
696            * @return the number of matching user groups
697            * @see com.liferay.portal.service.persistence.UserGroupFinder
698            */
699            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
700            public int searchCount(long companyId, java.lang.String name,
701                    java.lang.String description,
702                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
703                    boolean andOperator);
704    
705            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
706            public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.UserGroup> searchUserGroups(
707                    long companyId, java.lang.String keywords,
708                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
709                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
710                    throws PortalException;
711    
712            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
713            public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.UserGroup> searchUserGroups(
714                    long companyId, java.lang.String name, java.lang.String description,
715                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
716                    boolean andSearch, int start, int end,
717                    com.liferay.portal.kernel.search.Sort sort) throws PortalException;
718    
719            public void setGroupUserGroups(long groupId, long[] userGroupIds);
720    
721            public void setTeamUserGroups(long teamId, long[] userGroupIds);
722    
723            /**
724            * @throws PortalException
725            */
726            public void setUserUserGroups(long userId, long[] userGroupIds)
727                    throws PortalException;
728    
729            /**
730            * Removes the user groups from the group.
731            *
732            * @param groupId the primary key of the group
733            * @param userGroupIds the primary keys of the user groups
734            */
735            public void unsetGroupUserGroups(long groupId, long[] userGroupIds);
736    
737            /**
738            * Removes the user groups from the team.
739            *
740            * @param teamId the primary key of the team
741            * @param userGroupIds the primary keys of the user groups
742            */
743            public void unsetTeamUserGroups(long teamId, long[] userGroupIds);
744    
745            /**
746            * Updates the user group.
747            *
748            * @param companyId the primary key of the user group's company
749            * @param userGroupId the primary key of the user group
750            * @param name the user group's name
751            * @param description the user group's description
752            * @return the user group
753            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, long,
754            String, String, ServiceContext)}
755            */
756            @java.lang.Deprecated
757            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
758                    long userGroupId, java.lang.String name, java.lang.String description)
759                    throws PortalException;
760    
761            /**
762            * Updates the user group.
763            *
764            * @param companyId the primary key of the user group's company
765            * @param userGroupId the primary key of the user group
766            * @param name the user group's name
767            * @param description the user group's description
768            * @param serviceContext the service context to be applied (optionally
769            <code>null</code>). Can set expando bridge attributes for the
770            user group.
771            * @return the user group
772            */
773            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
774                    long userGroupId, java.lang.String name, java.lang.String description,
775                    com.liferay.portal.service.ServiceContext serviceContext)
776                    throws PortalException;
777    
778            /**
779            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
780            *
781            * @param userGroup the user group
782            * @return the user group that was updated
783            */
784            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
785            public com.liferay.portal.model.UserGroup updateUserGroup(
786                    com.liferay.portal.model.UserGroup userGroup);
787    }