001    /**
002     * Copyright (c) 2000-present 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    @AccessControlled
039    @JSONWebService
040    @ProviderType
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            * Adds the user groups to the group.
052            *
053            * @param groupId the primary key of the group
054            * @param userGroupIds the primary keys of the user groups
055            * @throws PortalException if a group or user group with the primary key
056            could not be found, or if the user did not have permission to
057            assign group members
058            */
059            public void addGroupUserGroups(long groupId, long[] userGroupIds)
060                    throws com.liferay.portal.kernel.exception.PortalException;
061    
062            /**
063            * Adds the user groups to the team
064            *
065            * @param teamId the primary key of the team
066            * @param userGroupIds the primary keys of the user groups
067            * @throws PortalException if a team or user group with the primary key
068            could not be found, or if the user did not have permission to
069            assign team members
070            */
071            public void addTeamUserGroups(long teamId, long[] userGroupIds)
072                    throws com.liferay.portal.kernel.exception.PortalException;
073    
074            /**
075            * Adds a user group.
076            *
077            * <p>
078            * This method handles the creation and bookkeeping of the user group,
079            * including its resources, metadata, and internal data structures.
080            * </p>
081            *
082            * @param name the user group's name
083            * @param description the user group's description
084            * @return the user group
085            * @throws PortalException if the user group's information was invalid
086            or if the user did not have permission to add the user group
087            * @deprecated As of 6.2.0, replaced by {@link #addUserGroup(String, String,
088            ServiceContext)}
089            */
090            @java.lang.Deprecated
091            public com.liferay.portal.model.UserGroup addUserGroup(
092                    java.lang.String name, java.lang.String description)
093                    throws com.liferay.portal.kernel.exception.PortalException;
094    
095            /**
096            * Adds a user group.
097            *
098            * <p>
099            * This method handles the creation and bookkeeping of the user group,
100            * including its resources, metadata, and internal data structures.
101            * </p>
102            *
103            * @param name the user group's name
104            * @param description the user group's description
105            * @param serviceContext the service context to be applied (optionally
106            <code>null</code>). Can set expando bridge attributes for the
107            user group.
108            * @return the user group
109            * @throws PortalException if the user group's information was invalid or if
110            the user did not have permission to add the user group
111            */
112            public com.liferay.portal.model.UserGroup addUserGroup(
113                    java.lang.String name, java.lang.String description,
114                    com.liferay.portal.service.ServiceContext serviceContext)
115                    throws com.liferay.portal.kernel.exception.PortalException;
116    
117            /**
118            * Deletes the user group.
119            *
120            * @param userGroupId the primary key of the user group
121            * @throws PortalException if a user group with the primary key could not be
122            found, if the user did not have permission to delete the user
123            group, or if the user group had a workflow in approved status
124            */
125            public void deleteUserGroup(long userGroupId)
126                    throws com.liferay.portal.kernel.exception.PortalException;
127    
128            /**
129            * Returns the Spring bean ID for this bean.
130            *
131            * @return the Spring bean ID for this bean
132            */
133            public java.lang.String getBeanIdentifier();
134    
135            /**
136            * Returns the user group with the name.
137            *
138            * @param name the user group's name
139            * @return Returns the user group with the name
140            * @throws PortalException if a user group with the name could not be found
141            or if the user did not have permission to view the user group
142            */
143            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144            public com.liferay.portal.model.UserGroup getUserGroup(
145                    java.lang.String name)
146                    throws com.liferay.portal.kernel.exception.PortalException;
147    
148            /**
149            * Returns the user group with the primary key.
150            *
151            * @param userGroupId the primary key of the user group
152            * @return Returns the user group with the primary key
153            * @throws PortalException if a user group with the primary key could not be
154            found or if the user did not have permission to view the user
155            group
156            */
157            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
158            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
159                    throws com.liferay.portal.kernel.exception.PortalException;
160    
161            /**
162            * Returns all the user groups to which the user belongs.
163            *
164            * @param userId the primary key of the user
165            * @return the user groups to which the user belongs
166            * @throws PortalException if the current user did not have permission to
167            view the user or any one of the user group members
168            */
169            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
171                    long userId) throws com.liferay.portal.kernel.exception.PortalException;
172    
173            /**
174            * Sets the Spring bean ID for this bean.
175            *
176            * @param beanIdentifier the Spring bean ID for this bean
177            */
178            public void setBeanIdentifier(java.lang.String beanIdentifier);
179    
180            /**
181            * Removes the user groups from the group.
182            *
183            * @param groupId the primary key of the group
184            * @param userGroupIds the primary keys of the user groups
185            * @throws PortalException if the user did not have permission to assign
186            group members
187            */
188            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
189                    throws com.liferay.portal.kernel.exception.PortalException;
190    
191            /**
192            * Removes the user groups from the team.
193            *
194            * @param teamId the primary key of the team
195            * @param userGroupIds the primary keys of the user groups
196            * @throws PortalException if the user did not have permission to assign
197            team members
198            */
199            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
200                    throws com.liferay.portal.kernel.exception.PortalException;
201    
202            /**
203            * Updates the user group.
204            *
205            * @param userGroupId the primary key of the user group
206            * @param name the user group's name
207            * @param description the the user group's description
208            * @return the user group
209            * @throws PortalException if a user group with the primary key was not
210            found, if the new information was invalid, or if the user did
211            not have permission to update the user group information
212            * @deprecated As of 6.2.0, replaced by {@link #updateUserGroup(long,
213            String, String, ServiceContext)}
214            */
215            @java.lang.Deprecated
216            public 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    
220            /**
221            * Updates the user group.
222            *
223            * @param userGroupId the primary key of the user group
224            * @param name the user group's name
225            * @param description the the user group's description
226            * @param serviceContext the service context to be applied (optionally
227            <code>null</code>). Can set expando bridge attributes for the
228            user group.
229            * @return the user group
230            * @throws PortalException if a user group with the primary key was not
231            found, if the new information was invalid, or if the user did not
232            have permission to update the user group information
233            */
234            public com.liferay.portal.model.UserGroup updateUserGroup(
235                    long userGroupId, java.lang.String name, java.lang.String description,
236                    com.liferay.portal.service.ServiceContext serviceContext)
237                    throws com.liferay.portal.kernel.exception.PortalException;
238    }