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