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