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