001
014
015 package com.liferay.portal.util;
016
017 import com.liferay.portal.kernel.exception.SystemException;
018 import com.liferay.portal.kernel.util.PropsKeys;
019 import com.liferay.portal.kernel.util.StringPool;
020 import com.liferay.portal.kernel.util.ThemeFactory;
021 import com.liferay.portal.kernel.util.ThemeFactoryUtil;
022 import com.liferay.portal.model.Theme;
023 import com.liferay.portal.model.impl.ThemeImpl;
024
025
028 public class ThemeFactoryImpl implements ThemeFactory {
029
030 public Theme getDefaultRegularTheme(long companyId) throws SystemException {
031 return new ThemeImpl(
032 ThemeFactoryUtil.getDefaultRegularThemeId(companyId),
033 StringPool.BLANK);
034 }
035
036 public String getDefaultRegularThemeId(long companyId)
037 throws SystemException {
038
039 String defaultRegularThemeId = PrefsPropsUtil.getString(
040 companyId, PropsKeys.DEFAULT_REGULAR_THEME_ID);
041
042 return PortalUtil.getJsSafePortletId(defaultRegularThemeId);
043 }
044
045 public Theme getDefaultWapTheme(long companyId) throws SystemException {
046 return new ThemeImpl(
047 ThemeFactoryUtil.getDefaultWapThemeId(companyId), StringPool.BLANK);
048 }
049
050 public String getDefaultWapThemeId(long companyId) throws SystemException {
051 String defaultWapThemeId = PrefsPropsUtil.getString(
052 companyId, PropsKeys.DEFAULT_WAP_THEME_ID);
053
054 return PortalUtil.getJsSafePortletId(defaultWapThemeId);
055 }
056
057 public Theme getTheme() {
058 return new ThemeImpl();
059 }
060
061 public Theme getTheme(String themeId) {
062 return new ThemeImpl(themeId);
063 }
064
065 public Theme getTheme(String themeId, String name) {
066 return new ThemeImpl(themeId, name);
067 }
068
069 }