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.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.jsonwebservice.JSONWebService;
020    import com.liferay.portal.kernel.transaction.Isolation;
021    import com.liferay.portal.kernel.transaction.Propagation;
022    import com.liferay.portal.kernel.transaction.Transactional;
023    import com.liferay.portal.security.ac.AccessControlled;
024    
025    /**
026     * The interface for the user group remote service.
027     *
028     * <p>
029     * 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.
030     * </p>
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    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface UserGroupService extends BaseService {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * 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.
047             */
048    
049            /**
050            * Returns the Spring bean ID for this bean.
051            *
052            * @return the Spring bean ID for this bean
053            */
054            public java.lang.String getBeanIdentifier();
055    
056            /**
057            * Sets the Spring bean ID for this bean.
058            *
059            * @param beanIdentifier the Spring bean ID for this bean
060            */
061            public void setBeanIdentifier(java.lang.String beanIdentifier);
062    
063            /**
064            * Adds the user groups to the group.
065            *
066            * @param groupId the primary key of the group
067            * @param userGroupIds the primary keys of the user groups
068            * @throws PortalException if a group or user group with the primary key
069            could not be found, or if the user did not have permission to
070            assign group members
071            * @throws SystemException if a system exception occurred
072            */
073            public void addGroupUserGroups(long groupId, long[] userGroupIds)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Adds the user groups to the team
079            *
080            * @param teamId the primary key of the team
081            * @param userGroupIds the primary keys of the user groups
082            * @throws PortalException if a team or user group with the primary key
083            could not be found, or if the user did not have permission to
084            assign team members
085            * @throws SystemException if a system exception occurred
086            */
087            public void addTeamUserGroups(long teamId, long[] userGroupIds)
088                    throws com.liferay.portal.kernel.exception.PortalException,
089                            com.liferay.portal.kernel.exception.SystemException;
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 {@link #addUserGroup(String, String, serviceContext)}
106            */
107            public com.liferay.portal.model.UserGroup addUserGroup(
108                    java.lang.String name, java.lang.String description)
109                    throws com.liferay.portal.kernel.exception.PortalException,
110                            com.liferay.portal.kernel.exception.SystemException;
111    
112            /**
113            * Adds a user group.
114            *
115            * <p>
116            * This method handles the creation and bookkeeping of the user group,
117            * including its resources, metadata, and internal data structures.
118            * </p>
119            *
120            * @param name the user group's name
121            * @param description the user group's description
122            * @param serviceContext the user group's service context (optionally
123            <code>null</code>). Can set expando bridge attributes for the
124            user group.
125            * @return the user group
126            * @throws PortalException if the user group's information was invalid or if
127            the user did not have permission to add the user group
128            * @throws SystemException if a system exception occurred
129            */
130            public com.liferay.portal.model.UserGroup addUserGroup(
131                    java.lang.String name, java.lang.String description,
132                    com.liferay.portal.service.ServiceContext serviceContext)
133                    throws com.liferay.portal.kernel.exception.PortalException,
134                            com.liferay.portal.kernel.exception.SystemException;
135    
136            /**
137            * Deletes the user group.
138            *
139            * @param userGroupId the primary key of the user group
140            * @throws PortalException if a user group with the primary key could not be
141            found, if the user did not have permission to delete the user
142            group, or if the user group had a workflow in approved status
143            * @throws SystemException if a system exception occurred
144            */
145            public void deleteUserGroup(long userGroupId)
146                    throws com.liferay.portal.kernel.exception.PortalException,
147                            com.liferay.portal.kernel.exception.SystemException;
148    
149            /**
150            * Returns the user group with the primary key.
151            *
152            * @param userGroupId the primary key of the user group
153            * @return Returns the user group with the primary key
154            * @throws PortalException if a user group with the primary key could not be
155            found or if the user did not have permission to view the user
156            group
157            * @throws SystemException if a system exception occurred
158            */
159            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
161                    throws com.liferay.portal.kernel.exception.PortalException,
162                            com.liferay.portal.kernel.exception.SystemException;
163    
164            /**
165            * Returns the user group with the name.
166            *
167            * @param name the user group's name
168            * @return Returns the user group with the name
169            * @throws PortalException if a user group with the name could not be found
170            or if the user did not have permission to view the user group
171            * @throws SystemException if a system exception occurred
172            */
173            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174            public com.liferay.portal.model.UserGroup getUserGroup(
175                    java.lang.String name)
176                    throws com.liferay.portal.kernel.exception.PortalException,
177                            com.liferay.portal.kernel.exception.SystemException;
178    
179            /**
180            * Returns all the user groups to which the user belongs.
181            *
182            * @param userId the primary key of the user
183            * @return the user groups to which the user belongs
184            * @throws PortalException if the current user did not have permission to
185            view the user or any one of the user group members
186            * @throws SystemException if a system exception occurred
187            */
188            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
189            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
190                    long userId)
191                    throws com.liferay.portal.kernel.exception.PortalException,
192                            com.liferay.portal.kernel.exception.SystemException;
193    
194            /**
195            * Removes the user groups from the group.
196            *
197            * @param groupId the primary key of the group
198            * @param userGroupIds the primary keys of the user groups
199            * @throws PortalException if the user did not have permission to assign
200            group members
201            * @throws SystemException if a system exception occurred
202            */
203            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
204                    throws com.liferay.portal.kernel.exception.PortalException,
205                            com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Removes the user groups from the team.
209            *
210            * @param teamId the primary key of the team
211            * @param userGroupIds the primary keys of the user groups
212            * @throws PortalException if the user did not have permission to assign
213            team members
214            * @throws SystemException if a system exception occurred
215            */
216            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
217                    throws com.liferay.portal.kernel.exception.PortalException,
218                            com.liferay.portal.kernel.exception.SystemException;
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            * @return the user group
227            * @throws PortalException if a user group with the primary key was not
228            found, if the new information was invalid, or if the user did
229            not have permission to update the user group information
230            * @throws SystemException if a system exception occurred
231            * @deprecated {@link #updateUserGroup(long, String, String,
232            serviceContext)}
233            */
234            public com.liferay.portal.model.UserGroup updateUserGroup(
235                    long userGroupId, java.lang.String name, java.lang.String description)
236                    throws com.liferay.portal.kernel.exception.PortalException,
237                            com.liferay.portal.kernel.exception.SystemException;
238    
239            /**
240            * Updates the user group.
241            *
242            * @param userGroupId the primary key of the user group
243            * @param name the user group's name
244            * @param description the the user group's description
245            * @param serviceContext the user group's service context (optionally
246            <code>null</code>). Can set expando bridge attributes for the
247            user group.
248            * @return the user group
249            * @throws PortalException if a user group with the primary key was not
250            found, if the new information was invalid, or if the user did not
251            have permission to update the user group information
252            * @throws SystemException if a system exception occurred
253            */
254            public com.liferay.portal.model.UserGroup updateUserGroup(
255                    long userGroupId, java.lang.String name, java.lang.String description,
256                    com.liferay.portal.service.ServiceContext serviceContext)
257                    throws com.liferay.portal.kernel.exception.PortalException,
258                            com.liferay.portal.kernel.exception.SystemException;
259    }