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