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