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