001    /**
002     * Copyright (c) 2000-2010 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    
019    /**
020     * 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.
021     *
022     * <p>
023     * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.GroupLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
024     * </p>
025     *
026     * <p>
027     * 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.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see GroupLocalService
032     * @see com.liferay.portal.service.base.GroupLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.GroupLocalServiceImpl
034     * @generated
035     */
036    public class GroupLocalServiceUtil {
037            /**
038            * Adds the group to the database. Also notifies the appropriate model listeners.
039            *
040            * @param group the group to add
041            * @return the group that was added
042            * @throws SystemException if a system exception occurred
043            */
044            public static com.liferay.portal.model.Group addGroup(
045                    com.liferay.portal.model.Group group)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getService().addGroup(group);
048            }
049    
050            /**
051            * Creates a new group with the primary key. Does not add the group to the database.
052            *
053            * @param groupId the primary key for the new group
054            * @return the new group
055            */
056            public static com.liferay.portal.model.Group createGroup(long groupId) {
057                    return getService().createGroup(groupId);
058            }
059    
060            /**
061            * Deletes the group with the primary key from the database. Also notifies the appropriate model listeners.
062            *
063            * @param groupId the primary key of the group to delete
064            * @throws PortalException if a group with the primary key could not be found
065            * @throws SystemException if a system exception occurred
066            */
067            public static void deleteGroup(long groupId)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    getService().deleteGroup(groupId);
071            }
072    
073            /**
074            * Deletes the group from the database. Also notifies the appropriate model listeners.
075            *
076            * @param group the group to delete
077            * @throws SystemException if a system exception occurred
078            */
079            public static void deleteGroup(com.liferay.portal.model.Group group)
080                    throws com.liferay.portal.kernel.exception.SystemException {
081                    getService().deleteGroup(group);
082            }
083    
084            /**
085            * Performs a dynamic query on the database and returns the matching rows.
086            *
087            * @param dynamicQuery the dynamic query to search with
088            * @return the matching rows
089            * @throws SystemException if a system exception occurred
090            */
091            @SuppressWarnings("rawtypes")
092            public static java.util.List dynamicQuery(
093                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
094                    throws com.liferay.portal.kernel.exception.SystemException {
095                    return getService().dynamicQuery(dynamicQuery);
096            }
097    
098            /**
099            * Performs a dynamic query on the database and returns a range of the matching rows.
100            *
101            * <p>
102            * 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.
103            * </p>
104            *
105            * @param dynamicQuery the dynamic query to search with
106            * @param start the lower bound of the range of model instances to return
107            * @param end the upper bound of the range of model instances to return (not inclusive)
108            * @return the range of matching rows
109            * @throws SystemException if a system exception occurred
110            */
111            @SuppressWarnings("rawtypes")
112            public static java.util.List dynamicQuery(
113                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
114                    int end) throws com.liferay.portal.kernel.exception.SystemException {
115                    return getService().dynamicQuery(dynamicQuery, start, end);
116            }
117    
118            /**
119            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
120            *
121            * <p>
122            * 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.
123            * </p>
124            *
125            * @param dynamicQuery the dynamic query to search with
126            * @param start the lower bound of the range of model instances to return
127            * @param end the upper bound of the range of model instances to return (not inclusive)
128            * @param orderByComparator the comparator to order the results by
129            * @return the ordered range of matching rows
130            * @throws SystemException if a system exception occurred
131            */
132            @SuppressWarnings("rawtypes")
133            public static java.util.List dynamicQuery(
134                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
135                    int end,
136                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
137                    throws com.liferay.portal.kernel.exception.SystemException {
138                    return getService()
139                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
140            }
141    
142            /**
143            * Counts the number of rows that match the dynamic query.
144            *
145            * @param dynamicQuery the dynamic query to search with
146            * @return the number of rows that match the dynamic query
147            * @throws SystemException if a system exception occurred
148            */
149            public static long dynamicQueryCount(
150                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
151                    throws com.liferay.portal.kernel.exception.SystemException {
152                    return getService().dynamicQueryCount(dynamicQuery);
153            }
154    
155            /**
156            * Gets the group with the primary key.
157            *
158            * @param groupId the primary key of the group to get
159            * @return the group
160            * @throws PortalException if a group with the primary key could not be found
161            * @throws SystemException if a system exception occurred
162            */
163            public static com.liferay.portal.model.Group getGroup(long groupId)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException {
166                    return getService().getGroup(groupId);
167            }
168    
169            /**
170            * Gets a range of all the groups.
171            *
172            * <p>
173            * 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.
174            * </p>
175            *
176            * @param start the lower bound of the range of groups to return
177            * @param end the upper bound of the range of groups to return (not inclusive)
178            * @return the range of groups
179            * @throws SystemException if a system exception occurred
180            */
181            public static java.util.List<com.liferay.portal.model.Group> getGroups(
182                    int start, int end)
183                    throws com.liferay.portal.kernel.exception.SystemException {
184                    return getService().getGroups(start, end);
185            }
186    
187            /**
188            * Gets the number of groups.
189            *
190            * @return the number of groups
191            * @throws SystemException if a system exception occurred
192            */
193            public static int getGroupsCount()
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getService().getGroupsCount();
196            }
197    
198            /**
199            * Updates the group in the database. Also notifies the appropriate model listeners.
200            *
201            * @param group the group to update
202            * @return the group that was updated
203            * @throws SystemException if a system exception occurred
204            */
205            public static com.liferay.portal.model.Group updateGroup(
206                    com.liferay.portal.model.Group group)
207                    throws com.liferay.portal.kernel.exception.SystemException {
208                    return getService().updateGroup(group);
209            }
210    
211            /**
212            * Updates the group in the database. Also notifies the appropriate model listeners.
213            *
214            * @param group the group to update
215            * @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.
216            * @return the group that was updated
217            * @throws SystemException if a system exception occurred
218            */
219            public static com.liferay.portal.model.Group updateGroup(
220                    com.liferay.portal.model.Group group, boolean merge)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getService().updateGroup(group, merge);
223            }
224    
225            public static com.liferay.portal.model.Group addGroup(long userId,
226                    java.lang.String className, long classPK, java.lang.String name,
227                    java.lang.String description, int type, java.lang.String friendlyURL,
228                    boolean active, com.liferay.portal.service.ServiceContext serviceContext)
229                    throws com.liferay.portal.kernel.exception.PortalException,
230                            com.liferay.portal.kernel.exception.SystemException {
231                    return getService()
232                                       .addGroup(userId, className, classPK, name, description,
233                            type, friendlyURL, active, serviceContext);
234            }
235    
236            public static com.liferay.portal.model.Group addGroup(long userId,
237                    java.lang.String className, long classPK, long liveGroupId,
238                    java.lang.String name, java.lang.String description, int type,
239                    java.lang.String friendlyURL, boolean active,
240                    com.liferay.portal.service.ServiceContext serviceContext)
241                    throws com.liferay.portal.kernel.exception.PortalException,
242                            com.liferay.portal.kernel.exception.SystemException {
243                    return getService()
244                                       .addGroup(userId, className, classPK, liveGroupId, name,
245                            description, type, friendlyURL, active, serviceContext);
246            }
247    
248            public static void addRoleGroups(long roleId, long[] groupIds)
249                    throws com.liferay.portal.kernel.exception.SystemException {
250                    getService().addRoleGroups(roleId, groupIds);
251            }
252    
253            public static void addUserGroups(long userId, long[] groupIds)
254                    throws com.liferay.portal.kernel.exception.SystemException {
255                    getService().addUserGroups(userId, groupIds);
256            }
257    
258            public static void checkCompanyGroup(long companyId)
259                    throws com.liferay.portal.kernel.exception.PortalException,
260                            com.liferay.portal.kernel.exception.SystemException {
261                    getService().checkCompanyGroup(companyId);
262            }
263    
264            public static void checkSystemGroups(long companyId)
265                    throws com.liferay.portal.kernel.exception.PortalException,
266                            com.liferay.portal.kernel.exception.SystemException {
267                    getService().checkSystemGroups(companyId);
268            }
269    
270            public static com.liferay.portal.model.Group getCompanyGroup(long companyId)
271                    throws com.liferay.portal.kernel.exception.PortalException,
272                            com.liferay.portal.kernel.exception.SystemException {
273                    return getService().getCompanyGroup(companyId);
274            }
275    
276            public static java.util.List<com.liferay.portal.model.Group> getCompanyGroups(
277                    long companyId, int start, int end)
278                    throws com.liferay.portal.kernel.exception.SystemException {
279                    return getService().getCompanyGroups(companyId, start, end);
280            }
281    
282            public static int getCompanyGroupsCount(long companyId)
283                    throws com.liferay.portal.kernel.exception.SystemException {
284                    return getService().getCompanyGroupsCount(companyId);
285            }
286    
287            public static com.liferay.portal.model.Group getFriendlyURLGroup(
288                    long companyId, java.lang.String friendlyURL)
289                    throws com.liferay.portal.kernel.exception.PortalException,
290                            com.liferay.portal.kernel.exception.SystemException {
291                    return getService().getFriendlyURLGroup(companyId, friendlyURL);
292            }
293    
294            public static com.liferay.portal.model.Group getGroup(long companyId,
295                    java.lang.String name)
296                    throws com.liferay.portal.kernel.exception.PortalException,
297                            com.liferay.portal.kernel.exception.SystemException {
298                    return getService().getGroup(companyId, name);
299            }
300    
301            public static java.util.List<com.liferay.portal.model.Group> getGroups(
302                    long[] groupIds)
303                    throws com.liferay.portal.kernel.exception.PortalException,
304                            com.liferay.portal.kernel.exception.SystemException {
305                    return getService().getGroups(groupIds);
306            }
307    
308            public static com.liferay.portal.model.Group getLayoutGroup(
309                    long companyId, long plid)
310                    throws com.liferay.portal.kernel.exception.PortalException,
311                            com.liferay.portal.kernel.exception.SystemException {
312                    return getService().getLayoutGroup(companyId, plid);
313            }
314    
315            public static com.liferay.portal.model.Group getLayoutPrototypeGroup(
316                    long companyId, long layoutPrototypeId)
317                    throws com.liferay.portal.kernel.exception.PortalException,
318                            com.liferay.portal.kernel.exception.SystemException {
319                    return getService().getLayoutPrototypeGroup(companyId, layoutPrototypeId);
320            }
321    
322            public static com.liferay.portal.model.Group getLayoutSetPrototypeGroup(
323                    long companyId, long layoutSetPrototypeId)
324                    throws com.liferay.portal.kernel.exception.PortalException,
325                            com.liferay.portal.kernel.exception.SystemException {
326                    return getService()
327                                       .getLayoutSetPrototypeGroup(companyId, layoutSetPrototypeId);
328            }
329    
330            public static java.util.List<com.liferay.portal.model.Group> getLiveGroups()
331                    throws com.liferay.portal.kernel.exception.SystemException {
332                    return getService().getLiveGroups();
333            }
334    
335            public static java.util.List<com.liferay.portal.model.Group> getNoLayoutsGroups(
336                    java.lang.String className, boolean privateLayout, int start, int end)
337                    throws com.liferay.portal.kernel.exception.SystemException {
338                    return getService()
339                                       .getNoLayoutsGroups(className, privateLayout, start, end);
340            }
341    
342            public static java.util.List<com.liferay.portal.model.Group> getNullFriendlyURLGroups()
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    return getService().getNullFriendlyURLGroups();
345            }
346    
347            public static com.liferay.portal.model.Group getOrganizationGroup(
348                    long companyId, long organizationId)
349                    throws com.liferay.portal.kernel.exception.PortalException,
350                            com.liferay.portal.kernel.exception.SystemException {
351                    return getService().getOrganizationGroup(companyId, organizationId);
352            }
353    
354            public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
355                    java.util.List<com.liferay.portal.model.Organization> organizations) {
356                    return getService().getOrganizationsGroups(organizations);
357            }
358    
359            public static java.util.List<com.liferay.portal.model.Group> getOrganizationsRelatedGroups(
360                    java.util.List<com.liferay.portal.model.Organization> organizations)
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    return getService().getOrganizationsRelatedGroups(organizations);
363            }
364    
365            public static java.util.List<com.liferay.portal.model.Group> getRoleGroups(
366                    long roleId) throws com.liferay.portal.kernel.exception.SystemException {
367                    return getService().getRoleGroups(roleId);
368            }
369    
370            public static com.liferay.portal.model.Group getStagingGroup(
371                    long liveGroupId)
372                    throws com.liferay.portal.kernel.exception.PortalException,
373                            com.liferay.portal.kernel.exception.SystemException {
374                    return getService().getStagingGroup(liveGroupId);
375            }
376    
377            public static com.liferay.portal.model.Group getUserGroup(long companyId,
378                    long userId)
379                    throws com.liferay.portal.kernel.exception.PortalException,
380                            com.liferay.portal.kernel.exception.SystemException {
381                    return getService().getUserGroup(companyId, userId);
382            }
383    
384            public static com.liferay.portal.model.Group getUserGroupGroup(
385                    long companyId, long userGroupId)
386                    throws com.liferay.portal.kernel.exception.PortalException,
387                            com.liferay.portal.kernel.exception.SystemException {
388                    return getService().getUserGroupGroup(companyId, userGroupId);
389            }
390    
391            public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
392                    long userId)
393                    throws com.liferay.portal.kernel.exception.PortalException,
394                            com.liferay.portal.kernel.exception.SystemException {
395                    return getService().getUserGroups(userId);
396            }
397    
398            public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
399                    long userId, boolean inherit)
400                    throws com.liferay.portal.kernel.exception.PortalException,
401                            com.liferay.portal.kernel.exception.SystemException {
402                    return getService().getUserGroups(userId, inherit);
403            }
404    
405            public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
406                    long userId, int start, int end)
407                    throws com.liferay.portal.kernel.exception.PortalException,
408                            com.liferay.portal.kernel.exception.SystemException {
409                    return getService().getUserGroups(userId, start, end);
410            }
411    
412            public static java.util.List<com.liferay.portal.model.Group> getUserGroups(
413                    long userId, boolean inherit, int start, int end)
414                    throws com.liferay.portal.kernel.exception.PortalException,
415                            com.liferay.portal.kernel.exception.SystemException {
416                    return getService().getUserGroups(userId, inherit, start, end);
417            }
418    
419            public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
420                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
421                    throws com.liferay.portal.kernel.exception.PortalException,
422                            com.liferay.portal.kernel.exception.SystemException {
423                    return getService().getUserGroupsGroups(userGroups);
424            }
425    
426            public static java.util.List<com.liferay.portal.model.Group> getUserGroupsRelatedGroups(
427                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
428                    throws com.liferay.portal.kernel.exception.SystemException {
429                    return getService().getUserGroupsRelatedGroups(userGroups);
430            }
431    
432            public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
433                    long userId, int start, int end)
434                    throws com.liferay.portal.kernel.exception.PortalException,
435                            com.liferay.portal.kernel.exception.SystemException {
436                    return getService().getUserOrganizationsGroups(userId, start, end);
437            }
438    
439            public static boolean hasRoleGroup(long roleId, long groupId)
440                    throws com.liferay.portal.kernel.exception.SystemException {
441                    return getService().hasRoleGroup(roleId, groupId);
442            }
443    
444            public static boolean hasStagingGroup(long liveGroupId)
445                    throws com.liferay.portal.kernel.exception.SystemException {
446                    return getService().hasStagingGroup(liveGroupId);
447            }
448    
449            public static boolean hasUserGroup(long userId, long groupId)
450                    throws com.liferay.portal.kernel.exception.SystemException {
451                    return getService().hasUserGroup(userId, groupId);
452            }
453    
454            public static java.util.List<com.liferay.portal.model.Group> search(
455                    long companyId, java.lang.String name, java.lang.String description,
456                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
457                    int start, int end)
458                    throws com.liferay.portal.kernel.exception.SystemException {
459                    return getService()
460                                       .search(companyId, name, description, params, start, end);
461            }
462    
463            public static java.util.List<com.liferay.portal.model.Group> search(
464                    long companyId, java.lang.String name, java.lang.String description,
465                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
466                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
467                    throws com.liferay.portal.kernel.exception.SystemException {
468                    return getService()
469                                       .search(companyId, name, description, params, start, end, obc);
470            }
471    
472            public static int searchCount(long companyId, java.lang.String name,
473                    java.lang.String description,
474                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
475                    throws com.liferay.portal.kernel.exception.SystemException {
476                    return getService().searchCount(companyId, name, description, params);
477            }
478    
479            public static void setRoleGroups(long roleId, long[] groupIds)
480                    throws com.liferay.portal.kernel.exception.SystemException {
481                    getService().setRoleGroups(roleId, groupIds);
482            }
483    
484            public static void unsetRoleGroups(long roleId, long[] groupIds)
485                    throws com.liferay.portal.kernel.exception.SystemException {
486                    getService().unsetRoleGroups(roleId, groupIds);
487            }
488    
489            public static void unsetUserGroups(long userId, long[] groupIds)
490                    throws com.liferay.portal.kernel.exception.SystemException {
491                    getService().unsetUserGroups(userId, groupIds);
492            }
493    
494            public static void updateAsset(long userId,
495                    com.liferay.portal.model.Group group, long[] assetCategoryIds,
496                    java.lang.String[] assetTagNames)
497                    throws com.liferay.portal.kernel.exception.PortalException,
498                            com.liferay.portal.kernel.exception.SystemException {
499                    getService().updateAsset(userId, group, assetCategoryIds, assetTagNames);
500            }
501    
502            public static com.liferay.portal.model.Group updateFriendlyURL(
503                    long groupId, java.lang.String friendlyURL)
504                    throws com.liferay.portal.kernel.exception.PortalException,
505                            com.liferay.portal.kernel.exception.SystemException {
506                    return getService().updateFriendlyURL(groupId, friendlyURL);
507            }
508    
509            public static com.liferay.portal.model.Group updateGroup(long groupId,
510                    java.lang.String name, java.lang.String description, int type,
511                    java.lang.String friendlyURL, boolean active,
512                    com.liferay.portal.service.ServiceContext serviceContext)
513                    throws com.liferay.portal.kernel.exception.PortalException,
514                            com.liferay.portal.kernel.exception.SystemException {
515                    return getService()
516                                       .updateGroup(groupId, name, description, type, friendlyURL,
517                            active, serviceContext);
518            }
519    
520            public static com.liferay.portal.model.Group updateGroup(long groupId,
521                    java.lang.String typeSettings)
522                    throws com.liferay.portal.kernel.exception.PortalException,
523                            com.liferay.portal.kernel.exception.SystemException {
524                    return getService().updateGroup(groupId, typeSettings);
525            }
526    
527            public static com.liferay.portal.model.Group updateWorkflow(long groupId,
528                    boolean workflowEnabled, int workflowStages,
529                    java.lang.String workflowRoleNames)
530                    throws com.liferay.portal.kernel.exception.PortalException,
531                            com.liferay.portal.kernel.exception.SystemException {
532                    return getService()
533                                       .updateWorkflow(groupId, workflowEnabled, workflowStages,
534                            workflowRoleNames);
535            }
536    
537            public static GroupLocalService getService() {
538                    if (_service == null) {
539                            _service = (GroupLocalService)PortalBeanLocatorUtil.locate(GroupLocalService.class.getName());
540                    }
541    
542                    return _service;
543            }
544    
545            public void setService(GroupLocalService service) {
546                    _service = service;
547            }
548    
549            private static GroupLocalService _service;
550    }