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.portal.kernel.cache.thread.local.ThreadLocalCachable;
020    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
021    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
022    import com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery;
023    import com.liferay.portal.kernel.dao.orm.Projection;
024    import com.liferay.portal.kernel.exception.PortalException;
025    import com.liferay.portal.kernel.exception.SystemException;
026    import com.liferay.portal.kernel.model.Group;
027    import com.liferay.portal.kernel.model.Layout;
028    import com.liferay.portal.kernel.model.Organization;
029    import com.liferay.portal.kernel.model.PersistedModel;
030    import com.liferay.portal.kernel.model.UserGroup;
031    import com.liferay.portal.kernel.search.Indexable;
032    import com.liferay.portal.kernel.search.IndexableType;
033    import com.liferay.portal.kernel.spring.aop.Skip;
034    import com.liferay.portal.kernel.transaction.Isolation;
035    import com.liferay.portal.kernel.transaction.Propagation;
036    import com.liferay.portal.kernel.transaction.Transactional;
037    import com.liferay.portal.kernel.util.OrderByComparator;
038    
039    import java.io.Serializable;
040    
041    import java.util.LinkedHashMap;
042    import java.util.List;
043    import java.util.Locale;
044    import java.util.Map;
045    
046    /**
047     * Provides the local service interface for Group. Methods of this
048     * service will not have security checks based on the propagated JAAS
049     * credentials because this service can only be accessed from within the same
050     * VM.
051     *
052     * @author Brian Wing Shun Chan
053     * @see GroupLocalServiceUtil
054     * @see com.liferay.portal.service.base.GroupLocalServiceBaseImpl
055     * @see com.liferay.portal.service.impl.GroupLocalServiceImpl
056     * @generated
057     */
058    @ProviderType
059    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
060            PortalException.class, SystemException.class})
061    public interface GroupLocalService extends BaseLocalService,
062            PersistedModelLocalService {
063            /*
064             * NOTE FOR DEVELOPERS:
065             *
066             * Never modify or reference this interface directly. Always use {@link GroupLocalServiceUtil} to access the group local service. Add custom service methods to {@link com.liferay.portal.service.impl.GroupLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
067             */
068    
069            /**
070            * Adds the group to the database. Also notifies the appropriate model listeners.
071            *
072            * @param group the group
073            * @return the group that was added
074            */
075            @Indexable(type = IndexableType.REINDEX)
076            public Group addGroup(Group group);
077    
078            /**
079            * Adds a group.
080            *
081            * @param userId the primary key of the group's creator/owner
082            * @param parentGroupId the primary key of the parent group
083            * @param className the entity's class name
084            * @param classPK the primary key of the entity's instance
085            * @param liveGroupId the primary key of the live group
086            * @param name the entity's name
087            * @param description the group's description (optionally
088            <code>null</code>)
089            * @param type the group's type. For more information see {@link
090            GroupConstants}.
091            * @param manualMembership whether manual membership is allowed for the
092            group
093            * @param membershipRestriction the group's membership restriction. For
094            more information see {@link GroupConstants}.
095            * @param friendlyURL the group's friendlyURL (optionally
096            <code>null</code>)
097            * @param site whether the group is to be associated with a main site
098            * @param active whether the group is active
099            * @param serviceContext the service context to be applied (optionally
100            <code>null</code>). Can set asset category IDs and asset tag
101            names for the group, and whether the group is for staging.
102            * @return the group
103            * @throws PortalException if a portal exception occured
104            * @deprecated As of 7.0.0, replaced by {@link #addGroup(long, long, String,
105            long, long, Map, Map, int, boolean, int, String, boolean,
106            boolean, ServiceContext)}
107            */
108            @java.lang.Deprecated
109            public Group addGroup(long userId, long parentGroupId,
110                    java.lang.String className, long classPK, long liveGroupId,
111                    java.lang.String name, java.lang.String description, int type,
112                    boolean manualMembership, int membershipRestriction,
113                    java.lang.String friendlyURL, boolean site, boolean active,
114                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
115                    throws PortalException;
116    
117            public Group addGroup(long userId, long parentGroupId,
118                    java.lang.String className, long classPK, long liveGroupId,
119                    Map<Locale, java.lang.String> nameMap,
120                    Map<Locale, java.lang.String> descriptionMap, int type,
121                    boolean manualMembership, int membershipRestriction,
122                    java.lang.String friendlyURL, boolean site, boolean active,
123                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
124                    throws PortalException;
125    
126            public Group addGroup(long userId, long parentGroupId,
127                    java.lang.String className, long classPK, long liveGroupId,
128                    Map<Locale, java.lang.String> nameMap,
129                    Map<Locale, java.lang.String> descriptionMap, int type,
130                    boolean manualMembership, int membershipRestriction,
131                    java.lang.String friendlyURL, boolean site, boolean inheritContent,
132                    boolean active,
133                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
134                    throws PortalException;
135    
136            public void addOrganizationGroup(long organizationId, Group group);
137    
138            public void addOrganizationGroup(long organizationId, long groupId);
139    
140            public void addOrganizationGroups(long organizationId, List<Group> Groups);
141    
142            public void addOrganizationGroups(long organizationId, long[] groupIds);
143    
144            public void addRoleGroup(long roleId, Group group);
145    
146            public void addRoleGroup(long roleId, long groupId);
147    
148            public void addRoleGroups(long roleId, List<Group> Groups);
149    
150            public void addRoleGroups(long roleId, long[] groupIds);
151    
152            public void addUserGroup(long userId, Group group);
153    
154            public void addUserGroup(long userId, long groupId);
155    
156            public void addUserGroupGroup(long userGroupId, Group group);
157    
158            public void addUserGroupGroup(long userGroupId, long groupId);
159    
160            public void addUserGroupGroups(long userGroupId, List<Group> Groups);
161    
162            public void addUserGroupGroups(long userGroupId, long[] groupIds);
163    
164            public void addUserGroups(long userId, List<Group> Groups);
165    
166            public void addUserGroups(long userId, long[] groupIds);
167    
168            /**
169            * Adds a company group if it does not exist. This method is typically used
170            * when a virtual host is added.
171            *
172            * @param companyId the primary key of the company
173            * @throws PortalException if a portal exception occurred
174            */
175            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
176            public void checkCompanyGroup(long companyId) throws PortalException;
177    
178            public Group checkScopeGroup(Layout layout, long userId)
179                    throws PortalException;
180    
181            /**
182            * Creates systems groups and other related data needed by the system on the
183            * very first startup. Also takes care of creating the Control Panel groups
184            * and layouts.
185            *
186            * @param companyId the primary key of the company
187            * @throws PortalException if a portal exception occurred
188            */
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public void checkSystemGroups(long companyId) throws PortalException;
191    
192            public void clearOrganizationGroups(long organizationId);
193    
194            public void clearRoleGroups(long roleId);
195    
196            public void clearUserGroupGroups(long userGroupId);
197    
198            public void clearUserGroups(long userId);
199    
200            /**
201            * Creates a new group with the primary key. Does not add the group to the database.
202            *
203            * @param groupId the primary key for the new group
204            * @return the new group
205            */
206            public Group createGroup(long groupId);
207    
208            /**
209            * Deletes the group from the database. Also notifies the appropriate model listeners.
210            *
211            * @param group the group
212            * @return the group that was removed
213            * @throws PortalException
214            */
215            @Indexable(type = IndexableType.DELETE)
216            public Group deleteGroup(Group group) throws PortalException;
217    
218            /**
219            * Deletes the group with the primary key from the database. Also notifies the appropriate model listeners.
220            *
221            * @param groupId the primary key of the group
222            * @return the group that was removed
223            * @throws PortalException if a group with the primary key could not be found
224            */
225            @Indexable(type = IndexableType.DELETE)
226            public Group deleteGroup(long groupId) throws PortalException;
227    
228            public void deleteOrganizationGroup(long organizationId, Group group);
229    
230            public void deleteOrganizationGroup(long organizationId, long groupId);
231    
232            public void deleteOrganizationGroups(long organizationId, List<Group> Groups);
233    
234            public void deleteOrganizationGroups(long organizationId, long[] groupIds);
235    
236            /**
237            * @throws PortalException
238            */
239            @Override
240            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
241                    throws PortalException;
242    
243            public void deleteRoleGroup(long roleId, Group group);
244    
245            public void deleteRoleGroup(long roleId, long groupId);
246    
247            public void deleteRoleGroups(long roleId, List<Group> Groups);
248    
249            public void deleteRoleGroups(long roleId, long[] groupIds);
250    
251            public void deleteUserGroup(long userId, Group group);
252    
253            public void deleteUserGroup(long userId, long groupId);
254    
255            public void deleteUserGroupGroup(long userGroupId, Group group);
256    
257            public void deleteUserGroupGroup(long userGroupId, long groupId);
258    
259            public void deleteUserGroupGroups(long userGroupId, List<Group> Groups);
260    
261            public void deleteUserGroupGroups(long userGroupId, long[] groupIds);
262    
263            public void deleteUserGroups(long userId, List<Group> Groups);
264    
265            public void deleteUserGroups(long userId, long[] groupIds);
266    
267            public void disableStaging(long groupId) throws PortalException;
268    
269            public DynamicQuery dynamicQuery();
270    
271            /**
272            * Performs a dynamic query on the database and returns the matching rows.
273            *
274            * @param dynamicQuery the dynamic query
275            * @return the matching rows
276            */
277            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery);
278    
279            /**
280            * Performs a dynamic query on the database and returns a range of the matching rows.
281            *
282            * <p>
283            * 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.GroupModelImpl}. 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.
284            * </p>
285            *
286            * @param dynamicQuery the dynamic query
287            * @param start the lower bound of the range of model instances
288            * @param end the upper bound of the range of model instances (not inclusive)
289            * @return the range of matching rows
290            */
291            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
292                    int end);
293    
294            /**
295            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
296            *
297            * <p>
298            * 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.GroupModelImpl}. 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.
299            * </p>
300            *
301            * @param dynamicQuery the dynamic query
302            * @param start the lower bound of the range of model instances
303            * @param end the upper bound of the range of model instances (not inclusive)
304            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
305            * @return the ordered range of matching rows
306            */
307            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
308                    int end, OrderByComparator<T> orderByComparator);
309    
310            /**
311            * Returns the number of rows matching the dynamic query.
312            *
313            * @param dynamicQuery the dynamic query
314            * @return the number of rows matching the dynamic query
315            */
316            public long dynamicQueryCount(DynamicQuery dynamicQuery);
317    
318            /**
319            * Returns the number of rows matching the dynamic query.
320            *
321            * @param dynamicQuery the dynamic query
322            * @param projection the projection to apply to the query
323            * @return the number of rows matching the dynamic query
324            */
325            public long dynamicQueryCount(DynamicQuery dynamicQuery,
326                    Projection projection);
327    
328            public void enableStaging(long groupId) throws PortalException;
329    
330            /**
331            * Returns the company's group.
332            *
333            * @param companyId the primary key of the company
334            * @return the company's group, or <code>null</code> if a matching group
335            could not be found
336            */
337            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
338            public Group fetchCompanyGroup(long companyId);
339    
340            /**
341            * Returns the group with the matching friendly URL.
342            *
343            * @param companyId the primary key of the company
344            * @param friendlyURL the friendly URL
345            * @return the group with the friendly URL, or <code>null</code> if a
346            matching group could not be found
347            */
348            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
349            public Group fetchFriendlyURLGroup(long companyId,
350                    java.lang.String friendlyURL);
351    
352            /**
353            * Returns the group with the matching group key by first searching the
354            * system groups and then using the finder cache.
355            *
356            * @param companyId the primary key of the company
357            * @param groupKey the group key
358            * @return the group with the group key and associated company, or
359            <code>null</code> if a matching group could not be found
360            */
361            @Skip
362            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
363            public Group fetchGroup(long companyId, java.lang.String groupKey);
364    
365            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
366            public Group fetchGroup(long groupId);
367    
368            /**
369            * Returns the group with the matching UUID and company.
370            *
371            * @param uuid the group's UUID
372            * @param companyId the primary key of the company
373            * @return the matching group, or <code>null</code> if a matching group could not be found
374            */
375            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
376            public Group fetchGroupByUuidAndCompanyId(java.lang.String uuid,
377                    long companyId);
378    
379            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
380            public Group fetchUserGroup(long companyId, long userId);
381    
382            /**
383            * Returns the default user's personal site group.
384            *
385            * @param companyId the primary key of the company
386            * @return the default user's personal site group, or <code>null</code> if a
387            matching group could not be found
388            * @throws PortalException if a portal exception occurred
389            */
390            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
391            public Group fetchUserPersonalSiteGroup(long companyId)
392                    throws PortalException;
393    
394            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
395            public ActionableDynamicQuery getActionableDynamicQuery();
396    
397            /**
398            * Returns all the active or inactive groups associated with the company.
399            *
400            * @param companyId the primary key of the company
401            * @param active whether to return only active groups, or only inactive
402            groups
403            * @return the active or inactive groups associated with the company
404            */
405            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
406            public List<Group> getActiveGroups(long companyId, boolean active);
407    
408            /**
409            * Returns the company group.
410            *
411            * @param companyId the primary key of the company
412            * @return the group associated with the company
413            * @throws PortalException if a portal exception occurred
414            */
415            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
416            public Group getCompanyGroup(long companyId) throws PortalException;
417    
418            /**
419            * Returns a range of all the groups associated with the company.
420            *
421            * <p>
422            * Useful when paginating results. Returns a maximum of <code>end -
423            * start</code> instances. <code>start</code> and <code>end</code> are not
424            * primary keys, they are indexes in the result set. Thus, <code>0</code>
425            * refers to the first result in the set. Setting both <code>start</code>
426            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
427            * result set.
428            * </p>
429            *
430            * @param companyId the primary key of the company
431            * @param start the lower bound of the range of groups to return
432            * @param end the upper bound of the range of groups to return (not
433            inclusive)
434            * @return the range of groups associated with the company
435            */
436            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
437            public List<Group> getCompanyGroups(long companyId, int start, int end);
438    
439            /**
440            * Returns the number of groups associated with the company.
441            *
442            * @param companyId the primary key of the company
443            * @return the number of groups associated with the company
444            */
445            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
446            public int getCompanyGroupsCount(long companyId);
447    
448            /**
449            * Returns the group with the matching friendly URL.
450            *
451            * @param companyId the primary key of the company
452            * @param friendlyURL the group's friendlyURL
453            * @return the group with the friendly URL
454            * @throws PortalException if a portal exception occurred
455            */
456            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
457            public Group getFriendlyURLGroup(long companyId,
458                    java.lang.String friendlyURL) throws PortalException;
459    
460            /**
461            * Returns the group with the matching group key.
462            *
463            * @param companyId the primary key of the company
464            * @param groupKey the group key
465            * @return the group with the group key
466            * @throws PortalException if a portal exception occurred
467            */
468            @Skip
469            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
470            public Group getGroup(long companyId, java.lang.String groupKey)
471                    throws PortalException;
472    
473            /**
474            * Returns the group with the primary key.
475            *
476            * @param groupId the primary key of the group
477            * @return the group
478            * @throws PortalException if a group with the primary key could not be found
479            */
480            @ThreadLocalCachable
481            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
482            public Group getGroup(long groupId) throws PortalException;
483    
484            /**
485            * Returns the group with the matching UUID and company.
486            *
487            * @param uuid the group's UUID
488            * @param companyId the primary key of the company
489            * @return the matching group
490            * @throws PortalException if a matching group could not be found
491            */
492            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
493            public Group getGroupByUuidAndCompanyId(java.lang.String uuid,
494                    long companyId) throws PortalException;
495    
496            /**
497            * @deprecated As of 7.0.0, replaced by {@link
498            Group#getDescriptiveName(Locale)}
499            */
500            @java.lang.Deprecated
501            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
502            public java.lang.String getGroupDescriptiveName(Group group, Locale locale)
503                    throws PortalException;
504    
505            /**
506            * @deprecated As of 7.0.0, replaced by {@link
507            Group#getDescriptiveName(Locale)}
508            */
509            @java.lang.Deprecated
510            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
511            public java.lang.String getGroupDescriptiveName(long groupId, Locale locale)
512                    throws PortalException;
513    
514            /**
515            * Returns all the groups that are direct children of the parent group with
516            * the matching className.
517            *
518            * @param companyId the primary key of the company
519            * @param className the class name of the group
520            * @param parentGroupId the primary key of the parent group
521            * @return the matching groups, or <code>null</code> if no matches were
522            found
523            */
524            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
525            public List<Group> getGroups(long companyId, java.lang.String className,
526                    long parentGroupId);
527    
528            /**
529            * Returns a range of all the groups that are direct children of the parent
530            * group with the matching className.
531            *
532            * @param companyId the primary key of the company
533            * @param className the class name of the group
534            * @param parentGroupId the primary key of the parent group
535            * @param start the lower bound of the range of results
536            * @param end the upper bound of the range of results (not inclusive)
537            * @return the range of matching groups
538            */
539            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
540            public List<Group> getGroups(long companyId, java.lang.String className,
541                    long parentGroupId, int start, int end);
542    
543            /**
544            * Returns all the groups that are direct children of the parent group.
545            *
546            * @param companyId the primary key of the company
547            * @param parentGroupId the primary key of the parent group
548            * @param site whether the group is to be associated with a main site
549            * @return the matching groups, or <code>null</code> if no matches were
550            found
551            */
552            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
553            public List<Group> getGroups(long companyId, long parentGroupId,
554                    boolean site);
555    
556            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
557            public List<Group> getGroups(long companyId, long parentGroupId,
558                    boolean site, boolean inheritContent);
559    
560            /**
561            * Returns the groups with the matching primary keys.
562            *
563            * @param groupIds the primary keys of the groups
564            * @return the groups with the primary keys
565            * @throws PortalException if a portal exception occurred
566            */
567            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
568            public List<Group> getGroups(long[] groupIds) throws PortalException;
569    
570            /**
571            * Returns a range of all the groups.
572            *
573            * <p>
574            * 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.GroupModelImpl}. 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.
575            * </p>
576            *
577            * @param start the lower bound of the range of groups
578            * @param end the upper bound of the range of groups (not inclusive)
579            * @return the range of groups
580            */
581            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
582            public List<Group> getGroups(int start, int end);
583    
584            /**
585            * Returns the number of groups.
586            *
587            * @return the number of groups
588            */
589            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
590            public int getGroupsCount();
591    
592            /**
593            * Returns the number of groups that are direct children of the parent group
594            * with the matching className.
595            *
596            * @param companyId the primary key of the company
597            * @param className the class name of the group
598            * @param parentGroupId the primary key of the parent group
599            * @return the number of matching groups
600            */
601            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
602            public int getGroupsCount(long companyId, java.lang.String className,
603                    long parentGroupId);
604    
605            /**
606            * Returns the number of groups that are direct children of the parent
607            * group.
608            *
609            * @param companyId the primary key of the company
610            * @param parentGroupId the primary key of the parent group
611            * @param site whether the group is to be associated with a main site
612            * @return the number of matching groups
613            */
614            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
615            public int getGroupsCount(long companyId, long parentGroupId, boolean site);
616    
617            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
618            public IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
619    
620            /**
621            * Returns the group associated with the layout.
622            *
623            * @param companyId the primary key of the company
624            * @param plid the primary key of the layout
625            * @return the group associated with the layout
626            * @throws PortalException if a portal exception occurred
627            */
628            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
629            public Group getLayoutGroup(long companyId, long plid)
630                    throws PortalException;
631    
632            /**
633            * Returns the group associated with the layout prototype.
634            *
635            * @param companyId the primary key of the company
636            * @param layoutPrototypeId the primary key of the layout prototype
637            * @return the group associated with the layout prototype
638            * @throws PortalException if a portal exception occurred
639            */
640            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
641            public Group getLayoutPrototypeGroup(long companyId, long layoutPrototypeId)
642                    throws PortalException;
643    
644            /**
645            * Returns the group associated with the layout set prototype.
646            *
647            * @param companyId the primary key of the company
648            * @param layoutSetPrototypeId the primary key of the layout set prototype
649            * @return the group associated with the layout set prototype
650            * @throws PortalException if a portal exception occurred
651            */
652            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
653            public Group getLayoutSetPrototypeGroup(long companyId,
654                    long layoutSetPrototypeId) throws PortalException;
655    
656            /**
657            * Returns a range of all groups that are children of the parent group and
658            * that have at least one layout.
659            *
660            * <p>
661            * Useful when paginating results. Returns a maximum of <code>end -
662            * start</code> instances. <code>start</code> and <code>end</code> are not
663            * primary keys, they are indexes in the result set. Thus, <code>0</code>
664            * refers to the first result in the set. Setting both <code>start</code>
665            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
666            * result set.
667            * </p>
668            *
669            * @param companyId the primary key of the company
670            * @param parentGroupId the primary key of the parent group
671            * @param site whether the group is to be associated with a main site
672            * @param start the lower bound of the range of groups to return
673            * @param end the upper bound of the range of groups to return (not
674            inclusive)
675            * @param obc the comparator to order the groups (optionally
676            <code>null</code>)
677            * @return the range of matching groups ordered by comparator
678            <code>obc</code>
679            */
680            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
681            public List<Group> getLayoutsGroups(long companyId, long parentGroupId,
682                    boolean site, int start, int end, OrderByComparator<Group> obc);
683    
684            /**
685            * Returns the number of groups that are children or the parent group and
686            * that have at least one layout
687            *
688            * @param companyId the primary key of the company
689            * @param parentGroupId the primary key of the parent group
690            * @param site whether the group is to be associated with a main site
691            * @return the number of matching groups
692            */
693            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
694            public int getLayoutsGroupsCount(long companyId, long parentGroupId,
695                    boolean site);
696    
697            /**
698            * Returns all live groups.
699            *
700            * @return all live groups
701            */
702            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
703            public List<Group> getLiveGroups();
704    
705            /**
706            * Returns a range of all non-system groups of a specified type (className)
707            * that have no layouts.
708            *
709            * <p>
710            * Useful when paginating results. Returns a maximum of <code>end -
711            * start</code> instances. <code>start</code> and <code>end</code> are not
712            * primary keys, they are indexes in the result set. Thus, <code>0</code>
713            * refers to the first result in the set. Setting both <code>start</code>
714            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
715            * result set.
716            * </p>
717            *
718            * @param className the entity's class name
719            * @param privateLayout whether to include groups with private layout sets
720            or non-private layout sets
721            * @param start the lower bound of the range of groups to return
722            * @param end the upper bound of the range of groups to return (not
723            inclusive)
724            * @return the range of matching groups
725            */
726            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
727            public List<Group> getNoLayoutsGroups(java.lang.String className,
728                    boolean privateLayout, int start, int end);
729    
730            /**
731            * Returns all non-system groups having <code>null</code> or empty friendly
732            * URLs.
733            *
734            * @return the non-system groups having <code>null</code> or empty friendly
735            URLs
736            */
737            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
738            public List<Group> getNullFriendlyURLGroups();
739    
740            /**
741            * Returns the OSGi service identifier.
742            *
743            * @return the OSGi service identifier
744            */
745            public java.lang.String getOSGiServiceIdentifier();
746    
747            /**
748            * Returns the specified organization group.
749            *
750            * @param companyId the primary key of the company
751            * @param organizationId the primary key of the organization
752            * @return the group associated with the organization
753            * @throws PortalException if a portal exception occurred
754            */
755            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
756            public Group getOrganizationGroup(long companyId, long organizationId)
757                    throws PortalException;
758    
759            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
760            public List<Group> getOrganizationGroups(long organizationId);
761    
762            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
763            public List<Group> getOrganizationGroups(long organizationId, int start,
764                    int end);
765    
766            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
767            public List<Group> getOrganizationGroups(long organizationId, int start,
768                    int end, OrderByComparator<Group> orderByComparator);
769    
770            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
771            public int getOrganizationGroupsCount(long organizationId);
772    
773            /**
774            * Returns the organizationIds of the organizations associated with the group.
775            *
776            * @param groupId the groupId of the group
777            * @return long[] the organizationIds of organizations associated with the group
778            */
779            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
780            public long[] getOrganizationPrimaryKeys(long groupId);
781    
782            /**
783            * Returns the specified organization groups.
784            *
785            * @param organizations the organizations
786            * @return the groups associated with the organizations
787            */
788            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
789            public List<Group> getOrganizationsGroups(List<Organization> organizations);
790    
791            /**
792            * Returns all the groups related to the organizations.
793            *
794            * @param organizations the organizations
795            * @return the groups related to the organizations
796            */
797            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
798            public List<Group> getOrganizationsRelatedGroups(
799                    List<Organization> organizations);
800    
801            /**
802            * Returns the group followed by all its parent groups ordered by closest
803            * ancestor.
804            *
805            * @param groupId the primary key of the group
806            * @return the group followed by all its parent groups ordered by closest
807            ancestor
808            * @throws PortalException if a portal exception occurred
809            */
810            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
811            public List<Group> getParentGroups(long groupId) throws PortalException;
812    
813            @Override
814            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
815            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
816                    throws PortalException;
817    
818            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
819            public List<Group> getRoleGroups(long roleId);
820    
821            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
822            public List<Group> getRoleGroups(long roleId, int start, int end);
823    
824            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
825            public List<Group> getRoleGroups(long roleId, int start, int end,
826                    OrderByComparator<Group> orderByComparator);
827    
828            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
829            public int getRoleGroupsCount(long roleId);
830    
831            /**
832            * Returns the roleIds of the roles associated with the group.
833            *
834            * @param groupId the groupId of the group
835            * @return long[] the roleIds of roles associated with the group
836            */
837            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
838            public long[] getRolePrimaryKeys(long groupId);
839    
840            /**
841            * Returns the staging group.
842            *
843            * @param liveGroupId the primary key of the live group
844            * @return the staging group
845            * @throws PortalException if a portal exception occurred
846            */
847            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
848            public Group getStagingGroup(long liveGroupId) throws PortalException;
849    
850            /**
851            * Returns the group directly associated with the user.
852            *
853            * @param companyId the primary key of the company
854            * @param userId the primary key of the user
855            * @return the group directly associated with the user
856            * @throws PortalException if a portal exception occurred
857            */
858            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
859            public Group getUserGroup(long companyId, long userId)
860                    throws PortalException;
861    
862            /**
863            * Returns the specified "user group" group. That is, the group that
864            * represents the {@link UserGroup} entity.
865            *
866            * @param companyId the primary key of the company
867            * @param userGroupId the primary key of the user group
868            * @return the group associated with the user group
869            * @throws PortalException if a portal exception occurred
870            */
871            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
872            public Group getUserGroupGroup(long companyId, long userGroupId)
873                    throws PortalException;
874    
875            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
876            public List<Group> getUserGroupGroups(long userGroupId);
877    
878            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
879            public List<Group> getUserGroupGroups(long userGroupId, int start, int end);
880    
881            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
882            public List<Group> getUserGroupGroups(long userGroupId, int start, int end,
883                    OrderByComparator<Group> orderByComparator);
884    
885            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
886            public int getUserGroupGroupsCount(long userGroupId);
887    
888            /**
889            * Returns the userGroupIds of the user groups associated with the group.
890            *
891            * @param groupId the groupId of the group
892            * @return long[] the userGroupIds of user groups associated with the group
893            */
894            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
895            public long[] getUserGroupPrimaryKeys(long groupId);
896    
897            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
898            public List<Group> getUserGroups(long userId);
899    
900            /**
901            * Returns all the user's site groups and immediate organization groups,
902            * optionally including the user's inherited organization groups and user
903            * groups. System and staged groups are not included.
904            *
905            * @param userId the primary key of the user
906            * @param inherit whether to include the user's inherited organization
907            groups and user groups
908            * @return the user's groups and immediate organization groups
909            * @throws PortalException if a portal exception occurred
910            */
911            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
912            public List<Group> getUserGroups(long userId, boolean inherit)
913                    throws PortalException;
914    
915            /**
916            * Returns an ordered range of all the user's site groups and immediate
917            * organization groups, optionally including the user's inherited
918            * organization groups and user groups. System and staged groups are not
919            * included.
920            *
921            * <p>
922            * Useful when paginating results. Returns a maximum of <code>end -
923            * start</code> instances. <code>start</code> and <code>end</code> are not
924            * primary keys, they are indexes in the result set. Thus, <code>0</code>
925            * refers to the first result in the set. Setting both <code>start</code>
926            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
927            * result set.
928            * </p>
929            *
930            * @param userId the primary key of the user
931            * @param inherit whether to include the user's inherited organization
932            groups and user groups
933            * @param start the lower bound of the range of groups to return
934            * @param end the upper bound of the range of groups to return (not
935            inclusive)
936            * @return the range of the user's groups and immediate organization groups
937            ordered by name
938            * @throws PortalException if a portal exception occurred
939            */
940            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
941            public List<Group> getUserGroups(long userId, boolean inherit, int start,
942                    int end) throws PortalException;
943    
944            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
945            public List<Group> getUserGroups(long userId, int start, int end);
946    
947            /**
948            * @throws PortalException
949            */
950            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
951            public List<Group> getUserGroups(long userId, int start, int end,
952                    OrderByComparator<Group> orderByComparator) throws PortalException;
953    
954            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
955            public int getUserGroupsCount(long userId);
956    
957            /**
958            * Returns the groups associated with the user groups.
959            *
960            * @param userGroups the user groups
961            * @return the groups associated with the user groups
962            * @throws PortalException if a portal exception occurred
963            */
964            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
965            public List<Group> getUserGroupsGroups(List<UserGroup> userGroups)
966                    throws PortalException;
967    
968            /**
969            * Returns all the groups related to the user groups.
970            *
971            * @param userGroups the user groups
972            * @return the groups related to the user groups
973            */
974            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
975            public List<Group> getUserGroupsRelatedGroups(List<UserGroup> userGroups);
976    
977            /**
978            * Returns the range of all groups associated with the user's organization
979            * groups, including the ancestors of the organization groups, unless portal
980            * property <code>organizations.membership.strict</code> is set to
981            * <code>true</code>.
982            *
983            * <p>
984            * Useful when paginating results. Returns a maximum of <code>end -
985            * start</code> instances. <code>start</code> and <code>end</code> are not
986            * primary keys, they are indexes in the result set. Thus, <code>0</code>
987            * refers to the first result in the set. Setting both <code>start</code>
988            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
989            * result set.
990            * </p>
991            *
992            * @param userId the primary key of the user
993            * @param start the lower bound of the range of groups to consider
994            * @param end the upper bound of the range of groups to consider (not
995            inclusive)
996            * @return the range of groups associated with the user's organization
997            groups
998            * @throws PortalException if a portal exception occurred
999            */
1000            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1001            public List<Group> getUserOrganizationsGroups(long userId, int start,
1002                    int end) throws PortalException;
1003    
1004            /**
1005            * Returns the default user's personal site group.
1006            *
1007            * @param companyId the primary key of the company
1008            * @return the default user's personal site group
1009            * @throws PortalException if a portal exception occurred
1010            */
1011            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1012            public Group getUserPersonalSiteGroup(long companyId)
1013                    throws PortalException;
1014    
1015            /**
1016            * Returns the userIds of the users associated with the group.
1017            *
1018            * @param groupId the groupId of the group
1019            * @return long[] the userIds of users associated with the group
1020            */
1021            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1022            public long[] getUserPrimaryKeys(long groupId);
1023    
1024            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1025            public List<Group> getUserSitesGroups(long userId)
1026                    throws PortalException;
1027    
1028            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1029            public List<Group> getUserSitesGroups(long userId,
1030                    boolean includeAdministrative) throws PortalException;
1031    
1032            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1033            public boolean hasOrganizationGroup(long organizationId, long groupId);
1034    
1035            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1036            public boolean hasOrganizationGroups(long organizationId);
1037    
1038            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1039            public boolean hasRoleGroup(long roleId, long groupId);
1040    
1041            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1042            public boolean hasRoleGroups(long roleId);
1043    
1044            /**
1045            * Returns <code>true</code> if the live group has a staging group.
1046            *
1047            * @param liveGroupId the primary key of the live group
1048            * @return <code>true</code> if the live group has a staging group;
1049            <code>false</code> otherwise
1050            */
1051            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1052            public boolean hasStagingGroup(long liveGroupId);
1053    
1054            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1055            public boolean hasUserGroup(long userId, long groupId);
1056    
1057            /**
1058            * Returns <code>true</code> if the user is immediately associated with the
1059            * group, or optionally if the user is associated with the group via the
1060            * user's organizations, inherited organizations, or user groups.
1061            *
1062            * @param userId the primary key of the user
1063            * @param groupId the primary key of the group
1064            * @param inherit whether to include organization groups and user groups to
1065            which the user belongs in the determination
1066            * @return <code>true</code> if the user is associated with the group;
1067            <code>false</code> otherwise
1068            */
1069            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1070            public boolean hasUserGroup(long userId, long groupId, boolean inherit);
1071    
1072            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1073            public boolean hasUserGroupGroup(long userGroupId, long groupId);
1074    
1075            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1076            public boolean hasUserGroupGroups(long userGroupId);
1077    
1078            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1079            public boolean hasUserGroups(long userId);
1080    
1081            /**
1082            * Returns the group with the matching group key by first searching the
1083            * system groups and then using the finder cache.
1084            *
1085            * @param companyId the primary key of the company
1086            * @param groupKey the group key
1087            * @return the group with the group key and associated company, or
1088            <code>null</code> if a matching group could not be found
1089            */
1090            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1091            public Group loadFetchGroup(long companyId, java.lang.String groupKey);
1092    
1093            /**
1094            * Returns the group with the matching group key.
1095            *
1096            * @param companyId the primary key of the company
1097            * @param groupKey the group key
1098            * @return the group with the group key and associated company
1099            * @throws PortalException if a portal exception occurred
1100            */
1101            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1102            public Group loadGetGroup(long companyId, java.lang.String groupKey)
1103                    throws PortalException;
1104    
1105            /**
1106            * Rebuilds the group tree.
1107            *
1108            * <p>
1109            * Only call this method if the tree has become stale through operations
1110            * other than normal CRUD. Under normal circumstances the tree is
1111            * automatically rebuilt whenever necessary.
1112            * </p>
1113            *
1114            * @param companyId the primary key of the group's company
1115            * @throws PortalException if a portal exception occurred
1116            */
1117            public void rebuildTree(long companyId) throws PortalException;
1118    
1119            /**
1120            * Returns an ordered range of all the groups that match the class name IDs
1121            * and keywords, optionally including the user's inherited organization
1122            * groups and user groups. System and staged groups are not included.
1123            *
1124            * <p>
1125            * Useful when paginating results. Returns a maximum of <code>end -
1126            * start</code> instances. <code>start</code> and <code>end</code> are not
1127            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1128            * refers to the first result in the set. Setting both <code>start</code>
1129            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1130            * result set.
1131            * </p>
1132            *
1133            * @param companyId the primary key of the company
1134            * @param classNameIds the primary keys of the class names of the entities
1135            the groups are related to (optionally <code>null</code>)
1136            * @param keywords the keywords (space separated), which may occur in the
1137            sites's name, or description (optionally <code>null</code>)
1138            * @param params the finder params (optionally <code>null</code>). To
1139            include a user's organizations, inherited organizations, and user
1140            groups in the search, add an entry with key
1141            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1142            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1143            For more information see {@link
1144            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1145            * @param start the lower bound of the range of groups to return
1146            * @param end the upper bound of the range of groups to return (not
1147            inclusive)
1148            * @return the matching groups ordered by name
1149            */
1150            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1151            public List<Group> search(long companyId, long[] classNameIds,
1152                    java.lang.String keywords,
1153                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1154                    int end);
1155    
1156            /**
1157            * Returns an ordered range of all the groups that match the class name IDs
1158            * and keywords, optionally including the user's inherited organization
1159            * groups and user groups. System and staged groups are not included.
1160            *
1161            * <p>
1162            * Useful when paginating results. Returns a maximum of <code>end -
1163            * start</code> instances. <code>start</code> and <code>end</code> are not
1164            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1165            * refers to the first result in the set. Setting both <code>start</code>
1166            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1167            * result set.
1168            * </p>
1169            *
1170            * @param companyId the primary key of the company
1171            * @param classNameIds the primary keys of the class names of the entities
1172            the groups are related to (optionally <code>null</code>)
1173            * @param keywords the keywords (space separated), which may occur in the
1174            sites's name, or description (optionally <code>null</code>)
1175            * @param params the finder params (optionally <code>null</code>). To
1176            include a user's organizations, inherited organizations, and user
1177            groups in the search, add an entry with key
1178            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1179            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1180            For more information see {@link
1181            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1182            * @param start the lower bound of the range of groups to return
1183            * @param end the upper bound of the range of groups to return (not
1184            inclusive)
1185            * @param obc the comparator to order the groups (optionally
1186            <code>null</code>)
1187            * @return the matching groups ordered by comparator <code>obc</code>
1188            */
1189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1190            public List<Group> search(long companyId, long[] classNameIds,
1191                    java.lang.String keywords,
1192                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1193                    int end, OrderByComparator<Group> obc);
1194    
1195            /**
1196            * Returns an ordered range of all the groups that match the class name IDs,
1197            * name, and description, optionally including the user's inherited
1198            * organization groups and user groups. System and staged groups are not
1199            * included.
1200            *
1201            * <p>
1202            * Useful when paginating results. Returns a maximum of <code>end -
1203            * start</code> instances. <code>start</code> and <code>end</code> are not
1204            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1205            * refers to the first result in the set. Setting both <code>start</code>
1206            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1207            * result set.
1208            * </p>
1209            *
1210            * @param companyId the primary key of the company
1211            * @param classNameIds the primary keys of the class names of the entities
1212            the groups are related to (optionally <code>null</code>)
1213            * @param name the group's name (optionally <code>null</code>)
1214            * @param description the group's description (optionally
1215            <code>null</code>)
1216            * @param params the finder params (optionally <code>null</code>). To
1217            include a user's organizations, inherited organizations, and user
1218            groups in the search, add an entry with key
1219            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1220            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1221            For more information see {@link
1222            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1223            * @param andOperator whether every field must match its keywords, or just
1224            one field.
1225            * @param start the lower bound of the range of groups to return
1226            * @param end the upper bound of the range of groups to return (not
1227            inclusive)
1228            * @return the matching groups ordered by name
1229            */
1230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1231            public List<Group> search(long companyId, long[] classNameIds,
1232                    java.lang.String name, java.lang.String description,
1233                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1234                    boolean andOperator, int start, int end);
1235    
1236            /**
1237            * Returns an ordered range of all the groups that match the class name IDs,
1238            * name, and description, optionally including the user's inherited
1239            * organization groups and user groups. System and staged groups are not
1240            * included.
1241            *
1242            * <p>
1243            * Useful when paginating results. Returns a maximum of <code>end -
1244            * start</code> instances. <code>start</code> and <code>end</code> are not
1245            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1246            * refers to the first result in the set. Setting both <code>start</code>
1247            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1248            * result set.
1249            * </p>
1250            *
1251            * @param companyId the primary key of the company
1252            * @param classNameIds the primary keys of the class names of the entities
1253            the groups are related to (optionally <code>null</code>)
1254            * @param name the group's name (optionally <code>null</code>)
1255            * @param description the group's description (optionally
1256            <code>null</code>)
1257            * @param params the finder params (optionally <code>null</code>). To
1258            include a user's organizations, inherited organizations, and user
1259            groups in the search, add an entry with key
1260            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1261            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1262            For more information see {@link
1263            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1264            * @param andOperator whether every field must match its keywords, or just
1265            one field.
1266            * @param start the lower bound of the range of groups to return
1267            * @param end the upper bound of the range of groups to return (not
1268            inclusive)
1269            * @param obc the comparator to order the groups (optionally
1270            <code>null</code>)
1271            * @return the matching groups ordered by comparator <code>obc</code>
1272            */
1273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1274            public List<Group> search(long companyId, long[] classNameIds,
1275                    java.lang.String name, java.lang.String description,
1276                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1277                    boolean andOperator, int start, int end, OrderByComparator<Group> obc);
1278    
1279            /**
1280            * Returns an ordered range of all the groups belonging to the parent group
1281            * that match the class name IDs and keywords, optionally including the
1282            * user's inherited organization groups and user groups. System and staged
1283            * groups are not included.
1284            *
1285            * <p>
1286            * Useful when paginating results. Returns a maximum of <code>end -
1287            * start</code> instances. <code>start</code> and <code>end</code> are not
1288            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1289            * refers to the first result in the set. Setting both <code>start</code>
1290            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1291            * result set.
1292            * </p>
1293            *
1294            * @param companyId the primary key of the company
1295            * @param classNameIds the primary keys of the class names of the entities
1296            the groups are related to (optionally <code>null</code>)
1297            * @param parentGroupId the primary key of the parent group
1298            * @param keywords the keywords (space separated), which may occur in the
1299            sites's name, or description (optionally <code>null</code>)
1300            * @param params the finder params (optionally <code>null</code>). To
1301            include a user's organizations, inherited organizations, and user
1302            groups in the search, add an entry with key
1303            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1304            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1305            For more information see {@link
1306            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1307            * @param start the lower bound of the range of groups to return
1308            * @param end the upper bound of the range of groups to return (not
1309            inclusive)
1310            * @return the matching groups ordered by name
1311            */
1312            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1313            public List<Group> search(long companyId, long[] classNameIds,
1314                    long parentGroupId, java.lang.String keywords,
1315                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1316                    int end);
1317    
1318            /**
1319            * Returns an ordered range of all the groups belonging to the parent group
1320            * that match the class name IDs and keywords, optionally including the
1321            * user's inherited organization groups and user groups. System and staged
1322            * groups are not included.
1323            *
1324            * <p>
1325            * Useful when paginating results. Returns a maximum of <code>end -
1326            * start</code> instances. <code>start</code> and <code>end</code> are not
1327            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1328            * refers to the first result in the set. Setting both <code>start</code>
1329            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1330            * result set.
1331            * </p>
1332            *
1333            * @param companyId the primary key of the company
1334            * @param classNameIds the primary keys of the class names of the entities
1335            the groups are related to (optionally <code>null</code>)
1336            * @param parentGroupId the primary key of the parent group
1337            * @param keywords the keywords (space separated), which may occur in the
1338            sites's name, or description (optionally <code>null</code>)
1339            * @param params the finder params (optionally <code>null</code>). To
1340            include a user's organizations, inherited organizations, and user
1341            groups in the search, add an entry with key
1342            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1343            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1344            For more information see {@link
1345            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1346            * @param start the lower bound of the range of groups to return
1347            * @param end the upper bound of the range of groups to return (not
1348            inclusive)
1349            * @param obc the comparator to order the groups (optionally
1350            <code>null</code>)
1351            * @return the matching groups ordered by comparator <code>obc</code>
1352            */
1353            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1354            public List<Group> search(long companyId, long[] classNameIds,
1355                    long parentGroupId, java.lang.String keywords,
1356                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1357                    int end, OrderByComparator<Group> obc);
1358    
1359            /**
1360            * Returns an ordered range of all the groups belonging to the parent group
1361            * that match the class name IDs, name, and description, optionally
1362            * including the user's inherited organization groups and user groups.
1363            * System and staged groups are not included.
1364            *
1365            * <p>
1366            * Useful when paginating results. Returns a maximum of <code>end -
1367            * start</code> instances. <code>start</code> and <code>end</code> are not
1368            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1369            * refers to the first result in the set. Setting both <code>start</code>
1370            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1371            * result set.
1372            * </p>
1373            *
1374            * @param companyId the primary key of the company
1375            * @param classNameIds the primary keys of the class names of the entities
1376            the groups are related to (optionally <code>null</code>)
1377            * @param parentGroupId the primary key of the parent group
1378            * @param name the group's name (optionally <code>null</code>)
1379            * @param description the group's description (optionally
1380            <code>null</code>)
1381            * @param params the finder params (optionally <code>null</code>). To
1382            include a user's organizations, inherited organizations, and user
1383            groups in the search, add an entry with key
1384            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1385            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1386            For more information see {@link
1387            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1388            * @param andOperator whether every field must match its keywords, or just
1389            one field.
1390            * @param start the lower bound of the range of groups to return
1391            * @param end the upper bound of the range of groups to return (not
1392            inclusive)
1393            * @return the matching groups ordered by name
1394            */
1395            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1396            public List<Group> search(long companyId, long[] classNameIds,
1397                    long parentGroupId, java.lang.String name,
1398                    java.lang.String description,
1399                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1400                    boolean andOperator, int start, int end);
1401    
1402            /**
1403            * Returns an ordered range of all the groups belonging to the parent group
1404            * that match the class name IDs, name, and description, optionally
1405            * including the user's inherited organization groups and user groups.
1406            * System and staged groups are not included.
1407            *
1408            * <p>
1409            * Useful when paginating results. Returns a maximum of <code>end -
1410            * start</code> instances. <code>start</code> and <code>end</code> are not
1411            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1412            * refers to the first result in the set. Setting both <code>start</code>
1413            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1414            * result set.
1415            * </p>
1416            *
1417            * @param companyId the primary key of the company
1418            * @param classNameIds the primary keys of the class names of the entities
1419            the groups are related to (optionally <code>null</code>)
1420            * @param parentGroupId the primary key of the parent group
1421            * @param name the group's name (optionally <code>null</code>)
1422            * @param description the group's description (optionally
1423            <code>null</code>)
1424            * @param params the finder params (optionally <code>null</code>). To
1425            include a user's organizations, inherited organizations, and user
1426            groups in the search, add an entry with key
1427            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1428            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1429            For more information see {@link
1430            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1431            * @param andOperator whether every field must match its keywords, or just
1432            one field.
1433            * @param start the lower bound of the range of groups to return
1434            * @param end the upper bound of the range of groups to return (not
1435            inclusive)
1436            * @param obc the comparator to order the groups (optionally
1437            <code>null</code>)
1438            * @return the matching groups ordered by comparator <code>obc</code>
1439            */
1440            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1441            public List<Group> search(long companyId, long[] classNameIds,
1442                    long parentGroupId, java.lang.String name,
1443                    java.lang.String description,
1444                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1445                    boolean andOperator, int start, int end, OrderByComparator<Group> obc);
1446    
1447            /**
1448            * Returns an ordered range of all the groups that match the keywords,
1449            * optionally including the user's inherited organization groups and user
1450            * groups. System and staged groups are not included.
1451            *
1452            * <p>
1453            * Useful when paginating results. Returns a maximum of <code>end -
1454            * start</code> instances. <code>start</code> and <code>end</code> are not
1455            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1456            * refers to the first result in the set. Setting both <code>start</code>
1457            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1458            * result set.
1459            * </p>
1460            *
1461            * @param companyId the primary key of the company
1462            * @param keywords the keywords (space separated), which may occur in the
1463            sites's name, or description (optionally <code>null</code>)
1464            * @param params the finder params (optionally <code>null</code>). To
1465            include the user's inherited organizations and user groups in the
1466            search, add entries having &quot;usersGroups&quot; and
1467            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1468            information see {@link
1469            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1470            * @param start the lower bound of the range of groups to return
1471            * @param end the upper bound of the range of groups to return (not
1472            inclusive)
1473            * @return the matching groups ordered by name
1474            */
1475            @ThreadLocalCachable
1476            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1477            public List<Group> search(long companyId, java.lang.String keywords,
1478                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1479                    int end);
1480    
1481            /**
1482            * Returns an ordered range of all the groups that match the keywords,
1483            * optionally including the user's inherited organization groups and user
1484            * groups. System and staged groups are not included.
1485            *
1486            * <p>
1487            * Useful when paginating results. Returns a maximum of <code>end -
1488            * start</code> instances. <code>start</code> and <code>end</code> are not
1489            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1490            * refers to the first result in the set. Setting both <code>start</code>
1491            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1492            * result set.
1493            * </p>
1494            *
1495            * @param companyId the primary key of the company
1496            * @param keywords the keywords (space separated), which may occur in the
1497            sites's name, or description (optionally <code>null</code>)
1498            * @param params the finder params (optionally <code>null</code>). To
1499            include the user's inherited organizations and user groups in the
1500            search, add entries having &quot;usersGroups&quot; and
1501            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1502            information see {@link
1503            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1504            * @param start the lower bound of the range of groups to return
1505            * @param end the upper bound of the range of groups to return (not
1506            inclusive)
1507            * @param obc the comparator to order the groups (optionally
1508            <code>null</code>)
1509            * @return the matching groups ordered by comparator <code>obc</code>
1510            */
1511            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1512            public List<Group> search(long companyId, java.lang.String keywords,
1513                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1514                    int end, OrderByComparator<Group> obc);
1515    
1516            /**
1517            * Returns an ordered range of all the site groups and organization groups
1518            * that match the name and description, optionally including the user's
1519            * inherited organization groups and user groups. System and staged groups
1520            * are not included.
1521            *
1522            * <p>
1523            * Useful when paginating results. Returns a maximum of <code>end -
1524            * start</code> instances. <code>start</code> and <code>end</code> are not
1525            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1526            * refers to the first result in the set. Setting both <code>start</code>
1527            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1528            * result set.
1529            * </p>
1530            *
1531            * @param companyId the primary key of the company
1532            * @param name the group's name (optionally <code>null</code>)
1533            * @param description the group's description (optionally
1534            <code>null</code>)
1535            * @param params the finder params (optionally <code>null</code>). To
1536            include the user's inherited organizations and user groups in the
1537            search, add entries having &quot;usersGroups&quot; and
1538            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1539            information see {@link
1540            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1541            * @param andOperator whether every field must match its keywords, or just
1542            one field.
1543            * @param start the lower bound of the range of groups to return
1544            * @param end the upper bound of the range of groups to return (not
1545            inclusive)
1546            * @return the matching groups ordered by name
1547            */
1548            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1549            public List<Group> search(long companyId, java.lang.String name,
1550                    java.lang.String description,
1551                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1552                    boolean andOperator, int start, int end);
1553    
1554            /**
1555            * Returns an ordered range of all the site groups and organization groups
1556            * that match the name and description, optionally including the user's
1557            * inherited organization groups and user groups. System and staged groups
1558            * are not included.
1559            *
1560            * <p>
1561            * Useful when paginating results. Returns a maximum of <code>end -
1562            * start</code> instances. <code>start</code> and <code>end</code> are not
1563            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1564            * refers to the first result in the set. Setting both <code>start</code>
1565            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1566            * result set.
1567            * </p>
1568            *
1569            * @param companyId the primary key of the company
1570            * @param name the group's name (optionally <code>null</code>)
1571            * @param description the group's description (optionally
1572            <code>null</code>)
1573            * @param params the finder params (optionally <code>null</code>). To
1574            include the user's inherited organizations and user groups in the
1575            search, add entries having &quot;usersGroups&quot; and
1576            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1577            information see {@link
1578            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1579            * @param andOperator whether every field must match its keywords, or just
1580            one field.
1581            * @param start the lower bound of the range of groups to return
1582            * @param end the upper bound of the range of groups to return (not
1583            inclusive)
1584            * @param obc the comparator to order the groups (optionally
1585            <code>null</code>)
1586            * @return the matching groups ordered by comparator <code>obc</code>
1587            */
1588            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1589            public List<Group> search(long companyId, java.lang.String name,
1590                    java.lang.String description,
1591                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1592                    boolean andOperator, int start, int end, OrderByComparator<Group> obc);
1593    
1594            /**
1595            * Returns an ordered range of all the company's groups, optionally
1596            * including the user's inherited organization groups and user groups.
1597            * System and staged groups are not included.
1598            *
1599            * <p>
1600            * Useful when paginating results. Returns a maximum of <code>end -
1601            * start</code> instances. <code>start</code> and <code>end</code> are not
1602            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1603            * refers to the first result in the set. Setting both <code>start</code>
1604            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1605            * result set.
1606            * </p>
1607            *
1608            * @param companyId the primary key of the company
1609            * @param params the finder params (optionally <code>null</code>). To
1610            include a user's organizations, inherited organizations, and user
1611            groups in the search, add an entry with key
1612            &quot;usersGroups&quot; mapped to the user's ID and an entry with
1613            key &quot;inherit&quot; mapped to a non-<code>null</code> object.
1614            For more information see {@link
1615            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1616            * @param start the lower bound of the range of groups to return
1617            * @param end the upper bound of the range of groups to return (not
1618            inclusive)
1619            * @return the matching groups ordered by name
1620            */
1621            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1622            public List<Group> search(long companyId,
1623                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1624                    int end);
1625    
1626            /**
1627            * Returns an ordered range of all the groups belonging to the parent group
1628            * that match the keywords, optionally including the user's inherited
1629            * organization groups and user groups. System and staged groups are not
1630            * included.
1631            *
1632            * <p>
1633            * Useful when paginating results. Returns a maximum of <code>end -
1634            * start</code> instances. <code>start</code> and <code>end</code> are not
1635            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1636            * refers to the first result in the set. Setting both <code>start</code>
1637            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1638            * result set.
1639            * </p>
1640            *
1641            * @param companyId the primary key of the company
1642            * @param parentGroupId the primary key of the parent group
1643            * @param keywords the keywords (space separated), which may occur in the
1644            sites's name, or description (optionally <code>null</code>)
1645            * @param params the finder params (optionally <code>null</code>). To
1646            include the user's inherited organizations and user groups in the
1647            search, add entries having &quot;usersGroups&quot; and
1648            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1649            information see {@link
1650            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1651            * @param start the lower bound of the range of groups to return
1652            * @param end the upper bound of the range of groups to return (not
1653            inclusive)
1654            * @return the matching groups ordered by name
1655            */
1656            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1657            public List<Group> search(long companyId, long parentGroupId,
1658                    java.lang.String keywords,
1659                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1660                    int end);
1661    
1662            /**
1663            * Returns an ordered range of all the groups belonging to the parent group
1664            * that match the keywords, optionally including the user's inherited
1665            * organization groups and user groups. System and staged groups are not
1666            * included.
1667            *
1668            * <p>
1669            * Useful when paginating results. Returns a maximum of <code>end -
1670            * start</code> instances. <code>start</code> and <code>end</code> are not
1671            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1672            * refers to the first result in the set. Setting both <code>start</code>
1673            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1674            * result set.
1675            * </p>
1676            *
1677            * @param companyId the primary key of the company
1678            * @param parentGroupId the primary key of the parent group
1679            * @param keywords the keywords (space separated), which may occur in the
1680            sites's name, or description (optionally <code>null</code>)
1681            * @param params the finder params (optionally <code>null</code>). To
1682            include the user's inherited organizations and user groups in the
1683            search, add entries having &quot;usersGroups&quot; and
1684            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1685            information see {@link
1686            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1687            * @param start the lower bound of the range of groups to return
1688            * @param end the upper bound of the range of groups to return (not
1689            inclusive)
1690            * @param obc the comparator to order the groups (optionally
1691            <code>null</code>)
1692            * @return the matching groups ordered by comparator <code>obc</code>
1693            */
1694            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1695            public List<Group> search(long companyId, long parentGroupId,
1696                    java.lang.String keywords,
1697                    LinkedHashMap<java.lang.String, java.lang.Object> params, int start,
1698                    int end, OrderByComparator<Group> obc);
1699    
1700            /**
1701            * Returns an ordered range of all the site groups belonging to the parent
1702            * group and organization groups that match the name and description,
1703            * optionally including the user's inherited organization groups and user
1704            * groups. System and staged groups are not included.
1705            *
1706            * <p>
1707            * Useful when paginating results. Returns a maximum of <code>end -
1708            * start</code> instances. <code>start</code> and <code>end</code> are not
1709            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1710            * refers to the first result in the set. Setting both <code>start</code>
1711            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1712            * result set.
1713            * </p>
1714            *
1715            * @param companyId the primary key of the company
1716            * @param parentGroupId the primary key of the parent group
1717            * @param name the group's name (optionally <code>null</code>)
1718            * @param description the group's description (optionally
1719            <code>null</code>)
1720            * @param params the finder params (optionally <code>null</code>). To
1721            include the user's inherited organizations and user groups in the
1722            search, add entries having &quot;usersGroups&quot; and
1723            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1724            information see {@link
1725            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1726            * @param andOperator whether every field must match its keywords, or just
1727            one field.
1728            * @param start the lower bound of the range of groups to return
1729            * @param end the upper bound of the range of groups to return (not
1730            inclusive)
1731            * @return the matching groups ordered by name
1732            */
1733            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1734            public List<Group> search(long companyId, long parentGroupId,
1735                    java.lang.String name, java.lang.String description,
1736                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1737                    boolean andOperator, int start, int end);
1738    
1739            /**
1740            * Returns an ordered range of all the site groups belonging to the parent
1741            * group and organization groups that match the name and description,
1742            * optionally including the user's inherited organization groups and user
1743            * groups. System and staged groups are not included.
1744            *
1745            * <p>
1746            * Useful when paginating results. Returns a maximum of <code>end -
1747            * start</code> instances. <code>start</code> and <code>end</code> are not
1748            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1749            * refers to the first result in the set. Setting both <code>start</code>
1750            * and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full
1751            * result set.
1752            * </p>
1753            *
1754            * @param companyId the primary key of the company
1755            * @param parentGroupId the primary key of the parent group
1756            * @param name the group's name (optionally <code>null</code>)
1757            * @param description the group's description (optionally
1758            <code>null</code>)
1759            * @param params the finder params (optionally <code>null</code>). To
1760            include the user's inherited organizations and user groups in the
1761            search, add entries having &quot;usersGroups&quot; and
1762            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1763            information see {@link
1764            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1765            * @param andOperator whether every field must match its keywords, or just
1766            one field.
1767            * @param start the lower bound of the range of groups to return
1768            * @param end the upper bound of the range of groups to return (not
1769            inclusive)
1770            * @param obc the comparator to order the groups (optionally
1771            <code>null</code>)
1772            * @return the matching groups ordered by comparator <code>obc</code>
1773            */
1774            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1775            public List<Group> search(long companyId, long parentGroupId,
1776                    java.lang.String name, java.lang.String description,
1777                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1778                    boolean andOperator, int start, int end, OrderByComparator<Group> obc);
1779    
1780            /**
1781            * Returns the number of groups that match the class name IDs, and keywords,
1782            * optionally including the user's inherited organization groups and user
1783            * groups. System and staged groups are not included.
1784            *
1785            * @param companyId the primary key of the company
1786            * @param classNameIds the primary keys of the class names of the entities
1787            the groups are related to (optionally <code>null</code>)
1788            * @param keywords the keywords (space separated), which may occur in the
1789            sites's name, or description (optionally <code>null</code>)
1790            * @param params the finder params (optionally <code>null</code>). To
1791            include the user's inherited organization groups and user groups
1792            in the search, add entries having &quot;usersGroups&quot; and
1793            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1794            information see {@link
1795            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1796            * @return the number of matching groups
1797            */
1798            @ThreadLocalCachable
1799            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1800            public int searchCount(long companyId, long[] classNameIds,
1801                    java.lang.String keywords,
1802                    LinkedHashMap<java.lang.String, java.lang.Object> params);
1803    
1804            /**
1805            * Returns the number of groups that match the class name IDs, name, and
1806            * description, optionally including the user's inherited organization
1807            * groups and user groups. System and staged groups are not included.
1808            *
1809            * @param companyId the primary key of the company
1810            * @param classNameIds the primary keys of the class names of the entities
1811            the groups are related to (optionally <code>null</code>)
1812            * @param name the group's name (optionally <code>null</code>)
1813            * @param description the group's description (optionally
1814            <code>null</code>)
1815            * @param params the finder params (optionally <code>null</code>). To
1816            include the user's inherited organization groups and user groups
1817            in the search, add entries having &quot;usersGroups&quot; and
1818            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1819            information see {@link
1820            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1821            * @param andOperator whether every field must match its keywords, or just
1822            one field.
1823            * @return the number of matching groups
1824            */
1825            @ThreadLocalCachable
1826            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1827            public int searchCount(long companyId, long[] classNameIds,
1828                    java.lang.String name, java.lang.String description,
1829                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1830                    boolean andOperator);
1831    
1832            /**
1833            * Returns the number of groups belonging to the parent group that match the
1834            * class name IDs, and keywords, optionally including the user's inherited
1835            * organization groups and user groups. System and staged groups are not
1836            * included.
1837            *
1838            * @param companyId the primary key of the company
1839            * @param classNameIds the primary keys of the class names of the entities
1840            the groups are related to (optionally <code>null</code>)
1841            * @param parentGroupId the primary key of the parent group
1842            * @param keywords the keywords (space separated), which may occur in the
1843            sites's name, or description (optionally <code>null</code>)
1844            * @param params the finder params (optionally <code>null</code>). To
1845            include the user's inherited organization groups and user groups
1846            in the search, add entries having &quot;usersGroups&quot; and
1847            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1848            information see {@link
1849            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1850            * @return the number of matching groups
1851            */
1852            @ThreadLocalCachable
1853            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1854            public int searchCount(long companyId, long[] classNameIds,
1855                    long parentGroupId, java.lang.String keywords,
1856                    LinkedHashMap<java.lang.String, java.lang.Object> params);
1857    
1858            /**
1859            * Returns the number of groups belonging to the parent group that match the
1860            * class name IDs, name, and description, optionally including the user's
1861            * inherited organization groups and user groups. System and staged groups
1862            * are not included.
1863            *
1864            * @param companyId the primary key of the company
1865            * @param classNameIds the primary keys of the class names of the entities
1866            the groups are related to (optionally <code>null</code>)
1867            * @param parentGroupId the primary key of the parent group
1868            * @param name the group's name (optionally <code>null</code>)
1869            * @param description the group's description (optionally
1870            <code>null</code>)
1871            * @param params the finder params (optionally <code>null</code>). To
1872            include the user's inherited organization groups and user groups
1873            in the search, add entries having &quot;usersGroups&quot; and
1874            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1875            information see {@link
1876            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1877            * @param andOperator whether every field must match its keywords, or just
1878            one field.
1879            * @return the number of matching groups
1880            */
1881            @ThreadLocalCachable
1882            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1883            public int searchCount(long companyId, long[] classNameIds,
1884                    long parentGroupId, java.lang.String name,
1885                    java.lang.String description,
1886                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1887                    boolean andOperator);
1888    
1889            /**
1890            * Returns the number of groups that match the keywords, optionally
1891            * including the user's inherited organization groups and user groups.
1892            * System and staged groups are not included.
1893            *
1894            * @param companyId the primary key of the company
1895            * @param keywords the keywords (space separated), which may occur in the
1896            sites's name, or description (optionally <code>null</code>)
1897            * @param params the finder params (optionally <code>null</code>). To
1898            include the user's inherited organization groups and user groups
1899            in the search, add entries having &quot;usersGroups&quot; and
1900            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1901            information see {@link
1902            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1903            * @return the number of matching groups
1904            */
1905            @ThreadLocalCachable
1906            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1907            public int searchCount(long companyId, java.lang.String keywords,
1908                    LinkedHashMap<java.lang.String, java.lang.Object> params);
1909    
1910            /**
1911            * Returns the number of groups and immediate organization groups that match
1912            * the name and description, optionally including the user's inherited
1913            * organization groups and user groups. System and staged groups are not
1914            * included.
1915            *
1916            * @param companyId the primary key of the company
1917            * @param name the group's name (optionally <code>null</code>)
1918            * @param description the group's description (optionally
1919            <code>null</code>)
1920            * @param params the finder params (optionally <code>null</code>). To
1921            include the user's inherited organization groups and user groups
1922            in the search, add entries having &quot;usersGroups&quot; and
1923            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1924            information see {@link
1925            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1926            * @param andOperator whether every field must match its keywords, or just
1927            one field.
1928            * @return the number of matching groups
1929            */
1930            @ThreadLocalCachable
1931            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1932            public int searchCount(long companyId, java.lang.String name,
1933                    java.lang.String description,
1934                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1935                    boolean andOperator);
1936    
1937            /**
1938            * Returns the number of groups belonging to the parent group that match the
1939            * keywords, optionally including the user's inherited organization groups
1940            * and user groups. System and staged groups are not included.
1941            *
1942            * @param companyId the primary key of the company
1943            * @param parentGroupId the primary key of the parent group
1944            * @param keywords the keywords (space separated), which may occur in the
1945            sites's name, or description (optionally <code>null</code>)
1946            * @param params the finder params (optionally <code>null</code>). To
1947            include the user's inherited organization groups and user groups
1948            in the search, add entries having &quot;usersGroups&quot; and
1949            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1950            information see {@link
1951            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1952            * @return the number of matching groups
1953            */
1954            @ThreadLocalCachable
1955            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1956            public int searchCount(long companyId, long parentGroupId,
1957                    java.lang.String keywords,
1958                    LinkedHashMap<java.lang.String, java.lang.Object> params);
1959    
1960            /**
1961            * Returns the number of groups belonging to the parent group and immediate
1962            * organization groups that match the name and description, optionally
1963            * including the user's inherited organization groups and user groups.
1964            * System and staged groups are not included.
1965            *
1966            * @param companyId the primary key of the company
1967            * @param parentGroupId the primary key of the parent group
1968            * @param name the group's name (optionally <code>null</code>)
1969            * @param description the group's description (optionally
1970            <code>null</code>)
1971            * @param params the finder params (optionally <code>null</code>). To
1972            include the user's inherited organization groups and user groups
1973            in the search, add entries having &quot;usersGroups&quot; and
1974            &quot;inherit&quot; as keys mapped to the the user's ID. For more
1975            information see {@link
1976            com.liferay.portal.kernel.service.persistence.GroupFinder}.
1977            * @param andOperator whether every field must match its keywords, or just
1978            one field.
1979            * @return the number of matching groups
1980            */
1981            @ThreadLocalCachable
1982            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1983            public int searchCount(long companyId, long parentGroupId,
1984                    java.lang.String name, java.lang.String description,
1985                    LinkedHashMap<java.lang.String, java.lang.Object> params,
1986                    boolean andOperator);
1987    
1988            public void setOrganizationGroups(long organizationId, long[] groupIds);
1989    
1990            public void setRoleGroups(long roleId, long[] groupIds);
1991    
1992            public void setUserGroupGroups(long userGroupId, long[] groupIds);
1993    
1994            public void setUserGroups(long userId, long[] groupIds);
1995    
1996            /**
1997            * Removes the groups from the role.
1998            *
1999            * @param roleId the primary key of the role
2000            * @param groupIds the primary keys of the groups
2001            */
2002            public void unsetRoleGroups(long roleId, long[] groupIds);
2003    
2004            /**
2005            * Removes the user from the groups.
2006            *
2007            * @param userId the primary key of the user
2008            * @param groupIds the primary keys of the groups
2009            */
2010            public void unsetUserGroups(long userId, long[] groupIds);
2011    
2012            /**
2013            * Updates the group's asset replacing categories and tag names.
2014            *
2015            * @param userId the primary key of the user
2016            * @param group the group
2017            * @param assetCategoryIds the primary keys of the asset categories
2018            (optionally <code>null</code>)
2019            * @param assetTagNames the asset tag names (optionally <code>null</code>)
2020            * @throws PortalException if a portal exception occurred
2021            */
2022            public void updateAsset(long userId, Group group, long[] assetCategoryIds,
2023                    java.lang.String[] assetTagNames) throws PortalException;
2024    
2025            /**
2026            * Updates the group's friendly URL.
2027            *
2028            * @param groupId the primary key of the group
2029            * @param friendlyURL the group's new friendlyURL (optionally
2030            <code>null</code>)
2031            * @return the group
2032            * @throws PortalException if a portal exception occurred
2033            */
2034            public Group updateFriendlyURL(long groupId, java.lang.String friendlyURL)
2035                    throws PortalException;
2036    
2037            /**
2038            * Updates the group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
2039            *
2040            * @param group the group
2041            * @return the group that was updated
2042            */
2043            @Indexable(type = IndexableType.REINDEX)
2044            public Group updateGroup(Group group);
2045    
2046            /**
2047            * Updates the group.
2048            *
2049            * @param groupId the primary key of the group
2050            * @param parentGroupId the primary key of the parent group
2051            * @param name the name's key
2052            * @param description the group's new description (optionally
2053            <code>null</code>)
2054            * @param type the group's new type. For more information see {@link
2055            GroupConstants}.
2056            * @param manualMembership whether manual membership is allowed for the
2057            group
2058            * @param membershipRestriction the group's membership restriction. For
2059            more information see {@link GroupConstants}.
2060            * @param friendlyURL the group's new friendlyURL (optionally
2061            <code>null</code>)
2062            * @param inheritContent whether to inherit content from the parent
2063            group
2064            * @param active whether the group is active
2065            * @param serviceContext the service context to be applied (optionally
2066            <code>null</code>). Can set asset category IDs and asset tag
2067            names for the group.
2068            * @return the group
2069            * @throws PortalException if a portal exception occurred
2070            * @deprecated As of 7.0.0, replaced by {@link #updateGroup(long, long, Map,
2071            Map, int, boolean, int, String, boolean, boolean,
2072            ServiceContext)}
2073            */
2074            @java.lang.Deprecated
2075            public Group updateGroup(long groupId, long parentGroupId,
2076                    java.lang.String name, java.lang.String description, int type,
2077                    boolean manualMembership, int membershipRestriction,
2078                    java.lang.String friendlyURL, boolean inheritContent, boolean active,
2079                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
2080                    throws PortalException;
2081    
2082            public Group updateGroup(long groupId, long parentGroupId,
2083                    Map<Locale, java.lang.String> nameMap,
2084                    Map<Locale, java.lang.String> descriptionMap, int type,
2085                    boolean manualMembership, int membershipRestriction,
2086                    java.lang.String friendlyURL, boolean inheritContent, boolean active,
2087                    com.liferay.portal.kernel.service.ServiceContext serviceContext)
2088                    throws PortalException;
2089    
2090            /**
2091            * Updates the group's type settings.
2092            *
2093            * @param groupId the primary key of the group
2094            * @param typeSettings the group's new type settings (optionally
2095            <code>null</code>)
2096            * @return the group
2097            * @throws PortalException if a portal exception occurred
2098            */
2099            public Group updateGroup(long groupId, java.lang.String typeSettings)
2100                    throws PortalException;
2101    
2102            /**
2103            * Associates the group with a main site if the group is an organization.
2104            *
2105            * @param groupId the primary key of the group
2106            * @param site whether the group is to be associated with a main site
2107            * @return the group
2108            * @throws PortalException if a portal exception occurred
2109            */
2110            public Group updateSite(long groupId, boolean site)
2111                    throws PortalException;
2112    }