001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 SystemException if a system exception occurred
158            */
159            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
160            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
161                    long userId)
162                    throws com.liferay.portal.kernel.exception.PortalException,
163                            com.liferay.portal.kernel.exception.SystemException;
164    
165            /**
166            * Removes the user groups from the group.
167            *
168            * @param groupId the primary key of the group
169            * @param userGroupIds the primary keys of the user groups
170            * @throws PortalException if the user did not have permission to assign
171            group members
172            * @throws SystemException if a system exception occurred
173            */
174            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException;
177    
178            /**
179            * Removes the user groups from the team.
180            *
181            * @param teamId the primary key of the team
182            * @param userGroupIds the primary keys of the user groups
183            * @throws PortalException if the user did not have permission to assign
184            team members
185            * @throws SystemException if a system exception occurred
186            */
187            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
188                    throws com.liferay.portal.kernel.exception.PortalException,
189                            com.liferay.portal.kernel.exception.SystemException;
190    
191            /**
192            * Updates the user group.
193            *
194            * @param userGroupId the primary key of the user group
195            * @param name the user group's name
196            * @param description the the user group's description
197            * @return the user group
198            * @throws PortalException if a user group with the primary key was not
199            found, if the new information was invalid, or if the user did not
200            have permission to update the user group information
201            * @throws SystemException if a system exception occurred
202            */
203            public com.liferay.portal.model.UserGroup updateUserGroup(
204                    long userGroupId, java.lang.String name, java.lang.String description)
205                    throws com.liferay.portal.kernel.exception.PortalException,
206                            com.liferay.portal.kernel.exception.SystemException;
207    }