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.model;
016    
017    import com.liferay.portal.theme.ThemeCompanyLimit;
018    import com.liferay.portal.theme.ThemeGroupLimit;
019    
020    import java.io.Serializable;
021    
022    import java.util.List;
023    import java.util.Map;
024    import java.util.Properties;
025    
026    import javax.servlet.ServletContext;
027    
028    /**
029     * @author Brian Wing Shun Chan
030     * @author Raymond Aug??
031     */
032    public interface Theme extends Comparable<Theme>, Plugin, Serializable {
033    
034            public void addSetting(
035                    String key, String value, boolean configurable, String type,
036                    String[] options, String script);
037    
038            public List<ColorScheme> getColorSchemes();
039    
040            public Map<String, ColorScheme> getColorSchemesMap();
041    
042            public Map<String, ThemeSetting> getConfigurableSettings();
043    
044            public String getContextPath();
045    
046            public String getCssPath();
047    
048            public String getDevice();
049    
050            public String getFreeMarkerTemplateLoader();
051    
052            public String getImagesPath();
053    
054            public String getJavaScriptPath();
055    
056            public boolean getLoadFromServletContext();
057    
058            public String getName();
059    
060            public String getResourcePath(
061                    ServletContext servletContext, String portletId, String path);
062    
063            public String getRootPath();
064    
065            public String getServletContextName();
066    
067            public String getSetting(String key);
068    
069            public String[] getSettingOptions(String key);
070    
071            public Map<String, ThemeSetting> getSettings();
072    
073            public Properties getSettingsProperties();
074    
075            public SpriteImage getSpriteImage(String fileName);
076    
077            public String getStaticResourcePath();
078    
079            public String getTemplateExtension();
080    
081            public String getTemplatesPath();
082    
083            public ThemeCompanyLimit getThemeCompanyLimit();
084    
085            public ThemeGroupLimit getThemeGroupLimit();
086    
087            public String getThemeId();
088    
089            public long getTimestamp();
090    
091            public String getVelocityResourceListener();
092    
093            public String getVirtualPath();
094    
095            public boolean getWapTheme();
096    
097            public boolean getWARFile();
098    
099            public boolean hasColorSchemes();
100    
101            public boolean isCompanyAvailable(long companyId);
102    
103            public boolean isGroupAvailable(long groupId);
104    
105            public boolean isLoadFromServletContext();
106    
107            public boolean isWapTheme();
108    
109            public boolean isWARFile();
110    
111            public boolean resourceExists(
112                            ServletContext servletContext, String portletId, String path)
113                    throws Exception;
114    
115            public void setCssPath(String cssPath);
116    
117            public void setImagesPath(String imagesPath);
118    
119            public void setJavaScriptPath(String javaScriptPath);
120    
121            public void setLoadFromServletContext(boolean loadFromServletContext);
122    
123            public void setName(String name);
124    
125            public void setRootPath(String rootPath);
126    
127            public void setServletContextName(String servletContextName);
128    
129            public void setSetting(String key, String value);
130    
131            public void setSpriteImages(
132                    String spriteFileName, Properties spriteProperties);
133    
134            public void setTemplateExtension(String templateExtension);
135    
136            public void setTemplatesPath(String templatesPath);
137    
138            public void setThemeCompanyLimit(ThemeCompanyLimit themeCompanyLimit);
139    
140            public void setThemeGroupLimit(ThemeGroupLimit themeGroupLimit);
141    
142            public void setTimestamp(long timestamp);
143    
144            public void setVirtualPath(String virtualPath);
145    
146            public void setWapTheme(boolean wapTheme);
147    
148    }