001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * <p>
021     * This class provides static methods for the
022     * {@link GroupService} bean. The static methods of
023     * this class calls the same methods of the bean instance. It's convenient to be
024     * able to just write one line to call a method on a bean instead of writing a
025     * lookup call and a method call.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       GroupService
030     * @generated
031     */
032    public class GroupServiceUtil {
033            public static com.liferay.portal.model.Group addGroup(
034                    java.lang.String name, java.lang.String description, int type,
035                    java.lang.String friendlyURL, boolean active,
036                    com.liferay.portal.service.ServiceContext serviceContext)
037                    throws com.liferay.portal.kernel.exception.PortalException,
038                            com.liferay.portal.kernel.exception.SystemException {
039                    return getService()
040                                       .addGroup(name, description, type, friendlyURL, active,
041                            serviceContext);
042            }
043    
044            public static com.liferay.portal.model.Group addGroup(long liveGroupId,
045                    java.lang.String name, java.lang.String description, int type,
046                    java.lang.String friendlyURL, boolean active,
047                    com.liferay.portal.service.ServiceContext serviceContext)
048                    throws com.liferay.portal.kernel.exception.PortalException,
049                            com.liferay.portal.kernel.exception.SystemException {
050                    return getService()
051                                       .addGroup(liveGroupId, name, description, type, friendlyURL,
052                            active, serviceContext);
053            }
054    
055            public static void addRoleGroups(long roleId, long[] groupIds)
056                    throws com.liferay.portal.kernel.exception.PortalException,
057                            com.liferay.portal.kernel.exception.SystemException {
058                    getService().addRoleGroups(roleId, groupIds);
059            }
060    
061            public static void deleteGroup(long groupId)
062                    throws com.liferay.portal.kernel.exception.PortalException,
063                            com.liferay.portal.kernel.exception.SystemException {
064                    getService().deleteGroup(groupId);
065            }
066    
067            public static com.liferay.portal.model.Group getGroup(long groupId)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    return getService().getGroup(groupId);
071            }
072    
073            public static com.liferay.portal.model.Group getGroup(long companyId,
074                    java.lang.String name)
075                    throws com.liferay.portal.kernel.exception.PortalException,
076                            com.liferay.portal.kernel.exception.SystemException {
077                    return getService().getGroup(companyId, name);
078            }
079    
080            public static java.util.List<com.liferay.portal.model.Group> getManageableGroups(
081                    java.lang.String actionId, int max)
082                    throws com.liferay.portal.kernel.exception.PortalException,
083                            com.liferay.portal.kernel.exception.SystemException {
084                    return getService().getManageableGroups(actionId, max);
085            }
086    
087            public static java.util.List<com.liferay.portal.model.Group> getOrganizationsGroups(
088                    java.util.List<com.liferay.portal.model.Organization> organizations) {
089                    return getService().getOrganizationsGroups(organizations);
090            }
091    
092            public static com.liferay.portal.model.Group getUserGroup(long companyId,
093                    long userId)
094                    throws com.liferay.portal.kernel.exception.PortalException,
095                            com.liferay.portal.kernel.exception.SystemException {
096                    return getService().getUserGroup(companyId, userId);
097            }
098    
099            public static java.util.List<com.liferay.portal.model.Group> getUserGroupsGroups(
100                    java.util.List<com.liferay.portal.model.UserGroup> userGroups)
101                    throws com.liferay.portal.kernel.exception.PortalException,
102                            com.liferay.portal.kernel.exception.SystemException {
103                    return getService().getUserGroupsGroups(userGroups);
104            }
105    
106            public static java.util.List<com.liferay.portal.model.Group> getUserOrganizationsGroups(
107                    long userId, int start, int end)
108                    throws com.liferay.portal.kernel.exception.PortalException,
109                            com.liferay.portal.kernel.exception.SystemException {
110                    return getService().getUserOrganizationsGroups(userId, start, end);
111            }
112    
113            public static boolean hasUserGroup(long userId, long groupId)
114                    throws com.liferay.portal.kernel.exception.SystemException {
115                    return getService().hasUserGroup(userId, groupId);
116            }
117    
118            public static java.util.List<com.liferay.portal.model.Group> search(
119                    long companyId, java.lang.String name, java.lang.String description,
120                    java.lang.String[] params, int start, int end)
121                    throws com.liferay.portal.kernel.exception.SystemException {
122                    return getService()
123                                       .search(companyId, name, description, params, start, end);
124            }
125    
126            public static int searchCount(long companyId, java.lang.String name,
127                    java.lang.String description, java.lang.String[] params)
128                    throws com.liferay.portal.kernel.exception.SystemException {
129                    return getService().searchCount(companyId, name, description, params);
130            }
131    
132            public static void setRoleGroups(long roleId, long[] groupIds)
133                    throws com.liferay.portal.kernel.exception.PortalException,
134                            com.liferay.portal.kernel.exception.SystemException {
135                    getService().setRoleGroups(roleId, groupIds);
136            }
137    
138            public static void unsetRoleGroups(long roleId, long[] groupIds)
139                    throws com.liferay.portal.kernel.exception.PortalException,
140                            com.liferay.portal.kernel.exception.SystemException {
141                    getService().unsetRoleGroups(roleId, groupIds);
142            }
143    
144            public static com.liferay.portal.model.Group updateFriendlyURL(
145                    long groupId, java.lang.String friendlyURL)
146                    throws com.liferay.portal.kernel.exception.PortalException,
147                            com.liferay.portal.kernel.exception.SystemException {
148                    return getService().updateFriendlyURL(groupId, friendlyURL);
149            }
150    
151            public static com.liferay.portal.model.Group updateGroup(long groupId,
152                    java.lang.String name, java.lang.String description, int type,
153                    java.lang.String friendlyURL, boolean active,
154                    com.liferay.portal.service.ServiceContext serviceContext)
155                    throws com.liferay.portal.kernel.exception.PortalException,
156                            com.liferay.portal.kernel.exception.SystemException {
157                    return getService()
158                                       .updateGroup(groupId, name, description, type, friendlyURL,
159                            active, serviceContext);
160            }
161    
162            public static com.liferay.portal.model.Group updateGroup(long groupId,
163                    java.lang.String typeSettings)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException {
166                    return getService().updateGroup(groupId, typeSettings);
167            }
168    
169            public static com.liferay.portal.model.Group updateWorkflow(long groupId,
170                    boolean workflowEnabled, int workflowStages,
171                    java.lang.String workflowRoleNames)
172                    throws com.liferay.portal.kernel.exception.PortalException,
173                            com.liferay.portal.kernel.exception.SystemException {
174                    return getService()
175                                       .updateWorkflow(groupId, workflowEnabled, workflowStages,
176                            workflowRoleNames);
177            }
178    
179            public static GroupService getService() {
180                    if (_service == null) {
181                            _service = (GroupService)PortalBeanLocatorUtil.locate(GroupService.class.getName());
182                    }
183    
184                    return _service;
185            }
186    
187            public void setService(GroupService service) {
188                    _service = service;
189            }
190    
191            private static GroupService _service;
192    }