001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the group local service. This utility wraps {@link com.liferay.portal.service.impl.GroupLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see GroupLocalService
030     * @see com.liferay.portal.service.base.GroupLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.GroupLocalServiceImpl
032     * @generated
033     */
034    public class GroupLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.GroupLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the group to the database. Also notifies the appropriate model listeners.
043            *
044            * @param group the group
045            * @return the group that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.Group addGroup(
049                    com.liferay.portal.model.Group group)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addGroup(group);
052            }
053    
054            /**
055            * Creates a new group with the primary key. Does not add the group to the database.
056            *
057            * @param groupId the primary key for the new group
058            * @return the new group
059            */
060            public static com.liferay.portal.model.Group createGroup(long groupId) {
061                    return getService().createGroup(groupId);
062            }
063    
064            /**
065            * Deletes the group with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param groupId the primary key of the group
068            * @throws PortalException if a group with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public static void deleteGroup(long groupId)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException {
074                    getService().deleteGroup(groupId);
075            }
076    
077            /**
078            * Deletes the group from the database. Also notifies the appropriate model listeners.
079            *
080            * @param group the group
081            * @throws PortalException
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteGroup(com.liferay.portal.model.Group group)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteGroup(group);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * 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.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * 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.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            /**
162            * Returns the group with the primary key.
163            *
164            * @param groupId the primary key of the group
165            * @return the group
166            * @throws PortalException if a group with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portal.model.Group getGroup(long groupId)
170                    throws com.liferay.portal.kernel.exception.PortalException,
171                            com.liferay.portal.kernel.exception.SystemException {
172                    return getService().getGroup(groupId);
173            }
174    
175            public static com.liferay.portal.model.PersistedModel getPersistedModel(
176                    java.io.Serializable primaryKeyObj)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getService().getPersistedModel(primaryKeyObj);
180            }
181    
182            /**
183            * Returns a range of all the groups.
184            *
185            * <p>
186            * 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.
187            * </p>
188            *
189            * @param start the lower bound of the range of groups
190            * @param end the upper bound of the range of groups (not inclusive)
191            * @return the range of groups
192            * @throws SystemException if a system exception occurred
193            */
194            public static java.util.List<com.liferay.portal.model.Group> getGroups(
195                    int start, int end)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getService().getGroups(start, end);
198            }
199    
200            /**
201            * Returns the number of groups.
202            *
203            * @return the number of groups
204            * @throws SystemException if a system exception occurred
205            */
206            public static int getGroupsCount()
207                    throws com.liferay.portal.kernel.exception.SystemException {
208                    return getService().getGroupsCount();
209            }
210    
211            /**
212            * Updates the group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
213            *
214            * @param group the group
215            * @return the group that was updated
216            * @throws SystemException if a system exception occurred
217            */
218            public static com.liferay.portal.model.Group updateGroup(
219                    com.liferay.portal.model.Group group)
220                    throws com.liferay.portal.kernel.exception.SystemException {
221                    return getService().updateGroup(group);
222            }
223    
224            /**
225            * Updates the group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
226            *
227            * @param group the group
228            * @param merge whether to merge the group with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
229            * @return the group that was updated
230            * @throws SystemException if a system exception occurred
231            */
232            public static com.liferay.portal.model.Group updateGroup(
233                    com.liferay.portal.model.Group group, boolean merge)
234                    throws com.liferay.portal.kernel.exception.SystemException {
235                    return getService().updateGroup(group, merge);
236            }
237    
238            /**
239            * Returns the Spring bean ID for this bean.
240            *
241            * @return the Spring bean ID for this bean
242            */
243            public static java.lang.String getBeanIdentifier() {
244                    return getService().getBeanIdentifier();
245            }
246    
247            /**
248            * Sets the Spring bean ID for this bean.
249            *
250            * @param beanIdentifier the Spring bean ID for this bean
251            */
252            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
253                    getService().setBeanIdentifier(beanIdentifier);
254            }
255    
256            /**
257            * Adds a group.
258            *
259            * @param userId the primary key of the group's creator/owner
260            * @param className the entity's class name
261            * @param classPK the primary key of the entity's instance
262            * @param liveGroupId the primary key of the live group
263            * @param name the entity's name
264            * @param description the group's description (optionally
265            <code>null</code>)
266            * @param type the group's type. For more information see {@link
267            com.liferay.portal.model.GroupConstants}
268            * @param friendlyURL the group's friendlyURL (optionally
269            <code>null</code>)
270            * @param site whether the group is to be associated with a main site
271            * @param active whether the group is active
272            * @param serviceContext the service context to be applied (optionally
273            <code>null</code>). Can specify the group's asset category IDs,
274            asset tag names, and whether the group is for staging
275            * @return the group
276            * @throws PortalException if a creator could not be found, if the group's
277            information was invalid, if a layout could not be found, or if a
278            valid friendly URL could not be created for the group
279            * @throws SystemException if a system exception occurred
280            */
281            public static com.liferay.portal.model.Group addGroup(long userId,
282                    java.lang.String className, long classPK, long liveGroupId,
283                    java.lang.String name, java.lang.String description, int type,
284                    java.lang.String friendlyURL, boolean site, boolean active,
285                    com.liferay.portal.service.ServiceContext serviceContext)
286                    throws com.liferay.portal.kernel.exception.PortalException,
287                            com.liferay.portal.kernel.exception.SystemException {
288                    return getService()
289                                       .addGroup(userId, className, classPK, liveGroupId, name,
290                            description, type, friendlyURL, site, active, serviceContext);
291            }
292    
293            /**
294            * Adds the group using the default live group.
295            *
296            * @param userId the primary key of the group's creator/owner
297            * @param className the entity's class name
298            * @param classPK the primary key of the entity's instance
299            * @param name the entity's name
300            * @param description the group's description (optionally
301            <code>null</code>)
302            * @param type the group's type. For more information see {@link
303            com.liferay.portal.model.GroupConstants}
304            * @param friendlyURL the group's friendlyURL
305            * @param site whether the group is to be associated with a main site
306            * @param active whether the group is active
307            * @param serviceContext the service context to be applied (optionally
308            <code>null</code>). Can specify the group's asset category IDs,
309            asset tag names, and whether the group is for staging
310            * @return the group
311            * @throws PortalException if a creator could not be found, if the group's
312            information was invalid, if a layout could not be found, or if a
313            valid friendly URL could not be created for the group
314            * @throws SystemException if a system exception occurred
315            */
316            public static com.liferay.portal.model.Group addGroup(long userId,
317                    java.lang.String className, long classPK, java.lang.String name,
318                    java.lang.String description, int type, java.lang.String friendlyURL,
319                    boolean site, boolean active,
320                    com.liferay.portal.service.ServiceContext serviceContext)
321                    throws com.liferay.portal.kernel.exception.PortalException,
322                            com.liferay.portal.kernel.exception.SystemException {
323                    return getService()
324                                       .addGroup(userId, className, classPK, name, description,
325                            type, friendlyURL, site, active, serviceContext);
326            }
327    
328            /**
329            * Adds the groups to the role.
330            *
331            * @param roleId the primary key of the role
332            * @param groupIds the primary keys of the groups
333            * @throws SystemException if a system exception occurred
334            */
335            public static void addRoleGroups(long roleId, long[] groupIds)
336                    throws com.liferay.portal.kernel.exception.SystemException {
337                    getService().addRoleGroups(roleId, groupIds);
338            }
339    
340            /**
341            * Adds the user to the groups.
342            *
343            * @param userId the primary key of the user
344            * @param groupIds the primary keys of the groups
345            * @throws SystemException if a system exception occurred
346            */
347            public static void addUserGroups(long userId, long[] groupIds)
348                    throws com.liferay.portal.kernel.exception.SystemException {
349                    getService().addUserGroups(userId, groupIds);
350            }
351    
352            /**
353            * Adds a company group if it does not exist. This method is typically used
354            * when a virtual host is added.
355            *
356            * @param companyId the primary key of the company
357            * @throws PortalException if a default user for the company could not be
358            found, if the group's information was invalid, if a layout could
359            not be found, or if a valid friendly URL could not be created
360            for the group
361            * @throws SystemException if a system exception occurred
362            */
363            public static void checkCompanyGroup(long companyId)
364                    throws com.liferay.portal.kernel.exception.PortalException,
365                            com.liferay.portal.kernel.exception.SystemException {
366                    getService().checkCompanyGroup(companyId);
367            }
368    
369            /**
370            * Creates systems groups and other related data needed by the system on
371            * the very first startup. Also takes care of creating the control panel
372            * groups and layouts.
373            *
374            * @param companyId the primary key of the company
375            * @throws PortalException if a new system group could not be created
376            * @throws SystemException if a system exception occurred
377            */
378            public static void checkSystemGroups(long companyId)
379                    throws com.liferay.portal.kernel.exception.PortalException,
380                            com.liferay.portal.kernel.exception.SystemException {
381                    getService().checkSystemGroups(companyId);
382            }
383    
384            /**
385            * Returns the group with the matching friendly URL.
386            *
387            * @param companyId the primary key of the company
388            * @param friendlyURL the friendly URL
389            * @return the group with the friendly URL, or <code>null</code> if a
390            matching group could not be found
391            * @throws SystemException if a system exception occurred
392            */
393            public static com.liferay.portal.model.Group fetchFriendlyURLGroup(
394                    long companyId, java.lang.String friendlyURL)
395                    throws com.liferay.portal.kernel.exception.SystemException {
396                    return getService().fetchFriendlyURLGroup(companyId, friendlyURL);
397            }
398    
399            /**
400            * Returns the group with the matching primary key.
401            *
402            * @param groupId the primary key of the group
403            * @return the group with the primary key, or <code>null</code> if a group
404            with the primary key could not be found
405            * @throws SystemException if a system exception occurred
406            */
407            public static com.liferay.portal.model.Group fetchGroup(long groupId)
408                    throws com.liferay.portal.kernel.exception.SystemException {
409                    return getService().fetchGroup(groupId);
410            }
411    
412            /**
413            * Returns the group with the matching group name.
414            *
415            * @param companyId the primary key of the company
416            * @param name the group's name
417            * @return the group with the name and associated company, or
418            <code>null</code> if a matching group could not be found
419            * @throws SystemException if a system exception occurred
420            */
421            public static com.liferay.portal.model.Group fetchGroup(long companyId,
422                    java.lang.String name)
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    return getService().fetchGroup(companyId, name);
425            }
426    
427            /**
428            * Returns the company group.
429            *
430            * @param companyId the primary key of the company
431            * @return the group associated with the company
432            * @throws PortalException if a matching group could not be found
433            * @throws SystemException if a system exception occurred
434            */
435            public static com.liferay.portal.model.Group getCompanyGroup(long companyId)
436                    throws com.liferay.portal.kernel.exception.PortalException,
437                            com.liferay.portal.kernel.exception.SystemException {
438                    return getService().getCompanyGroup(companyId);
439            }
440    
441            /**
442            * Returns a range of all the groups associated with the company.
443            *
444            * <p>
445            * Useful when paginating results. Returns a maximum of <code>end -
446            * start</code> instances. <code>start</code> and <code>end</code> are not
447            * primary keys, they are indexes in the result set. Thus, <code>0</code>
448            * refers to the first result in the set. Setting both <code>start</code>
449            * and <code>end</code> to {@link
450            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
451            * full result set.
452            * </p>
453            *
454            * @param companyId the primary key of the company
455            * @param start the lower bound of the range of groups to return
456            * @param end the upper bound of the range of groups to return (not
457            inclusive)
458            * @return the range of groups associated with the company
459            * @throws SystemException if a system exception occurred
460            */
461            public static java.util.List<com.liferay.portal.model.Group> getCompanyGroups(
462                    long companyId, int start, int end)
463                    throws com.liferay.portal.kernel.exception.SystemException {
464                    return getService().getCompanyGroups(companyId, start, end);
465            }
466    
467            /**
468            * Returns the number of groups associated with the company.
469            *
470            * @param companyId the primary key of the company
471            * @return the number of groups associated with the company
472            * @throws SystemException if a system exception occurred
473            */
474            public static int getCompanyGroupsCount(long companyId)
475                    throws com.liferay.portal.kernel.exception.SystemException {
476                    return getService().getCompanyGroupsCount(companyId);
477            }
478    
479            /**
480            * Returns the group with the matching friendly URL.
481            *
482            * @param companyId the primary key of the company
483            * @param friendlyURL the group's friendlyURL
484            * @return the group with the friendly URL
485            * @throws PortalException if a matching group could not be found, or if
486            the friendly URL was invalid
487            * @throws SystemException if a system exception occurred
488            */
489            public static com.liferay.portal.model.Group getFriendlyURLGroup(
490                    long companyId, java.lang.String friendlyURL)
491                    throws com.liferay.portal.kernel.exception.PortalException,
492                            com.liferay.portal.kernel.exception.SystemException {
493                    return getService().getFriendlyURLGroup(companyId, friendlyURL);
494            }
495    
496            /**
497            * Returns the group with the matching group name.
498            *
499            * @param companyId the primary key of the company
500            * @param name the group's name
501            * @return the group with the name
502            * @throws PortalException if a matching group could not be found
503            * @throws SystemException if a system exception occurred
504            */
505            public static com.liferay.portal.model.Group getGroup(long companyId,
506                    java.lang.String name)
507                    throws com.liferay.portal.kernel.exception.PortalException,
508                            com.liferay.portal.kernel.exception.SystemException {
509                    return getService().getGroup(companyId, name);
510            }
511    
512            /**
513            * Returns the groups with the matching primary keys.
514            *
515            * @param groupIds the primary keys of the groups
516            * @return the groups with the primary keys
517            * @throws PortalException if any one of the groups could not be found
518            * @throws SystemException if a system exception occurred
519            */
520            public static java.util.List<com.liferay.portal.model.Group> getGroups(
521                    long[] groupIds)
522                    throws com.liferay.portal.kernel.exception.PortalException,
523                            com.liferay.portal.kernel.exception.SystemException {
524                    return getService().getGroups(groupIds);
525            }
526    
527            /**
528            * Returns the group associated with the layout.
529            *
530            * @param companyId the primary key of the company
531            * @param plid the primary key of the layout
532            * @return the group associated with the layout
533            * @throws PortalException if a matching group could not be found
534            * @throws SystemException if a system exception occurred
535            */
536            public static com.liferay.portal.model.Group getLayoutGroup(
537                    long companyId, long plid)
538                    throws com.liferay.portal.kernel.exception.PortalException,
539                            com.liferay.portal.kernel.exception.SystemException {
540                    return getService().getLayoutGroup(companyId, plid);
541            }
542    
543            /**
544            * Returns the group associated with the layout prototype.
545            *
546            * @param companyId the primary key of the company
547            * @param layoutPrototypeId the primary key of the layout prototype
548            * @return the group associated with the layout prototype
549            * @throws PortalException if a matching group could not be found
550            * @throws SystemException if a system exception occurred
551            */
552            public static com.liferay.portal.model.Group getLayoutPrototypeGroup(
553                    long companyId, long layoutPrototypeId)
554                    throws com.liferay.portal.kernel.exception.PortalException,
555                            com.liferay.portal.kernel.exception.SystemException {
556                    return getService().getLayoutPrototypeGroup(companyId, layoutPrototypeId);
557            }
558    
559            /**
560            * Returns the group associated with the layout set prototype.
561            *
562            * @param companyId the primary key of the company
563            * @param layoutSetPrototypeId the primary key of the layout set prototype
564            * @return the group associated with the layout set prototype
565            * @throws PortalException if a matching group could not be found
566            * @throws SystemException if a system exception occurred
567            */
568            public static com.liferay.portal.model.Group getLayoutSetPrototypeGroup(
569                    long companyId, long layoutSetPrototypeId)
570                    throws com.liferay.portal.kernel.exception.PortalException,
571                            com.liferay.portal.kernel.exception.SystemException {
572                    return getService()
573                                       .getLayoutSetPrototypeGroup(companyId, layoutSetPrototypeId);
574            }
575    
576            /**
577            * Returns all live groups.
578            *
579            * @return all live groups
580            * @throws SystemException if a system exception occurred
581            */
582            public static java.util.List<com.liferay.portal.model.Group> getLiveGroups()
583                    throws com.liferay.portal.kernel.exception.SystemException {
584                    return getService().getLiveGroups();
585            }
586    
587            /**
588            * Returns a range of all non-system groups of a specified type (className)
589            * that have no layouts.
590            *
591            * <p>
592            * Useful when paginating results. Returns a maximum of <code>end -
593            * start</code> instances. <code>start</code> and <code>end</code> are not
594            * primary keys, they are indexes in the result set. Thus, <code>0</code>
595            * refers to the first result in the set. Setting both <code>start</code>
596            * and <code>end</code> to {@link
597            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
598            * full result set.
599            * </p>
600            *
601            * @param className the entity's class name
602            * @param privateLayout whether to include groups with private layout sets
603            or non-private layout sets
604            * @param start the lower bound of the range of groups to return
605            * @param end the upper bound of the range of groups to return (not
606            inclusive)
607            * @return the range of matching groups
608            * @throws SystemException if a system exception occurred
609            */
610            public static java.util.List<com.liferay.portal.model.Group> getNoLayoutsGroups(
611                    java.lang.String className, boolean privateLayout, int start, int end)
612                    throws com.liferay.portal.kernel.exception.SystemException {
613                    return getService()
614                                       .getNoLayoutsGroups(className, privateLayout, start, end);
615            }
616    
617            /**
618            * Returns all non-system groups having <code>null</code> or empty friendly
619            * URLs.
620            *
621            * @return the non-system groups having <code>null</code> or empty friendly
622            URLs
623            * @throws SystemException if a system exception occurred
624            */
625            public static java.util.List<com.liferay.portal.model.Group> getNullFriendlyURLGroups()
626                    throws com.liferay.portal.kernel.exception.SystemException {
627                    return getService().getNullFriendlyURLGroups();
628            }
629    
630            /**
631            * Returns the specified organization group.
632            *
633            * @param companyId the primary key of the company
634            * @param organizationId the primary key of the organization
635            * @return the group associated with the organization
636            * @throws PortalException if a matching group could not be found
637            * @throws SystemException if a system exception occurred
638            */
639            public static com.liferay.portal.model.Group getOrganizationGroup(
640                    long companyId, long organizationId)
641                    throws com.liferay.portal.kernel.exception.PortalException,
642                            com.liferay.portal.kernel.exception.SystemException {
643                    return getService().getOrganizationGroup(companyId, organizationId);
644            }
645    
646            /**
647            * Returns the specified organization groups.
648            *
649            * @param organizations the organizations
650            * @return the groups associated with the organizations
651            */
652            public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
653                    java.util.List<com.liferay.portal.model.Organization> organizations) {
654                    return getService().getOrganizationsGroups(organizations);
655            }
656    
657            /**
658            * Returns all the groups related to the organizations.
659            *
660            * @param organizations the organizations
661            * @return the groups related to the organizations
662            * @throws SystemException if a system exception occurred
663            */
664            public static java.util.List<com.liferay.portal.model.Group> getOrganizationsRelatedGroups(
665                    java.util.List<com.liferay.portal.model.Organization> organizations)
666                    throws com.liferay.portal.kernel.exception.SystemException {
667                    return getService().getOrganizationsRelatedGroups(organizations);
668            }
669    
670            /**
671            * Returns all the groups associated with the role.
672            *
673            * @param roleId the primary key of the role
674            * @return the groups associated with the role
675            * @throws SystemException if a system exception occurred
676            */
677            public static java.util.List<com.liferay.portal.model.Group> getRoleGroups(
678                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
679                    return getService().getRoleGroups(roleId);
680            }
681    
682            /**
683            * Returns the staging group.
684            *
685            * @param liveGroupId the primary key of the live group
686            * @return the staging group
687            * @throws PortalException if a matching staging group could not be found
688            * @throws SystemException if a system exception occurred
689            */
690            public static com.liferay.portal.model.Group getStagingGroup(
691                    long liveGroupId)
692                    throws com.liferay.portal.kernel.exception.PortalException,
693                            com.liferay.portal.kernel.exception.SystemException {
694                    return getService().getStagingGroup(liveGroupId);
695            }
696    
697            /**
698            * Returns the group associated with the user.
699            *
700            * @param companyId the primary key of the company
701            * @param userId the primary key of the user
702            * @return the group associated with the user
703            * @throws PortalException if a matching group could not be found
704            * @throws SystemException if a system exception occurred
705            */
706            public static com.liferay.portal.model.Group getUserGroup(long companyId,
707                    long userId)
708                    throws com.liferay.portal.kernel.exception.PortalException,
709                            com.liferay.portal.kernel.exception.SystemException {
710                    return getService().getUserGroup(companyId, userId);
711            }
712    
713            /**
714            * Returns the specified "user group" group. That is, the group that
715            * represents the {@link com.liferay.portal.model.UserGroup} entity.
716            *
717            * @param companyId the primary key of the company
718            * @param userGroupId the primary key of the user group
719            * @return the group associated with the user group
720            * @throws PortalException if a matching group could not be found
721            * @throws SystemException if a system exception occurred
722            */
723            public static com.liferay.portal.model.Group getUserGroupGroup(
724                    long companyId, long userGroupId)
725                    throws com.liferay.portal.kernel.exception.PortalException,
726                            com.liferay.portal.kernel.exception.SystemException {
727                    return getService().getUserGroupGroup(companyId, userGroupId);
728            }
729    
730            /**
731            * Returns all the user's site groups and immediate organization groups.
732            * System and staged groups are not included.
733            *
734            * @param userId the primary key of the user
735            * @return the user's groups and organization groups
736            * @throws PortalException if a user with the primary key could not be
737            found
738            * @throws SystemException if a system exception occurred
739            */
740            public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
741                    long userId)
742                    throws com.liferay.portal.kernel.exception.PortalException,
743                            com.liferay.portal.kernel.exception.SystemException {
744                    return getService().getUserGroups(userId);
745            }
746    
747            /**
748            * Returns all the user's site groups and immediate organization groups,
749            * optionally including the user's inherited organization groups and user
750            * groups. System and staged groups are not included.
751            *
752            * @param userId the primary key of the user
753            * @param inherit whether to include the user's inherited organization
754            groups and user groups
755            * @return the user's groups and immediate organization groups
756            * @throws PortalException if a user with the primary key could not be
757            found
758            * @throws SystemException if a system exception occurred
759            */
760            public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
761                    long userId, boolean inherit)
762                    throws com.liferay.portal.kernel.exception.PortalException,
763                            com.liferay.portal.kernel.exception.SystemException {
764                    return getService().getUserGroups(userId, inherit);
765            }
766    
767            /**
768            * Returns a name ordered range of all the user's site groups and immediate
769            * organization groups, optionally including the user's inherited
770            * organization groups and user groups. System and staged groups are not
771            * included.
772            *
773            * <p>
774            * Useful when paginating results. Returns a maximum of <code>end -
775            * start</code> instances. <code>start</code> and <code>end</code> are not
776            * primary keys, they are indexes in the result set. Thus, <code>0</code>
777            * refers to the first result in the set. Setting both <code>start</code>
778            * and <code>end</code> to {@link
779            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
780            * full result set.
781            * </p>
782            *
783            * @param userId the primary key of the user
784            * @param inherit whether to include the user's inherited organization
785            groups and user groups
786            * @param start the lower bound of the range of groups to return
787            * @param end the upper bound of the range of groups to return (not
788            inclusive)
789            * @return the range of the user's groups and immediate organization groups
790            ordered by name
791            * @throws PortalException if a user with the primary key could not be
792            found
793            * @throws SystemException if a system exception occurred
794            */
795            public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
796                    long userId, boolean inherit, int start, int end)
797                    throws com.liferay.portal.kernel.exception.PortalException,
798                            com.liferay.portal.kernel.exception.SystemException {
799                    return getService().getUserGroups(userId, inherit, start, end);
800            }
801    
802            /**
803            * Returns a name ordered range of all the user's site groups and immediate
804            * organization groups. System and staged groups are not included.
805            *
806            * <p>
807            * Useful when paginating results. Returns a maximum of <code>end -
808            * start</code> instances. <code>start</code> and <code>end</code> are not
809            * primary keys, they are indexes in the result set. Thus, <code>0</code>
810            * refers to the first result in the set. Setting both <code>start</code>
811            * and <code>end</code> to {@link
812            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
813            * full result set.
814            * </p>
815            *
816            * @param userId the primary key of the user
817            * @param start the lower bound of the range of groups to return
818            * @param end the upper bound of the range of groups to return (not
819            inclusive)
820            * @return the range of the user's groups and organization groups ordered
821            by name
822            * @throws PortalException if a user with the primary key could not be
823            found
824            * @throws SystemException if a system exception occurred
825            */
826            public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
827                    long userId, int start, int end)
828                    throws com.liferay.portal.kernel.exception.PortalException,
829                            com.liferay.portal.kernel.exception.SystemException {
830                    return getService().getUserGroups(userId, start, end);
831            }
832    
833            /**
834            * Returns the groups associated with the user groups.
835            *
836            * @param userGroups the user groups
837            * @return the groups associated with the user groups
838            * @throws PortalException if any one of the user group's group could not
839            be found
840            * @throws SystemException if a system exception occurred
841            */
842            public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
843                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
844                    throws com.liferay.portal.kernel.exception.PortalException,
845                            com.liferay.portal.kernel.exception.SystemException {
846                    return getService().getUserGroupsGroups(userGroups);
847            }
848    
849            /**
850            * Returns all the groups related to the user groups.
851            *
852            * @param userGroups the user groups
853            * @return the groups related to the user groups
854            * @throws SystemException if a system exception occurred
855            */
856            public static java.util.List<com.liferay.portal.model.Group> getUserGroupsRelatedGroups(
857                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
858                    throws com.liferay.portal.kernel.exception.SystemException {
859                    return getService().getUserGroupsRelatedGroups(userGroups);
860            }
861    
862            /**
863            * Returns the range of all groups associated with the user's organization
864            * groups, including the ancestors of the organization groups, unless
865            * portal property <code>organizations.membership.strict</code> is set to
866            * <code>true</code>.
867            *
868            * <p>
869            * Useful when paginating results. Returns a maximum of <code>end -
870            * start</code> instances. <code>start</code> and <code>end</code> are not
871            * primary keys, they are indexes in the result set. Thus, <code>0</code>
872            * refers to the first result in the set. Setting both <code>start</code>
873            * and <code>end</code> to {@link
874            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
875            * full result set.
876            * </p>
877            *
878            * @param userId the primary key of the user
879            * @param start the lower bound of the range of groups to consider
880            * @param end the upper bound of the range of groups to consider (not
881            inclusive)
882            * @return the range of groups associated with the user's organization
883            groups
884            * @throws PortalException if a user with the primary key could not be
885            found or if another portal exception occurred
886            * @throws SystemException if a system exception occurred
887            */
888            public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
889                    long userId, int start, int end)
890                    throws com.liferay.portal.kernel.exception.PortalException,
891                            com.liferay.portal.kernel.exception.SystemException {
892                    return getService().getUserOrganizationsGroups(userId, start, end);
893            }
894    
895            /**
896            * Returns <code>true</code> if the group is associated with the role.
897            *
898            * @param roleId the primary key of the role
899            * @param groupId the primary key of the group
900            * @return <code>true</code> if the group is associated with the role;
901            <code>false</code> otherwise
902            * @throws SystemException if a system exception occurred
903            */
904            public static boolean hasRoleGroup(long roleId, long groupId)
905                    throws com.liferay.portal.kernel.exception.SystemException {
906                    return getService().hasRoleGroup(roleId, groupId);
907            }
908    
909            /**
910            * Returns <code>true</code> if the live group has a staging group.
911            *
912            * @param liveGroupId the primary key of the live group
913            * @return <code>true</code> if the live group has a staging group;
914            <code>false</code> otherwise
915            * @throws SystemException if a system exception occurred
916            */
917            public static boolean hasStagingGroup(long liveGroupId)
918                    throws com.liferay.portal.kernel.exception.SystemException {
919                    return getService().hasStagingGroup(liveGroupId);
920            }
921    
922            /**
923            * Returns <code>true</code> if the user is immediately associated with the
924            * group, or associated with the group via the user's organizations,
925            * inherited organizations, or user groups.
926            *
927            * @param userId the primary key of the user
928            * @param groupId the primary key of the group
929            * @return <code>true</code> if the user is associated with the group;
930            <code>false</code> otherwise
931            * @throws SystemException if a system exception occurred
932            */
933            public static boolean hasUserGroup(long userId, long groupId)
934                    throws com.liferay.portal.kernel.exception.SystemException {
935                    return getService().hasUserGroup(userId, groupId);
936            }
937    
938            /**
939            * Returns <code>true</code> if the user is immediately associated with the
940            * group, or optionally if the user is associated with the group via the
941            * user's organizations, inherited organizations, or user groups.
942            *
943            * @param userId the primary key of the user
944            * @param groupId the primary key of the group
945            * @param inherit whether to include organization groups and user groups
946            to which the user belongs in the determination
947            * @return <code>true</code> if the user is associated with the group;
948            <code>false</code> otherwise
949            * @throws SystemException if a system exception occurred
950            */
951            public static boolean hasUserGroup(long userId, long groupId,
952                    boolean inherit)
953                    throws com.liferay.portal.kernel.exception.SystemException {
954                    return getService().hasUserGroup(userId, groupId, inherit);
955            }
956    
957            public static com.liferay.portal.model.Group loadFetchGroup(
958                    long companyId, java.lang.String name)
959                    throws com.liferay.portal.kernel.exception.SystemException {
960                    return getService().loadFetchGroup(companyId, name);
961            }
962    
963            public static com.liferay.portal.model.Group loadGetGroup(long companyId,
964                    java.lang.String name)
965                    throws com.liferay.portal.kernel.exception.PortalException,
966                            com.liferay.portal.kernel.exception.SystemException {
967                    return getService().loadGetGroup(companyId, name);
968            }
969    
970            public static java.util.List<com.liferay.portal.model.Group> search(
971                    long companyId,
972                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
973                    int start, int end)
974                    throws com.liferay.portal.kernel.exception.SystemException {
975                    return getService().search(companyId, params, start, end);
976            }
977    
978            /**
979            * Returns a name ordered range of all the groups that match the class name
980            * IDs, name, and description, optionally including the user's inherited
981            * organization groups and user groups. System and staged groups are not
982            * included.
983            *
984            * <p>
985            * Useful when paginating results. Returns a maximum of <code>end -
986            * start</code> instances. <code>start</code> and <code>end</code> are not
987            * primary keys, they are indexes in the result set. Thus, <code>0</code>
988            * refers to the first result in the set. Setting both <code>start</code>
989            * and <code>end</code> to {@link
990            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
991            * full result set.
992            * </p>
993            *
994            * @param companyId the primary key of the company
995            * @param classNameIds the class names of entities to include in the
996            search (optionally <code>null</code>)
997            * @param name the group's name (optionally <code>null</code>)
998            * @param description the group's description (optionally
999            <code>null</code>)
1000            * @param params the finder params (optionally <code>null</code>). To
1001            include a user's organizations, inherited organizations, and
1002            user groups in the search, add an entry with key
1003            &quot;usersGroups&quot; mapped to the user's ID and an entry
1004            with key &quot;inherit&quot; mapped to a non-<code>null</code>
1005            object. For more information see {@link
1006            com.liferay.portal.service.persistence.GroupFinder}
1007            com.liferay.portal.service.persistence.GroupFinder}
1008            * @param start the lower bound of the range of groups to return
1009            * @param end the upper bound of the range of groups to return (not
1010            inclusive)
1011            * @return the matching groups ordered by name
1012            * @throws SystemException if a system exception occurred
1013            */
1014            public static java.util.List<com.liferay.portal.model.Group> search(
1015                    long companyId, long[] classNameIds, java.lang.String name,
1016                    java.lang.String description,
1017                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1018                    int start, int end)
1019                    throws com.liferay.portal.kernel.exception.SystemException {
1020                    return getService()
1021                                       .search(companyId, classNameIds, name, description, params,
1022                            start, end);
1023            }
1024    
1025            /**
1026            * Returns an ordered range of all the groups that match the class name
1027            * IDs, name, and description, optionally including the user's inherited
1028            * organization groups and user groups. System and staged groups are not
1029            * included.
1030            *
1031            * <p>
1032            * Useful when paginating results. Returns a maximum of <code>end -
1033            * start</code> instances. <code>start</code> and <code>end</code> are not
1034            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1035            * refers to the first result in the set. Setting both <code>start</code>
1036            * and <code>end</code> to {@link
1037            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1038            * full result set.
1039            * </p>
1040            *
1041            * @param companyId the primary key of the company
1042            * @param classNameIds the group's class name IDs (optionally
1043            <code>null</code>)
1044            * @param name the group's name (optionally <code>null</code>)
1045            * @param description the group's description (optionally
1046            <code>null</code>)
1047            * @param params the finder params (optionally <code>null</code>). To
1048            include a user's organizations, inherited organizations, and
1049            user groups in the search, add an entry with key
1050            &quot;usersGroups&quot; mapped to the user's ID and an entry
1051            with key &quot;inherit&quot; mapped to a non-<code>null</code>
1052            object. For more information see {@link
1053            com.liferay.portal.service.persistence.GroupFinder}
1054            * @param start the lower bound of the range of groups to return
1055            * @param end the upper bound of the range of groups to return (not
1056            inclusive)
1057            * @param obc the comparator to order the groups (optionally
1058            <code>null</code>)
1059            * @return the matching groups ordered by comparator <code>obc</code>
1060            * @throws SystemException if a system exception occurred
1061            */
1062            public static java.util.List<com.liferay.portal.model.Group> search(
1063                    long companyId, long[] classNameIds, java.lang.String name,
1064                    java.lang.String description,
1065                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1066                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1067                    throws com.liferay.portal.kernel.exception.SystemException {
1068                    return getService()
1069                                       .search(companyId, classNameIds, name, description, params,
1070                            start, end, obc);
1071            }
1072    
1073            /**
1074            * Returns a name ordered range of all the site groups and organization
1075            * groups that match the name and description, optionally including the
1076            * user's inherited organization groups and user groups. System and staged
1077            * groups are not included.
1078            *
1079            * <p>
1080            * Useful when paginating results. Returns a maximum of <code>end -
1081            * start</code> instances. <code>start</code> and <code>end</code> are not
1082            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1083            * refers to the first result in the set. Setting both <code>start</code>
1084            * and <code>end</code> to {@link
1085            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1086            * full result set.
1087            * </p>
1088            *
1089            * @param companyId the primary key of the company
1090            * @param name the group's name (optionally <code>null</code>)
1091            * @param description the group's description (optionally
1092            <code>null</code>)
1093            * @param params the finder params (optionally <code>null</code>). To
1094            include the user's inherited organizations and user groups in
1095            the search, add entries having &quot;usersGroups&quot; and
1096            &quot;inherit&quot; as keys mapped to the the user's ID. For
1097            more information see {@link
1098            com.liferay.portal.service.persistence.GroupFinder}
1099            * @param start the lower bound of the range of groups to return
1100            * @param end the upper bound of the range of groups to return (not
1101            inclusive)
1102            * @return the matching groups ordered by name
1103            * @throws SystemException if a system exception occurred
1104            */
1105            public static java.util.List<com.liferay.portal.model.Group> search(
1106                    long companyId, java.lang.String name, java.lang.String description,
1107                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1108                    int start, int end)
1109                    throws com.liferay.portal.kernel.exception.SystemException {
1110                    return getService()
1111                                       .search(companyId, name, description, params, start, end);
1112            }
1113    
1114            /**
1115            * Returns an ordered range of all the site groups and organization groups
1116            * that match the name and description, optionally including the user's
1117            * inherited organization groups and user groups. System and staged groups
1118            * are not included.
1119            *
1120            * <p>
1121            * Useful when paginating results. Returns a maximum of <code>end -
1122            * start</code> instances. <code>start</code> and <code>end</code> are not
1123            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1124            * refers to the first result in the set. Setting both <code>start</code>
1125            * and <code>end</code> to {@link
1126            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
1127            * full result set.
1128            * </p>
1129            *
1130            * @param companyId the primary key of the company
1131            * @param name the group's name (optionally <code>null</code>)
1132            * @param description the group's description (optionally
1133            <code>null</code>)
1134            * @param params the finder params (optionally <code>null</code>). To
1135            include the user's inherited organizations and user groups in
1136            the search, add entries having &quot;usersGroups&quot; and
1137            &quot;inherit&quot; as keys mapped to the the user's ID. For
1138            more information see {@link
1139            com.liferay.portal.service.persistence.GroupFinder}
1140            * @param start the lower bound of the range of groups to return
1141            * @param end the upper bound of the range of groups to return (not
1142            inclusive)
1143            * @param obc the comparator to order the groups (optionally
1144            <code>null</code>)
1145            * @return the matching groups ordered by comparator <code>obc</code>
1146            * @throws SystemException if a system exception occurred
1147            */
1148            public static java.util.List<com.liferay.portal.model.Group> search(
1149                    long companyId, java.lang.String name, java.lang.String description,
1150                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1151                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1152                    throws com.liferay.portal.kernel.exception.SystemException {
1153                    return getService()
1154                                       .search(companyId, name, description, params, start, end, obc);
1155            }
1156    
1157            /**
1158            * Returns the number of groups that match the class name IDs, name, and
1159            * description, optionally including the user's inherited organization
1160            * groups and user groups. System and staged groups are not included.
1161            *
1162            * @param companyId the primary key of the company
1163            * @param classNameIds the class names of entities to include in the
1164            search (optionally <code>null</code>)
1165            * @param name the group's name (optionally <code>null</code>)
1166            * @param description the group's description (optionally
1167            <code>null</code>)
1168            * @param params the finder params (optionally <code>null</code>). To
1169            include the user's inherited organization groups and user groups
1170            in the search, add entries having &quot;usersGroups&quot; and
1171            &quot;inherit&quot; as keys mapped to the the user's ID. For
1172            more information see {@link
1173            com.liferay.portal.service.persistence.GroupFinder}
1174            * @return the number of matching groups
1175            * @throws SystemException if a system exception occurred
1176            */
1177            public static int searchCount(long companyId, long[] classNameIds,
1178                    java.lang.String name, java.lang.String description,
1179                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1180                    throws com.liferay.portal.kernel.exception.SystemException {
1181                    return getService()
1182                                       .searchCount(companyId, classNameIds, name, description,
1183                            params);
1184            }
1185    
1186            /**
1187            * Returns the number of groups and immediate organization groups that
1188            * match the name and description, optionally including the user's
1189            * inherited organization groups and user groups. System and staged groups
1190            * are not included.
1191            *
1192            * @param companyId the primary key of the company
1193            * @param name the group's name (optionally <code>null</code>)
1194            * @param description the group's description (optionally
1195            <code>null</code>)
1196            * @param params the finder params (optionally <code>null</code>). To
1197            include the user's inherited organization groups and user groups
1198            in the search, add entries having &quot;usersGroups&quot; and
1199            &quot;inherit&quot; as keys mapped to the the user's ID. For
1200            more information see {@link
1201            com.liferay.portal.service.persistence.GroupFinder}
1202            * @return the number of matching groups
1203            * @throws SystemException if a system exception occurred
1204            */
1205            public static int searchCount(long companyId, java.lang.String name,
1206                    java.lang.String description,
1207                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1208                    throws com.liferay.portal.kernel.exception.SystemException {
1209                    return getService().searchCount(companyId, name, description, params);
1210            }
1211    
1212            /**
1213            * Sets the groups associated with the role, removing and adding
1214            * associations as necessary.
1215            *
1216            * @param roleId the primary key of the role
1217            * @param groupIds the primary keys of the groups
1218            * @throws SystemException if a system exception occurred
1219            */
1220            public static void setRoleGroups(long roleId, long[] groupIds)
1221                    throws com.liferay.portal.kernel.exception.SystemException {
1222                    getService().setRoleGroups(roleId, groupIds);
1223            }
1224    
1225            /**
1226            * Removes the groups from the role.
1227            *
1228            * @param roleId the primary key of the role
1229            * @param groupIds the primary keys of the groups
1230            * @throws SystemException if a system exception occurred
1231            */
1232            public static void unsetRoleGroups(long roleId, long[] groupIds)
1233                    throws com.liferay.portal.kernel.exception.SystemException {
1234                    getService().unsetRoleGroups(roleId, groupIds);
1235            }
1236    
1237            /**
1238            * Removes the user from the groups.
1239            *
1240            * @param userId the primary key of the user
1241            * @param groupIds the primary keys of the groups
1242            * @throws SystemException if a system exception occurred
1243            */
1244            public static void unsetUserGroups(long userId, long[] groupIds)
1245                    throws com.liferay.portal.kernel.exception.SystemException {
1246                    getService().unsetUserGroups(userId, groupIds);
1247            }
1248    
1249            /**
1250            * Updates the group's asset replacing categories and tag names.
1251            *
1252            * @param userId the primary key of the user
1253            * @param group the group
1254            * @param assetCategoryIds the primary keys of the asset categories
1255            (optionally <code>null</code>)
1256            * @param assetTagNames the asset tag names (optionally <code>null</code>)
1257            * @throws PortalException if a user with the primary key could not be
1258            found
1259            * @throws SystemException if a system exception occurred
1260            */
1261            public static void updateAsset(long userId,
1262                    com.liferay.portal.model.Group group, long[] assetCategoryIds,
1263                    java.lang.String[] assetTagNames)
1264                    throws com.liferay.portal.kernel.exception.PortalException,
1265                            com.liferay.portal.kernel.exception.SystemException {
1266                    getService().updateAsset(userId, group, assetCategoryIds, assetTagNames);
1267            }
1268    
1269            /**
1270            * Updates the group's friendly URL.
1271            *
1272            * @param groupId the primary key of the group
1273            * @param friendlyURL the group's new friendlyURL (optionally
1274            <code>null</code>)
1275            * @return the group
1276            * @throws PortalException if a group with the primary key could not be
1277            found or if a valid friendly URL could not be created for the
1278            group
1279            * @throws SystemException if a system exception occurred
1280            */
1281            public static com.liferay.portal.model.Group updateFriendlyURL(
1282                    long groupId, java.lang.String friendlyURL)
1283                    throws com.liferay.portal.kernel.exception.PortalException,
1284                            com.liferay.portal.kernel.exception.SystemException {
1285                    return getService().updateFriendlyURL(groupId, friendlyURL);
1286            }
1287    
1288            /**
1289            * Updates the group's type settings.
1290            *
1291            * @param groupId the primary key of the group
1292            * @param typeSettings the group's new type settings (optionally
1293            <code>null</code>)
1294            * @return the group
1295            * @throws PortalException if a group with the primary key could not be
1296            found
1297            * @throws SystemException if a system exception occurred
1298            */
1299            public static com.liferay.portal.model.Group updateGroup(long groupId,
1300                    java.lang.String typeSettings)
1301                    throws com.liferay.portal.kernel.exception.PortalException,
1302                            com.liferay.portal.kernel.exception.SystemException {
1303                    return getService().updateGroup(groupId, typeSettings);
1304            }
1305    
1306            /**
1307            * Updates the group.
1308            *
1309            * @param groupId the primary key of the group
1310            * @param name the group's new name
1311            * @param description the group's new description (optionally
1312            <code>null</code>)
1313            * @param type the group's new type. For more information see {@link
1314            com.liferay.portal.model.GroupConstants}
1315            * @param friendlyURL the group's new friendlyURL (optionally
1316            <code>null</code>)
1317            * @param active whether the group is active
1318            * @param serviceContext the service context to be applied (optionally
1319            <code>null</code>). Can specify the group's replacement asset
1320            category IDs and replacement asset tag names
1321            * @return the group
1322            * @throws PortalException if a group with the primary key could not be
1323            found or if the friendly URL was invalid or could one not be
1324            created
1325            * @throws SystemException if a system exception occurred
1326            */
1327            public static com.liferay.portal.model.Group updateGroup(long groupId,
1328                    java.lang.String name, java.lang.String description, int type,
1329                    java.lang.String friendlyURL, boolean active,
1330                    com.liferay.portal.service.ServiceContext serviceContext)
1331                    throws com.liferay.portal.kernel.exception.PortalException,
1332                            com.liferay.portal.kernel.exception.SystemException {
1333                    return getService()
1334                                       .updateGroup(groupId, name, description, type, friendlyURL,
1335                            active, serviceContext);
1336            }
1337    
1338            /**
1339            * Associates the group with a main site if the group is an organization.
1340            *
1341            * @param groupId the primary key of the group
1342            * @param site whether the group is to be associated with a main site
1343            * @return the group
1344            * @throws PortalException if a group with the primary key could not be
1345            found
1346            * @throws SystemException if a system exception occurred
1347            */
1348            public static com.liferay.portal.model.Group updateSite(long groupId,
1349                    boolean site)
1350                    throws com.liferay.portal.kernel.exception.PortalException,
1351                            com.liferay.portal.kernel.exception.SystemException {
1352                    return getService().updateSite(groupId, site);
1353            }
1354    
1355            public static GroupLocalService getService() {
1356                    if (_service == null) {
1357                            _service = (GroupLocalService)PortalBeanLocatorUtil.locate(GroupLocalService.class.getName());
1358    
1359                            ReferenceRegistry.registerReference(GroupLocalServiceUtil.class,
1360                                    "_service");
1361                            MethodCache.remove(GroupLocalService.class);
1362                    }
1363    
1364                    return _service;
1365            }
1366    
1367            public void setService(GroupLocalService service) {
1368                    MethodCache.remove(GroupLocalService.class);
1369    
1370                    _service = service;
1371    
1372                    ReferenceRegistry.registerReference(GroupLocalServiceUtil.class,
1373                            "_service");
1374                    MethodCache.remove(GroupLocalService.class);
1375            }
1376    
1377            private static GroupLocalService _service;
1378    }