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