001    /**
002     * Copyright (c) 2000-present 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 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 GroupFinderUtil {
027            public static int countByLayouts(long companyId, long parentGroupId,
028                    boolean site) {
029                    return getFinder().countByLayouts(companyId, parentGroupId, site);
030            }
031    
032            public static int countByG_U(long groupId, long userId, boolean inherit) {
033                    return getFinder().countByG_U(groupId, userId, inherit);
034            }
035    
036            public static int countByC_C_PG_N_D(long companyId, long[] classNameIds,
037                    long parentGroupId, java.lang.String[] names,
038                    java.lang.String[] descriptions,
039                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
040                    boolean andOperator) {
041                    return getFinder()
042                                       .countByC_C_PG_N_D(companyId, classNameIds, parentGroupId,
043                            names, descriptions, params, andOperator);
044            }
045    
046            public static java.util.List<com.liferay.portal.model.Group> findByLayouts(
047                    long companyId, long parentGroupId, boolean site, int start, int end) {
048                    return getFinder()
049                                       .findByLayouts(companyId, parentGroupId, site, start, end);
050            }
051    
052            public static java.util.List<com.liferay.portal.model.Group> findByLayouts(
053                    long companyId, long parentGroupId, boolean site, int start, int end,
054                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Group> obc) {
055                    return getFinder()
056                                       .findByLayouts(companyId, parentGroupId, site, start, end,
057                            obc);
058            }
059    
060            public static java.util.List<com.liferay.portal.model.Group> findByLiveGroups() {
061                    return getFinder().findByLiveGroups();
062            }
063    
064            public static java.util.List<com.liferay.portal.model.Group> findByNoLayouts(
065                    long classNameId, boolean privateLayout, int start, int end) {
066                    return getFinder()
067                                       .findByNoLayouts(classNameId, privateLayout, start, end);
068            }
069    
070            public static java.util.List<com.liferay.portal.model.Group> findByNullFriendlyURL() {
071                    return getFinder().findByNullFriendlyURL();
072            }
073    
074            public static java.util.List<com.liferay.portal.model.Group> findBySystem(
075                    long companyId) {
076                    return getFinder().findBySystem(companyId);
077            }
078    
079            public static java.util.List<com.liferay.portal.model.Group> findByCompanyId(
080                    long companyId,
081                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
082                    int start, int end,
083                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Group> obc) {
084                    return getFinder().findByCompanyId(companyId, params, start, end, obc);
085            }
086    
087            public static java.util.List<java.lang.Long> findByC_P(long companyId,
088                    long parentGroupId, long previousGroupId, int size) {
089                    return getFinder()
090                                       .findByC_P(companyId, parentGroupId, previousGroupId, size);
091            }
092    
093            public static com.liferay.portal.model.Group findByC_N(long companyId,
094                    java.lang.String name) throws com.liferay.portal.NoSuchGroupException {
095                    return getFinder().findByC_N(companyId, name);
096            }
097    
098            public static java.util.List<com.liferay.portal.model.Group> findByC_C_PG_N_D(
099                    long companyId, long[] classNameIds, long parentGroupId,
100                    java.lang.String[] names, java.lang.String[] descriptions,
101                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
102                    boolean andOperator, int start, int end,
103                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Group> obc) {
104                    return getFinder()
105                                       .findByC_C_PG_N_D(companyId, classNameIds, parentGroupId,
106                            names, descriptions, params, andOperator, start, end, obc);
107            }
108    
109            public static GroupFinder getFinder() {
110                    if (_finder == null) {
111                            _finder = (GroupFinder)PortalBeanLocatorUtil.locate(GroupFinder.class.getName());
112    
113                            ReferenceRegistry.registerReference(GroupFinderUtil.class, "_finder");
114                    }
115    
116                    return _finder;
117            }
118    
119            public void setFinder(GroupFinder finder) {
120                    _finder = finder;
121    
122                    ReferenceRegistry.registerReference(GroupFinderUtil.class, "_finder");
123            }
124    
125            private static GroupFinder _finder;
126    }