001    /**
002     * Copyright (c) 2000-2010 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.portlet;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.model.Layout;
020    import com.liferay.portal.model.Portlet;
021    import com.liferay.portal.model.PortletPreferencesIds;
022    
023    import javax.portlet.PortletPreferences;
024    import javax.portlet.PortletRequest;
025    import javax.portlet.PreferencesValidator;
026    
027    import javax.servlet.http.HttpServletRequest;
028    
029    /**
030     * @author Brian Wing Shun Chan
031     */
032    public interface PortletPreferencesFactory {
033    
034            public PortletPreferences getLayoutPortletSetup(
035                            Layout layout, String portletId)
036                    throws SystemException;
037    
038            public PortalPreferences getPortalPreferences(HttpServletRequest request)
039                    throws SystemException;
040    
041            public PortalPreferences getPortalPreferences(PortletRequest portletRequest)
042                    throws SystemException;
043    
044            public PortletPreferences getPortletPreferences(
045                            HttpServletRequest request, String portletId)
046                    throws PortalException, SystemException;
047    
048            public PortletPreferencesIds getPortletPreferencesIds(
049                            HttpServletRequest request, String portletId)
050                    throws PortalException, SystemException;
051    
052            public PortletPreferencesIds getPortletPreferencesIds(
053                            HttpServletRequest request, Layout selLayout, String portletId)
054                    throws PortalException, SystemException;
055    
056            public PortletPreferences getPortletSetup(
057                            Layout layout, String portletId, String defaultPreferences)
058                    throws SystemException;
059    
060            public PortletPreferences getPortletSetup(
061                            HttpServletRequest request, String portletId)
062                    throws SystemException;
063    
064            public PortletPreferences getPortletSetup(
065                            HttpServletRequest request, String portletId,
066                            String defaultPreferences)
067                    throws SystemException;
068    
069            public PortletPreferences getPortletSetup(PortletRequest portletRequest)
070                    throws SystemException;
071    
072            public PortletPreferences getPortletSetup(
073                            PortletRequest portletRequest, String portletId)
074                    throws SystemException;
075    
076            public PortletPreferences getPreferences(HttpServletRequest request);
077    
078            public PreferencesValidator getPreferencesValidator(Portlet portlet);
079    
080    }