001    /**
002     * Copyright (c) 2000-2013 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 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 SystemException if a system exception occurred
373            */
374            public void addUserRole(long userId, long roleId)
375                    throws com.liferay.portal.kernel.exception.SystemException;
376    
377            /**
378            * @throws SystemException if a system exception occurred
379            */
380            public void addUserRole(long userId, com.liferay.portal.model.Role role)
381                    throws com.liferay.portal.kernel.exception.SystemException;
382    
383            /**
384            * @throws PortalException
385            * @throws SystemException if a system exception occurred
386            */
387            public void addUserRoles(long userId, long[] roleIds)
388                    throws com.liferay.portal.kernel.exception.PortalException,
389                            com.liferay.portal.kernel.exception.SystemException;
390    
391            /**
392            * @throws PortalException
393            * @throws SystemException if a system exception occurred
394            */
395            public void addUserRoles(long userId,
396                    java.util.List<com.liferay.portal.model.Role> Roles)
397                    throws com.liferay.portal.kernel.exception.PortalException,
398                            com.liferay.portal.kernel.exception.SystemException;
399    
400            /**
401            * @throws SystemException if a system exception occurred
402            */
403            public void clearUserRoles(long userId)
404                    throws com.liferay.portal.kernel.exception.SystemException;
405    
406            /**
407            * @throws SystemException if a system exception occurred
408            */
409            public void deleteUserRole(long userId, long roleId)
410                    throws com.liferay.portal.kernel.exception.SystemException;
411    
412            /**
413            * @throws SystemException if a system exception occurred
414            */
415            public void deleteUserRole(long userId, com.liferay.portal.model.Role role)
416                    throws com.liferay.portal.kernel.exception.SystemException;
417    
418            /**
419            * @throws SystemException if a system exception occurred
420            */
421            public void deleteUserRoles(long userId, long[] roleIds)
422                    throws com.liferay.portal.kernel.exception.SystemException;
423    
424            /**
425            * @throws SystemException if a system exception occurred
426            */
427            public void deleteUserRoles(long userId,
428                    java.util.List<com.liferay.portal.model.Role> Roles)
429                    throws com.liferay.portal.kernel.exception.SystemException;
430    
431            /**
432            * @throws SystemException if a system exception occurred
433            */
434            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
435            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
436                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
437    
438            /**
439            * @throws SystemException if a system exception occurred
440            */
441            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
442            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
443                    long userId, int start, int end)
444                    throws com.liferay.portal.kernel.exception.SystemException;
445    
446            /**
447            * @throws SystemException if a system exception occurred
448            */
449            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
450            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
451                    long userId, int start, int end,
452                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
453                    throws com.liferay.portal.kernel.exception.SystemException;
454    
455            /**
456            * @throws SystemException if a system exception occurred
457            */
458            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
459            public int getUserRolesCount(long userId)
460                    throws com.liferay.portal.kernel.exception.SystemException;
461    
462            /**
463            * @throws SystemException if a system exception occurred
464            */
465            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
466            public boolean hasUserRole(long userId, long roleId)
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 boolean hasUserRoles(long userId)
474                    throws com.liferay.portal.kernel.exception.SystemException;
475    
476            /**
477            * @throws PortalException
478            * @throws SystemException if a system exception occurred
479            */
480            public void setUserRoles(long userId, long[] roleIds)
481                    throws com.liferay.portal.kernel.exception.PortalException,
482                            com.liferay.portal.kernel.exception.SystemException;
483    
484            /**
485            * Returns the Spring bean ID for this bean.
486            *
487            * @return the Spring bean ID for this bean
488            */
489            public java.lang.String getBeanIdentifier();
490    
491            /**
492            * Sets the Spring bean ID for this bean.
493            *
494            * @param beanIdentifier the Spring bean ID for this bean
495            */
496            public void setBeanIdentifier(java.lang.String beanIdentifier);
497    
498            /**
499            * Adds a role. The user is reindexed after role is added.
500            *
501            * @param userId the primary key of the user
502            * @param companyId the primary key of the company
503            * @param name the role's name
504            * @param titleMap the role's localized titles (optionally
505            <code>null</code>)
506            * @param descriptionMap the role's localized descriptions (optionally
507            <code>null</code>)
508            * @param type the role's type (optionally <code>0</code>)
509            * @return the role
510            * @throws PortalException if the class name or the role name were
511            invalid, if the role is a duplicate, or if a user with the
512            primary key could not be found
513            * @throws SystemException if a system exception occurred
514            * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long,
515            String, Map, Map, int, String, ServiceContext)}
516            */
517            public com.liferay.portal.model.Role addRole(long userId, long companyId,
518                    java.lang.String name,
519                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
520                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
521                    int type)
522                    throws com.liferay.portal.kernel.exception.PortalException,
523                            com.liferay.portal.kernel.exception.SystemException;
524    
525            /**
526            * Adds a role with additional parameters. The user is reindexed after role
527            * is added.
528            *
529            * @param userId the primary key of the user
530            * @param companyId the primary key of the company
531            * @param name the role's name
532            * @param titleMap the role's localized titles (optionally
533            <code>null</code>)
534            * @param descriptionMap the role's localized descriptions (optionally
535            <code>null</code>)
536            * @param type the role's type (optionally <code>0</code>)
537            * @param className the name of the class for which the role is created
538            (optionally <code>null</code>)
539            * @param classPK the primary key of the class for which the role is
540            created (optionally <code>0</code>)
541            * @return the role
542            * @throws PortalException if the class name or the role name were
543            invalid, if the role is a duplicate, or if a user with the
544            primary key could not be found
545            * @throws SystemException if a system exception occurred
546            * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long,
547            String, Map, Map, int, String, ServiceContext)}
548            */
549            public com.liferay.portal.model.Role addRole(long userId, long companyId,
550                    java.lang.String name,
551                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
552                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
553                    int type, java.lang.String className, long classPK)
554                    throws com.liferay.portal.kernel.exception.PortalException,
555                            com.liferay.portal.kernel.exception.SystemException;
556    
557            /**
558            * Adds a role with additional parameters. The user is reindexed after role
559            * is added.
560            *
561            * @param userId the primary key of the user
562            * @param className the name of the class for which the role is created
563            (optionally <code>null</code>)
564            * @param classPK the primary key of the class for which the role is
565            created (optionally <code>0</code>)
566            * @param name the role's name
567            * @param titleMap the role's localized titles (optionally
568            <code>null</code>)
569            * @param descriptionMap the role's localized descriptions (optionally
570            <code>null</code>)
571            * @param type the role's type (optionally <code>0</code>)
572            * @param subtype the role's subtype (optionally <code>null</code>)
573            * @param serviceContext the service context to be applied (optionally
574            <code>null</code>). Can set expando bridge attributes for the
575            role.
576            * @return the role
577            * @throws PortalException if the class name or the role name were invalid,
578            if the role is a duplicate, or if a user with the primary key
579            could not be found
580            * @throws SystemException if a system exception occurred
581            */
582            public com.liferay.portal.model.Role addRole(long userId,
583                    java.lang.String className, long classPK, java.lang.String name,
584                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
585                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
586                    int type, java.lang.String subtype,
587                    com.liferay.portal.service.ServiceContext serviceContext)
588                    throws com.liferay.portal.kernel.exception.PortalException,
589                            com.liferay.portal.kernel.exception.SystemException;
590    
591            /**
592            * Checks to ensure that the system roles map has appropriate default roles
593            * in each company.
594            *
595            * @throws PortalException if the current user did not have permission to
596            set applicable permissions on a role
597            * @throws SystemException if a system exception occurred
598            */
599            public void checkSystemRoles()
600                    throws com.liferay.portal.kernel.exception.PortalException,
601                            com.liferay.portal.kernel.exception.SystemException;
602    
603            /**
604            * Checks to ensure that the system roles map has appropriate default roles
605            * in the company.
606            *
607            * @param companyId the primary key of the company
608            * @throws PortalException if the current user did not have permission to
609            set applicable permissions on a role
610            * @throws SystemException if a system exception occurred
611            */
612            @com.liferay.portal.kernel.transaction.Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
613            public void checkSystemRoles(long companyId)
614                    throws com.liferay.portal.kernel.exception.PortalException,
615                            com.liferay.portal.kernel.exception.SystemException;
616    
617            /**
618            * Returns the role with the name in the company.
619            *
620            * <p>
621            * The method searches the system roles map first for default roles. If a
622            * role with the name is not found, then the method will query the database.
623            * </p>
624            *
625            * @param companyId the primary key of the company
626            * @param name the role's name
627            * @return Returns the role with the name or <code>null</code> if a role
628            with the name could not be found in the company
629            * @throws SystemException if a system exception occurred
630            */
631            @com.liferay.portal.kernel.spring.aop.Skip
632            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
633            public com.liferay.portal.model.Role fetchRole(long companyId,
634                    java.lang.String name)
635                    throws com.liferay.portal.kernel.exception.SystemException;
636    
637            /**
638            * Returns the default role for the group with the primary key.
639            *
640            * <p>
641            * If the group is a site, then the default role is {@link
642            * com.liferay.portal.model.RoleConstants#SITE_MEMBER}. If the group is an
643            * organization, then the default role is {@link
644            * com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}. If the group
645            * is a user or user group, then the default role is {@link
646            * com.liferay.portal.model.RoleConstants#POWER_USER}. For all other group
647            * types, the default role is {@link
648            * com.liferay.portal.model.RoleConstants#USER}.
649            * </p>
650            *
651            * @param groupId the primary key of the group
652            * @return the default role for the group with the primary key
653            * @throws PortalException if a group with the primary key could not be
654            found, or if a default role could not be found for the group
655            * @throws SystemException if a system exception occurred
656            */
657            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
658            public com.liferay.portal.model.Role getDefaultGroupRole(long groupId)
659                    throws com.liferay.portal.kernel.exception.PortalException,
660                            com.liferay.portal.kernel.exception.SystemException;
661    
662            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
663            public java.util.List<com.liferay.portal.model.Role> getGroupRelatedRoles(
664                    long groupId)
665                    throws com.liferay.portal.kernel.exception.PortalException,
666                            com.liferay.portal.kernel.exception.SystemException;
667    
668            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
669            public java.util.List<com.liferay.portal.model.Role> getResourceBlockRoles(
670                    long resourceBlockId, java.lang.String className,
671                    java.lang.String actionId)
672                    throws com.liferay.portal.kernel.exception.SystemException;
673    
674            /**
675            * Returns a map of role names to associated action IDs for the named
676            * resource in the company within the permission scope.
677            *
678            * @param companyId the primary key of the company
679            * @param name the resource name
680            * @param scope the permission scope
681            * @param primKey the primary key of the resource's class
682            * @return the role names and action IDs
683            * @throws SystemException if a system exception occurred
684            * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P(
685            long, String, int, String)
686            */
687            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
688            public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
689                    long companyId, java.lang.String name, int scope,
690                    java.lang.String primKey)
691                    throws com.liferay.portal.kernel.exception.SystemException;
692    
693            /**
694            * Returns all the roles associated with the action ID in the company within
695            * the permission scope.
696            *
697            * @param companyId the primary key of the company
698            * @param name the resource name
699            * @param scope the permission scope
700            * @param primKey the primary key of the resource's class
701            * @param actionId the name of the resource action
702            * @return the roles
703            * @throws SystemException if a system exception occurred
704            * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A(
705            long, String, int, String, String)
706            */
707            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
708            public java.util.List<com.liferay.portal.model.Role> getResourceRoles(
709                    long companyId, java.lang.String name, int scope,
710                    java.lang.String primKey, java.lang.String actionId)
711                    throws com.liferay.portal.kernel.exception.SystemException;
712    
713            /**
714            * Returns the role with the name in the company.
715            *
716            * <p>
717            * The method searches the system roles map first for default roles. If a
718            * role with the name is not found, then the method will query the database.
719            * </p>
720            *
721            * @param companyId the primary key of the company
722            * @param name the role's name
723            * @return the role with the name
724            * @throws PortalException if a role with the name could not be found in the
725            company
726            * @throws SystemException if a system exception occurred
727            */
728            @com.liferay.portal.kernel.spring.aop.Skip
729            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
730            public com.liferay.portal.model.Role getRole(long companyId,
731                    java.lang.String name)
732                    throws com.liferay.portal.kernel.exception.PortalException,
733                            com.liferay.portal.kernel.exception.SystemException;
734    
735            /**
736            * Returns all the roles of the type and subtype.
737            *
738            * @param type the role's type (optionally <code>0</code>)
739            * @param subtype the role's subtype (optionally <code>null</code>)
740            * @return the roles of the type and subtype
741            * @throws SystemException if a system exception occurred
742            */
743            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
744            public java.util.List<com.liferay.portal.model.Role> getRoles(int type,
745                    java.lang.String subtype)
746                    throws com.liferay.portal.kernel.exception.SystemException;
747    
748            /**
749            * Returns all the roles in the company.
750            *
751            * @param companyId the primary key of the company
752            * @return the roles in the company
753            * @throws SystemException if a system exception occurred
754            */
755            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
756            public java.util.List<com.liferay.portal.model.Role> getRoles(
757                    long companyId)
758                    throws com.liferay.portal.kernel.exception.SystemException;
759    
760            /**
761            * Returns all the roles with the types.
762            *
763            * @param companyId the primary key of the company
764            * @param types the role types (optionally <code>null</code>)
765            * @return the roles with the types
766            * @throws SystemException if a system exception occurred
767            */
768            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
769            public java.util.List<com.liferay.portal.model.Role> getRoles(
770                    long companyId, int[] types)
771                    throws com.liferay.portal.kernel.exception.SystemException;
772    
773            /**
774            * Returns all the roles with the primary keys.
775            *
776            * @param roleIds the primary keys of the roles
777            * @return the roles with the primary keys
778            * @throws PortalException if any one of the roles with the primary keys
779            could not be found
780            * @throws SystemException if a system exception occurred
781            */
782            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
783            public java.util.List<com.liferay.portal.model.Role> getRoles(
784                    long[] roleIds)
785                    throws com.liferay.portal.kernel.exception.PortalException,
786                            com.liferay.portal.kernel.exception.SystemException;
787    
788            /**
789            * Returns all the roles of the subtype.
790            *
791            * @param subtype the role's subtype (optionally <code>null</code>)
792            * @return the roles of the subtype
793            * @throws SystemException if a system exception occurred
794            */
795            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
796            public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
797                    java.lang.String subtype)
798                    throws com.liferay.portal.kernel.exception.SystemException;
799    
800            /**
801            * Returns the number of roles of the subtype.
802            *
803            * @param subtype the role's subtype (optionally <code>null</code>)
804            * @return the number of roles of the subtype
805            * @throws SystemException if a system exception occurred
806            */
807            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
808            public int getSubtypeRolesCount(java.lang.String subtype)
809                    throws com.liferay.portal.kernel.exception.SystemException;
810    
811            /**
812            * Returns the team role in the company.
813            *
814            * @param companyId the primary key of the company
815            * @param teamId the primary key of the team
816            * @return the team role in the company
817            * @throws PortalException if a role could not be found in the team and
818            company
819            * @throws SystemException if a system exception occurred
820            */
821            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
822            public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId)
823                    throws com.liferay.portal.kernel.exception.PortalException,
824                            com.liferay.portal.kernel.exception.SystemException;
825    
826            /**
827            * Returns the team role map for the group.
828            *
829            * @param groupId the primary key of the group
830            * @return the team role map for the group
831            * @throws PortalException if a group with the primary key could not be
832            found, if a role could not be found in one of the group's teams,
833            or if a portal exception occurred
834            * @throws SystemException if a system exception occurred
835            */
836            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
837            public java.util.Map<com.liferay.portal.model.Team, com.liferay.portal.model.Role> getTeamRoleMap(
838                    long groupId)
839                    throws com.liferay.portal.kernel.exception.PortalException,
840                            com.liferay.portal.kernel.exception.SystemException;
841    
842            /**
843            * Returns the team roles in the group.
844            *
845            * @param groupId the primary key of the group
846            * @return the team roles in the group
847            * @throws PortalException if a group with the primary key could not be
848            found, if a role could not be found in one of the group's teams,
849            or if a portal exception occurred
850            * @throws SystemException if a system exception occurred
851            */
852            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
853            public java.util.List<com.liferay.portal.model.Role> getTeamRoles(
854                    long groupId)
855                    throws com.liferay.portal.kernel.exception.PortalException,
856                            com.liferay.portal.kernel.exception.SystemException;
857    
858            /**
859            * Returns the team roles in the group, excluding the specified role IDs.
860            *
861            * @param groupId the primary key of the group
862            * @param excludedRoleIds the primary keys of the roles to exclude
863            (optionally <code>null</code>)
864            * @return the team roles in the group, excluding the specified role IDs
865            * @throws PortalException if a group with the primary key could not be
866            found, if a role could not be found in one of the group's teams,
867            or if a portal exception occurred
868            * @throws SystemException if a system exception occurred
869            */
870            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
871            public java.util.List<com.liferay.portal.model.Role> getTeamRoles(
872                    long groupId, long[] excludedRoleIds)
873                    throws com.liferay.portal.kernel.exception.PortalException,
874                            com.liferay.portal.kernel.exception.SystemException;
875    
876            /**
877            * Returns all the roles of the type.
878            *
879            * @param type the role's type (optionally <code>0</code>)
880            * @return the range of the roles of the type
881            * @throws SystemException if a system exception occurred
882            */
883            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
884            public java.util.List<com.liferay.portal.model.Role> getTypeRoles(int type)
885                    throws com.liferay.portal.kernel.exception.SystemException;
886    
887            /**
888            * Returns a range of all the roles of the type.
889            *
890            * @param type the role's type (optionally <code>0</code>)
891            * @param start the lower bound of the range of roles to return
892            * @param end the upper bound of the range of roles to return (not
893            inclusive)
894            * @return the range of the roles of the type
895            * @throws SystemException if a system exception occurred
896            */
897            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
898            public java.util.List<com.liferay.portal.model.Role> getTypeRoles(
899                    int type, int start, int end)
900                    throws com.liferay.portal.kernel.exception.SystemException;
901    
902            /**
903            * Returns the number of roles of the type.
904            *
905            * @param type the role's type (optionally <code>0</code>)
906            * @return the number of roles of the type
907            * @throws SystemException if a system exception occurred
908            */
909            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
910            public int getTypeRolesCount(int type)
911                    throws com.liferay.portal.kernel.exception.SystemException;
912    
913            /**
914            * Returns all the user's roles within the user group.
915            *
916            * @param userId the primary key of the user
917            * @param groupId the primary key of the group
918            * @return the user's roles within the user group
919            * @throws SystemException if a system exception occurred
920            * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole(
921            long, long)
922            */
923            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
924            public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
925                    long userId, long groupId)
926                    throws com.liferay.portal.kernel.exception.SystemException;
927    
928            /**
929            * Returns all the user's roles within the user group.
930            *
931            * @param userId the primary key of the user
932            * @param groupId the primary key of the group
933            * @return the user's roles within the user group
934            * @throws SystemException if a system exception occurred
935            * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole(
936            long, long)
937            */
938            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
939            public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
940                    long userId, long groupId)
941                    throws com.liferay.portal.kernel.exception.SystemException;
942    
943            /**
944            * Returns the union of all the user's roles within the groups.
945            *
946            * @param userId the primary key of the user
947            * @param groups the groups (optionally <code>null</code>)
948            * @return the union of all the user's roles within the groups
949            * @throws SystemException if a system exception occurred
950            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
951            long, List)
952            */
953            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
954            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
955                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
956                    throws com.liferay.portal.kernel.exception.SystemException;
957    
958            /**
959            * Returns all the user's roles within the group.
960            *
961            * @param userId the primary key of the user
962            * @param groupId the primary key of the group
963            * @return the user's roles within the group
964            * @throws SystemException if a system exception occurred
965            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
966            long, long)
967            */
968            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
969            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
970                    long userId, long groupId)
971                    throws com.liferay.portal.kernel.exception.SystemException;
972    
973            /**
974            * Returns the union of all the user's roles within the groups.
975            *
976            * @param userId the primary key of the user
977            * @param groupIds the primary keys of the groups
978            * @return the union of all the user's roles within the groups
979            * @throws SystemException if a system exception occurred
980            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
981            long, long[])
982            */
983            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
984            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
985                    long userId, long[] groupIds)
986                    throws com.liferay.portal.kernel.exception.SystemException;
987    
988            /**
989            * Returns <code>true</code> if the user is associated with the named
990            * regular role.
991            *
992            * @param userId the primary key of the user
993            * @param companyId the primary key of the company
994            * @param name the name of the role
995            * @param inherited whether to include the user's inherited roles in the
996            search
997            * @return <code>true</code> if the user is associated with the regular
998            role; <code>false</code> otherwise
999            * @throws PortalException if a default user for the company could not be
1000            found
1001            * @throws SystemException if a system exception occurred
1002            */
1003            @com.liferay.portal.kernel.cache.ThreadLocalCachable
1004            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1005            public boolean hasUserRole(long userId, long companyId,
1006                    java.lang.String name, boolean inherited)
1007                    throws com.liferay.portal.kernel.exception.PortalException,
1008                            com.liferay.portal.kernel.exception.SystemException;
1009    
1010            /**
1011            * Returns <code>true</code> if the user has any one of the named regular
1012            * roles.
1013            *
1014            * @param userId the primary key of the user
1015            * @param companyId the primary key of the company
1016            * @param names the names of the roles
1017            * @param inherited whether to include the user's inherited roles in the
1018            search
1019            * @return <code>true</code> if the user has any one of the regular roles;
1020            <code>false</code> otherwise
1021            * @throws PortalException if any one of the roles with the names could not
1022            be found in the company or if the default user for the company
1023            could not be found
1024            * @throws SystemException if a system exception occurred
1025            */
1026            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1027            public boolean hasUserRoles(long userId, long companyId,
1028                    java.lang.String[] names, boolean inherited)
1029                    throws com.liferay.portal.kernel.exception.PortalException,
1030                            com.liferay.portal.kernel.exception.SystemException;
1031    
1032            /**
1033            * Returns a role with the name in the company.
1034            *
1035            * @param companyId the primary key of the company
1036            * @param name the role's name (optionally <code>null</code>)
1037            * @return the role with the name, or <code>null</code> if a role with the
1038            name could not be found in the company
1039            * @throws SystemException if a system exception occurred
1040            */
1041            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1042            public com.liferay.portal.model.Role loadFetchRole(long companyId,
1043                    java.lang.String name)
1044                    throws com.liferay.portal.kernel.exception.SystemException;
1045    
1046            /**
1047            * Returns a role with the name in the company.
1048            *
1049            * @param companyId the primary key of the company
1050            * @param name the role's name
1051            * @return the role with the name in the company
1052            * @throws PortalException if a role with the name could not be found in the
1053            company
1054            * @throws SystemException if a system exception occurred
1055            */
1056            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1057            public com.liferay.portal.model.Role loadGetRole(long companyId,
1058                    java.lang.String name)
1059                    throws com.liferay.portal.kernel.exception.PortalException,
1060                            com.liferay.portal.kernel.exception.SystemException;
1061    
1062            /**
1063            * Returns an ordered range of all the roles that match the keywords and
1064            * types.
1065            *
1066            * <p>
1067            * Useful when paginating results. Returns a maximum of <code>end -
1068            * start</code> instances. <code>start</code> and <code>end</code> are not
1069            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1070            * refers to the first result in the set. Setting both <code>start</code>
1071            * and <code>end</code> to {@link
1072            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1073            * result set.
1074            * </p>
1075            *
1076            * @param companyId the primary key of the company
1077            * @param keywords the keywords (space separated), which may occur in the
1078            role's name or description (optionally <code>null</code>)
1079            * @param types the role types (optionally <code>null</code>)
1080            * @param start the lower bound of the range of roles to return
1081            * @param end the upper bound of the range of roles to return (not
1082            inclusive)
1083            * @param obc the comparator to order the roles (optionally
1084            <code>null</code>)
1085            * @return the ordered range of the matching roles, ordered by
1086            <code>obc</code>
1087            * @throws SystemException if a system exception occurred
1088            * @see com.liferay.portal.service.persistence.RoleFinder
1089            */
1090            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1091            public java.util.List<com.liferay.portal.model.Role> search(
1092                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
1093                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1094                    throws com.liferay.portal.kernel.exception.SystemException;
1095    
1096            /**
1097            * Returns an ordered range of all the roles that match the keywords, types,
1098            * and params.
1099            *
1100            * <p>
1101            * Useful when paginating results. Returns a maximum of <code>end -
1102            * start</code> instances. <code>start</code> and <code>end</code> are not
1103            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1104            * refers to the first result in the set. Setting both <code>start</code>
1105            * and <code>end</code> to {@link
1106            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1107            * result set.
1108            * </p>
1109            *
1110            * @param companyId the primary key of the company
1111            * @param keywords the keywords (space separated), which may occur in the
1112            role's name or description (optionally <code>null</code>)
1113            * @param types the role types (optionally <code>null</code>)
1114            * @param params the finder parameters. Can specify values for the
1115            "usersRoles" key. For more information, see {@link
1116            com.liferay.portal.service.persistence.RoleFinder}
1117            * @param start the lower bound of the range of roles to return
1118            * @param end the upper bound of the range of roles to return (not
1119            inclusive)
1120            * @param obc the comparator to order the roles (optionally
1121            <code>null</code>)
1122            * @return the ordered range of the matching roles, ordered by
1123            <code>obc</code>
1124            * @throws SystemException if a system exception occurred
1125            * @see com.liferay.portal.service.persistence.RoleFinder
1126            */
1127            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1128            public java.util.List<com.liferay.portal.model.Role> search(
1129                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
1130                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1131                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1132                    throws com.liferay.portal.kernel.exception.SystemException;
1133    
1134            /**
1135            * Returns an ordered range of all the roles that match the name,
1136            * description, and types.
1137            *
1138            * <p>
1139            * Useful when paginating results. Returns a maximum of <code>end -
1140            * start</code> instances. <code>start</code> and <code>end</code> are not
1141            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1142            * refers to the first result in the set. Setting both <code>start</code>
1143            * and <code>end</code> to {@link
1144            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1145            * result set.
1146            * </p>
1147            *
1148            * @param companyId the primary key of the company
1149            * @param name the role's name (optionally <code>null</code>)
1150            * @param description the role's description (optionally <code>null</code>)
1151            * @param types the role types (optionally <code>null</code>)
1152            * @param start the lower bound of the range of the roles to return
1153            * @param end the upper bound of the range of the roles to return (not
1154            inclusive)
1155            * @param obc the comparator to order the roles (optionally
1156            <code>null</code>)
1157            * @return the ordered range of the matching roles, ordered by
1158            <code>obc</code>
1159            * @throws SystemException if a system exception occurred
1160            * @see com.liferay.portal.service.persistence.RoleFinder
1161            */
1162            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1163            public java.util.List<com.liferay.portal.model.Role> search(
1164                    long companyId, java.lang.String name, java.lang.String description,
1165                    java.lang.Integer[] types, int start, int end,
1166                    com.liferay.portal.kernel.util.OrderByComparator obc)
1167                    throws com.liferay.portal.kernel.exception.SystemException;
1168    
1169            /**
1170            * Returns an ordered range of all the roles that match the name,
1171            * description, types, and params.
1172            *
1173            * <p>
1174            * Useful when paginating results. Returns a maximum of <code>end -
1175            * start</code> instances. <code>start</code> and <code>end</code> are not
1176            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1177            * refers to the first result in the set. Setting both <code>start</code>
1178            * and <code>end</code> to {@link
1179            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1180            * result set.
1181            * </p>
1182            *
1183            * @param companyId the primary key of the company
1184            * @param name the role's name (optionally <code>null</code>)
1185            * @param description the role's description (optionally <code>null</code>)
1186            * @param types the role types (optionally <code>null</code>)
1187            * @param params the finder's parameters. Can specify values for the
1188            "usersRoles" key. For more information, see {@link
1189            com.liferay.portal.service.persistence.RoleFinder}
1190            * @param start the lower bound of the range of the roles to return
1191            * @param end the upper bound of the range of the roles to return (not
1192            inclusive)
1193            * @param obc the comparator to order the roles (optionally
1194            <code>null</code>)
1195            * @return the ordered range of the matching roles, ordered by
1196            <code>obc</code>
1197            * @throws SystemException if a system exception occurred
1198            * @see com.liferay.portal.service.persistence.RoleFinder
1199            */
1200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1201            public java.util.List<com.liferay.portal.model.Role> search(
1202                    long companyId, java.lang.String name, java.lang.String description,
1203                    java.lang.Integer[] types,
1204                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1205                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1206                    throws com.liferay.portal.kernel.exception.SystemException;
1207    
1208            /**
1209            * Returns the number of roles that match the keywords and types.
1210            *
1211            * @param companyId the primary key of the company
1212            * @param keywords the keywords (space separated), which may occur in the
1213            role's name or description (optionally <code>null</code>)
1214            * @param types the role types (optionally <code>null</code>)
1215            * @return the number of matching roles
1216            * @throws SystemException if a system exception occurred
1217            */
1218            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1219            public int searchCount(long companyId, java.lang.String keywords,
1220                    java.lang.Integer[] types)
1221                    throws com.liferay.portal.kernel.exception.SystemException;
1222    
1223            /**
1224            * Returns the number of roles that match the keywords, types and params.
1225            *
1226            * @param companyId the primary key of the company
1227            * @param keywords the keywords (space separated), which may occur in the
1228            role's name or description (optionally <code>null</code>)
1229            * @param types the role types (optionally <code>null</code>)
1230            * @param params the finder parameters. For more information, see {@link
1231            com.liferay.portal.service.persistence.RoleFinder}
1232            * @return the number of matching roles
1233            * @throws SystemException if a system exception occurred
1234            */
1235            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1236            public int searchCount(long companyId, java.lang.String keywords,
1237                    java.lang.Integer[] types,
1238                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1239                    throws com.liferay.portal.kernel.exception.SystemException;
1240    
1241            /**
1242            * Returns the number of roles that match the name, description, and types.
1243            *
1244            * @param companyId the primary key of the company
1245            * @param name the role's name (optionally <code>null</code>)
1246            * @param description the role's description (optionally <code>null</code>)
1247            * @param types the role types (optionally <code>null</code>)
1248            * @return the number of matching roles
1249            * @throws SystemException if a system exception occurred
1250            */
1251            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1252            public int searchCount(long companyId, java.lang.String name,
1253                    java.lang.String description, java.lang.Integer[] types)
1254                    throws com.liferay.portal.kernel.exception.SystemException;
1255    
1256            /**
1257            * Returns the number of roles that match the name, description, types, and
1258            * params.
1259            *
1260            * @param companyId the primary key of the company
1261            * @param name the role's name (optionally <code>null</code>)
1262            * @param description the role's description (optionally <code>null</code>)
1263            * @param types the role types (optionally <code>null</code>)
1264            * @param params the finder parameters. Can specify values for the
1265            "usersRoles" key. For more information, see {@link
1266            com.liferay.portal.service.persistence.RoleFinder}
1267            * @return the number of matching roles
1268            * @throws SystemException if a system exception occurred
1269            */
1270            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1271            public int searchCount(long companyId, java.lang.String name,
1272                    java.lang.String description, java.lang.Integer[] types,
1273                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1274                    throws com.liferay.portal.kernel.exception.SystemException;
1275    
1276            /**
1277            * Removes the matching roles associated with the user. The user is
1278            * reindexed after the roles are removed.
1279            *
1280            * @param userId the primary key of the user
1281            * @param roleIds the primary keys of the roles
1282            * @throws PortalException if a user with the primary key could not be found
1283            or if a role with any one of the primary keys could not be found
1284            * @throws SystemException if a system exception occurred
1285            */
1286            public void unsetUserRoles(long userId, long[] roleIds)
1287                    throws com.liferay.portal.kernel.exception.PortalException,
1288                            com.liferay.portal.kernel.exception.SystemException;
1289    
1290            /**
1291            * Updates the role with the primary key.
1292            *
1293            * @param roleId the primary key of the role
1294            * @param name the role's new name
1295            * @param titleMap the new localized titles (optionally <code>null</code>)
1296            to replace those existing for the role
1297            * @param descriptionMap the new localized descriptions (optionally
1298            <code>null</code>) to replace those existing for the role
1299            * @param subtype the role's new subtype (optionally <code>null</code>)
1300            * @param serviceContext the service context to be applied (optionally
1301            <code>null</code>). Can set expando bridge attributes for the
1302            role.
1303            * @return the role with the primary key
1304            * @throws PortalException if a role with the primary could not be found or
1305            if the role's name was invalid
1306            * @throws SystemException if a system exception occurred
1307            */
1308            public com.liferay.portal.model.Role updateRole(long roleId,
1309                    java.lang.String name,
1310                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
1311                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
1312                    java.lang.String subtype,
1313                    com.liferay.portal.service.ServiceContext serviceContext)
1314                    throws com.liferay.portal.kernel.exception.PortalException,
1315                            com.liferay.portal.kernel.exception.SystemException;
1316    }