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