001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    @ProviderType
026    public class RoleFinderUtil {
027            public static int countByGroupRoleAndTeamRole(long companyId,
028                    java.lang.String keywords,
029                    java.util.List<java.lang.String> excludedNames, int[] types,
030                    long excludedTeamRoleId, long teamGroupId)
031                    throws com.liferay.portal.kernel.exception.SystemException {
032                    return getFinder()
033                                       .countByGroupRoleAndTeamRole(companyId, keywords,
034                            excludedNames, types, excludedTeamRoleId, teamGroupId);
035            }
036    
037            public static int countByKeywords(long companyId,
038                    java.lang.String keywords, java.lang.Integer[] types)
039                    throws com.liferay.portal.kernel.exception.SystemException {
040                    return getFinder().countByKeywords(companyId, keywords, types);
041            }
042    
043            public static int countByKeywords(long companyId,
044                    java.lang.String keywords, java.lang.Integer[] types,
045                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getFinder().countByKeywords(companyId, keywords, types, params);
048            }
049    
050            public static int countByR_U(long roleId, long userId)
051                    throws com.liferay.portal.kernel.exception.SystemException {
052                    return getFinder().countByR_U(roleId, userId);
053            }
054    
055            public static int countByU_G_R(long userId, long groupId, long roleId)
056                    throws com.liferay.portal.kernel.exception.SystemException {
057                    return getFinder().countByU_G_R(userId, groupId, roleId);
058            }
059    
060            public static int countByC_N_D_T(long companyId, java.lang.String name,
061                    java.lang.String description, java.lang.Integer[] types,
062                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
063                    boolean andOperator)
064                    throws com.liferay.portal.kernel.exception.SystemException {
065                    return getFinder()
066                                       .countByC_N_D_T(companyId, name, description, types, params,
067                            andOperator);
068            }
069    
070            public static int countByC_N_D_T(long companyId, java.lang.String[] names,
071                    java.lang.String[] descriptions, java.lang.Integer[] types,
072                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
073                    boolean andOperator)
074                    throws com.liferay.portal.kernel.exception.SystemException {
075                    return getFinder()
076                                       .countByC_N_D_T(companyId, names, descriptions, types,
077                            params, andOperator);
078            }
079    
080            public static int filterCountByC_N_D_T(long companyId,
081                    java.lang.String[] names, java.lang.String[] descriptions,
082                    java.lang.Integer[] types,
083                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
084                    boolean andOperator)
085                    throws com.liferay.portal.kernel.exception.SystemException {
086                    return getFinder()
087                                       .filterCountByC_N_D_T(companyId, names, descriptions, types,
088                            params, andOperator);
089            }
090    
091            public static java.util.List<com.liferay.portal.model.Role> filterFindByC_N_D_T(
092                    long companyId, java.lang.String[] names,
093                    java.lang.String[] descriptions, java.lang.Integer[] types,
094                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
095                    boolean andOperator, int start, int end,
096                    com.liferay.portal.kernel.util.OrderByComparator obc)
097                    throws com.liferay.portal.kernel.exception.SystemException {
098                    return getFinder()
099                                       .filterFindByC_N_D_T(companyId, names, descriptions, types,
100                            params, andOperator, start, end, obc);
101            }
102    
103            public static java.util.List<com.liferay.portal.model.Role> findByUserGroupRole(
104                    long userId, long groupId)
105                    throws com.liferay.portal.kernel.exception.SystemException {
106                    return getFinder().findByUserGroupRole(userId, groupId);
107            }
108    
109            public static int countByUserGroupGroupRole(long userId, long groupId)
110                    throws com.liferay.portal.kernel.exception.SystemException {
111                    return getFinder().countByUserGroupGroupRole(userId, groupId);
112            }
113    
114            public static int filterCountByGroupRoleAndTeamRole(long companyId,
115                    java.lang.String keywords,
116                    java.util.List<java.lang.String> excludedNames, int[] types,
117                    long excludedTeamRoleId, long teamGroupId)
118                    throws com.liferay.portal.kernel.exception.SystemException {
119                    return getFinder()
120                                       .filterCountByGroupRoleAndTeamRole(companyId, keywords,
121                            excludedNames, types, excludedTeamRoleId, teamGroupId);
122            }
123    
124            public static java.util.List<com.liferay.portal.model.Role> filterFindByKeywords(
125                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
126                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
127                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
128                    throws com.liferay.portal.kernel.exception.SystemException {
129                    return getFinder()
130                                       .filterFindByKeywords(companyId, keywords, types, params,
131                            start, end, obc);
132            }
133    
134            public static java.util.List<com.liferay.portal.model.Role> filterFindByC_N_D_T(
135                    long companyId, java.lang.String name, java.lang.String description,
136                    java.lang.Integer[] types,
137                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
138                    boolean andOperator, int start, int end,
139                    com.liferay.portal.kernel.util.OrderByComparator obc)
140                    throws com.liferay.portal.kernel.exception.SystemException {
141                    return getFinder()
142                                       .filterFindByC_N_D_T(companyId, name, description, types,
143                            params, andOperator, start, end, obc);
144            }
145    
146            public static java.util.List<com.liferay.portal.model.Role> filterFindByGroupRoleAndTeamRole(
147                    long companyId, java.lang.String keywords,
148                    java.util.List<java.lang.String> excludedNames, int[] types,
149                    long excludedTeamRoleId, long teamGroupId, int start, int end)
150                    throws com.liferay.portal.kernel.exception.SystemException {
151                    return getFinder()
152                                       .filterFindByGroupRoleAndTeamRole(companyId, keywords,
153                            excludedNames, types, excludedTeamRoleId, teamGroupId, start, end);
154            }
155    
156            public static java.util.List<com.liferay.portal.model.Role> findByGroupRoleAndTeamRole(
157                    long companyId, java.lang.String keywords,
158                    java.util.List<java.lang.String> excludedNames, int[] types,
159                    long excludedTeamRoleId, long teamGroupId, int start, int end)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getFinder()
162                                       .findByGroupRoleAndTeamRole(companyId, keywords,
163                            excludedNames, types, excludedTeamRoleId, teamGroupId, start, end);
164            }
165    
166            public static java.util.List<com.liferay.portal.model.Role> findBySystem(
167                    long companyId)
168                    throws com.liferay.portal.kernel.exception.SystemException {
169                    return getFinder().findBySystem(companyId);
170            }
171    
172            public static java.util.List<com.liferay.portal.model.Role> findByUserGroupGroupRole(
173                    long userId, long groupId)
174                    throws com.liferay.portal.kernel.exception.SystemException {
175                    return getFinder().findByUserGroupGroupRole(userId, groupId);
176            }
177    
178            public static java.util.List<com.liferay.portal.model.Role> findByUserGroupGroupRole(
179                    long userId, long groupId, int start, int end)
180                    throws com.liferay.portal.kernel.exception.SystemException {
181                    return getFinder().findByUserGroupGroupRole(userId, groupId, start, end);
182            }
183    
184            public static com.liferay.portal.model.Role findByC_N(long companyId,
185                    java.lang.String name)
186                    throws com.liferay.portal.NoSuchRoleException,
187                            com.liferay.portal.kernel.exception.SystemException {
188                    return getFinder().findByC_N(companyId, name);
189            }
190    
191            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
192                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getFinder().findByU_G(userId, groups);
195            }
196    
197            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
198                    long userId, long groupId)
199                    throws com.liferay.portal.kernel.exception.SystemException {
200                    return getFinder().findByU_G(userId, groupId);
201            }
202    
203            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
204                    long userId, long[] groupIds)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getFinder().findByU_G(userId, groupIds);
207            }
208    
209            public static java.util.List<com.liferay.portal.model.Role> findByR_N_A(
210                    long resourceBlockId, java.lang.String className,
211                    java.lang.String actionId)
212                    throws com.liferay.portal.kernel.exception.SystemException {
213                    return getFinder().findByR_N_A(resourceBlockId, className, actionId);
214            }
215    
216            public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
217                    long companyId, java.lang.String name, java.lang.String description,
218                    java.lang.Integer[] types,
219                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
220                    boolean andOperator, int start, int end,
221                    com.liferay.portal.kernel.util.OrderByComparator obc)
222                    throws com.liferay.portal.kernel.exception.SystemException {
223                    return getFinder()
224                                       .findByC_N_D_T(companyId, name, description, types, params,
225                            andOperator, start, end, obc);
226            }
227    
228            public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
229                    long companyId, java.lang.String[] names,
230                    java.lang.String[] descriptions, java.lang.Integer[] types,
231                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
232                    boolean andOperator, int start, int end,
233                    com.liferay.portal.kernel.util.OrderByComparator obc)
234                    throws com.liferay.portal.kernel.exception.SystemException {
235                    return getFinder()
236                                       .findByC_N_D_T(companyId, names, descriptions, types,
237                            params, andOperator, start, end, obc);
238            }
239    
240            public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> findByC_N_S_P(
241                    long companyId, java.lang.String name, int scope,
242                    java.lang.String primKey)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getFinder().findByC_N_S_P(companyId, name, scope, primKey);
245            }
246    
247            public static java.util.List<com.liferay.portal.model.Role> findByC_N_S_P_A(
248                    long companyId, java.lang.String name, int scope,
249                    java.lang.String primKey, java.lang.String actionId)
250                    throws com.liferay.portal.kernel.exception.SystemException {
251                    return getFinder()
252                                       .findByC_N_S_P_A(companyId, name, scope, primKey, actionId);
253            }
254    
255            public static java.util.List<com.liferay.portal.model.Role> findByKeywords(
256                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
257                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
258                    throws com.liferay.portal.kernel.exception.SystemException {
259                    return getFinder()
260                                       .findByKeywords(companyId, keywords, types, start, end, obc);
261            }
262    
263            public static java.util.List<com.liferay.portal.model.Role> findByKeywords(
264                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
265                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
266                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
267                    throws com.liferay.portal.kernel.exception.SystemException {
268                    return getFinder()
269                                       .findByKeywords(companyId, keywords, types, params, start,
270                            end, obc);
271            }
272    
273            public static int filterCountByKeywords(long companyId,
274                    java.lang.String keywords, java.lang.Integer[] types,
275                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
276                    throws com.liferay.portal.kernel.exception.SystemException {
277                    return getFinder()
278                                       .filterCountByKeywords(companyId, keywords, types, params);
279            }
280    
281            public static int filterCountByC_N_D_T(long companyId,
282                    java.lang.String name, java.lang.String description,
283                    java.lang.Integer[] types,
284                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
285                    boolean andOperator)
286                    throws com.liferay.portal.kernel.exception.SystemException {
287                    return getFinder()
288                                       .filterCountByC_N_D_T(companyId, name, description, types,
289                            params, andOperator);
290            }
291    
292            public static RoleFinder getFinder() {
293                    if (_finder == null) {
294                            _finder = (RoleFinder)PortalBeanLocatorUtil.locate(RoleFinder.class.getName());
295    
296                            ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
297                    }
298    
299                    return _finder;
300            }
301    
302            public void setFinder(RoleFinder finder) {
303                    _finder = finder;
304    
305                    ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
306            }
307    
308            private static RoleFinder _finder;
309    }