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