001    /**
002     * Copyright (c) 2000-2011 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 {
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            * Adds the user groups to the group.
049            *
050            * @param groupId the primary key of the group
051            * @param userGroupIds the primary keys of the user groups
052            * @throws PortalException if a group or user group with the primary key
053            could not be found, or if the user did not have permission to
054            assign group members
055            * @throws SystemException if a system exception occurred
056            */
057            public void addGroupUserGroups(long groupId, long[] userGroupIds)
058                    throws com.liferay.portal.kernel.exception.PortalException,
059                            com.liferay.portal.kernel.exception.SystemException;
060    
061            /**
062            * Adds the user groups to the team
063            *
064            * @param teamId the primary key of the team
065            * @param userGroupIds the primary keys of the user groups
066            * @throws PortalException if a team or user group with the primary key
067            could not be found, or if the user did not have permission to
068            assign team members
069            * @throws SystemException if a system exception occurred
070            */
071            public void addTeamUserGroups(long teamId, long[] userGroupIds)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Adds a user group.
077            *
078            * <p>
079            * This method handles the creation and bookkeeping of the user group,
080            * including its resources, metadata, and internal data structures.
081            * </p>
082            *
083            * @param name the user group's name
084            * @param description the user group's description
085            * @param publicLayoutSetPrototypeId the primary key of the user group's
086            public layout set
087            * @param privateLayoutSetPrototypeId the primary key of the user group's
088            private layout set
089            * @return the user group
090            * @throws PortalException if the user group's information was invalid or
091            if the user did not have permission to add the user group
092            * @throws SystemException if a system exception occurred
093            */
094            public com.liferay.portal.model.UserGroup addUserGroup(
095                    java.lang.String name, java.lang.String description,
096                    long publicLayoutSetPrototypeId, long privateLayoutSetPrototypeId)
097                    throws com.liferay.portal.kernel.exception.PortalException,
098                            com.liferay.portal.kernel.exception.SystemException;
099    
100            /**
101            * Deletes the user group.
102            *
103            * @param userGroupId the primary key of the user group
104            * @throws PortalException if a user group with the primary key could not
105            be found, if the user did not have permission to delete the user
106            group, or if the user group had a workflow in approved status
107            * @throws SystemException if a system exception occurred
108            */
109            public void deleteUserGroup(long userGroupId)
110                    throws com.liferay.portal.kernel.exception.PortalException,
111                            com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Returns the user group with the primary key.
115            *
116            * @param userGroupId the primary key of the user group
117            * @return Returns the user group with the primary key
118            * @throws PortalException if a user group with the primary key could not
119            be found or if the user did not have permission to view the user
120            group
121            * @throws SystemException if a system exception occurred
122            */
123            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
124            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
125                    throws com.liferay.portal.kernel.exception.PortalException,
126                            com.liferay.portal.kernel.exception.SystemException;
127    
128            /**
129            * Returns the user group with the name.
130            *
131            * @param name the user group's name
132            * @return Returns the user group with the name
133            * @throws PortalException if a user group with the name could not be found
134            or if the user did not have permission to view the user group
135            * @throws SystemException if a system exception occurred
136            */
137            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
138            public com.liferay.portal.model.UserGroup getUserGroup(
139                    java.lang.String name)
140                    throws com.liferay.portal.kernel.exception.PortalException,
141                            com.liferay.portal.kernel.exception.SystemException;
142    
143            /**
144            * Returns all the user groups to which the user belongs.
145            *
146            * @param userId the primary key of the user
147            * @return the user groups to which the user belongs
148            * @throws SystemException if a system exception occurred
149            */
150            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
151            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
152                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
153    
154            /**
155            * Removes the user groups from the group.
156            *
157            * @param groupId the primary key of the group
158            * @param userGroupIds the primary keys of the user groups
159            * @throws PortalException if the user did not have permission to assign
160            group members
161            * @throws SystemException if a system exception occurred
162            */
163            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException;
166    
167            /**
168            * Removes the user groups from the team.
169            *
170            * @param teamId the primary key of the team
171            * @param userGroupIds the primary keys of the user groups
172            * @throws PortalException if the user did not have permission to assign
173            team members
174            * @throws SystemException if a system exception occurred
175            */
176            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException;
179    
180            /**
181            * Updates the user group.
182            *
183            * @param userGroupId the primary key of the user group
184            * @param name the user group's name
185            * @param description the the user group's description
186            * @param publicLayoutSetPrototypeId the primary key of the user group's
187            public layout set
188            * @param privateLayoutSetPrototypeId the primary key of the user group's
189            private layout set
190            * @return the user group
191            * @throws PortalException if a user group with the primary key was not
192            found, if the new information was invalid, or if the user did
193            not have permission to update the user group information
194            * @throws SystemException if a system exception occurred
195            */
196            public com.liferay.portal.model.UserGroup updateUserGroup(
197                    long userGroupId, java.lang.String name, java.lang.String description,
198                    long publicLayoutSetPrototypeId, long privateLayoutSetPrototypeId)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException;
201    }