001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * The interface for the role local service.
025     *
026     * <p>
027     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see RoleLocalServiceUtil
032     * @see com.liferay.portal.service.base.RoleLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.RoleLocalServiceImpl
034     * @generated
035     */
036    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
037            PortalException.class, SystemException.class})
038    public interface RoleLocalService extends PersistedModelLocalService {
039            /*
040             * NOTE FOR DEVELOPERS:
041             *
042             * 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.
043             */
044    
045            /**
046            * Adds the role to the database. Also notifies the appropriate model listeners.
047            *
048            * @param role the role
049            * @return the role that was added
050            * @throws SystemException if a system exception occurred
051            */
052            public com.liferay.portal.model.Role addRole(
053                    com.liferay.portal.model.Role role)
054                    throws com.liferay.portal.kernel.exception.SystemException;
055    
056            /**
057            * Creates a new role with the primary key. Does not add the role to the database.
058            *
059            * @param roleId the primary key for the new role
060            * @return the new role
061            */
062            public com.liferay.portal.model.Role createRole(long roleId);
063    
064            /**
065            * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param roleId the primary key of the role
068            * @throws PortalException if a role with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public void deleteRole(long roleId)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Deletes the role from the database. Also notifies the appropriate model listeners.
077            *
078            * @param role the role
079            * @throws PortalException
080            * @throws SystemException if a system exception occurred
081            */
082            public void deleteRole(com.liferay.portal.model.Role role)
083                    throws com.liferay.portal.kernel.exception.PortalException,
084                            com.liferay.portal.kernel.exception.SystemException;
085    
086            /**
087            * Performs a dynamic query on the database and returns the matching rows.
088            *
089            * @param dynamicQuery the dynamic query
090            * @return the matching rows
091            * @throws SystemException if a system exception occurred
092            */
093            @SuppressWarnings("rawtypes")
094            public java.util.List dynamicQuery(
095                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
096                    throws com.liferay.portal.kernel.exception.SystemException;
097    
098            /**
099            * Performs a dynamic query on the database and returns a range of the matching rows.
100            *
101            * <p>
102            * 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.
103            * </p>
104            *
105            * @param dynamicQuery the dynamic query
106            * @param start the lower bound of the range of model instances
107            * @param end the upper bound of the range of model instances (not inclusive)
108            * @return the range of matching rows
109            * @throws SystemException if a system exception occurred
110            */
111            @SuppressWarnings("rawtypes")
112            public java.util.List dynamicQuery(
113                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
114                    int end) throws com.liferay.portal.kernel.exception.SystemException;
115    
116            /**
117            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
118            *
119            * <p>
120            * 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.
121            * </p>
122            *
123            * @param dynamicQuery the dynamic query
124            * @param start the lower bound of the range of model instances
125            * @param end the upper bound of the range of model instances (not inclusive)
126            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
127            * @return the ordered range of matching rows
128            * @throws SystemException if a system exception occurred
129            */
130            @SuppressWarnings("rawtypes")
131            public java.util.List dynamicQuery(
132                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
133                    int end,
134                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
135                    throws com.liferay.portal.kernel.exception.SystemException;
136    
137            /**
138            * Returns the number of rows that match the dynamic query.
139            *
140            * @param dynamicQuery the dynamic query
141            * @return the number of rows that match the dynamic query
142            * @throws SystemException if a system exception occurred
143            */
144            public long dynamicQueryCount(
145                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
146                    throws com.liferay.portal.kernel.exception.SystemException;
147    
148            /**
149            * Returns the role with the primary key.
150            *
151            * @param roleId the primary key of the role
152            * @return the role
153            * @throws PortalException if a role with the primary key could not be found
154            * @throws SystemException if a system exception occurred
155            */
156            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
157            public com.liferay.portal.model.Role getRole(long roleId)
158                    throws com.liferay.portal.kernel.exception.PortalException,
159                            com.liferay.portal.kernel.exception.SystemException;
160    
161            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
162            public com.liferay.portal.model.PersistedModel getPersistedModel(
163                    java.io.Serializable primaryKeyObj)
164                    throws com.liferay.portal.kernel.exception.PortalException,
165                            com.liferay.portal.kernel.exception.SystemException;
166    
167            /**
168            * Returns a range of all the roles.
169            *
170            * <p>
171            * 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.
172            * </p>
173            *
174            * @param start the lower bound of the range of roles
175            * @param end the upper bound of the range of roles (not inclusive)
176            * @return the range of roles
177            * @throws SystemException if a system exception occurred
178            */
179            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
180            public java.util.List<com.liferay.portal.model.Role> getRoles(int start,
181                    int end) throws com.liferay.portal.kernel.exception.SystemException;
182    
183            /**
184            * Returns the number of roles.
185            *
186            * @return the number of roles
187            * @throws SystemException if a system exception occurred
188            */
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public int getRolesCount()
191                    throws com.liferay.portal.kernel.exception.SystemException;
192    
193            /**
194            * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
195            *
196            * @param role the role
197            * @return the role that was updated
198            * @throws SystemException if a system exception occurred
199            */
200            public com.liferay.portal.model.Role updateRole(
201                    com.liferay.portal.model.Role role)
202                    throws com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
206            *
207            * @param role the role
208            * @param merge whether to merge the role with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
209            * @return the role that was updated
210            * @throws SystemException if a system exception occurred
211            */
212            public com.liferay.portal.model.Role updateRole(
213                    com.liferay.portal.model.Role role, boolean merge)
214                    throws com.liferay.portal.kernel.exception.SystemException;
215    
216            /**
217            * Returns the Spring bean ID for this bean.
218            *
219            * @return the Spring bean ID for this bean
220            */
221            public java.lang.String getBeanIdentifier();
222    
223            /**
224            * Sets the Spring bean ID for this bean.
225            *
226            * @param beanIdentifier the Spring bean ID for this bean
227            */
228            public void setBeanIdentifier(java.lang.String beanIdentifier);
229    
230            public com.liferay.portal.model.Role addRole(long userId, long companyId,
231                    java.lang.String name,
232                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
233                    java.lang.String description, int type)
234                    throws com.liferay.portal.kernel.exception.PortalException,
235                            com.liferay.portal.kernel.exception.SystemException;
236    
237            public com.liferay.portal.model.Role addRole(long userId, long companyId,
238                    java.lang.String name,
239                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
240                    java.lang.String description, int type, java.lang.String className,
241                    long classPK)
242                    throws com.liferay.portal.kernel.exception.PortalException,
243                            com.liferay.portal.kernel.exception.SystemException;
244    
245            public void addUserRoles(long userId, long[] roleIds)
246                    throws com.liferay.portal.kernel.exception.PortalException,
247                            com.liferay.portal.kernel.exception.SystemException;
248    
249            public void checkSystemRoles()
250                    throws com.liferay.portal.kernel.exception.PortalException,
251                            com.liferay.portal.kernel.exception.SystemException;
252    
253            public void checkSystemRoles(long companyId)
254                    throws com.liferay.portal.kernel.exception.PortalException,
255                            com.liferay.portal.kernel.exception.SystemException;
256    
257            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
258            public com.liferay.portal.model.Role getDefaultGroupRole(long groupId)
259                    throws com.liferay.portal.kernel.exception.PortalException,
260                            com.liferay.portal.kernel.exception.SystemException;
261    
262            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
264                    long groupId)
265                    throws com.liferay.portal.kernel.exception.SystemException;
266    
267            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
268            public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
269                    long companyId, java.lang.String name, int scope,
270                    java.lang.String primKey)
271                    throws com.liferay.portal.kernel.exception.SystemException;
272    
273            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
274            public java.util.List<com.liferay.portal.model.Role> getResourceRoles(
275                    long companyId, java.lang.String name, int scope,
276                    java.lang.String primKey, java.lang.String actionId)
277                    throws com.liferay.portal.kernel.exception.SystemException;
278    
279            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
280            public com.liferay.portal.model.Role getRole(long companyId,
281                    java.lang.String name)
282                    throws com.liferay.portal.kernel.exception.PortalException,
283                            com.liferay.portal.kernel.exception.SystemException;
284    
285            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
286            public java.util.List<com.liferay.portal.model.Role> getRoles(int type,
287                    java.lang.String subtype)
288                    throws com.liferay.portal.kernel.exception.SystemException;
289    
290            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
291            public java.util.List<com.liferay.portal.model.Role> getRoles(
292                    long companyId)
293                    throws com.liferay.portal.kernel.exception.SystemException;
294    
295            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296            public java.util.List<com.liferay.portal.model.Role> getRoles(
297                    long[] roleIds)
298                    throws com.liferay.portal.kernel.exception.PortalException,
299                            com.liferay.portal.kernel.exception.SystemException;
300    
301            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
302            public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
303                    java.lang.String subtype)
304                    throws com.liferay.portal.kernel.exception.SystemException;
305    
306            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307            public int getSubtypeRolesCount(java.lang.String subtype)
308                    throws com.liferay.portal.kernel.exception.SystemException;
309    
310            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
311            public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId)
312                    throws com.liferay.portal.kernel.exception.PortalException,
313                            com.liferay.portal.kernel.exception.SystemException;
314    
315            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
316            public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
317                    long userId, long groupId)
318                    throws com.liferay.portal.kernel.exception.SystemException;
319    
320            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
321            public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
322                    long userId, long groupId)
323                    throws com.liferay.portal.kernel.exception.SystemException;
324    
325            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
326            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
327                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
328                    throws com.liferay.portal.kernel.exception.SystemException;
329    
330            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
331            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
332                    long userId, long groupId)
333                    throws com.liferay.portal.kernel.exception.SystemException;
334    
335            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
337                    long userId, long[] groupIds)
338                    throws com.liferay.portal.kernel.exception.SystemException;
339    
340            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
341            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
342                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
343    
344            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
345            public boolean hasUserRole(long userId, long roleId)
346                    throws com.liferay.portal.kernel.exception.SystemException;
347    
348            /**
349            * Returns <code>true</code> if the user has the regular role.
350            *
351            * @return <code>true</code> if the user has the regular role
352            */
353            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
354            public boolean hasUserRole(long userId, long companyId,
355                    java.lang.String name, boolean inherited)
356                    throws com.liferay.portal.kernel.exception.PortalException,
357                            com.liferay.portal.kernel.exception.SystemException;
358    
359            /**
360            * Returns <code>true</code> if the user has any one of the specified
361            * regular roles.
362            *
363            * @return <code>true</code> if the user has the regular role
364            */
365            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
366            public boolean hasUserRoles(long userId, long companyId,
367                    java.lang.String[] names, boolean inherited)
368                    throws com.liferay.portal.kernel.exception.PortalException,
369                            com.liferay.portal.kernel.exception.SystemException;
370    
371            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
372            public java.util.List<com.liferay.portal.model.Role> search(
373                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
374                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
375                    throws com.liferay.portal.kernel.exception.SystemException;
376    
377            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
378            public java.util.List<com.liferay.portal.model.Role> search(
379                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
380                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
381                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
382                    throws com.liferay.portal.kernel.exception.SystemException;
383    
384            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
385            public java.util.List<com.liferay.portal.model.Role> search(
386                    long companyId, java.lang.String name, java.lang.String description,
387                    java.lang.Integer[] types, int start, int end,
388                    com.liferay.portal.kernel.util.OrderByComparator obc)
389                    throws com.liferay.portal.kernel.exception.SystemException;
390    
391            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
392            public java.util.List<com.liferay.portal.model.Role> search(
393                    long companyId, java.lang.String name, java.lang.String description,
394                    java.lang.Integer[] types,
395                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
396                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
397                    throws com.liferay.portal.kernel.exception.SystemException;
398    
399            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
400            public int searchCount(long companyId, java.lang.String keywords,
401                    java.lang.Integer[] types)
402                    throws com.liferay.portal.kernel.exception.SystemException;
403    
404            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
405            public int searchCount(long companyId, java.lang.String keywords,
406                    java.lang.Integer[] types,
407                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
408                    throws com.liferay.portal.kernel.exception.SystemException;
409    
410            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
411            public int searchCount(long companyId, java.lang.String name,
412                    java.lang.String description, java.lang.Integer[] types)
413                    throws com.liferay.portal.kernel.exception.SystemException;
414    
415            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
416            public int searchCount(long companyId, java.lang.String name,
417                    java.lang.String description, java.lang.Integer[] types,
418                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
419                    throws com.liferay.portal.kernel.exception.SystemException;
420    
421            public void setUserRoles(long userId, long[] roleIds)
422                    throws com.liferay.portal.kernel.exception.PortalException,
423                            com.liferay.portal.kernel.exception.SystemException;
424    
425            public void unsetUserRoles(long userId, long[] roleIds)
426                    throws com.liferay.portal.kernel.exception.PortalException,
427                            com.liferay.portal.kernel.exception.SystemException;
428    
429            public com.liferay.portal.model.Role updateRole(long roleId,
430                    java.lang.String name,
431                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
432                    java.lang.String description, java.lang.String subtype)
433                    throws com.liferay.portal.kernel.exception.PortalException,
434                            com.liferay.portal.kernel.exception.SystemException;
435    }