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