001    /**
002     * Copyright (c) 2000-2012 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.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public class RoleFinderUtil {
024            public static int countByR_U(long roleId, long userId)
025                    throws com.liferay.portal.kernel.exception.SystemException {
026                    return getFinder().countByR_U(roleId, userId);
027            }
028    
029            public static int countByU_G_R(long userId, long groupId, long roleId)
030                    throws com.liferay.portal.kernel.exception.SystemException {
031                    return getFinder().countByU_G_R(userId, groupId, roleId);
032            }
033    
034            public static int countByC_N_D_T(long companyId, java.lang.String name,
035                    java.lang.String description, java.lang.Integer[] types,
036                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
037                    boolean andOperator)
038                    throws com.liferay.portal.kernel.exception.SystemException {
039                    return getFinder()
040                                       .countByC_N_D_T(companyId, name, description, types, params,
041                            andOperator);
042            }
043    
044            public static int countByC_N_D_T(long companyId, java.lang.String[] names,
045                    java.lang.String[] descriptions, java.lang.Integer[] types,
046                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
047                    boolean andOperator)
048                    throws com.liferay.portal.kernel.exception.SystemException {
049                    return getFinder()
050                                       .countByC_N_D_T(companyId, names, descriptions, types,
051                            params, andOperator);
052            }
053    
054            public static int countByKeywords(long companyId,
055                    java.lang.String keywords, java.lang.Integer[] types)
056                    throws com.liferay.portal.kernel.exception.SystemException {
057                    return getFinder().countByKeywords(companyId, keywords, types);
058            }
059    
060            public static int countByKeywords(long companyId,
061                    java.lang.String keywords, java.lang.Integer[] types,
062                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
063                    throws com.liferay.portal.kernel.exception.SystemException {
064                    return getFinder().countByKeywords(companyId, keywords, types, params);
065            }
066    
067            public static java.util.List<com.liferay.portal.model.Role> findBySystem(
068                    long companyId)
069                    throws com.liferay.portal.kernel.exception.SystemException {
070                    return getFinder().findBySystem(companyId);
071            }
072    
073            public static java.util.List<com.liferay.portal.model.Role> findByUserGroupGroupRole(
074                    long userId, long groupId)
075                    throws com.liferay.portal.kernel.exception.SystemException {
076                    return getFinder().findByUserGroupGroupRole(userId, groupId);
077            }
078    
079            public static java.util.List<com.liferay.portal.model.Role> findByUserGroupRole(
080                    long userId, long groupId)
081                    throws com.liferay.portal.kernel.exception.SystemException {
082                    return getFinder().findByUserGroupRole(userId, groupId);
083            }
084    
085            public static com.liferay.portal.model.Role findByC_N(long companyId,
086                    java.lang.String name)
087                    throws com.liferay.portal.NoSuchRoleException,
088                            com.liferay.portal.kernel.exception.SystemException {
089                    return getFinder().findByC_N(companyId, name);
090            }
091    
092            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
093                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
094                    throws com.liferay.portal.kernel.exception.SystemException {
095                    return getFinder().findByU_G(userId, groups);
096            }
097    
098            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
099                    long userId, long groupId)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getFinder().findByU_G(userId, groupId);
102            }
103    
104            public static java.util.List<com.liferay.portal.model.Role> findByU_G(
105                    long userId, long[] groupIds)
106                    throws com.liferay.portal.kernel.exception.SystemException {
107                    return getFinder().findByU_G(userId, groupIds);
108            }
109    
110            public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
111                    long companyId, java.lang.String name, java.lang.String description,
112                    java.lang.Integer[] types,
113                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
114                    boolean andOperator, int start, int end,
115                    com.liferay.portal.kernel.util.OrderByComparator obc)
116                    throws com.liferay.portal.kernel.exception.SystemException {
117                    return getFinder()
118                                       .findByC_N_D_T(companyId, name, description, types, params,
119                            andOperator, start, end, obc);
120            }
121    
122            public static java.util.List<com.liferay.portal.model.Role> findByC_N_D_T(
123                    long companyId, java.lang.String[] names,
124                    java.lang.String[] descriptions, java.lang.Integer[] types,
125                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
126                    boolean andOperator, int start, int end,
127                    com.liferay.portal.kernel.util.OrderByComparator obc)
128                    throws com.liferay.portal.kernel.exception.SystemException {
129                    return getFinder()
130                                       .findByC_N_D_T(companyId, names, descriptions, types,
131                            params, andOperator, start, end, obc);
132            }
133    
134            public static java.util.Map<java.lang.String, java.util.List<java.lang.String>> findByC_N_S_P(
135                    long companyId, java.lang.String name, int scope,
136                    java.lang.String primKey)
137                    throws com.liferay.portal.kernel.exception.SystemException {
138                    return getFinder().findByC_N_S_P(companyId, name, scope, primKey);
139            }
140    
141            public static java.util.List<com.liferay.portal.model.Role> findByC_N_S_P_A(
142                    long companyId, java.lang.String name, int scope,
143                    java.lang.String primKey, java.lang.String actionId)
144                    throws com.liferay.portal.kernel.exception.SystemException {
145                    return getFinder()
146                                       .findByC_N_S_P_A(companyId, name, scope, primKey, actionId);
147            }
148    
149            public static java.util.List<com.liferay.portal.model.Role> findByKeywords(
150                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
151                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
152                    throws com.liferay.portal.kernel.exception.SystemException {
153                    return getFinder()
154                                       .findByKeywords(companyId, keywords, types, start, end, obc);
155            }
156    
157            public static java.util.List<com.liferay.portal.model.Role> findByKeywords(
158                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
159                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
160                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
161                    throws com.liferay.portal.kernel.exception.SystemException {
162                    return getFinder()
163                                       .findByKeywords(companyId, keywords, types, params, start,
164                            end, obc);
165            }
166    
167            public static RoleFinder getFinder() {
168                    if (_finder == null) {
169                            _finder = (RoleFinder)PortalBeanLocatorUtil.locate(RoleFinder.class.getName());
170    
171                            ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
172                    }
173    
174                    return _finder;
175            }
176    
177            public void setFinder(RoleFinder finder) {
178                    _finder = finder;
179    
180                    ReferenceRegistry.registerReference(RoleFinderUtil.class, "_finder");
181            }
182    
183            private static RoleFinder _finder;
184    }