001    /**
002     * Copyright (c) 2000-present 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.kernel.settings;
016    
017    import com.liferay.registry.collections.ServiceTrackerCollections;
018    import com.liferay.registry.collections.ServiceTrackerList;
019    
020    /**
021     * @author Iv??n Zaera
022     */
023    public class SettingsLocatorHelperUtil {
024    
025            public static Settings getCompanyPortletPreferencesSettings(
026                    long companyId, String settingsId, Settings parentSettings) {
027    
028                    return getSettingsLocatorHelper().getCompanyPortletPreferencesSettings(
029                            companyId, settingsId, parentSettings);
030            }
031    
032            public static SettingsLocatorHelper getSettingsLocatorHelper() {
033                    return _settingsLocatorHelpers.get(0);
034            }
035    
036            public Settings getConfigurationBeanSettings(
037                    String settingsId, Settings parentSettings) {
038    
039                    return getSettingsLocatorHelper().getConfigurationBeanSettings(
040                            settingsId, parentSettings);
041            }
042    
043            public Settings getGroupPortletPreferencesSettings(
044                    long groupId, String settingsId, Settings parentSettings) {
045    
046                    return getSettingsLocatorHelper().getGroupPortletPreferencesSettings(
047                            groupId, settingsId, parentSettings);
048            }
049    
050            public Settings getPortalPreferencesSettings(
051                    long companyId, Settings parentSettings) {
052    
053                    return getSettingsLocatorHelper().getPortalPreferencesSettings(
054                            companyId, parentSettings);
055            }
056    
057            public Settings getPortalPropertiesSettings() {
058                    return getSettingsLocatorHelper().getPortalPropertiesSettings();
059            }
060    
061            public Settings getPortletInstancePortletPreferencesSettings(
062                    long companyId, long plid, String portletId, Settings parentSettings) {
063    
064                    return getSettingsLocatorHelper().
065                            getPortletInstancePortletPreferencesSettings(
066                                    companyId, plid, portletId, parentSettings);
067            }
068    
069            private static final ServiceTrackerList<SettingsLocatorHelper>
070                    _settingsLocatorHelpers = ServiceTrackerCollections.openList(
071                            SettingsLocatorHelper.class);
072    
073    }