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