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 PortletPreferencesFinderUtil {
024            public static long countByO_O_P(long ownerId, int ownerType,
025                    java.lang.String portletId, boolean excludeDefaultPreferences)
026                    throws com.liferay.portal.kernel.exception.SystemException {
027                    return getFinder()
028                                       .countByO_O_P(ownerId, ownerType, portletId,
029                            excludeDefaultPreferences);
030            }
031    
032            public static long countByO_O_P_P_P(long ownerId, int ownerType, long plid,
033                    java.lang.String portletId, boolean excludeDefaultPreferences)
034                    throws com.liferay.portal.kernel.exception.SystemException {
035                    return getFinder()
036                                       .countByO_O_P_P_P(ownerId, ownerType, plid, portletId,
037                            excludeDefaultPreferences);
038            }
039    
040            public static java.util.List<com.liferay.portal.model.PortletPreferences> findByPortletId(
041                    java.lang.String portletId)
042                    throws com.liferay.portal.kernel.exception.SystemException {
043                    return getFinder().findByPortletId(portletId);
044            }
045    
046            public static java.util.List<com.liferay.portal.model.PortletPreferences> findByC_G_O_O_P_P(
047                    long companyId, long groupId, long ownerId, int ownerType,
048                    java.lang.String portletId, boolean privateLayout)
049                    throws com.liferay.portal.kernel.exception.SystemException {
050                    return getFinder()
051                                       .findByC_G_O_O_P_P(companyId, groupId, ownerId, ownerType,
052                            portletId, privateLayout);
053            }
054    
055            public static PortletPreferencesFinder getFinder() {
056                    if (_finder == null) {
057                            _finder = (PortletPreferencesFinder)PortalBeanLocatorUtil.locate(PortletPreferencesFinder.class.getName());
058    
059                            ReferenceRegistry.registerReference(PortletPreferencesFinderUtil.class,
060                                    "_finder");
061                    }
062    
063                    return _finder;
064            }
065    
066            public void setFinder(PortletPreferencesFinder finder) {
067                    _finder = finder;
068    
069                    ReferenceRegistry.registerReference(PortletPreferencesFinderUtil.class,
070                            "_finder");
071            }
072    
073            private static PortletPreferencesFinder _finder;
074    }