001    /**
002     * Copyright (c) 2000-2010 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.annotation.Isolation;
018    import com.liferay.portal.kernel.annotation.Propagation;
019    import com.liferay.portal.kernel.annotation.Transactional;
020    import com.liferay.portal.kernel.exception.PortalException;
021    import com.liferay.portal.kernel.exception.SystemException;
022    
023    /**
024     * The interface for the user group local service.
025     *
026     * <p>
027     * Never modify or reference this interface directly. Always use {@link UserGroupLocalServiceUtil} to access the user group local service. Add custom service methods to {@link com.liferay.portal.service.impl.UserGroupLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
028     * </p>
029     *
030     * <p>
031     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see UserGroupLocalServiceUtil
036     * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl
037     * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl
038     * @generated
039     */
040    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
041            PortalException.class, SystemException.class})
042    public interface UserGroupLocalService {
043            /**
044            * Adds the user group to the database. Also notifies the appropriate model listeners.
045            *
046            * @param userGroup the user group to add
047            * @return the user group that was added
048            * @throws SystemException if a system exception occurred
049            */
050            public com.liferay.portal.model.UserGroup addUserGroup(
051                    com.liferay.portal.model.UserGroup userGroup)
052                    throws com.liferay.portal.kernel.exception.SystemException;
053    
054            /**
055            * Creates a new user group with the primary key. Does not add the user group to the database.
056            *
057            * @param userGroupId the primary key for the new user group
058            * @return the new user group
059            */
060            public com.liferay.portal.model.UserGroup createUserGroup(long userGroupId);
061    
062            /**
063            * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners.
064            *
065            * @param userGroupId the primary key of the user group to delete
066            * @throws PortalException if a user group with the primary key could not be found
067            * @throws SystemException if a system exception occurred
068            */
069            public void deleteUserGroup(long userGroupId)
070                    throws com.liferay.portal.kernel.exception.PortalException,
071                            com.liferay.portal.kernel.exception.SystemException;
072    
073            /**
074            * Deletes the user group from the database. Also notifies the appropriate model listeners.
075            *
076            * @param userGroup the user group to delete
077            * @throws SystemException if a system exception occurred
078            */
079            public void deleteUserGroup(com.liferay.portal.model.UserGroup userGroup)
080                    throws com.liferay.portal.kernel.exception.SystemException;
081    
082            /**
083            * Performs a dynamic query on the database and returns the matching rows.
084            *
085            * @param dynamicQuery the dynamic query to search with
086            * @return the matching rows
087            * @throws SystemException if a system exception occurred
088            */
089            @SuppressWarnings("rawtypes")
090            public java.util.List dynamicQuery(
091                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
092                    throws com.liferay.portal.kernel.exception.SystemException;
093    
094            /**
095            * Performs a dynamic query on the database and returns a range of the matching rows.
096            *
097            * <p>
098            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
099            * </p>
100            *
101            * @param dynamicQuery the dynamic query to search with
102            * @param start the lower bound of the range of model instances to return
103            * @param end the upper bound of the range of model instances to return (not inclusive)
104            * @return the range of matching rows
105            * @throws SystemException if a system exception occurred
106            */
107            @SuppressWarnings("rawtypes")
108            public java.util.List dynamicQuery(
109                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
110                    int end) throws com.liferay.portal.kernel.exception.SystemException;
111    
112            /**
113            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
114            *
115            * <p>
116            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
117            * </p>
118            *
119            * @param dynamicQuery the dynamic query to search with
120            * @param start the lower bound of the range of model instances to return
121            * @param end the upper bound of the range of model instances to return (not inclusive)
122            * @param orderByComparator the comparator to order the results by
123            * @return the ordered range of matching rows
124            * @throws SystemException if a system exception occurred
125            */
126            @SuppressWarnings("rawtypes")
127            public java.util.List dynamicQuery(
128                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
129                    int end,
130                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
131                    throws com.liferay.portal.kernel.exception.SystemException;
132    
133            /**
134            * Counts the number of rows that match the dynamic query.
135            *
136            * @param dynamicQuery the dynamic query to search with
137            * @return the number of rows that match the dynamic query
138            * @throws SystemException if a system exception occurred
139            */
140            public long dynamicQueryCount(
141                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
142                    throws com.liferay.portal.kernel.exception.SystemException;
143    
144            /**
145            * Gets the user group with the primary key.
146            *
147            * @param userGroupId the primary key of the user group to get
148            * @return the user group
149            * @throws PortalException if a user group with the primary key could not be found
150            * @throws SystemException if a system exception occurred
151            */
152            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
153            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
154                    throws com.liferay.portal.kernel.exception.PortalException,
155                            com.liferay.portal.kernel.exception.SystemException;
156    
157            /**
158            * Gets a range of all the user groups.
159            *
160            * <p>
161            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
162            * </p>
163            *
164            * @param start the lower bound of the range of user groups to return
165            * @param end the upper bound of the range of user groups to return (not inclusive)
166            * @return the range of user groups
167            * @throws SystemException if a system exception occurred
168            */
169            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
171                    int start, int end)
172                    throws com.liferay.portal.kernel.exception.SystemException;
173    
174            /**
175            * Gets the number of user groups.
176            *
177            * @return the number of user groups
178            * @throws SystemException if a system exception occurred
179            */
180            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
181            public int getUserGroupsCount()
182                    throws com.liferay.portal.kernel.exception.SystemException;
183    
184            /**
185            * Updates the user group in the database. Also notifies the appropriate model listeners.
186            *
187            * @param userGroup the user group to update
188            * @return the user group that was updated
189            * @throws SystemException if a system exception occurred
190            */
191            public com.liferay.portal.model.UserGroup updateUserGroup(
192                    com.liferay.portal.model.UserGroup userGroup)
193                    throws com.liferay.portal.kernel.exception.SystemException;
194    
195            /**
196            * Updates the user group in the database. Also notifies the appropriate model listeners.
197            *
198            * @param userGroup the user group to update
199            * @param merge whether to merge the user group with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
200            * @return the user group that was updated
201            * @throws SystemException if a system exception occurred
202            */
203            public com.liferay.portal.model.UserGroup updateUserGroup(
204                    com.liferay.portal.model.UserGroup userGroup, boolean merge)
205                    throws com.liferay.portal.kernel.exception.SystemException;
206    
207            public void addGroupUserGroups(long groupId, long[] userGroupIds)
208                    throws com.liferay.portal.kernel.exception.SystemException;
209    
210            public com.liferay.portal.model.UserGroup addUserGroup(long userId,
211                    long companyId, java.lang.String name, java.lang.String description)
212                    throws com.liferay.portal.kernel.exception.PortalException,
213                            com.liferay.portal.kernel.exception.SystemException;
214    
215            public void clearUserUserGroups(long userId)
216                    throws com.liferay.portal.kernel.exception.SystemException;
217    
218            public void copyUserGroupLayouts(long userGroupId, long[] userIds)
219                    throws com.liferay.portal.kernel.exception.PortalException,
220                            com.liferay.portal.kernel.exception.SystemException;
221    
222            public void copyUserGroupLayouts(long[] userGroupIds, long userId)
223                    throws com.liferay.portal.kernel.exception.PortalException,
224                            com.liferay.portal.kernel.exception.SystemException;
225    
226            public void copyUserGroupLayouts(long userGroupId, long userId)
227                    throws com.liferay.portal.kernel.exception.PortalException,
228                            com.liferay.portal.kernel.exception.SystemException;
229    
230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231            public com.liferay.portal.model.UserGroup getUserGroup(long companyId,
232                    java.lang.String name)
233                    throws com.liferay.portal.kernel.exception.PortalException,
234                            com.liferay.portal.kernel.exception.SystemException;
235    
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
238                    long companyId)
239                    throws com.liferay.portal.kernel.exception.SystemException;
240    
241            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
242            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
243                    long[] userGroupIds)
244                    throws com.liferay.portal.kernel.exception.PortalException,
245                            com.liferay.portal.kernel.exception.SystemException;
246    
247            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
248            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
249                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
250    
251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
252            public boolean hasGroupUserGroup(long groupId, long userGroupId)
253                    throws com.liferay.portal.kernel.exception.SystemException;
254    
255            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
256            public java.util.List<com.liferay.portal.model.UserGroup> search(
257                    long companyId, java.lang.String name, java.lang.String description,
258                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
259                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
260                    throws com.liferay.portal.kernel.exception.SystemException;
261    
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public int searchCount(long companyId, java.lang.String name,
264                    java.lang.String description,
265                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
266                    throws com.liferay.portal.kernel.exception.SystemException;
267    
268            public void setUserUserGroups(long userId, long[] userGroupIds)
269                    throws com.liferay.portal.kernel.exception.PortalException,
270                            com.liferay.portal.kernel.exception.SystemException;
271    
272            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
273                    throws com.liferay.portal.kernel.exception.SystemException;
274    
275            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
276                    long userGroupId, java.lang.String name, java.lang.String description)
277                    throws com.liferay.portal.kernel.exception.PortalException,
278                            com.liferay.portal.kernel.exception.SystemException;
279    }