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.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * 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.
023     *
024     * <p>
025     * 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.
026     * </p>
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            * Adds the user groups to the group.
043            *
044            * @param groupId the primary key of the group
045            * @param userGroupIds the primary keys of the user groups
046            * @throws PortalException if a group or user group with the primary key
047            could not be found, or if the user did not have permission to
048            assign group members
049            * @throws SystemException if a system exception occurred
050            */
051            public static void addGroupUserGroups(long groupId, long[] userGroupIds)
052                    throws com.liferay.portal.kernel.exception.PortalException,
053                            com.liferay.portal.kernel.exception.SystemException {
054                    getService().addGroupUserGroups(groupId, userGroupIds);
055            }
056    
057            /**
058            * Adds the user groups to the team
059            *
060            * @param teamId the primary key of the team
061            * @param userGroupIds the primary keys of the user groups
062            * @throws PortalException if a team or user group with the primary key
063            could not be found, or if the user did not have permission to
064            assign team members
065            * @throws SystemException if a system exception occurred
066            */
067            public static void addTeamUserGroups(long teamId, long[] userGroupIds)
068                    throws com.liferay.portal.kernel.exception.PortalException,
069                            com.liferay.portal.kernel.exception.SystemException {
070                    getService().addTeamUserGroups(teamId, userGroupIds);
071            }
072    
073            /**
074            * Adds a user group.
075            *
076            * <p>
077            * This method handles the creation and bookkeeping of the user group,
078            * including its resources, metadata, and internal data structures.
079            * </p>
080            *
081            * @param name the user group's name
082            * @param description the user group's description
083            * @return the user group
084            * @throws PortalException if the user group's information was invalid or if
085            the user did not have permission to add the user group
086            * @throws SystemException if a system exception occurred
087            */
088            public static com.liferay.portal.model.UserGroup addUserGroup(
089                    java.lang.String name, java.lang.String description)
090                    throws com.liferay.portal.kernel.exception.PortalException,
091                            com.liferay.portal.kernel.exception.SystemException {
092                    return getService().addUserGroup(name, description);
093            }
094    
095            /**
096            * Deletes the user group.
097            *
098            * @param userGroupId the primary key of the user group
099            * @throws PortalException if a user group with the primary key could not be
100            found, if the user did not have permission to delete the user
101            group, or if the user group had a workflow in approved status
102            * @throws SystemException if a system exception occurred
103            */
104            public static void deleteUserGroup(long userGroupId)
105                    throws com.liferay.portal.kernel.exception.PortalException,
106                            com.liferay.portal.kernel.exception.SystemException {
107                    getService().deleteUserGroup(userGroupId);
108            }
109    
110            /**
111            * Returns the user group with the primary key.
112            *
113            * @param userGroupId the primary key of the user group
114            * @return Returns the user group with the primary key
115            * @throws PortalException if a user group with the primary key could not be
116            found or if the user did not have permission to view the user
117            group
118            * @throws SystemException if a system exception occurred
119            */
120            public static com.liferay.portal.model.UserGroup getUserGroup(
121                    long userGroupId)
122                    throws com.liferay.portal.kernel.exception.PortalException,
123                            com.liferay.portal.kernel.exception.SystemException {
124                    return getService().getUserGroup(userGroupId);
125            }
126    
127            /**
128            * Returns the user group with the name.
129            *
130            * @param name the user group's name
131            * @return Returns the user group with the name
132            * @throws PortalException if a user group with the name could not be found
133            or if the user did not have permission to view the user group
134            * @throws SystemException if a system exception occurred
135            */
136            public static com.liferay.portal.model.UserGroup getUserGroup(
137                    java.lang.String name)
138                    throws com.liferay.portal.kernel.exception.PortalException,
139                            com.liferay.portal.kernel.exception.SystemException {
140                    return getService().getUserGroup(name);
141            }
142    
143            /**
144            * Returns all the user groups to which the user belongs.
145            *
146            * @param userId the primary key of the user
147            * @return the user groups to which the user belongs
148            * @throws SystemException if a system exception occurred
149            */
150            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
151                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
152                    return getService().getUserUserGroups(userId);
153            }
154    
155            /**
156            * Removes the user groups from the group.
157            *
158            * @param groupId the primary key of the group
159            * @param userGroupIds the primary keys of the user groups
160            * @throws PortalException if the user did not have permission to assign
161            group members
162            * @throws SystemException if a system exception occurred
163            */
164            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
165                    throws com.liferay.portal.kernel.exception.PortalException,
166                            com.liferay.portal.kernel.exception.SystemException {
167                    getService().unsetGroupUserGroups(groupId, userGroupIds);
168            }
169    
170            /**
171            * Removes the user groups from the team.
172            *
173            * @param teamId the primary key of the team
174            * @param userGroupIds the primary keys of the user groups
175            * @throws PortalException if the user did not have permission to assign
176            team members
177            * @throws SystemException if a system exception occurred
178            */
179            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
180                    throws com.liferay.portal.kernel.exception.PortalException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    getService().unsetTeamUserGroups(teamId, userGroupIds);
183            }
184    
185            /**
186            * Updates the user group.
187            *
188            * @param userGroupId the primary key of the user group
189            * @param name the user group's name
190            * @param description the the user group's description
191            * @return the user group
192            * @throws PortalException if a user group with the primary key was not
193            found, if the new information was invalid, or if the user did not
194            have permission to update the user group information
195            * @throws SystemException if a system exception occurred
196            */
197            public static com.liferay.portal.model.UserGroup updateUserGroup(
198                    long userGroupId, java.lang.String name, java.lang.String description)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    return getService().updateUserGroup(userGroupId, name, description);
202            }
203    
204            public static UserGroupService getService() {
205                    if (_service == null) {
206                            _service = (UserGroupService)PortalBeanLocatorUtil.locate(UserGroupService.class.getName());
207    
208                            ReferenceRegistry.registerReference(UserGroupServiceUtil.class,
209                                    "_service");
210                            MethodCache.remove(UserGroupService.class);
211                    }
212    
213                    return _service;
214            }
215    
216            public void setService(UserGroupService service) {
217                    MethodCache.remove(UserGroupService.class);
218    
219                    _service = service;
220    
221                    ReferenceRegistry.registerReference(UserGroupServiceUtil.class,
222                            "_service");
223                    MethodCache.remove(UserGroupService.class);
224            }
225    
226            private static UserGroupService _service;
227    }