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