001    /**
002     * Copyright (c) 2000-2013 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.exception.PortalException;
020    import com.liferay.portal.kernel.exception.SystemException;
021    import com.liferay.portal.kernel.search.IndexableType;
022    import com.liferay.portal.kernel.transaction.Isolation;
023    import com.liferay.portal.kernel.transaction.Propagation;
024    import com.liferay.portal.kernel.transaction.Transactional;
025    
026    /**
027     * Provides the local service interface for Role. Methods of this
028     * service will not have security checks based on the propagated JAAS
029     * credentials because this service can only be accessed from within the same
030     * VM.
031     *
032     * @author Brian Wing Shun Chan
033     * @see RoleLocalServiceUtil
034     * @see com.liferay.portal.service.base.RoleLocalServiceBaseImpl
035     * @see com.liferay.portal.service.impl.RoleLocalServiceImpl
036     * @generated
037     */
038    @ProviderType
039    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
040            PortalException.class, SystemException.class})
041    public interface RoleLocalService extends BaseLocalService,
042            PersistedModelLocalService {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify or reference this interface directly. Always use {@link RoleLocalServiceUtil} to access the role local service. Add custom service methods to {@link com.liferay.portal.service.impl.RoleLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
047             */
048    
049            /**
050            * Adds the role to the database. Also notifies the appropriate model listeners.
051            *
052            * @param role the role
053            * @return the role that was added
054            * @throws SystemException if a system exception occurred
055            */
056            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
057            public com.liferay.portal.model.Role addRole(
058                    com.liferay.portal.model.Role role)
059                    throws com.liferay.portal.kernel.exception.SystemException;
060    
061            /**
062            * Creates a new role with the primary key. Does not add the role to the database.
063            *
064            * @param roleId the primary key for the new role
065            * @return the new role
066            */
067            public com.liferay.portal.model.Role createRole(long roleId);
068    
069            /**
070            * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners.
071            *
072            * @param roleId the primary key of the role
073            * @return the role that was removed
074            * @throws PortalException if a role with the primary key could not be found
075            * @throws SystemException if a system exception occurred
076            */
077            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
078            public com.liferay.portal.model.Role deleteRole(long roleId)
079                    throws com.liferay.portal.kernel.exception.PortalException,
080                            com.liferay.portal.kernel.exception.SystemException;
081    
082            /**
083            * Deletes the role from the database. Also notifies the appropriate model listeners.
084            *
085            * @param role the role
086            * @return the role that was removed
087            * @throws PortalException
088            * @throws SystemException if a system exception occurred
089            */
090            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
091            public com.liferay.portal.model.Role deleteRole(
092                    com.liferay.portal.model.Role role)
093                    throws com.liferay.portal.kernel.exception.PortalException,
094                            com.liferay.portal.kernel.exception.SystemException;
095    
096            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
097    
098            /**
099            * Performs a dynamic query on the database and returns the matching rows.
100            *
101            * @param dynamicQuery the dynamic query
102            * @return the matching rows
103            * @throws SystemException if a system exception occurred
104            */
105            @SuppressWarnings("rawtypes")
106            public java.util.List dynamicQuery(
107                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
108                    throws com.liferay.portal.kernel.exception.SystemException;
109    
110            /**
111            * Performs a dynamic query on the database and returns a range of the matching rows.
112            *
113            * <p>
114            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
115            * </p>
116            *
117            * @param dynamicQuery the dynamic query
118            * @param start the lower bound of the range of model instances
119            * @param end the upper bound of the range of model instances (not inclusive)
120            * @return the range of matching rows
121            * @throws SystemException if a system exception occurred
122            */
123            @SuppressWarnings("rawtypes")
124            public java.util.List dynamicQuery(
125                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
126                    int end) throws com.liferay.portal.kernel.exception.SystemException;
127    
128            /**
129            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
130            *
131            * <p>
132            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
133            * </p>
134            *
135            * @param dynamicQuery the dynamic query
136            * @param start the lower bound of the range of model instances
137            * @param end the upper bound of the range of model instances (not inclusive)
138            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
139            * @return the ordered range of matching rows
140            * @throws SystemException if a system exception occurred
141            */
142            @SuppressWarnings("rawtypes")
143            public java.util.List dynamicQuery(
144                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
145                    int end,
146                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
147                    throws com.liferay.portal.kernel.exception.SystemException;
148    
149            /**
150            * Returns the number of rows that match the dynamic query.
151            *
152            * @param dynamicQuery the dynamic query
153            * @return the number of rows that match the dynamic query
154            * @throws SystemException if a system exception occurred
155            */
156            public long dynamicQueryCount(
157                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
158                    throws com.liferay.portal.kernel.exception.SystemException;
159    
160            /**
161            * Returns the number of rows that match the dynamic query.
162            *
163            * @param dynamicQuery the dynamic query
164            * @param projection the projection to apply to the query
165            * @return the number of rows that match the dynamic query
166            * @throws SystemException if a system exception occurred
167            */
168            public long dynamicQueryCount(
169                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
170                    com.liferay.portal.kernel.dao.orm.Projection projection)
171                    throws com.liferay.portal.kernel.exception.SystemException;
172    
173            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174            public com.liferay.portal.model.Role fetchRole(long roleId)
175                    throws com.liferay.portal.kernel.exception.SystemException;
176    
177            /**
178            * Returns the role with the matching UUID and company.
179            *
180            * @param uuid the role's UUID
181            * @param companyId the primary key of the company
182            * @return the matching role, or <code>null</code> if a matching role could not be found
183            * @throws SystemException if a system exception occurred
184            */
185            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186            public com.liferay.portal.model.Role fetchRoleByUuidAndCompanyId(
187                    java.lang.String uuid, long companyId)
188                    throws com.liferay.portal.kernel.exception.SystemException;
189    
190            /**
191            * Returns the role with the primary key.
192            *
193            * @param roleId the primary key of the role
194            * @return the role
195            * @throws PortalException if a role with the primary key could not be found
196            * @throws SystemException if a system exception occurred
197            */
198            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
199            public com.liferay.portal.model.Role getRole(long roleId)
200                    throws com.liferay.portal.kernel.exception.PortalException,
201                            com.liferay.portal.kernel.exception.SystemException;
202    
203            @Override
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public com.liferay.portal.model.PersistedModel getPersistedModel(
206                    java.io.Serializable primaryKeyObj)
207                    throws com.liferay.portal.kernel.exception.PortalException,
208                            com.liferay.portal.kernel.exception.SystemException;
209    
210            /**
211            * Returns the role with the matching UUID and company.
212            *
213            * @param uuid the role's UUID
214            * @param companyId the primary key of the company
215            * @return the matching role
216            * @throws PortalException if a matching role could not be found
217            * @throws SystemException if a system exception occurred
218            */
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public com.liferay.portal.model.Role getRoleByUuidAndCompanyId(
221                    java.lang.String uuid, long companyId)
222                    throws com.liferay.portal.kernel.exception.PortalException,
223                            com.liferay.portal.kernel.exception.SystemException;
224    
225            /**
226            * Returns a range of all the roles.
227            *
228            * <p>
229            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
230            * </p>
231            *
232            * @param start the lower bound of the range of roles
233            * @param end the upper bound of the range of roles (not inclusive)
234            * @return the range of roles
235            * @throws SystemException if a system exception occurred
236            */
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public java.util.List<com.liferay.portal.model.Role> getRoles(int start,
239                    int end) throws com.liferay.portal.kernel.exception.SystemException;
240    
241            /**
242            * Returns the number of roles.
243            *
244            * @return the number of roles
245            * @throws SystemException if a system exception occurred
246            */
247            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
248            public int getRolesCount()
249                    throws com.liferay.portal.kernel.exception.SystemException;
250    
251            /**
252            * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
253            *
254            * @param role the role
255            * @return the role that was updated
256            * @throws SystemException if a system exception occurred
257            */
258            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
259            public com.liferay.portal.model.Role updateRole(
260                    com.liferay.portal.model.Role role)
261                    throws com.liferay.portal.kernel.exception.SystemException;
262    
263            /**
264            * @throws SystemException if a system exception occurred
265            */
266            public void addGroupRole(long groupId, long roleId)
267                    throws com.liferay.portal.kernel.exception.SystemException;
268    
269            /**
270            * @throws SystemException if a system exception occurred
271            */
272            public void addGroupRole(long groupId, com.liferay.portal.model.Role role)
273                    throws com.liferay.portal.kernel.exception.SystemException;
274    
275            /**
276            * @throws SystemException if a system exception occurred
277            */
278            public void addGroupRoles(long groupId, long[] roleIds)
279                    throws com.liferay.portal.kernel.exception.SystemException;
280    
281            /**
282            * @throws SystemException if a system exception occurred
283            */
284            public void addGroupRoles(long groupId,
285                    java.util.List<com.liferay.portal.model.Role> roles)
286                    throws com.liferay.portal.kernel.exception.SystemException;
287    
288            /**
289            * @throws SystemException if a system exception occurred
290            */
291            public void clearGroupRoles(long groupId)
292                    throws com.liferay.portal.kernel.exception.SystemException;
293    
294            /**
295            * @throws SystemException if a system exception occurred
296            */
297            public void deleteGroupRole(long groupId, long roleId)
298                    throws com.liferay.portal.kernel.exception.SystemException;
299    
300            /**
301            * @throws SystemException if a system exception occurred
302            */
303            public void deleteGroupRole(long groupId, com.liferay.portal.model.Role role)
304                    throws com.liferay.portal.kernel.exception.SystemException;
305    
306            /**
307            * @throws SystemException if a system exception occurred
308            */
309            public void deleteGroupRoles(long groupId, long[] roleIds)
310                    throws com.liferay.portal.kernel.exception.SystemException;
311    
312            /**
313            * @throws SystemException if a system exception occurred
314            */
315            public void deleteGroupRoles(long groupId,
316                    java.util.List<com.liferay.portal.model.Role> roles)
317                    throws com.liferay.portal.kernel.exception.SystemException;
318    
319            /**
320            * @throws SystemException if a system exception occurred
321            */
322            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
324                    long groupId)
325                    throws com.liferay.portal.kernel.exception.SystemException;
326    
327            /**
328            * @throws SystemException if a system exception occurred
329            */
330            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
331            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
332                    long groupId, int start, int end)
333                    throws com.liferay.portal.kernel.exception.SystemException;
334    
335            /**
336            * @throws SystemException if a system exception occurred
337            */
338            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
339            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
340                    long groupId, int start, int end,
341                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
342                    throws com.liferay.portal.kernel.exception.SystemException;
343    
344            /**
345            * @throws SystemException if a system exception occurred
346            */
347            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
348            public int getGroupRolesCount(long groupId)
349                    throws com.liferay.portal.kernel.exception.SystemException;
350    
351            /**
352            * @throws SystemException if a system exception occurred
353            */
354            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
355            public boolean hasGroupRole(long groupId, long roleId)
356                    throws com.liferay.portal.kernel.exception.SystemException;
357    
358            /**
359            * @throws SystemException if a system exception occurred
360            */
361            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
362            public boolean hasGroupRoles(long groupId)
363                    throws com.liferay.portal.kernel.exception.SystemException;
364    
365            /**
366            * @throws SystemException if a system exception occurred
367            */
368            public void setGroupRoles(long groupId, long[] roleIds)
369                    throws com.liferay.portal.kernel.exception.SystemException;
370    
371            /**
372            * @throws PortalException
373            * @throws SystemException if a system exception occurred
374            */
375            public void addUserRole(long userId, long roleId)
376                    throws com.liferay.portal.kernel.exception.PortalException,
377                            com.liferay.portal.kernel.exception.SystemException;
378    
379            /**
380            * @throws PortalException
381            * @throws SystemException if a system exception occurred
382            */
383            public void addUserRole(long userId, com.liferay.portal.model.Role role)
384                    throws com.liferay.portal.kernel.exception.PortalException,
385                            com.liferay.portal.kernel.exception.SystemException;
386    
387            /**
388            * @throws PortalException
389            * @throws SystemException if a system exception occurred
390            */
391            public void addUserRoles(long userId, long[] roleIds)
392                    throws com.liferay.portal.kernel.exception.PortalException,
393                            com.liferay.portal.kernel.exception.SystemException;
394    
395            /**
396            * @throws PortalException
397            * @throws SystemException if a system exception occurred
398            */
399            public void addUserRoles(long userId,
400                    java.util.List<com.liferay.portal.model.Role> roles)
401                    throws com.liferay.portal.kernel.exception.PortalException,
402                            com.liferay.portal.kernel.exception.SystemException;
403    
404            /**
405            * @throws PortalException
406            * @throws SystemException if a system exception occurred
407            */
408            public void clearUserRoles(long userId)
409                    throws com.liferay.portal.kernel.exception.PortalException,
410                            com.liferay.portal.kernel.exception.SystemException;
411    
412            /**
413            * @throws PortalException
414            * @throws SystemException if a system exception occurred
415            */
416            public void deleteUserRole(long userId, long roleId)
417                    throws com.liferay.portal.kernel.exception.PortalException,
418                            com.liferay.portal.kernel.exception.SystemException;
419    
420            /**
421            * @throws PortalException
422            * @throws SystemException if a system exception occurred
423            */
424            public void deleteUserRole(long userId, com.liferay.portal.model.Role role)
425                    throws com.liferay.portal.kernel.exception.PortalException,
426                            com.liferay.portal.kernel.exception.SystemException;
427    
428            /**
429            * @throws PortalException
430            * @throws SystemException if a system exception occurred
431            */
432            public void deleteUserRoles(long userId, long[] roleIds)
433                    throws com.liferay.portal.kernel.exception.PortalException,
434                            com.liferay.portal.kernel.exception.SystemException;
435    
436            /**
437            * @throws PortalException
438            * @throws SystemException if a system exception occurred
439            */
440            public void deleteUserRoles(long userId,
441                    java.util.List<com.liferay.portal.model.Role> roles)
442                    throws com.liferay.portal.kernel.exception.PortalException,
443                            com.liferay.portal.kernel.exception.SystemException;
444    
445            /**
446            * @throws SystemException if a system exception occurred
447            */
448            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
449            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
450                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
451    
452            /**
453            * @throws SystemException if a system exception occurred
454            */
455            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
456            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
457                    long userId, int start, int end)
458                    throws com.liferay.portal.kernel.exception.SystemException;
459    
460            /**
461            * @throws SystemException if a system exception occurred
462            */
463            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
464            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
465                    long userId, int start, int end,
466                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
467                    throws com.liferay.portal.kernel.exception.SystemException;
468    
469            /**
470            * @throws SystemException if a system exception occurred
471            */
472            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
473            public int getUserRolesCount(long userId)
474                    throws com.liferay.portal.kernel.exception.SystemException;
475    
476            /**
477            * @throws SystemException if a system exception occurred
478            */
479            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
480            public boolean hasUserRole(long userId, long roleId)
481                    throws com.liferay.portal.kernel.exception.SystemException;
482    
483            /**
484            * @throws SystemException if a system exception occurred
485            */
486            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
487            public boolean hasUserRoles(long userId)
488                    throws com.liferay.portal.kernel.exception.SystemException;
489    
490            /**
491            * @throws PortalException
492            * @throws SystemException if a system exception occurred
493            */
494            public void setUserRoles(long userId, long[] roleIds)
495                    throws com.liferay.portal.kernel.exception.PortalException,
496                            com.liferay.portal.kernel.exception.SystemException;
497    
498            /**
499            * Returns the Spring bean ID for this bean.
500            *
501            * @return the Spring bean ID for this bean
502            */
503            public java.lang.String getBeanIdentifier();
504    
505            /**
506            * Sets the Spring bean ID for this bean.
507            *
508            * @param beanIdentifier the Spring bean ID for this bean
509            */
510            public void setBeanIdentifier(java.lang.String beanIdentifier);
511    
512            /**
513            * Adds a role. The user is reindexed after role is added.
514            *
515            * @param userId the primary key of the user
516            * @param companyId the primary key of the company
517            * @param name the role's name
518            * @param titleMap the role's localized titles (optionally
519            <code>null</code>)
520            * @param descriptionMap the role's localized descriptions (optionally
521            <code>null</code>)
522            * @param type the role's type (optionally <code>0</code>)
523            * @return the role
524            * @throws PortalException if the class name or the role name were
525            invalid, if the role is a duplicate, or if a user with the
526            primary key could not be found
527            * @throws SystemException if a system exception occurred
528            * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long,
529            String, Map, Map, int, String, ServiceContext)}
530            */
531            public com.liferay.portal.model.Role addRole(long userId, long companyId,
532                    java.lang.String name,
533                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
534                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
535                    int type)
536                    throws com.liferay.portal.kernel.exception.PortalException,
537                            com.liferay.portal.kernel.exception.SystemException;
538    
539            /**
540            * Adds a role with additional parameters. The user is reindexed after role
541            * is added.
542            *
543            * @param userId the primary key of the user
544            * @param companyId the primary key of the company
545            * @param name the role's name
546            * @param titleMap the role's localized titles (optionally
547            <code>null</code>)
548            * @param descriptionMap the role's localized descriptions (optionally
549            <code>null</code>)
550            * @param type the role's type (optionally <code>0</code>)
551            * @param className the name of the class for which the role is created
552            (optionally <code>null</code>)
553            * @param classPK the primary key of the class for which the role is
554            created (optionally <code>0</code>)
555            * @return the role
556            * @throws PortalException if the class name or the role name were
557            invalid, if the role is a duplicate, or if a user with the
558            primary key could not be found
559            * @throws SystemException if a system exception occurred
560            * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long,
561            String, Map, Map, int, String, ServiceContext)}
562            */
563            public com.liferay.portal.model.Role addRole(long userId, long companyId,
564                    java.lang.String name,
565                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
566                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
567                    int type, java.lang.String className, long classPK)
568                    throws com.liferay.portal.kernel.exception.PortalException,
569                            com.liferay.portal.kernel.exception.SystemException;
570    
571            /**
572            * Adds a role with additional parameters. The user is reindexed after role
573            * is added.
574            *
575            * @param userId the primary key of the user
576            * @param className the name of the class for which the role is created
577            (optionally <code>null</code>)
578            * @param classPK the primary key of the class for which the role is
579            created (optionally <code>0</code>)
580            * @param name the role's name
581            * @param titleMap the role's localized titles (optionally
582            <code>null</code>)
583            * @param descriptionMap the role's localized descriptions (optionally
584            <code>null</code>)
585            * @param type the role's type (optionally <code>0</code>)
586            * @param subtype the role's subtype (optionally <code>null</code>)
587            * @param serviceContext the service context to be applied (optionally
588            <code>null</code>). Can set expando bridge attributes for the
589            role.
590            * @return the role
591            * @throws PortalException if the class name or the role name were invalid,
592            if the role is a duplicate, or if a user with the primary key
593            could not be found
594            * @throws SystemException if a system exception occurred
595            */
596            public com.liferay.portal.model.Role addRole(long userId,
597                    java.lang.String className, long classPK, java.lang.String name,
598                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
599                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
600                    int type, java.lang.String subtype,
601                    com.liferay.portal.service.ServiceContext serviceContext)
602                    throws com.liferay.portal.kernel.exception.PortalException,
603                            com.liferay.portal.kernel.exception.SystemException;
604    
605            /**
606            * Checks to ensure that the system roles map has appropriate default roles
607            * in each company.
608            *
609            * @throws PortalException if the current user did not have permission to
610            set applicable permissions on a role
611            * @throws SystemException if a system exception occurred
612            */
613            public void checkSystemRoles()
614                    throws com.liferay.portal.kernel.exception.PortalException,
615                            com.liferay.portal.kernel.exception.SystemException;
616    
617            /**
618            * Checks to ensure that the system roles map has appropriate default roles
619            * in the company.
620            *
621            * @param companyId the primary key of the company
622            * @throws PortalException if the current user did not have permission to
623            set applicable permissions on a role
624            * @throws SystemException if a system exception occurred
625            */
626            @com.liferay.portal.kernel.transaction.Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
627            public void checkSystemRoles(long companyId)
628                    throws com.liferay.portal.kernel.exception.PortalException,
629                            com.liferay.portal.kernel.exception.SystemException;
630    
631            /**
632            * Returns the role with the name in the company.
633            *
634            * <p>
635            * The method searches the system roles map first for default roles. If a
636            * role with the name is not found, then the method will query the database.
637            * </p>
638            *
639            * @param companyId the primary key of the company
640            * @param name the role's name
641            * @return Returns the role with the name or <code>null</code> if a role
642            with the name could not be found in the company
643            * @throws SystemException if a system exception occurred
644            */
645            @com.liferay.portal.kernel.spring.aop.Skip
646            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
647            public com.liferay.portal.model.Role fetchRole(long companyId,
648                    java.lang.String name)
649                    throws com.liferay.portal.kernel.exception.SystemException;
650    
651            /**
652            * Returns the default role for the group with the primary key.
653            *
654            * <p>
655            * If the group is a site, then the default role is {@link
656            * com.liferay.portal.model.RoleConstants#SITE_MEMBER}. If the group is an
657            * organization, then the default role is {@link
658            * com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}. If the group
659            * is a user or user group, then the default role is {@link
660            * com.liferay.portal.model.RoleConstants#POWER_USER}. For all other group
661            * types, the default role is {@link
662            * com.liferay.portal.model.RoleConstants#USER}.
663            * </p>
664            *
665            * @param groupId the primary key of the group
666            * @return the default role for the group with the primary key
667            * @throws PortalException if a group with the primary key could not be
668            found, or if a default role could not be found for the group
669            * @throws SystemException if a system exception occurred
670            */
671            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
672            public com.liferay.portal.model.Role getDefaultGroupRole(long groupId)
673                    throws com.liferay.portal.kernel.exception.PortalException,
674                            com.liferay.portal.kernel.exception.SystemException;
675    
676            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
677            public java.util.List<com.liferay.portal.model.Role> getGroupRelatedRoles(
678                    long groupId)
679                    throws com.liferay.portal.kernel.exception.PortalException,
680                            com.liferay.portal.kernel.exception.SystemException;
681    
682            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
683            public java.util.List<com.liferay.portal.model.Role> getGroupRolesAndTeamRoles(
684                    long companyId, java.lang.String keywords,
685                    java.util.List<java.lang.String> excludedNames, int[] types,
686                    long excludedTeamRoleId, long teamGroupId, int start, int end)
687                    throws com.liferay.portal.kernel.exception.SystemException;
688    
689            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
690            public int getGroupRolesAndTeamRolesCount(long companyId,
691                    java.lang.String keywords,
692                    java.util.List<java.lang.String> excludedNames, int[] types,
693                    long excludedTeamRoleId, long teamGroupId)
694                    throws com.liferay.portal.kernel.exception.SystemException;
695    
696            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
697            public java.util.List<com.liferay.portal.model.Role> getResourceBlockRoles(
698                    long resourceBlockId, java.lang.String className,
699                    java.lang.String actionId)
700                    throws com.liferay.portal.kernel.exception.SystemException;
701    
702            /**
703            * Returns a map of role names to associated action IDs for the named
704            * resource in the company within the permission scope.
705            *
706            * @param companyId the primary key of the company
707            * @param name the resource name
708            * @param scope the permission scope
709            * @param primKey the primary key of the resource's class
710            * @return the role names and action IDs
711            * @throws SystemException if a system exception occurred
712            * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P(
713            long, String, int, String)
714            */
715            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
716            public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
717                    long companyId, java.lang.String name, int scope,
718                    java.lang.String primKey)
719                    throws com.liferay.portal.kernel.exception.SystemException;
720    
721            /**
722            * Returns all the roles associated with the action ID in the company within
723            * the permission scope.
724            *
725            * @param companyId the primary key of the company
726            * @param name the resource name
727            * @param scope the permission scope
728            * @param primKey the primary key of the resource's class
729            * @param actionId the name of the resource action
730            * @return the roles
731            * @throws SystemException if a system exception occurred
732            * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A(
733            long, String, int, String, String)
734            */
735            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
736            public java.util.List<com.liferay.portal.model.Role> getResourceRoles(
737                    long companyId, java.lang.String name, int scope,
738                    java.lang.String primKey, java.lang.String actionId)
739                    throws com.liferay.portal.kernel.exception.SystemException;
740    
741            /**
742            * Returns the role with the name in the company.
743            *
744            * <p>
745            * The method searches the system roles map first for default roles. If a
746            * role with the name is not found, then the method will query the database.
747            * </p>
748            *
749            * @param companyId the primary key of the company
750            * @param name the role's name
751            * @return the role with the name
752            * @throws PortalException if a role with the name could not be found in the
753            company
754            * @throws SystemException if a system exception occurred
755            */
756            @com.liferay.portal.kernel.spring.aop.Skip
757            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
758            public com.liferay.portal.model.Role getRole(long companyId,
759                    java.lang.String name)
760                    throws com.liferay.portal.kernel.exception.PortalException,
761                            com.liferay.portal.kernel.exception.SystemException;
762    
763            /**
764            * Returns all the roles of the type and subtype.
765            *
766            * @param type the role's type (optionally <code>0</code>)
767            * @param subtype the role's subtype (optionally <code>null</code>)
768            * @return the roles of the type and subtype
769            * @throws SystemException if a system exception occurred
770            */
771            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
772            public java.util.List<com.liferay.portal.model.Role> getRoles(int type,
773                    java.lang.String subtype)
774                    throws com.liferay.portal.kernel.exception.SystemException;
775    
776            /**
777            * Returns all the roles in the company.
778            *
779            * @param companyId the primary key of the company
780            * @return the roles in the company
781            * @throws SystemException if a system exception occurred
782            */
783            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
784            public java.util.List<com.liferay.portal.model.Role> getRoles(
785                    long companyId)
786                    throws com.liferay.portal.kernel.exception.SystemException;
787    
788            /**
789            * Returns all the roles with the types.
790            *
791            * @param companyId the primary key of the company
792            * @param types the role types (optionally <code>null</code>)
793            * @return the roles with the types
794            * @throws SystemException if a system exception occurred
795            */
796            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
797            public java.util.List<com.liferay.portal.model.Role> getRoles(
798                    long companyId, int[] types)
799                    throws com.liferay.portal.kernel.exception.SystemException;
800    
801            /**
802            * Returns all the roles with the primary keys.
803            *
804            * @param roleIds the primary keys of the roles
805            * @return the roles with the primary keys
806            * @throws PortalException if any one of the roles with the primary keys
807            could not be found
808            * @throws SystemException if a system exception occurred
809            */
810            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
811            public java.util.List<com.liferay.portal.model.Role> getRoles(
812                    long[] roleIds)
813                    throws com.liferay.portal.kernel.exception.PortalException,
814                            com.liferay.portal.kernel.exception.SystemException;
815    
816            /**
817            * Returns all the roles of the subtype.
818            *
819            * @param subtype the role's subtype (optionally <code>null</code>)
820            * @return the roles of the subtype
821            * @throws SystemException if a system exception occurred
822            */
823            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
824            public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
825                    java.lang.String subtype)
826                    throws com.liferay.portal.kernel.exception.SystemException;
827    
828            /**
829            * Returns the number of roles of the subtype.
830            *
831            * @param subtype the role's subtype (optionally <code>null</code>)
832            * @return the number of roles of the subtype
833            * @throws SystemException if a system exception occurred
834            */
835            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
836            public int getSubtypeRolesCount(java.lang.String subtype)
837                    throws com.liferay.portal.kernel.exception.SystemException;
838    
839            /**
840            * Returns the team role in the company.
841            *
842            * @param companyId the primary key of the company
843            * @param teamId the primary key of the team
844            * @return the team role in the company
845            * @throws PortalException if a role could not be found in the team and
846            company
847            * @throws SystemException if a system exception occurred
848            */
849            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
850            public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId)
851                    throws com.liferay.portal.kernel.exception.PortalException,
852                            com.liferay.portal.kernel.exception.SystemException;
853    
854            /**
855            * Returns the team role map for the group.
856            *
857            * @param groupId the primary key of the group
858            * @return the team role map for the group
859            * @throws PortalException if a group with the primary key could not be
860            found, if a role could not be found in one of the group's teams,
861            or if a portal exception occurred
862            * @throws SystemException if a system exception occurred
863            */
864            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
865            public java.util.Map<com.liferay.portal.model.Team, com.liferay.portal.model.Role> getTeamRoleMap(
866                    long groupId)
867                    throws com.liferay.portal.kernel.exception.PortalException,
868                            com.liferay.portal.kernel.exception.SystemException;
869    
870            /**
871            * Returns the team roles in the group.
872            *
873            * @param groupId the primary key of the group
874            * @return the team roles in the group
875            * @throws PortalException if a group with the primary key could not be
876            found, if a role could not be found in one of the group's teams,
877            or if a portal exception occurred
878            * @throws SystemException if a system exception occurred
879            */
880            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
881            public java.util.List<com.liferay.portal.model.Role> getTeamRoles(
882                    long groupId)
883                    throws com.liferay.portal.kernel.exception.PortalException,
884                            com.liferay.portal.kernel.exception.SystemException;
885    
886            /**
887            * Returns the team roles in the group, excluding the specified role IDs.
888            *
889            * @param groupId the primary key of the group
890            * @param excludedRoleIds the primary keys of the roles to exclude
891            (optionally <code>null</code>)
892            * @return the team roles in the group, excluding the specified role IDs
893            * @throws PortalException if a group with the primary key could not be
894            found, if a role could not be found in one of the group's teams,
895            or if a portal exception occurred
896            * @throws SystemException if a system exception occurred
897            */
898            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
899            public java.util.List<com.liferay.portal.model.Role> getTeamRoles(
900                    long groupId, long[] excludedRoleIds)
901                    throws com.liferay.portal.kernel.exception.PortalException,
902                            com.liferay.portal.kernel.exception.SystemException;
903    
904            /**
905            * Returns the team roles in the company.
906            *
907            * @param companyId the primary key of the company
908            * @param teamIds the primary keys of the teams
909            * @return the team roles in the company
910            */
911            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
912            public java.util.List<com.liferay.portal.model.Role> getTeamsRoles(
913                    long companyId, long[] teamIds)
914                    throws com.liferay.portal.kernel.exception.PortalException,
915                            com.liferay.portal.kernel.exception.SystemException;
916    
917            /**
918            * Returns all the roles of the type.
919            *
920            * @param type the role's type (optionally <code>0</code>)
921            * @return the range of the roles of the type
922            * @throws SystemException if a system exception occurred
923            */
924            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
925            public java.util.List<com.liferay.portal.model.Role> getTypeRoles(int type)
926                    throws com.liferay.portal.kernel.exception.SystemException;
927    
928            /**
929            * Returns a range of all the roles of the type.
930            *
931            * @param type the role's type (optionally <code>0</code>)
932            * @param start the lower bound of the range of roles to return
933            * @param end the upper bound of the range of roles to return (not
934            inclusive)
935            * @return the range of the roles of the type
936            * @throws SystemException if a system exception occurred
937            */
938            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
939            public java.util.List<com.liferay.portal.model.Role> getTypeRoles(
940                    int type, int start, int end)
941                    throws com.liferay.portal.kernel.exception.SystemException;
942    
943            /**
944            * Returns the number of roles of the type.
945            *
946            * @param type the role's type (optionally <code>0</code>)
947            * @return the number of roles of the type
948            * @throws SystemException if a system exception occurred
949            */
950            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
951            public int getTypeRolesCount(int type)
952                    throws com.liferay.portal.kernel.exception.SystemException;
953    
954            /**
955            * Returns all the user's roles within the user group.
956            *
957            * @param userId the primary key of the user
958            * @param groupId the primary key of the group
959            * @return the user's roles within the user group
960            * @throws SystemException if a system exception occurred
961            * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole(
962            long, long)
963            */
964            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
965            public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
966                    long userId, long groupId)
967                    throws com.liferay.portal.kernel.exception.SystemException;
968    
969            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
970            public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
971                    long userId, long groupId, int start, int end)
972                    throws com.liferay.portal.kernel.exception.SystemException;
973    
974            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
975            public int getUserGroupGroupRolesCount(long userId, long groupId)
976                    throws com.liferay.portal.kernel.exception.SystemException;
977    
978            /**
979            * Returns all the user's roles within the user group.
980            *
981            * @param userId the primary key of the user
982            * @param groupId the primary key of the group
983            * @return the user's roles within the user group
984            * @throws SystemException if a system exception occurred
985            * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole(
986            long, long)
987            */
988            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
989            public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
990                    long userId, long groupId)
991                    throws com.liferay.portal.kernel.exception.SystemException;
992    
993            /**
994            * Returns the union of all the user's roles within the groups.
995            *
996            * @param userId the primary key of the user
997            * @param groups the groups (optionally <code>null</code>)
998            * @return the union of all the user's roles within the groups
999            * @throws SystemException if a system exception occurred
1000            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
1001            long, List)
1002            */
1003            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1004            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
1005                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
1006                    throws com.liferay.portal.kernel.exception.SystemException;
1007    
1008            /**
1009            * Returns all the user's roles within the group.
1010            *
1011            * @param userId the primary key of the user
1012            * @param groupId the primary key of the group
1013            * @return the user's roles within the group
1014            * @throws SystemException if a system exception occurred
1015            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
1016            long, long)
1017            */
1018            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1019            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
1020                    long userId, long groupId)
1021                    throws com.liferay.portal.kernel.exception.SystemException;
1022    
1023            /**
1024            * Returns the union of all the user's roles within the groups.
1025            *
1026            * @param userId the primary key of the user
1027            * @param groupIds the primary keys of the groups
1028            * @return the union of all the user's roles within the groups
1029            * @throws SystemException if a system exception occurred
1030            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
1031            long, long[])
1032            */
1033            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1034            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
1035                    long userId, long[] groupIds)
1036                    throws com.liferay.portal.kernel.exception.SystemException;
1037    
1038            /**
1039            * Returns <code>true</code> if the user is associated with the named
1040            * regular role.
1041            *
1042            * @param userId the primary key of the user
1043            * @param companyId the primary key of the company
1044            * @param name the name of the role
1045            * @param inherited whether to include the user's inherited roles in the
1046            search
1047            * @return <code>true</code> if the user is associated with the regular
1048            role; <code>false</code> otherwise
1049            * @throws PortalException if a default user for the company could not be
1050            found
1051            * @throws SystemException if a system exception occurred
1052            */
1053            @com.liferay.portal.kernel.cache.ThreadLocalCachable
1054            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1055            public boolean hasUserRole(long userId, long companyId,
1056                    java.lang.String name, boolean inherited)
1057                    throws com.liferay.portal.kernel.exception.PortalException,
1058                            com.liferay.portal.kernel.exception.SystemException;
1059    
1060            /**
1061            * Returns <code>true</code> if the user has any one of the named regular
1062            * roles.
1063            *
1064            * @param userId the primary key of the user
1065            * @param companyId the primary key of the company
1066            * @param names the names of the roles
1067            * @param inherited whether to include the user's inherited roles in the
1068            search
1069            * @return <code>true</code> if the user has any one of the regular roles;
1070            <code>false</code> otherwise
1071            * @throws PortalException if any one of the roles with the names could not
1072            be found in the company or if the default user for the company
1073            could not be found
1074            * @throws SystemException if a system exception occurred
1075            */
1076            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1077            public boolean hasUserRoles(long userId, long companyId,
1078                    java.lang.String[] names, boolean inherited)
1079                    throws com.liferay.portal.kernel.exception.PortalException,
1080                            com.liferay.portal.kernel.exception.SystemException;
1081    
1082            /**
1083            * Returns a role with the name in the company.
1084            *
1085            * @param companyId the primary key of the company
1086            * @param name the role's name (optionally <code>null</code>)
1087            * @return the role with the name, or <code>null</code> if a role with the
1088            name could not be found in the company
1089            * @throws SystemException if a system exception occurred
1090            */
1091            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1092            public com.liferay.portal.model.Role loadFetchRole(long companyId,
1093                    java.lang.String name)
1094                    throws com.liferay.portal.kernel.exception.SystemException;
1095    
1096            /**
1097            * Returns a role with the name in the company.
1098            *
1099            * @param companyId the primary key of the company
1100            * @param name the role's name
1101            * @return the role with the name in the company
1102            * @throws PortalException if a role with the name could not be found in the
1103            company
1104            * @throws SystemException if a system exception occurred
1105            */
1106            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1107            public com.liferay.portal.model.Role loadGetRole(long companyId,
1108                    java.lang.String name)
1109                    throws com.liferay.portal.kernel.exception.PortalException,
1110                            com.liferay.portal.kernel.exception.SystemException;
1111    
1112            /**
1113            * Returns an ordered range of all the roles that match the keywords and
1114            * types.
1115            *
1116            * <p>
1117            * Useful when paginating results. Returns a maximum of <code>end -
1118            * start</code> instances. <code>start</code> and <code>end</code> are not
1119            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1120            * refers to the first result in the set. Setting both <code>start</code>
1121            * and <code>end</code> to {@link
1122            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1123            * result set.
1124            * </p>
1125            *
1126            * @param companyId the primary key of the company
1127            * @param keywords the keywords (space separated), which may occur in the
1128            role's name or description (optionally <code>null</code>)
1129            * @param types the role types (optionally <code>null</code>)
1130            * @param start the lower bound of the range of roles to return
1131            * @param end the upper bound of the range of roles to return (not
1132            inclusive)
1133            * @param obc the comparator to order the roles (optionally
1134            <code>null</code>)
1135            * @return the ordered range of the matching roles, ordered by
1136            <code>obc</code>
1137            * @throws SystemException if a system exception occurred
1138            * @see com.liferay.portal.service.persistence.RoleFinder
1139            */
1140            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1141            public java.util.List<com.liferay.portal.model.Role> search(
1142                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
1143                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1144                    throws com.liferay.portal.kernel.exception.SystemException;
1145    
1146            /**
1147            * Returns an ordered range of all the roles that match the keywords, types,
1148            * and params.
1149            *
1150            * <p>
1151            * Useful when paginating results. Returns a maximum of <code>end -
1152            * start</code> instances. <code>start</code> and <code>end</code> are not
1153            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1154            * refers to the first result in the set. Setting both <code>start</code>
1155            * and <code>end</code> to {@link
1156            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1157            * result set.
1158            * </p>
1159            *
1160            * @param companyId the primary key of the company
1161            * @param keywords the keywords (space separated), which may occur in the
1162            role's name or description (optionally <code>null</code>)
1163            * @param types the role types (optionally <code>null</code>)
1164            * @param params the finder parameters. Can specify values for the
1165            "usersRoles" key. For more information, see {@link
1166            com.liferay.portal.service.persistence.RoleFinder}
1167            * @param start the lower bound of the range of roles to return
1168            * @param end the upper bound of the range of roles to return (not
1169            inclusive)
1170            * @param obc the comparator to order the roles (optionally
1171            <code>null</code>)
1172            * @return the ordered range of the matching roles, ordered by
1173            <code>obc</code>
1174            * @throws SystemException if a system exception occurred
1175            * @see com.liferay.portal.service.persistence.RoleFinder
1176            */
1177            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1178            public java.util.List<com.liferay.portal.model.Role> search(
1179                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
1180                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1181                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1182                    throws com.liferay.portal.kernel.exception.SystemException;
1183    
1184            /**
1185            * Returns an ordered range of all the roles that match the name,
1186            * description, and types.
1187            *
1188            * <p>
1189            * Useful when paginating results. Returns a maximum of <code>end -
1190            * start</code> instances. <code>start</code> and <code>end</code> are not
1191            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1192            * refers to the first result in the set. Setting both <code>start</code>
1193            * and <code>end</code> to {@link
1194            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1195            * result set.
1196            * </p>
1197            *
1198            * @param companyId the primary key of the company
1199            * @param name the role's name (optionally <code>null</code>)
1200            * @param description the role's description (optionally <code>null</code>)
1201            * @param types the role types (optionally <code>null</code>)
1202            * @param start the lower bound of the range of the roles to return
1203            * @param end the upper bound of the range of the roles to return (not
1204            inclusive)
1205            * @param obc the comparator to order the roles (optionally
1206            <code>null</code>)
1207            * @return the ordered range of the matching roles, ordered by
1208            <code>obc</code>
1209            * @throws SystemException if a system exception occurred
1210            * @see com.liferay.portal.service.persistence.RoleFinder
1211            */
1212            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1213            public java.util.List<com.liferay.portal.model.Role> search(
1214                    long companyId, java.lang.String name, java.lang.String description,
1215                    java.lang.Integer[] types, int start, int end,
1216                    com.liferay.portal.kernel.util.OrderByComparator obc)
1217                    throws com.liferay.portal.kernel.exception.SystemException;
1218    
1219            /**
1220            * Returns an ordered range of all the roles that match the name,
1221            * description, types, and params.
1222            *
1223            * <p>
1224            * Useful when paginating results. Returns a maximum of <code>end -
1225            * start</code> instances. <code>start</code> and <code>end</code> are not
1226            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1227            * refers to the first result in the set. Setting both <code>start</code>
1228            * and <code>end</code> to {@link
1229            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1230            * result set.
1231            * </p>
1232            *
1233            * @param companyId the primary key of the company
1234            * @param name the role's name (optionally <code>null</code>)
1235            * @param description the role's description (optionally <code>null</code>)
1236            * @param types the role types (optionally <code>null</code>)
1237            * @param params the finder's parameters. Can specify values for the
1238            "usersRoles" key. For more information, see {@link
1239            com.liferay.portal.service.persistence.RoleFinder}
1240            * @param start the lower bound of the range of the roles to return
1241            * @param end the upper bound of the range of the roles to return (not
1242            inclusive)
1243            * @param obc the comparator to order the roles (optionally
1244            <code>null</code>)
1245            * @return the ordered range of the matching roles, ordered by
1246            <code>obc</code>
1247            * @throws SystemException if a system exception occurred
1248            * @see com.liferay.portal.service.persistence.RoleFinder
1249            */
1250            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1251            public java.util.List<com.liferay.portal.model.Role> search(
1252                    long companyId, java.lang.String name, java.lang.String description,
1253                    java.lang.Integer[] types,
1254                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1255                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1256                    throws com.liferay.portal.kernel.exception.SystemException;
1257    
1258            /**
1259            * Returns the number of roles that match the keywords and types.
1260            *
1261            * @param companyId the primary key of the company
1262            * @param keywords the keywords (space separated), which may occur in the
1263            role's name or description (optionally <code>null</code>)
1264            * @param types the role types (optionally <code>null</code>)
1265            * @return the number of matching roles
1266            * @throws SystemException if a system exception occurred
1267            */
1268            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1269            public int searchCount(long companyId, java.lang.String keywords,
1270                    java.lang.Integer[] types)
1271                    throws com.liferay.portal.kernel.exception.SystemException;
1272    
1273            /**
1274            * Returns the number of roles that match the keywords, types and params.
1275            *
1276            * @param companyId the primary key of the company
1277            * @param keywords the keywords (space separated), which may occur in the
1278            role's name or description (optionally <code>null</code>)
1279            * @param types the role types (optionally <code>null</code>)
1280            * @param params the finder parameters. For more information, see {@link
1281            com.liferay.portal.service.persistence.RoleFinder}
1282            * @return the number of matching roles
1283            * @throws SystemException if a system exception occurred
1284            */
1285            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1286            public int searchCount(long companyId, java.lang.String keywords,
1287                    java.lang.Integer[] types,
1288                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1289                    throws com.liferay.portal.kernel.exception.SystemException;
1290    
1291            /**
1292            * Returns the number of roles that match the name, description, and types.
1293            *
1294            * @param companyId the primary key of the company
1295            * @param name the role's name (optionally <code>null</code>)
1296            * @param description the role's description (optionally <code>null</code>)
1297            * @param types the role types (optionally <code>null</code>)
1298            * @return the number of matching roles
1299            * @throws SystemException if a system exception occurred
1300            */
1301            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1302            public int searchCount(long companyId, java.lang.String name,
1303                    java.lang.String description, java.lang.Integer[] types)
1304                    throws com.liferay.portal.kernel.exception.SystemException;
1305    
1306            /**
1307            * Returns the number of roles that match the name, description, types, and
1308            * params.
1309            *
1310            * @param companyId the primary key of the company
1311            * @param name the role's name (optionally <code>null</code>)
1312            * @param description the role's description (optionally <code>null</code>)
1313            * @param types the role types (optionally <code>null</code>)
1314            * @param params the finder parameters. Can specify values for the
1315            "usersRoles" key. For more information, see {@link
1316            com.liferay.portal.service.persistence.RoleFinder}
1317            * @return the number of matching roles
1318            * @throws SystemException if a system exception occurred
1319            */
1320            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1321            public int searchCount(long companyId, java.lang.String name,
1322                    java.lang.String description, java.lang.Integer[] types,
1323                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1324                    throws com.liferay.portal.kernel.exception.SystemException;
1325    
1326            /**
1327            * Removes the matching roles associated with the user. The user is
1328            * reindexed after the roles are removed.
1329            *
1330            * @param userId the primary key of the user
1331            * @param roleIds the primary keys of the roles
1332            * @throws PortalException if a user with the primary key could not be found
1333            or if a role with any one of the primary keys could not be found
1334            * @throws SystemException if a system exception occurred
1335            */
1336            public void unsetUserRoles(long userId, long[] roleIds)
1337                    throws com.liferay.portal.kernel.exception.PortalException,
1338                            com.liferay.portal.kernel.exception.SystemException;
1339    
1340            /**
1341            * Updates the role with the primary key.
1342            *
1343            * @param roleId the primary key of the role
1344            * @param name the role's new name
1345            * @param titleMap the new localized titles (optionally <code>null</code>)
1346            to replace those existing for the role
1347            * @param descriptionMap the new localized descriptions (optionally
1348            <code>null</code>) to replace those existing for the role
1349            * @param subtype the role's new subtype (optionally <code>null</code>)
1350            * @param serviceContext the service context to be applied (optionally
1351            <code>null</code>). Can set expando bridge attributes for the
1352            role.
1353            * @return the role with the primary key
1354            * @throws PortalException if a role with the primary could not be found or
1355            if the role's name was invalid
1356            * @throws SystemException if a system exception occurred
1357            */
1358            public com.liferay.portal.model.Role updateRole(long roleId,
1359                    java.lang.String name,
1360                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
1361                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
1362                    java.lang.String subtype,
1363                    com.liferay.portal.service.ServiceContext serviceContext)
1364                    throws com.liferay.portal.kernel.exception.PortalException,
1365                            com.liferay.portal.kernel.exception.SystemException;
1366    }