001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * The utility for the user group remote service. This utility wraps {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
022     *
023     * <p>
024     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see UserGroupService
029     * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl
030     * @see com.liferay.portal.service.impl.UserGroupServiceImpl
031     * @generated
032     */
033    public class UserGroupServiceUtil {
034            /*
035             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and rerun ServiceBuilder to regenerate this class.
038             */
039    
040            /**
041            * Returns the Spring bean ID for this bean.
042            *
043            * @return the Spring bean ID for this bean
044            */
045            public static java.lang.String getBeanIdentifier() {
046                    return getService().getBeanIdentifier();
047            }
048    
049            /**
050            * Sets the Spring bean ID for this bean.
051            *
052            * @param beanIdentifier the Spring bean ID for this bean
053            */
054            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
055                    getService().setBeanIdentifier(beanIdentifier);
056            }
057    
058            /**
059            * Adds the user groups to the group.
060            *
061            * @param groupId the primary key of the group
062            * @param userGroupIds the primary keys of the user groups
063            * @throws PortalException if a group or user group with the primary key
064            could not be found, or if the user did not have permission to
065            assign group members
066            * @throws SystemException if a system exception occurred
067            */
068            public static void addGroupUserGroups(long groupId, long[] userGroupIds)
069                    throws com.liferay.portal.kernel.exception.PortalException,
070                            com.liferay.portal.kernel.exception.SystemException {
071                    getService().addGroupUserGroups(groupId, userGroupIds);
072            }
073    
074            /**
075            * Adds the user groups to the team
076            *
077            * @param teamId the primary key of the team
078            * @param userGroupIds the primary keys of the user groups
079            * @throws PortalException if a team or user group with the primary key
080            could not be found, or if the user did not have permission to
081            assign team members
082            * @throws SystemException if a system exception occurred
083            */
084            public static void addTeamUserGroups(long teamId, long[] userGroupIds)
085                    throws com.liferay.portal.kernel.exception.PortalException,
086                            com.liferay.portal.kernel.exception.SystemException {
087                    getService().addTeamUserGroups(teamId, userGroupIds);
088            }
089    
090            /**
091            * Adds a user group.
092            *
093            * <p>
094            * This method handles the creation and bookkeeping of the user group,
095            * including its resources, metadata, and internal data structures.
096            * </p>
097            *
098            * @param name the user group's name
099            * @param description the user group's description
100            * @return the user group
101            * @throws PortalException if the user group's information was invalid
102            or if the user did not have permission to add the user group
103            * @throws SystemException if a system exception occurred
104            * @deprecated {@link #addUserGroup(String, String, serviceContext)}
105            */
106            public static com.liferay.portal.model.UserGroup addUserGroup(
107                    java.lang.String name, java.lang.String description)
108                    throws com.liferay.portal.kernel.exception.PortalException,
109                            com.liferay.portal.kernel.exception.SystemException {
110                    return getService().addUserGroup(name, description);
111            }
112    
113            /**
114            * Adds a user group.
115            *
116            * <p>
117            * This method handles the creation and bookkeeping of the user group,
118            * including its resources, metadata, and internal data structures.
119            * </p>
120            *
121            * @param name the user group's name
122            * @param description the user group's description
123            * @param serviceContext the user group's service context (optionally
124            <code>null</code>). Can set expando bridge attributes for the
125            user group.
126            * @return the user group
127            * @throws PortalException if the user group's information was invalid or if
128            the user did not have permission to add the user group
129            * @throws SystemException if a system exception occurred
130            */
131            public static com.liferay.portal.model.UserGroup addUserGroup(
132                    java.lang.String name, java.lang.String description,
133                    com.liferay.portal.service.ServiceContext serviceContext)
134                    throws com.liferay.portal.kernel.exception.PortalException,
135                            com.liferay.portal.kernel.exception.SystemException {
136                    return getService().addUserGroup(name, description, serviceContext);
137            }
138    
139            /**
140            * Deletes the user group.
141            *
142            * @param userGroupId the primary key of the user group
143            * @throws PortalException if a user group with the primary key could not be
144            found, if the user did not have permission to delete the user
145            group, or if the user group had a workflow in approved status
146            * @throws SystemException if a system exception occurred
147            */
148            public static void deleteUserGroup(long userGroupId)
149                    throws com.liferay.portal.kernel.exception.PortalException,
150                            com.liferay.portal.kernel.exception.SystemException {
151                    getService().deleteUserGroup(userGroupId);
152            }
153    
154            /**
155            * Returns the user group with the primary key.
156            *
157            * @param userGroupId the primary key of the user group
158            * @return Returns the user group with the primary key
159            * @throws PortalException if a user group with the primary key could not be
160            found or if the user did not have permission to view the user
161            group
162            * @throws SystemException if a system exception occurred
163            */
164            public static com.liferay.portal.model.UserGroup getUserGroup(
165                    long userGroupId)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException {
168                    return getService().getUserGroup(userGroupId);
169            }
170    
171            /**
172            * Returns the user group with the name.
173            *
174            * @param name the user group's name
175            * @return Returns the user group with the name
176            * @throws PortalException if a user group with the name could not be found
177            or if the user did not have permission to view the user group
178            * @throws SystemException if a system exception occurred
179            */
180            public static com.liferay.portal.model.UserGroup getUserGroup(
181                    java.lang.String name)
182                    throws com.liferay.portal.kernel.exception.PortalException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    return getService().getUserGroup(name);
185            }
186    
187            /**
188            * Returns all the user groups to which the user belongs.
189            *
190            * @param userId the primary key of the user
191            * @return the user groups to which the user belongs
192            * @throws PortalException if the current user did not have permission to
193            view the user or any one of the user group members
194            * @throws SystemException if a system exception occurred
195            */
196            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
197                    long userId)
198                    throws com.liferay.portal.kernel.exception.PortalException,
199                            com.liferay.portal.kernel.exception.SystemException {
200                    return getService().getUserUserGroups(userId);
201            }
202    
203            /**
204            * Removes the user groups from the group.
205            *
206            * @param groupId the primary key of the group
207            * @param userGroupIds the primary keys of the user groups
208            * @throws PortalException if the user did not have permission to assign
209            group members
210            * @throws SystemException if a system exception occurred
211            */
212            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
213                    throws com.liferay.portal.kernel.exception.PortalException,
214                            com.liferay.portal.kernel.exception.SystemException {
215                    getService().unsetGroupUserGroups(groupId, userGroupIds);
216            }
217    
218            /**
219            * Removes the user groups from the team.
220            *
221            * @param teamId the primary key of the team
222            * @param userGroupIds the primary keys of the user groups
223            * @throws PortalException if the user did not have permission to assign
224            team members
225            * @throws SystemException if a system exception occurred
226            */
227            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
228                    throws com.liferay.portal.kernel.exception.PortalException,
229                            com.liferay.portal.kernel.exception.SystemException {
230                    getService().unsetTeamUserGroups(teamId, userGroupIds);
231            }
232    
233            /**
234            * Updates the user group.
235            *
236            * @param userGroupId the primary key of the user group
237            * @param name the user group's name
238            * @param description the the user group's description
239            * @return the user group
240            * @throws PortalException if a user group with the primary key was not
241            found, if the new information was invalid, or if the user did
242            not have permission to update the user group information
243            * @throws SystemException if a system exception occurred
244            * @deprecated {@link #updateUserGroup(long, String, String,
245            serviceContext)}
246            */
247            public static com.liferay.portal.model.UserGroup updateUserGroup(
248                    long userGroupId, java.lang.String name, java.lang.String description)
249                    throws com.liferay.portal.kernel.exception.PortalException,
250                            com.liferay.portal.kernel.exception.SystemException {
251                    return getService().updateUserGroup(userGroupId, name, description);
252            }
253    
254            /**
255            * Updates the user group.
256            *
257            * @param userGroupId the primary key of the user group
258            * @param name the user group's name
259            * @param description the the user group's description
260            * @param serviceContext the user group's service context (optionally
261            <code>null</code>). Can set expando bridge attributes for the
262            user group.
263            * @return the user group
264            * @throws PortalException if a user group with the primary key was not
265            found, if the new information was invalid, or if the user did not
266            have permission to update the user group information
267            * @throws SystemException if a system exception occurred
268            */
269            public static com.liferay.portal.model.UserGroup updateUserGroup(
270                    long userGroupId, java.lang.String name, java.lang.String description,
271                    com.liferay.portal.service.ServiceContext serviceContext)
272                    throws com.liferay.portal.kernel.exception.PortalException,
273                            com.liferay.portal.kernel.exception.SystemException {
274                    return getService()
275                                       .updateUserGroup(userGroupId, name, description,
276                            serviceContext);
277            }
278    
279            public static UserGroupService getService() {
280                    if (_service == null) {
281                            _service = (UserGroupService)PortalBeanLocatorUtil.locate(UserGroupService.class.getName());
282    
283                            ReferenceRegistry.registerReference(UserGroupServiceUtil.class,
284                                    "_service");
285                    }
286    
287                    return _service;
288            }
289    
290            /**
291             * @deprecated
292             */
293            public void setService(UserGroupService service) {
294            }
295    
296            private static UserGroupService _service;
297    }