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            /**
367            * Returns the OSGi service identifier.
368            *
369            * @return the OSGi service identifier
370            */
371            public java.lang.String getOSGiServiceIdentifier();
372    
373            @Override
374            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
375            public com.liferay.portal.model.PersistedModel getPersistedModel(
376                    java.io.Serializable primaryKeyObj) throws PortalException;
377    
378            /**
379            * Returns the teamIds of the teams associated with the user group.
380            *
381            * @param userGroupId the userGroupId of the user group
382            * @return long[] the teamIds of teams associated with the user group
383            */
384            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
385            public long[] getTeamPrimaryKeys(long userGroupId);
386    
387            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
388            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
389                    long teamId);
390    
391            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
392            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
393                    long teamId, int start, int end);
394    
395            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
396            public java.util.List<com.liferay.portal.model.UserGroup> getTeamUserGroups(
397                    long teamId, int start, int end,
398                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator);
399    
400            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
401            public int getTeamUserGroupsCount(long teamId);
402    
403            /**
404            * Returns the user group with the name.
405            *
406            * @param companyId the primary key of the user group's company
407            * @param name the user group's name
408            * @return Returns the user group with the name
409            */
410            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
411            public com.liferay.portal.model.UserGroup getUserGroup(long companyId,
412                    java.lang.String name) throws PortalException;
413    
414            /**
415            * Returns the user group with the primary key.
416            *
417            * @param userGroupId the primary key of the user group
418            * @return the user group
419            * @throws PortalException if a user group with the primary key could not be found
420            */
421            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
422            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
423                    throws PortalException;
424    
425            /**
426            * Returns the user group with the matching UUID and company.
427            *
428            * @param uuid the user group's UUID
429            * @param companyId the primary key of the company
430            * @return the matching user group
431            * @throws PortalException if a matching user group could not be found
432            */
433            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
434            public com.liferay.portal.model.UserGroup getUserGroupByUuidAndCompanyId(
435                    java.lang.String uuid, long companyId) throws PortalException;
436    
437            /**
438            * Returns all the user groups belonging to the company.
439            *
440            * @param companyId the primary key of the user groups' company
441            * @return the user groups belonging to the company
442            */
443            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
444            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
445                    long companyId);
446    
447            /**
448            * Returns a range of all the user groups.
449            *
450            * <p>
451            * 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.
452            * </p>
453            *
454            * @param start the lower bound of the range of user groups
455            * @param end the upper bound of the range of user groups (not inclusive)
456            * @return the range of user groups
457            */
458            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
459            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
460                    int start, int end);
461    
462            /**
463            * Returns all the user groups with the primary keys.
464            *
465            * @param userGroupIds the primary keys of the user groups
466            * @return the user groups with the primary keys
467            */
468            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
469            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
470                    long[] userGroupIds) throws PortalException;
471    
472            /**
473            * Returns the number of user groups.
474            *
475            * @return the number of user groups
476            */
477            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
478            public int getUserGroupsCount();
479    
480            /**
481            * Returns the userIds of the users associated with the user group.
482            *
483            * @param userGroupId the userGroupId of the user group
484            * @return long[] the userIds of users associated with the user group
485            */
486            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
487            public long[] getUserPrimaryKeys(long userGroupId);
488    
489            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
490            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
491                    long userId);
492    
493            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
494            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
495                    long userId, int start, int end);
496    
497            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
498            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
499                    long userId, int start, int end,
500                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> orderByComparator);
501    
502            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
503            public int getUserUserGroupsCount(long userId);
504    
505            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
506            public boolean hasGroupUserGroup(long groupId, long userGroupId);
507    
508            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
509            public boolean hasGroupUserGroups(long groupId);
510    
511            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
512            public boolean hasTeamUserGroup(long teamId, long userGroupId);
513    
514            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
515            public boolean hasTeamUserGroups(long teamId);
516    
517            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
518            public boolean hasUserUserGroup(long userId, long userGroupId);
519    
520            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
521            public boolean hasUserUserGroups(long userId);
522    
523            /**
524            * Returns an ordered range of all the user groups that match the keywords.
525            *
526            * <p>
527            * Useful when paginating results. Returns a maximum of <code>end -
528            * start</code> instances. <code>start</code> and <code>end</code> are not
529            * primary keys, they are indexes in the result set. Thus, <code>0</code>
530            * refers to the first result in the set. Setting both <code>start</code>
531            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
532            * result set.
533            * </p>
534            *
535            * @param companyId the primary key of the user group's company
536            * @param keywords the keywords (space separated), which may occur in the
537            user group's name or description (optionally <code>null</code>)
538            * @param params the finder params (optionally <code>null</code>). For more
539            information see {@link
540            com.liferay.portal.service.persistence.UserGroupFinder}
541            * @param start the lower bound of the range of user groups to return
542            * @param end the upper bound of the range of user groups to return (not
543            inclusive)
544            * @param obc the comparator to order the user groups (optionally
545            <code>null</code>)
546            * @return the matching user groups ordered by comparator <code>obc</code>
547            * @see com.liferay.portal.service.persistence.UserGroupFinder
548            */
549            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
550            public java.util.List<com.liferay.portal.model.UserGroup> search(
551                    long companyId, java.lang.String keywords,
552                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
553                    int start, int end,
554                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> obc);
555    
556            /**
557            * Returns an ordered range of all the user groups that match the keywords,
558            * using the indexer. It is preferable to use this method instead of the
559            * non-indexed version whenever possible for performance reasons.
560            *
561            * <p>
562            * Useful when paginating results. Returns a maximum of <code>end -
563            * start</code> instances. <code>start</code> and <code>end</code> are not
564            * primary keys, they are indexes in the result set. Thus, <code>0</code>
565            * refers to the first result in the set. Setting both <code>start</code>
566            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
567            * result set.
568            * </p>
569            *
570            * @param companyId the primary key of the user group's company
571            * @param keywords the keywords (space separated), which may occur in the
572            user group's name or description (optionally <code>null</code>)
573            * @param params the finder params (optionally <code>null</code>). For more
574            information see {@link
575            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
576            * @param start the lower bound of the range of user groups to return
577            * @param end the upper bound of the range of user groups to return (not
578            inclusive)
579            * @param sort the field and direction by which to sort (optionally
580            <code>null</code>)
581            * @return the matching user groups ordered by sort
582            * @see com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer
583            */
584            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
585            public com.liferay.portal.kernel.search.Hits search(long companyId,
586                    java.lang.String keywords,
587                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
588                    int start, int end, com.liferay.portal.kernel.search.Sort sort);
589    
590            /**
591            * Returns an ordered range of all the user groups that match the name and
592            * description.
593            *
594            * <p>
595            * Useful when paginating results. Returns a maximum of <code>end -
596            * start</code> instances. <code>start</code> and <code>end</code> are not
597            * primary keys, they are indexes in the result set. Thus, <code>0</code>
598            * refers to the first result in the set. Setting both <code>start</code>
599            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
600            * result set.
601            * </p>
602            *
603            * @param companyId the primary key of the user group's company
604            * @param name the user group's name (optionally <code>null</code>)
605            * @param description the user group's description (optionally
606            <code>null</code>)
607            * @param params the finder params (optionally <code>null</code>). For more
608            information see {@link
609            com.liferay.portal.service.persistence.UserGroupFinder}
610            * @param andOperator whether every field must match its keywords or just
611            one field
612            * @param start the lower bound of the range of user groups to return
613            * @param end the upper bound of the range of user groups to return (not
614            inclusive)
615            * @param obc the comparator to order the user groups (optionally
616            <code>null</code>)
617            * @return the matching user groups ordered by comparator <code>obc</code>
618            * @see com.liferay.portal.service.persistence.UserGroupFinder
619            */
620            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
621            public java.util.List<com.liferay.portal.model.UserGroup> search(
622                    long companyId, java.lang.String name, java.lang.String description,
623                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
624                    boolean andOperator, int start, int end,
625                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.UserGroup> obc);
626    
627            /**
628            * Returns an ordered range of all the user groups that match the name and
629            * description. It is preferable to use this method instead of the
630            * non-indexed version whenever possible for performance reasons.
631            *
632            * <p>
633            * Useful when paginating results. Returns a maximum of <code>end -
634            * start</code> instances. <code>start</code> and <code>end</code> are not
635            * primary keys, they are indexes in the result set. Thus, <code>0</code>
636            * refers to the first result in the set. Setting both <code>start</code>
637            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
638            * result set.
639            * </p>
640            *
641            * @param companyId the primary key of the user group's company
642            * @param name the user group's name (optionally <code>null</code>)
643            * @param description the user group's description (optionally
644            <code>null</code>)
645            * @param params the finder params (optionally <code>null</code>). For more
646            information see {@link
647            com.liferay.portlet.usergroupsadmin.util.UserGroupIndexer}
648            * @param andSearch whether every field must match its keywords or just one
649            field
650            * @param start the lower bound of the range of user groups to return
651            * @param end the upper bound of the range of user groups to return (not
652            inclusive)
653            * @param sort the field and direction by which to sort (optionally
654            <code>null</code>)
655            * @return the matching user groups ordered by sort
656            * @see com.liferay.portal.service.persistence.UserGroupFinder
657            */
658            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
659            public com.liferay.portal.kernel.search.Hits search(long companyId,
660                    java.lang.String name, java.lang.String description,
661                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
662                    boolean andSearch, int start, int end,
663                    com.liferay.portal.kernel.search.Sort sort);
664    
665            /**
666            * Returns the number of user groups that match the keywords
667            *
668            * @param companyId the primary key of the user group's company
669            * @param keywords the keywords (space separated), which may occur in the
670            user group's name or description (optionally <code>null</code>)
671            * @param params the finder params (optionally <code>null</code>). For more
672            information see {@link
673            com.liferay.portal.service.persistence.UserGroupFinder}
674            * @return the number of matching user groups
675            * @see com.liferay.portal.service.persistence.UserGroupFinder
676            */
677            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
678            public int searchCount(long companyId, java.lang.String keywords,
679                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params);
680    
681            /**
682            * Returns the number of user groups that match the name and description.
683            *
684            * @param companyId the primary key of the user group's company
685            * @param name the user group's name (optionally <code>null</code>)
686            * @param description the user group's description (optionally
687            <code>null</code>)
688            * @param params the finder params (optionally <code>null</code>). For more
689            information see {@link
690            com.liferay.portal.service.persistence.UserGroupFinder}
691            * @param andOperator whether every field must match its keywords or just
692            one field
693            * @return the number of matching user groups
694            * @see com.liferay.portal.service.persistence.UserGroupFinder
695            */
696            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
697            public int searchCount(long companyId, java.lang.String name,
698                    java.lang.String description,
699                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
700                    boolean andOperator);
701    
702            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
703            public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.UserGroup> searchUserGroups(
704                    long companyId, java.lang.String keywords,
705                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
706                    int start, int end, com.liferay.portal.kernel.search.Sort sort)
707                    throws PortalException;
708    
709            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
710            public com.liferay.portal.kernel.search.BaseModelSearchResult<com.liferay.portal.model.UserGroup> searchUserGroups(
711                    long companyId, java.lang.String name, java.lang.String description,
712                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
713                    boolean andSearch, int start, int end,
714                    com.liferay.portal.kernel.search.Sort sort) throws PortalException;
715    
716            public void setGroupUserGroups(long groupId, long[] userGroupIds);
717    
718            public void setTeamUserGroups(long teamId, long[] userGroupIds);
719    
720            /**
721            * @throws PortalException
722            */
723            public void setUserUserGroups(long userId, long[] userGroupIds)
724                    throws PortalException;
725    
726            /**
727            * Removes the user groups from the group.
728            *
729            * @param groupId the primary key of the group
730            * @param userGroupIds the primary keys of the user groups
731            */
732            public void unsetGroupUserGroups(long groupId, long[] userGroupIds);
733    
734            /**
735            * Removes the user groups from the team.
736            *
737            * @param teamId the primary key of the team
738            * @param userGroupIds the primary keys of the user groups
739            */
740            public void unsetTeamUserGroups(long teamId, long[] userGroupIds);
741    
742            /**
743            * Updates the user group.
744            *
745            * @param companyId the primary key of the user group's company
746            * @param userGroupId the primary key of the user group
747            * @param name the user group's name
748            * @param description the user group's description
749            * @return the user group
750            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long, long,
751            String, String, ServiceContext)}
752            */
753            @java.lang.Deprecated
754            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
755                    long userGroupId, java.lang.String name, java.lang.String description)
756                    throws PortalException;
757    
758            /**
759            * Updates the user group.
760            *
761            * @param companyId the primary key of the user group's company
762            * @param userGroupId the primary key of the user group
763            * @param name the user group's name
764            * @param description the user group's description
765            * @param serviceContext the service context to be applied (optionally
766            <code>null</code>). Can set expando bridge attributes for the
767            user group.
768            * @return the user group
769            */
770            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
771                    long userGroupId, java.lang.String name, java.lang.String description,
772                    com.liferay.portal.service.ServiceContext serviceContext)
773                    throws PortalException;
774    
775            /**
776            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
777            *
778            * @param userGroup the user group
779            * @return the user group that was updated
780            */
781            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
782            public com.liferay.portal.model.UserGroup updateUserGroup(
783                    com.liferay.portal.model.UserGroup userGroup);
784    }