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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    import com.liferay.portal.security.ac.AccessControlled;
026    
027    /**
028     * Provides the remote service interface for UserGroup. Methods of this
029     * service are expected to have security checks based on the propagated JAAS
030     * credentials because this service can be accessed remotely.
031     *
032     * @author Brian Wing Shun Chan
033     * @see UserGroupServiceUtil
034     * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl
035     * @see com.liferay.portal.service.impl.UserGroupServiceImpl
036     * @generated
037     */
038    @ProviderType
039    @AccessControlled
040    @JSONWebService
041    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
042            PortalException.class, SystemException.class})
043    public interface UserGroupService extends BaseService {
044            /*
045             * NOTE FOR DEVELOPERS:
046             *
047             * Never modify or reference this interface directly. Always use {@link UserGroupServiceUtil} to access the user group remote service. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
048             */
049    
050            /**
051            * Returns the Spring bean ID for this bean.
052            *
053            * @return the Spring bean ID for this bean
054            */
055            public java.lang.String getBeanIdentifier();
056    
057            /**
058            * Sets the Spring bean ID for this bean.
059            *
060            * @param beanIdentifier the Spring bean ID for this bean
061            */
062            public void setBeanIdentifier(java.lang.String beanIdentifier);
063    
064            /**
065            * Adds the user groups to the group.
066            *
067            * @param groupId the primary key of the group
068            * @param userGroupIds the primary keys of the user groups
069            * @throws PortalException if a group or user group with the primary key
070            could not be found, or if the user did not have permission to
071            assign group members
072            * @throws SystemException if a system exception occurred
073            */
074            public void addGroupUserGroups(long groupId, long[] userGroupIds)
075                    throws com.liferay.portal.kernel.exception.PortalException,
076                            com.liferay.portal.kernel.exception.SystemException;
077    
078            /**
079            * Adds the user groups to the team
080            *
081            * @param teamId the primary key of the team
082            * @param userGroupIds the primary keys of the user groups
083            * @throws PortalException if a team or user group with the primary key
084            could not be found, or if the user did not have permission to
085            assign team members
086            * @throws SystemException if a system exception occurred
087            */
088            public void addTeamUserGroups(long teamId, long[] userGroupIds)
089                    throws com.liferay.portal.kernel.exception.PortalException,
090                            com.liferay.portal.kernel.exception.SystemException;
091    
092            /**
093            * Adds a user group.
094            *
095            * <p>
096            * This method handles the creation and bookkeeping of the user group,
097            * including its resources, metadata, and internal data structures.
098            * </p>
099            *
100            * @param name the user group's name
101            * @param description the user group's description
102            * @return the user group
103            * @throws PortalException if the user group's information was invalid
104            or if the user did not have permission to add the user group
105            * @throws SystemException if a system exception occurred
106            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String,
107            ServiceContext)}
108            */
109            public com.liferay.portal.model.UserGroup addUserGroup(
110                    java.lang.String name, java.lang.String description)
111                    throws com.liferay.portal.kernel.exception.PortalException,
112                            com.liferay.portal.kernel.exception.SystemException;
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 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    
138            /**
139            * Deletes the user group.
140            *
141            * @param userGroupId the primary key of the user group
142            * @throws PortalException if a user group with the primary key could not be
143            found, if the user did not have permission to delete the user
144            group, or if the user group had a workflow in approved status
145            * @throws SystemException if a system exception occurred
146            */
147            public void deleteUserGroup(long userGroupId)
148                    throws com.liferay.portal.kernel.exception.PortalException,
149                            com.liferay.portal.kernel.exception.SystemException;
150    
151            /**
152            * Returns the user group with the primary key.
153            *
154            * @param userGroupId the primary key of the user group
155            * @return Returns the user group with the primary key
156            * @throws PortalException if a user group with the primary key could not be
157            found or if the user did not have permission to view the user
158            group
159            * @throws SystemException if a system exception occurred
160            */
161            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
163                    throws com.liferay.portal.kernel.exception.PortalException,
164                            com.liferay.portal.kernel.exception.SystemException;
165    
166            /**
167            * Returns the user group with the name.
168            *
169            * @param name the user group's name
170            * @return Returns the user group with the name
171            * @throws PortalException if a user group with the name could not be found
172            or if the user did not have permission to view the user group
173            * @throws SystemException if a system exception occurred
174            */
175            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
176            public com.liferay.portal.model.UserGroup getUserGroup(
177                    java.lang.String name)
178                    throws com.liferay.portal.kernel.exception.PortalException,
179                            com.liferay.portal.kernel.exception.SystemException;
180    
181            /**
182            * Returns all the user groups to which the user belongs.
183            *
184            * @param userId the primary key of the user
185            * @return the user groups to which the user belongs
186            * @throws PortalException if the current user did not have permission to
187            view the user or any one of the user group members
188            * @throws SystemException if a system exception occurred
189            */
190            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
192                    long userId)
193                    throws com.liferay.portal.kernel.exception.PortalException,
194                            com.liferay.portal.kernel.exception.SystemException;
195    
196            /**
197            * Removes the user groups from the group.
198            *
199            * @param groupId the primary key of the group
200            * @param userGroupIds the primary keys of the user groups
201            * @throws PortalException if the user did not have permission to assign
202            group members
203            * @throws SystemException if a system exception occurred
204            */
205            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
206                    throws com.liferay.portal.kernel.exception.PortalException,
207                            com.liferay.portal.kernel.exception.SystemException;
208    
209            /**
210            * Removes the user groups from the team.
211            *
212            * @param teamId the primary key of the team
213            * @param userGroupIds the primary keys of the user groups
214            * @throws PortalException if the user did not have permission to assign
215            team members
216            * @throws SystemException if a system exception occurred
217            */
218            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
219                    throws com.liferay.portal.kernel.exception.PortalException,
220                            com.liferay.portal.kernel.exception.SystemException;
221    
222            /**
223            * Updates the user group.
224            *
225            * @param userGroupId the primary key of the user group
226            * @param name the user group's name
227            * @param description the the user group's description
228            * @return the user group
229            * @throws PortalException if a user group with the primary key was not
230            found, if the new information was invalid, or if the user did
231            not have permission to update the user group information
232            * @throws SystemException if a system exception occurred
233            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long,
234            String, String, ServiceContext)}
235            */
236            public com.liferay.portal.model.UserGroup updateUserGroup(
237                    long userGroupId, java.lang.String name, java.lang.String description)
238                    throws com.liferay.portal.kernel.exception.PortalException,
239                            com.liferay.portal.kernel.exception.SystemException;
240    
241            /**
242            * Updates the user group.
243            *
244            * @param userGroupId the primary key of the user group
245            * @param name the user group's name
246            * @param description the the user group's description
247            * @param serviceContext the service context to be applied (optionally
248            <code>null</code>). Can set expando bridge attributes for the
249            user group.
250            * @return the user group
251            * @throws PortalException if a user group with the primary key was not
252            found, if the new information was invalid, or if the user did not
253            have permission to update the user group information
254            * @throws SystemException if a system exception occurred
255            */
256            public com.liferay.portal.model.UserGroup updateUserGroup(
257                    long userGroupId, java.lang.String name, java.lang.String description,
258                    com.liferay.portal.service.ServiceContext serviceContext)
259                    throws com.liferay.portal.kernel.exception.PortalException,
260                            com.liferay.portal.kernel.exception.SystemException;
261    }