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.portlet.social.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 SocialActivityFinderUtil {
024            public static int countByGroupId(long groupId)
025                    throws com.liferay.portal.kernel.exception.SystemException {
026                    return getFinder().countByGroupId(groupId);
027            }
028    
029            public static int countByGroupUsers(long groupId)
030                    throws com.liferay.portal.kernel.exception.SystemException {
031                    return getFinder().countByGroupUsers(groupId);
032            }
033    
034            public static int countByOrganizationId(long organizationId)
035                    throws com.liferay.portal.kernel.exception.SystemException {
036                    return getFinder().countByOrganizationId(organizationId);
037            }
038    
039            public static int countByOrganizationUsers(long organizationId)
040                    throws com.liferay.portal.kernel.exception.SystemException {
041                    return getFinder().countByOrganizationUsers(organizationId);
042            }
043    
044            public static int countByRelation(long userId)
045                    throws com.liferay.portal.kernel.exception.SystemException {
046                    return getFinder().countByRelation(userId);
047            }
048    
049            public static int countByRelationType(long userId, int type)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getFinder().countByRelationType(userId, type);
052            }
053    
054            public static int countByUserGroups(long userId)
055                    throws com.liferay.portal.kernel.exception.SystemException {
056                    return getFinder().countByUserGroups(userId);
057            }
058    
059            public static int countByUserGroupsAndOrganizations(long userId)
060                    throws com.liferay.portal.kernel.exception.SystemException {
061                    return getFinder().countByUserGroupsAndOrganizations(userId);
062            }
063    
064            public static int countByUserOrganizations(long userId)
065                    throws com.liferay.portal.kernel.exception.SystemException {
066                    return getFinder().countByUserOrganizations(userId);
067            }
068    
069            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupId(
070                    long groupId, int start, int end)
071                    throws com.liferay.portal.kernel.exception.SystemException {
072                    return getFinder().findByGroupId(groupId, start, end);
073            }
074    
075            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupUsers(
076                    long groupId, int start, int end)
077                    throws com.liferay.portal.kernel.exception.SystemException {
078                    return getFinder().findByGroupUsers(groupId, start, end);
079            }
080    
081            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByOrganizationId(
082                    long organizationId, int start, int end)
083                    throws com.liferay.portal.kernel.exception.SystemException {
084                    return getFinder().findByOrganizationId(organizationId, start, end);
085            }
086    
087            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByOrganizationUsers(
088                    long organizationId, int start, int end)
089                    throws com.liferay.portal.kernel.exception.SystemException {
090                    return getFinder().findByOrganizationUsers(organizationId, start, end);
091            }
092    
093            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByRelation(
094                    long userId, int start, int end)
095                    throws com.liferay.portal.kernel.exception.SystemException {
096                    return getFinder().findByRelation(userId, start, end);
097            }
098    
099            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByRelationType(
100                    long userId, int type, int start, int end)
101                    throws com.liferay.portal.kernel.exception.SystemException {
102                    return getFinder().findByRelationType(userId, type, start, end);
103            }
104    
105            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserGroups(
106                    long userId, int start, int end)
107                    throws com.liferay.portal.kernel.exception.SystemException {
108                    return getFinder().findByUserGroups(userId, start, end);
109            }
110    
111            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserGroupsAndOrganizations(
112                    long userId, int start, int end)
113                    throws com.liferay.portal.kernel.exception.SystemException {
114                    return getFinder().findByUserGroupsAndOrganizations(userId, start, end);
115            }
116    
117            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserOrganizations(
118                    long userId, int start, int end)
119                    throws com.liferay.portal.kernel.exception.SystemException {
120                    return getFinder().findByUserOrganizations(userId, start, end);
121            }
122    
123            public static SocialActivityFinder getFinder() {
124                    if (_finder == null) {
125                            _finder = (SocialActivityFinder)PortalBeanLocatorUtil.locate(SocialActivityFinder.class.getName());
126    
127                            ReferenceRegistry.registerReference(SocialActivityFinderUtil.class,
128                                    "_finder");
129                    }
130    
131                    return _finder;
132            }
133    
134            public void setFinder(SocialActivityFinder finder) {
135                    _finder = finder;
136    
137                    ReferenceRegistry.registerReference(SocialActivityFinderUtil.class,
138                            "_finder");
139            }
140    
141            private static SocialActivityFinder _finder;
142    }