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 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    
024    /**
025     * The interface for the user group remote service.
026     *
027     * <p>
028     * 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.
029     * </p>
030     *
031     * @author Brian Wing Shun Chan
032     * @see UserGroupServiceUtil
033     * @see com.liferay.portal.service.base.UserGroupServiceBaseImpl
034     * @see com.liferay.portal.service.impl.UserGroupServiceImpl
035     * @generated
036     */
037    @JSONWebService
038    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
039            PortalException.class, SystemException.class})
040    public interface UserGroupService extends BaseService {
041            /*
042             * NOTE FOR DEVELOPERS:
043             *
044             * 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.
045             */
046    
047            /**
048            * Returns the Spring bean ID for this bean.
049            *
050            * @return the Spring bean ID for this bean
051            */
052            public java.lang.String getBeanIdentifier();
053    
054            /**
055            * Sets the Spring bean ID for this bean.
056            *
057            * @param beanIdentifier the Spring bean ID for this bean
058            */
059            public void setBeanIdentifier(java.lang.String beanIdentifier);
060    
061            /**
062            * Adds the user groups to the group.
063            *
064            * @param groupId the primary key of the group
065            * @param userGroupIds the primary keys of the user groups
066            * @throws PortalException if a group or user group with the primary key
067            could not be found, or if the user did not have permission to
068            assign group members
069            * @throws SystemException if a system exception occurred
070            */
071            public void addGroupUserGroups(long groupId, long[] userGroupIds)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Adds the user groups to the team
077            *
078            * @param teamId the primary key of the team
079            * @param userGroupIds the primary keys of the user groups
080            * @throws PortalException if a team or user group with the primary key
081            could not be found, or if the user did not have permission to
082            assign team members
083            * @throws SystemException if a system exception occurred
084            */
085            public void addTeamUserGroups(long teamId, long[] userGroupIds)
086                    throws com.liferay.portal.kernel.exception.PortalException,
087                            com.liferay.portal.kernel.exception.SystemException;
088    
089            /**
090            * Adds a user group.
091            *
092            * <p>
093            * This method handles the creation and bookkeeping of the user group,
094            * including its resources, metadata, and internal data structures.
095            * </p>
096            *
097            * @param name the user group's name
098            * @param description the user group's description
099            * @return the user group
100            * @throws PortalException if the user group's information was invalid or if
101            the user did not have permission to add the user group
102            * @throws SystemException if a system exception occurred
103            */
104            public com.liferay.portal.model.UserGroup addUserGroup(
105                    java.lang.String name, java.lang.String description)
106                    throws com.liferay.portal.kernel.exception.PortalException,
107                            com.liferay.portal.kernel.exception.SystemException;
108    
109            /**
110            * Deletes the user group.
111            *
112            * @param userGroupId the primary key of the user group
113            * @throws PortalException if a user group with the primary key could not be
114            found, if the user did not have permission to delete the user
115            group, or if the user group had a workflow in approved status
116            * @throws SystemException if a system exception occurred
117            */
118            public void deleteUserGroup(long userGroupId)
119                    throws com.liferay.portal.kernel.exception.PortalException,
120                            com.liferay.portal.kernel.exception.SystemException;
121    
122            /**
123            * Returns the user group with the primary key.
124            *
125            * @param userGroupId the primary key of the user group
126            * @return Returns the user group with the primary key
127            * @throws PortalException if a user group with the primary key could not be
128            found or if the user did not have permission to view the user
129            group
130            * @throws SystemException if a system exception occurred
131            */
132            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
133            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
134                    throws com.liferay.portal.kernel.exception.PortalException,
135                            com.liferay.portal.kernel.exception.SystemException;
136    
137            /**
138            * Returns the user group with the name.
139            *
140            * @param name the user group's name
141            * @return Returns the user group with the name
142            * @throws PortalException if a user group with the name could not be found
143            or if the user did not have permission to view the user group
144            * @throws SystemException if a system exception occurred
145            */
146            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
147            public com.liferay.portal.model.UserGroup getUserGroup(
148                    java.lang.String name)
149                    throws com.liferay.portal.kernel.exception.PortalException,
150                            com.liferay.portal.kernel.exception.SystemException;
151    
152            /**
153            * Returns all the user groups to which the user belongs.
154            *
155            * @param userId the primary key of the user
156            * @return the user groups to which the user belongs
157            * @throws PortalException if the current user did not have permission to
158            view the user or any one of the user group members
159            * @throws SystemException if a system exception occurred
160            */
161            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
163                    long userId)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException;
166    
167            /**
168            * Removes the user groups from the group.
169            *
170            * @param groupId the primary key of the group
171            * @param userGroupIds the primary keys of the user groups
172            * @throws PortalException if the user did not have permission to assign
173            group members
174            * @throws SystemException if a system exception occurred
175            */
176            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException;
179    
180            /**
181            * Removes the user groups from the team.
182            *
183            * @param teamId the primary key of the team
184            * @param userGroupIds the primary keys of the user groups
185            * @throws PortalException if the user did not have permission to assign
186            team members
187            * @throws SystemException if a system exception occurred
188            */
189            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
190                    throws com.liferay.portal.kernel.exception.PortalException,
191                            com.liferay.portal.kernel.exception.SystemException;
192    
193            /**
194            * Updates the user group.
195            *
196            * @param userGroupId the primary key of the user group
197            * @param name the user group's name
198            * @param description the the user group's description
199            * @return the user group
200            * @throws PortalException if a user group with the primary key was not
201            found, if the new information was invalid, or if the user did not
202            have permission to update the user group information
203            * @throws SystemException if a system exception occurred
204            */
205            public com.liferay.portal.model.UserGroup updateUserGroup(
206                    long userGroupId, java.lang.String name, java.lang.String description)
207                    throws com.liferay.portal.kernel.exception.PortalException,
208                            com.liferay.portal.kernel.exception.SystemException;
209    }