001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 or if
102            the user did not have permission to add the user group
103            * @throws SystemException if a system exception occurred
104            */
105            public static com.liferay.portal.model.UserGroup addUserGroup(
106                    java.lang.String name, java.lang.String description)
107                    throws com.liferay.portal.kernel.exception.PortalException,
108                            com.liferay.portal.kernel.exception.SystemException {
109                    return getService().addUserGroup(name, description);
110            }
111    
112            /**
113            * Deletes the user group.
114            *
115            * @param userGroupId the primary key of the user group
116            * @throws PortalException if a user group with the primary key could not be
117            found, if the user did not have permission to delete the user
118            group, or if the user group had a workflow in approved status
119            * @throws SystemException if a system exception occurred
120            */
121            public static void deleteUserGroup(long userGroupId)
122                    throws com.liferay.portal.kernel.exception.PortalException,
123                            com.liferay.portal.kernel.exception.SystemException {
124                    getService().deleteUserGroup(userGroupId);
125            }
126    
127            /**
128            * Returns the user group with the primary key.
129            *
130            * @param userGroupId the primary key of the user group
131            * @return Returns the user group with the primary key
132            * @throws PortalException if a user group with the primary key could not be
133            found or if the user did not have permission to view the user
134            group
135            * @throws SystemException if a system exception occurred
136            */
137            public static com.liferay.portal.model.UserGroup getUserGroup(
138                    long userGroupId)
139                    throws com.liferay.portal.kernel.exception.PortalException,
140                            com.liferay.portal.kernel.exception.SystemException {
141                    return getService().getUserGroup(userGroupId);
142            }
143    
144            /**
145            * Returns the user group with the name.
146            *
147            * @param name the user group's name
148            * @return Returns the user group with the name
149            * @throws PortalException if a user group with the name could not be found
150            or if the user did not have permission to view the user group
151            * @throws SystemException if a system exception occurred
152            */
153            public static com.liferay.portal.model.UserGroup getUserGroup(
154                    java.lang.String name)
155                    throws com.liferay.portal.kernel.exception.PortalException,
156                            com.liferay.portal.kernel.exception.SystemException {
157                    return getService().getUserGroup(name);
158            }
159    
160            /**
161            * Returns all the user groups to which the user belongs.
162            *
163            * @param userId the primary key of the user
164            * @return the user groups to which the user belongs
165            * @throws SystemException if a system exception occurred
166            */
167            public static java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
168                    long userId)
169                    throws com.liferay.portal.kernel.exception.PortalException,
170                            com.liferay.portal.kernel.exception.SystemException {
171                    return getService().getUserUserGroups(userId);
172            }
173    
174            /**
175            * Removes the user groups from the group.
176            *
177            * @param groupId the primary key of the group
178            * @param userGroupIds the primary keys of the user groups
179            * @throws PortalException if the user did not have permission to assign
180            group members
181            * @throws SystemException if a system exception occurred
182            */
183            public static void unsetGroupUserGroups(long groupId, long[] userGroupIds)
184                    throws com.liferay.portal.kernel.exception.PortalException,
185                            com.liferay.portal.kernel.exception.SystemException {
186                    getService().unsetGroupUserGroups(groupId, userGroupIds);
187            }
188    
189            /**
190            * Removes the user groups from the team.
191            *
192            * @param teamId the primary key of the team
193            * @param userGroupIds the primary keys of the user groups
194            * @throws PortalException if the user did not have permission to assign
195            team members
196            * @throws SystemException if a system exception occurred
197            */
198            public static void unsetTeamUserGroups(long teamId, long[] userGroupIds)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    getService().unsetTeamUserGroups(teamId, userGroupIds);
202            }
203    
204            /**
205            * Updates the user group.
206            *
207            * @param userGroupId the primary key of the user group
208            * @param name the user group's name
209            * @param description the the user group's description
210            * @return the user group
211            * @throws PortalException if a user group with the primary key was not
212            found, if the new information was invalid, or if the user did not
213            have permission to update the user group information
214            * @throws SystemException if a system exception occurred
215            */
216            public static com.liferay.portal.model.UserGroup updateUserGroup(
217                    long userGroupId, java.lang.String name, java.lang.String description)
218                    throws com.liferay.portal.kernel.exception.PortalException,
219                            com.liferay.portal.kernel.exception.SystemException {
220                    return getService().updateUserGroup(userGroupId, name, description);
221            }
222    
223            public static UserGroupService getService() {
224                    if (_service == null) {
225                            _service = (UserGroupService)PortalBeanLocatorUtil.locate(UserGroupService.class.getName());
226    
227                            ReferenceRegistry.registerReference(UserGroupServiceUtil.class,
228                                    "_service");
229                    }
230    
231                    return _service;
232            }
233    
234            /**
235             * @deprecated
236             */
237            public void setService(UserGroupService service) {
238            }
239    
240            private static UserGroupService _service;
241    }