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 or if
103            the user did not have permission to add the user group
104            * @throws SystemException if a system exception occurred
105            */
106            public com.liferay.portal.model.UserGroup addUserGroup(
107                    java.lang.String name, java.lang.String description)
108                    throws com.liferay.portal.kernel.exception.PortalException,
109                            com.liferay.portal.kernel.exception.SystemException;
110    
111            /**
112            * Deletes the user group.
113            *
114            * @param userGroupId the primary key of the user group
115            * @throws PortalException if a user group with the primary key could not be
116            found, if the user did not have permission to delete the user
117            group, or if the user group had a workflow in approved status
118            * @throws SystemException if a system exception occurred
119            */
120            public void deleteUserGroup(long userGroupId)
121                    throws com.liferay.portal.kernel.exception.PortalException,
122                            com.liferay.portal.kernel.exception.SystemException;
123    
124            /**
125            * Returns the user group with the primary key.
126            *
127            * @param userGroupId the primary key of the user group
128            * @return Returns the user group with the primary key
129            * @throws PortalException if a user group with the primary key could not be
130            found or if the user did not have permission to view the user
131            group
132            * @throws SystemException if a system exception occurred
133            */
134            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
135            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
136                    throws com.liferay.portal.kernel.exception.PortalException,
137                            com.liferay.portal.kernel.exception.SystemException;
138    
139            /**
140            * Returns the user group with the name.
141            *
142            * @param name the user group's name
143            * @return Returns the user group with the name
144            * @throws PortalException if a user group with the name could not be found
145            or if the user did not have permission to view the user group
146            * @throws SystemException if a system exception occurred
147            */
148            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
149            public com.liferay.portal.model.UserGroup getUserGroup(
150                    java.lang.String name)
151                    throws com.liferay.portal.kernel.exception.PortalException,
152                            com.liferay.portal.kernel.exception.SystemException;
153    
154            /**
155            * Returns all the user groups to which the user belongs.
156            *
157            * @param userId the primary key of the user
158            * @return the user groups to which the user belongs
159            * @throws PortalException if the current user did not have permission to
160            view the user or any one of the user group members
161            * @throws SystemException if a system exception occurred
162            */
163            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
164            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
165                    long userId)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException;
168    
169            /**
170            * Removes the user groups from the group.
171            *
172            * @param groupId the primary key of the group
173            * @param userGroupIds the primary keys of the user groups
174            * @throws PortalException if the user did not have permission to assign
175            group members
176            * @throws SystemException if a system exception occurred
177            */
178            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
179                    throws com.liferay.portal.kernel.exception.PortalException,
180                            com.liferay.portal.kernel.exception.SystemException;
181    
182            /**
183            * Removes the user groups from the team.
184            *
185            * @param teamId the primary key of the team
186            * @param userGroupIds the primary keys of the user groups
187            * @throws PortalException if the user did not have permission to assign
188            team members
189            * @throws SystemException if a system exception occurred
190            */
191            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
192                    throws com.liferay.portal.kernel.exception.PortalException,
193                            com.liferay.portal.kernel.exception.SystemException;
194    
195            /**
196            * Updates the user group.
197            *
198            * @param userGroupId the primary key of the user group
199            * @param name the user group's name
200            * @param description the the user group's description
201            * @return the user group
202            * @throws PortalException if a user group with the primary key was not
203            found, if the new information was invalid, or if the user did not
204            have permission to update the user group information
205            * @throws SystemException if a system exception occurred
206            */
207            public com.liferay.portal.model.UserGroup updateUserGroup(
208                    long userGroupId, java.lang.String name, java.lang.String description)
209                    throws com.liferay.portal.kernel.exception.PortalException,
210                            com.liferay.portal.kernel.exception.SystemException;
211    }