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> findByLayouts(
057                    long companyId, long parentGroupId, boolean site, int start, int end,
058                    com.liferay.portal.kernel.util.OrderByComparator obc)
059                    throws com.liferay.portal.kernel.exception.SystemException {
060                    return getFinder()
061                                       .findByLayouts(companyId, parentGroupId, site, start, end,
062                            obc);
063            }
064    
065            public static java.util.List<com.liferay.portal.model.Group> findByLiveGroups()
066                    throws com.liferay.portal.kernel.exception.SystemException {
067                    return getFinder().findByLiveGroups();
068            }
069    
070            public static java.util.List<com.liferay.portal.model.Group> findByNoLayouts(
071                    long classNameId, boolean privateLayout, int start, int end)
072                    throws com.liferay.portal.kernel.exception.SystemException {
073                    return getFinder()
074                                       .findByNoLayouts(classNameId, privateLayout, start, end);
075            }
076    
077            public static java.util.List<com.liferay.portal.model.Group> findByNullFriendlyURL()
078                    throws com.liferay.portal.kernel.exception.SystemException {
079                    return getFinder().findByNullFriendlyURL();
080            }
081    
082            public static java.util.List<com.liferay.portal.model.Group> findBySystem(
083                    long companyId)
084                    throws com.liferay.portal.kernel.exception.SystemException {
085                    return getFinder().findBySystem(companyId);
086            }
087    
088            public static java.util.List<com.liferay.portal.model.Group> findByCompanyId(
089                    long companyId,
090                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
091                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
092                    throws com.liferay.portal.kernel.exception.SystemException {
093                    return getFinder().findByCompanyId(companyId, params, start, end, obc);
094            }
095    
096            public static java.util.List<java.lang.Long> findByC_P(long companyId,
097                    long parentGroupId, long previousGroupId, int size)
098                    throws com.liferay.portal.kernel.exception.SystemException {
099                    return getFinder()
100                                       .findByC_P(companyId, parentGroupId, previousGroupId, size);
101            }
102    
103            public static com.liferay.portal.model.Group findByC_N(long companyId,
104                    java.lang.String name)
105                    throws com.liferay.portal.NoSuchGroupException,
106                            com.liferay.portal.kernel.exception.SystemException {
107                    return getFinder().findByC_N(companyId, name);
108            }
109    
110            public static java.util.List<com.liferay.portal.model.Group> findByC_C_PG_N_D(
111                    long companyId, long[] classNameIds, long parentGroupId,
112                    java.lang.String[] names, java.lang.String[] descriptions,
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_C_PG_N_D(companyId, classNameIds, parentGroupId,
119                            names, descriptions, params, andOperator, start, end, obc);
120            }
121    
122            public static GroupFinder getFinder() {
123                    if (_finder == null) {
124                            _finder = (GroupFinder)PortalBeanLocatorUtil.locate(GroupFinder.class.getName());
125    
126                            ReferenceRegistry.registerReference(GroupFinderUtil.class, "_finder");
127                    }
128    
129                    return _finder;
130            }
131    
132            public void setFinder(GroupFinder finder) {
133                    _finder = finder;
134    
135                    ReferenceRegistry.registerReference(GroupFinderUtil.class, "_finder");
136            }
137    
138            private static GroupFinder _finder;
139    }