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.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * The interface for the user group local service.
025     *
026     * <p>
027     * 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.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see UserGroupLocalServiceUtil
032     * @see com.liferay.portal.service.base.UserGroupLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.UserGroupLocalServiceImpl
034     * @generated
035     */
036    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
037            PortalException.class, SystemException.class})
038    public interface UserGroupLocalService extends BaseLocalService,
039            PersistedModelLocalService {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * 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.
044             */
045    
046            /**
047            * Adds the user group to the database. Also notifies the appropriate model listeners.
048            *
049            * @param userGroup the user group
050            * @return the user group that was added
051            * @throws SystemException if a system exception occurred
052            */
053            public com.liferay.portal.model.UserGroup addUserGroup(
054                    com.liferay.portal.model.UserGroup userGroup)
055                    throws com.liferay.portal.kernel.exception.SystemException;
056    
057            /**
058            * Creates a new user group with the primary key. Does not add the user group to the database.
059            *
060            * @param userGroupId the primary key for the new user group
061            * @return the new user group
062            */
063            public com.liferay.portal.model.UserGroup createUserGroup(long userGroupId);
064    
065            /**
066            * Deletes the user group with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param userGroupId the primary key of the user group
069            * @return the user group that was removed
070            * @throws PortalException if a user group with the primary key could not be found
071            * @throws SystemException if a system exception occurred
072            */
073            public com.liferay.portal.model.UserGroup deleteUserGroup(long userGroupId)
074                    throws com.liferay.portal.kernel.exception.PortalException,
075                            com.liferay.portal.kernel.exception.SystemException;
076    
077            /**
078            * Deletes the user group from the database. Also notifies the appropriate model listeners.
079            *
080            * @param userGroup the user group
081            * @return the user group that was removed
082            * @throws PortalException
083            * @throws SystemException if a system exception occurred
084            */
085            public com.liferay.portal.model.UserGroup deleteUserGroup(
086                    com.liferay.portal.model.UserGroup userGroup)
087                    throws com.liferay.portal.kernel.exception.PortalException,
088                            com.liferay.portal.kernel.exception.SystemException;
089    
090            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException;
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * 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.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException;
121    
122            /**
123            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
124            *
125            * <p>
126            * 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.
127            * </p>
128            *
129            * @param dynamicQuery the dynamic query
130            * @param start the lower bound of the range of model instances
131            * @param end the upper bound of the range of model instances (not inclusive)
132            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
133            * @return the ordered range of matching rows
134            * @throws SystemException if a system exception occurred
135            */
136            @SuppressWarnings("rawtypes")
137            public java.util.List dynamicQuery(
138                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
139                    int end,
140                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141                    throws com.liferay.portal.kernel.exception.SystemException;
142    
143            /**
144            * Returns the number of rows that match the dynamic query.
145            *
146            * @param dynamicQuery the dynamic query
147            * @return the number of rows that match the dynamic query
148            * @throws SystemException if a system exception occurred
149            */
150            public long dynamicQueryCount(
151                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
152                    throws com.liferay.portal.kernel.exception.SystemException;
153    
154            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155            public com.liferay.portal.model.UserGroup fetchUserGroup(long userGroupId)
156                    throws com.liferay.portal.kernel.exception.SystemException;
157    
158            /**
159            * Returns the user group with the primary key.
160            *
161            * @param userGroupId the primary key of the user group
162            * @return the user group
163            * @throws PortalException if a user group with the primary key could not be found
164            * @throws SystemException if a system exception occurred
165            */
166            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
167            public com.liferay.portal.model.UserGroup getUserGroup(long userGroupId)
168                    throws com.liferay.portal.kernel.exception.PortalException,
169                            com.liferay.portal.kernel.exception.SystemException;
170    
171            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
172            public com.liferay.portal.model.PersistedModel getPersistedModel(
173                    java.io.Serializable primaryKeyObj)
174                    throws com.liferay.portal.kernel.exception.PortalException,
175                            com.liferay.portal.kernel.exception.SystemException;
176    
177            /**
178            * Returns a range of all the user groups.
179            *
180            * <p>
181            * 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.
182            * </p>
183            *
184            * @param start the lower bound of the range of user groups
185            * @param end the upper bound of the range of user groups (not inclusive)
186            * @return the range of user groups
187            * @throws SystemException if a system exception occurred
188            */
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
191                    int start, int end)
192                    throws com.liferay.portal.kernel.exception.SystemException;
193    
194            /**
195            * Returns the number of user groups.
196            *
197            * @return the number of user groups
198            * @throws SystemException if a system exception occurred
199            */
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public int getUserGroupsCount()
202                    throws com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Updates the user group in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
206            *
207            * @param userGroup the user group
208            * @return the user group that was updated
209            * @throws SystemException if a system exception occurred
210            */
211            public com.liferay.portal.model.UserGroup updateUserGroup(
212                    com.liferay.portal.model.UserGroup userGroup)
213                    throws com.liferay.portal.kernel.exception.SystemException;
214    
215            /**
216            * Returns the Spring bean ID for this bean.
217            *
218            * @return the Spring bean ID for this bean
219            */
220            public java.lang.String getBeanIdentifier();
221    
222            /**
223            * Sets the Spring bean ID for this bean.
224            *
225            * @param beanIdentifier the Spring bean ID for this bean
226            */
227            public void setBeanIdentifier(java.lang.String beanIdentifier);
228    
229            /**
230            * Adds the user groups to the group.
231            *
232            * @param groupId the primary key of the group
233            * @param userGroupIds the primary keys of the user groups
234            * @throws SystemException if a system exception occurred
235            */
236            public void addGroupUserGroups(long groupId, long[] userGroupIds)
237                    throws com.liferay.portal.kernel.exception.SystemException;
238    
239            /**
240            * Adds the user groups to the team.
241            *
242            * @param teamId the primary key of the team
243            * @param userGroupIds the primary keys of the user groups
244            * @throws SystemException if a system exception occurred
245            */
246            public void addTeamUserGroups(long teamId, long[] userGroupIds)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Adds a user group.
251            *
252            * <p>
253            * This method handles the creation and bookkeeping of the user group,
254            * including its resources, metadata, and internal data structures. It is
255            * not necessary to make subsequent calls to setup default groups and
256            * resources for the user group.
257            * </p>
258            *
259            * @param userId the primary key of the user
260            * @param companyId the primary key of the user group's company
261            * @param name the user group's name
262            * @param description the user group's description
263            * @return the user group
264            * @throws PortalException if the user group's information was invalid
265            * @throws SystemException if a system exception occurred
266            */
267            public com.liferay.portal.model.UserGroup addUserGroup(long userId,
268                    long companyId, java.lang.String name, java.lang.String description)
269                    throws com.liferay.portal.kernel.exception.PortalException,
270                            com.liferay.portal.kernel.exception.SystemException;
271    
272            /**
273            * Clears all associations between the user and its user groups and clears
274            * the permissions cache.
275            *
276            * <p>
277            * This method is called from {@link #deleteUserGroup(UserGroup)}.
278            * </p>
279            *
280            * @param userId the primary key of the user
281            * @throws SystemException if a system exception occurred
282            */
283            public void clearUserUserGroups(long userId)
284                    throws com.liferay.portal.kernel.exception.SystemException;
285    
286            /**
287            * Copies the user group's layouts to the users who are not already members
288            * of the user group.
289            *
290            * @param userGroupId the primary key of the user group
291            * @param userIds the primary keys of the users
292            * @throws PortalException if any one of the users could not be found or
293            if a portal exception occurred
294            * @throws SystemException if a system exception occurred
295            * @deprecated
296            */
297            public void copyUserGroupLayouts(long userGroupId, long[] userIds)
298                    throws com.liferay.portal.kernel.exception.PortalException,
299                            com.liferay.portal.kernel.exception.SystemException;
300    
301            /**
302            * Copies the user groups' layouts to the user.
303            *
304            * @param userGroupIds the primary keys of the user groups
305            * @param userId the primary key of the user
306            * @throws PortalException if a user with the primary key could not be
307            found or if a portal exception occurred
308            * @throws SystemException if a system exception occurred
309            * @deprecated
310            */
311            public void copyUserGroupLayouts(long[] userGroupIds, long userId)
312                    throws com.liferay.portal.kernel.exception.PortalException,
313                            com.liferay.portal.kernel.exception.SystemException;
314    
315            /**
316            * Copies the user group's layout to the user.
317            *
318            * @param userGroupId the primary key of the user group
319            * @param userId the primary key of the user
320            * @throws PortalException if a user with the primary key could not be
321            found or if a portal exception occurred
322            * @throws SystemException if a system exception occurred
323            * @deprecated
324            */
325            public void copyUserGroupLayouts(long userGroupId, long userId)
326                    throws com.liferay.portal.kernel.exception.PortalException,
327                            com.liferay.portal.kernel.exception.SystemException;
328    
329            /**
330            * Returns the user group with the name.
331            *
332            * @param companyId the primary key of the user group's company
333            * @param name the user group's name
334            * @return Returns the user group with the name
335            * @throws PortalException if a user group with the name could not be found
336            * @throws SystemException if a system exception occurred
337            */
338            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
339            public com.liferay.portal.model.UserGroup getUserGroup(long companyId,
340                    java.lang.String name)
341                    throws com.liferay.portal.kernel.exception.PortalException,
342                            com.liferay.portal.kernel.exception.SystemException;
343    
344            /**
345            * Returns all the user groups belonging to the company.
346            *
347            * @param companyId the primary key of the user groups' company
348            * @return the user groups belonging to the company
349            * @throws SystemException if a system exception occurred
350            */
351            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
352            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
353                    long companyId)
354                    throws com.liferay.portal.kernel.exception.SystemException;
355    
356            /**
357            * Returns all the user groups with the primary keys.
358            *
359            * @param userGroupIds the primary keys of the user groups
360            * @return the user groups with the primary keys
361            * @throws PortalException if any one of the user groups could not be found
362            * @throws SystemException if a system exception occurred
363            */
364            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
365            public java.util.List<com.liferay.portal.model.UserGroup> getUserGroups(
366                    long[] userGroupIds)
367                    throws com.liferay.portal.kernel.exception.PortalException,
368                            com.liferay.portal.kernel.exception.SystemException;
369    
370            /**
371            * Returns all the user groups to which the user belongs.
372            *
373            * @param userId the primary key of the user
374            * @return the user groups to which the user belongs
375            * @throws SystemException if a system exception occurred
376            */
377            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
378            public java.util.List<com.liferay.portal.model.UserGroup> getUserUserGroups(
379                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
380    
381            /**
382            * Returns <code>true</code> if the user group is associated with the group.
383            *
384            * @param groupId the primary key of the group
385            * @param userGroupId the primary key of the user group
386            * @return <code>true</code> if the user group belongs to the group;
387            <code>false</code> otherwise
388            * @throws SystemException if a system exception occurred
389            */
390            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
391            public boolean hasGroupUserGroup(long groupId, long userGroupId)
392                    throws com.liferay.portal.kernel.exception.SystemException;
393    
394            /**
395            * Returns <code>true</code> if the user group belongs to the team.
396            *
397            * @param teamId the primary key of the team
398            * @param userGroupId the primary key of the user group
399            * @return <code>true</code> if the user group belongs to the team;
400            <code>false</code> otherwise
401            * @throws SystemException if a system exception occurred
402            */
403            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
404            public boolean hasTeamUserGroup(long teamId, long userGroupId)
405                    throws com.liferay.portal.kernel.exception.SystemException;
406    
407            /**
408            * Returns an ordered range of all the user groups that match the keywords.
409            *
410            * <p>
411            * Useful when paginating results. Returns a maximum of <code>end -
412            * start</code> instances. <code>start</code> and <code>end</code> are not
413            * primary keys, they are indexes in the result set. Thus, <code>0</code>
414            * refers to the first result in the set. Setting both <code>start</code>
415            * and <code>end</code> to {@link
416            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
417            * result set.
418            * </p>
419            *
420            * @param companyId the primary key of the user group's company
421            * @param keywords the keywords (space separated), which may occur in the
422            user group's name or description (optionally <code>null</code>)
423            * @param params the finder params (optionally <code>null</code>). For more
424            information see {@link
425            com.liferay.portal.service.persistence.UserGroupFinder}
426            * @param start the lower bound of the range of user groups to return
427            * @param end the upper bound of the range of user groups to return (not
428            inclusive)
429            * @param obc the comparator to order the user groups (optionally
430            <code>null</code>)
431            * @return the matching user groups ordered by comparator <code>obc</code>
432            * @throws SystemException if a system exception occurred
433            * @see com.liferay.portal.service.persistence.UserGroupFinder
434            */
435            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
436            public java.util.List<com.liferay.portal.model.UserGroup> search(
437                    long companyId, java.lang.String keywords,
438                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
439                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
440                    throws com.liferay.portal.kernel.exception.SystemException;
441    
442            /**
443            * Returns an ordered range of all the user groups that match the name and
444            * description.
445            *
446            * <p>
447            * Useful when paginating results. Returns a maximum of <code>end -
448            * start</code> instances. <code>start</code> and <code>end</code> are not
449            * primary keys, they are indexes in the result set. Thus, <code>0</code>
450            * refers to the first result in the set. Setting both <code>start</code>
451            * and <code>end</code> to {@link
452            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
453            * result set.
454            * </p>
455            *
456            * @param companyId the primary key of the user group's company
457            * @param name the user group's name (optionally <code>null</code>)
458            * @param description the user group's description (optionally
459            <code>null</code>)
460            * @param params the finder params (optionally <code>null</code>). For more
461            information see {@link
462            com.liferay.portal.service.persistence.UserGroupFinder}
463            * @param start the lower bound of the range of user groups to return
464            * @param end the upper bound of the range of user groups to return (not
465            inclusive)
466            * @param obc the comparator to order the user groups (optionally
467            <code>null</code>)
468            * @return the matching user groups ordered by comparator <code>obc</code>
469            * @throws SystemException if a system exception occurred
470            * @see com.liferay.portal.service.persistence.UserGroupFinder
471            */
472            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
473            public java.util.List<com.liferay.portal.model.UserGroup> search(
474                    long companyId, java.lang.String name, java.lang.String description,
475                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
476                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
477                    throws com.liferay.portal.kernel.exception.SystemException;
478    
479            /**
480            * Returns the number of user groups that match the keywords
481            *
482            * @param companyId the primary key of the user group's company
483            * @param keywords the keywords (space separated), which may occur in the
484            user group's name or description (optionally <code>null</code>)
485            * @param params the finder params (optionally <code>null</code>). For more
486            information see {@link
487            com.liferay.portal.service.persistence.UserGroupFinder}
488            * @return the number of matching user groups
489            * @throws SystemException if a system exception occurred
490            * @see com.liferay.portal.service.persistence.UserGroupFinder
491            */
492            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
493            public int searchCount(long companyId, java.lang.String keywords,
494                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
495                    throws com.liferay.portal.kernel.exception.SystemException;
496    
497            /**
498            * Returns the number of user groups that match the name and description.
499            *
500            * @param companyId the primary key of the user group's company
501            * @param name the user group's name (optionally <code>null</code>)
502            * @param description the user group's description (optionally
503            <code>null</code>)
504            * @param params the finder params (optionally <code>null</code>). For more
505            information see {@link
506            com.liferay.portal.service.persistence.UserGroupFinder}
507            * @return the number of matching user groups
508            * @throws SystemException if a system exception occurred
509            * @see com.liferay.portal.service.persistence.UserGroupFinder
510            */
511            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
512            public int searchCount(long companyId, java.lang.String name,
513                    java.lang.String description,
514                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
515                    throws com.liferay.portal.kernel.exception.SystemException;
516    
517            /**
518            * Sets the user groups associated with the user copying the user group
519            * layouts and removing and adding user group associations for the user as
520            * necessary.
521            *
522            * @param userId the primary key of the user
523            * @param userGroupIds the primary keys of the user groups
524            * @throws PortalException if a portal exception occurred
525            * @throws SystemException if a system exception occurred
526            */
527            public void setUserUserGroups(long userId, long[] userGroupIds)
528                    throws com.liferay.portal.kernel.exception.PortalException,
529                            com.liferay.portal.kernel.exception.SystemException;
530    
531            /**
532            * Removes the user groups from the group.
533            *
534            * @param groupId the primary key of the group
535            * @param userGroupIds the primary keys of the user groups
536            * @throws SystemException if a system exception occurred
537            */
538            public void unsetGroupUserGroups(long groupId, long[] userGroupIds)
539                    throws com.liferay.portal.kernel.exception.SystemException;
540    
541            /**
542            * Removes the user groups from the team.
543            *
544            * @param teamId the primary key of the team
545            * @param userGroupIds the primary keys of the user groups
546            * @throws SystemException if a system exception occurred
547            */
548            public void unsetTeamUserGroups(long teamId, long[] userGroupIds)
549                    throws com.liferay.portal.kernel.exception.SystemException;
550    
551            /**
552            * Updates the user group.
553            *
554            * @param companyId the primary key of the user group's company
555            * @param userGroupId the primary key of the user group
556            * @param name the user group's name
557            * @param description the user group's description
558            * @return the user group
559            * @throws PortalException if a user group with the primary key could not be
560            found or if the new information was invalid
561            * @throws SystemException if a system exception occurred
562            */
563            public com.liferay.portal.model.UserGroup updateUserGroup(long companyId,
564                    long userGroupId, java.lang.String name, java.lang.String description)
565                    throws com.liferay.portal.kernel.exception.PortalException,
566                            com.liferay.portal.kernel.exception.SystemException;
567    }