001    /**
002     * Copyright (c) 2000-2013 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 As of 6.2.0, replaced by {@link #addUserGroup(String, String,
105            serviceContext)}
106            */
107            public static com.liferay.portal.model.UserGroup addUserGroup(
108                    java.lang.String name, java.lang.String description)
109                    throws com.liferay.portal.kernel.exception.PortalException,
110                            com.liferay.portal.kernel.exception.SystemException {
111                    return getService().addUserGroup(name, description);
112            }
113    
114            /**
115            * Adds a user group.
116            *
117            * <p>
118            * This method handles the creation and bookkeeping of the user group,
119            * including its resources, metadata, and internal data structures.
120            * </p>
121            *
122            * @param name the user group's name
123            * @param description the user group's description
124            * @param serviceContext the service context to be applied (optionally
125            <code>null</code>). Can set expando bridge attributes for the
126            user group.
127            * @return the user group
128            * @throws PortalException if the user group's information was invalid or if
129            the user did not have permission to add the user group
130            * @throws SystemException if a system exception occurred
131            */
132            public static com.liferay.portal.model.UserGroup addUserGroup(
133                    java.lang.String name, java.lang.String description,
134                    com.liferay.portal.service.ServiceContext serviceContext)
135                    throws com.liferay.portal.kernel.exception.PortalException,
136                            com.liferay.portal.kernel.exception.SystemException {
137                    return getService().addUserGroup(name, description, serviceContext);
138            }
139    
140            /**
141            * Deletes the user group.
142            *
143            * @param userGroupId the primary key of the user group
144            * @throws PortalException if a user group with the primary key could not be
145            found, if the user did not have permission to delete the user
146            group, or if the user group had a workflow in approved status
147            * @throws SystemException if a system exception occurred
148            */
149            public static void deleteUserGroup(long userGroupId)
150                    throws com.liferay.portal.kernel.exception.PortalException,
151                            com.liferay.portal.kernel.exception.SystemException {
152                    getService().deleteUserGroup(userGroupId);
153            }
154    
155            /**
156            * Returns the user group with the primary key.
157            *
158            * @param userGroupId the primary key of the user group
159            * @return Returns the user group with the primary key
160            * @throws PortalException if a user group with the primary key could not be
161            found or if the user did not have permission to view the user
162            group
163            * @throws SystemException if a system exception occurred
164            */
165            public static com.liferay.portal.model.UserGroup getUserGroup(
166                    long userGroupId)
167                    throws com.liferay.portal.kernel.exception.PortalException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    return getService().getUserGroup(userGroupId);
170            }
171    
172            /**
173            * Returns the user group with the name.
174            *
175            * @param name the user group's name
176            * @return Returns the user group with the name
177            * @throws PortalException if a user group with the name could not be found
178            or if the user did not have permission to view the user group
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portal.model.UserGroup getUserGroup(
182                    java.lang.String name)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().getUserGroup(name);
186            }
187    
188            /**
189            * Returns all the user groups to which the user belongs.
190            *
191            * @param userId the primary key of the user
192            * @return the user groups to which the user belongs
193            * @throws PortalException if the current user did not have permission to
194            view the user or any one of the user group members
195            * @throws SystemException if a system exception occurred
196            */
197            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
198                    long userId)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    return getService().getUserUserGroups(userId);
202            }
203    
204            /**
205            * Removes the user groups from the group.
206            *
207            * @param groupId the primary key of the group
208            * @param userGroupIds the primary keys of the user groups
209            * @throws PortalException if the user did not have permission to assign
210            group members
211            * @throws SystemException if a system exception occurred
212            */
213            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    getService().unsetGroupUserGroups(groupId, userGroupIds);
217            }
218    
219            /**
220            * Removes the user groups from the team.
221            *
222            * @param teamId the primary key of the team
223            * @param userGroupIds the primary keys of the user groups
224            * @throws PortalException if the user did not have permission to assign
225            team members
226            * @throws SystemException if a system exception occurred
227            */
228            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
229                    throws com.liferay.portal.kernel.exception.PortalException,
230                            com.liferay.portal.kernel.exception.SystemException {
231                    getService().unsetTeamUserGroups(teamId, userGroupIds);
232            }
233    
234            /**
235            * Updates the user group.
236            *
237            * @param userGroupId the primary key of the user group
238            * @param name the user group's name
239            * @param description the the user group's description
240            * @return the user group
241            * @throws PortalException if a user group with the primary key was not
242            found, if the new information was invalid, or if the user did
243            not have permission to update the user group information
244            * @throws SystemException if a system exception occurred
245            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long,
246            String, String, serviceContext)}
247            */
248            public static com.liferay.portal.model.UserGroup updateUserGroup(
249                    long userGroupId, java.lang.String name, java.lang.String description)
250                    throws com.liferay.portal.kernel.exception.PortalException,
251                            com.liferay.portal.kernel.exception.SystemException {
252                    return getService().updateUserGroup(userGroupId, name, description);
253            }
254    
255            /**
256            * Updates the user group.
257            *
258            * @param userGroupId the primary key of the user group
259            * @param name the user group's name
260            * @param description the the user group's description
261            * @param serviceContext the service context to be applied (optionally
262            <code>null</code>). Can set expando bridge attributes for the
263            user group.
264            * @return the user group
265            * @throws PortalException if a user group with the primary key was not
266            found, if the new information was invalid, or if the user did not
267            have permission to update the user group information
268            * @throws SystemException if a system exception occurred
269            */
270            public static com.liferay.portal.model.UserGroup updateUserGroup(
271                    long userGroupId, java.lang.String name, java.lang.String description,
272                    com.liferay.portal.service.ServiceContext serviceContext)
273                    throws com.liferay.portal.kernel.exception.PortalException,
274                            com.liferay.portal.kernel.exception.SystemException {
275                    return getService()
276                                       .updateUserGroup(userGroupId, name, description,
277                            serviceContext);
278            }
279    
280            public static UserGroupService getService() {
281                    if (_service == null) {
282                            _service = (UserGroupService)PortalBeanLocatorUtil.locate(UserGroupService.class.getName());
283    
284                            ReferenceRegistry.registerReference(UserGroupServiceUtil.class,
285                                    "_service");
286                    }
287    
288                    return _service;
289            }
290    
291            /**
292             * @deprecated As of 6.2.0
293             */
294            public void setService(UserGroupService service) {
295            }
296    
297            private static UserGroupService _service;
298    }