001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 PortletPreferencesFinderUtil {
027            public static long countByO_O_P(long ownerId, int ownerType,
028                    java.lang.String portletId, boolean excludeDefaultPreferences)
029                    throws com.liferay.portal.kernel.exception.SystemException {
030                    return getFinder()
031                                       .countByO_O_P(ownerId, ownerType, portletId,
032                            excludeDefaultPreferences);
033            }
034    
035            public static long countByO_O_P_P_P(long ownerId, int ownerType, long plid,
036                    java.lang.String portletId, boolean excludeDefaultPreferences)
037                    throws com.liferay.portal.kernel.exception.SystemException {
038                    return getFinder()
039                                       .countByO_O_P_P_P(ownerId, ownerType, plid, portletId,
040                            excludeDefaultPreferences);
041            }
042    
043            public static java.util.List<com.liferay.portal.model.PortletPreferences> findByPortletId(
044                    java.lang.String portletId)
045                    throws com.liferay.portal.kernel.exception.SystemException {
046                    return getFinder().findByPortletId(portletId);
047            }
048    
049            public static java.util.List<com.liferay.portal.model.PortletPreferences> findByC_G_O_O_P_P(
050                    long companyId, long groupId, long ownerId, int ownerType,
051                    java.lang.String portletId, boolean privateLayout)
052                    throws com.liferay.portal.kernel.exception.SystemException {
053                    return getFinder()
054                                       .findByC_G_O_O_P_P(companyId, groupId, ownerId, ownerType,
055                            portletId, privateLayout);
056            }
057    
058            public static PortletPreferencesFinder getFinder() {
059                    if (_finder == null) {
060                            _finder = (PortletPreferencesFinder)PortalBeanLocatorUtil.locate(PortletPreferencesFinder.class.getName());
061    
062                            ReferenceRegistry.registerReference(PortletPreferencesFinderUtil.class,
063                                    "_finder");
064                    }
065    
066                    return _finder;
067            }
068    
069            public void setFinder(PortletPreferencesFinder finder) {
070                    _finder = finder;
071    
072                    ReferenceRegistry.registerReference(PortletPreferencesFinderUtil.class,
073                            "_finder");
074            }
075    
076            private static PortletPreferencesFinder _finder;
077    }