001
014
015 package com.liferay.taglib.theme;
016
017 import com.liferay.portal.kernel.util.WebKeys;
018 import com.liferay.portal.theme.ThemeDisplay;
019
020 import javax.servlet.http.HttpServletRequest;
021 import javax.servlet.jsp.tagext.TagSupport;
022
023
026 public class DefineObjectsTag extends TagSupport {
027
028 @Override
029 public int doStartTag() {
030 HttpServletRequest request =
031 (HttpServletRequest)pageContext.getRequest();
032
033 ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
034 WebKeys.THEME_DISPLAY);
035
036 if (themeDisplay == null) {
037 return SKIP_BODY;
038 }
039
040 pageContext.setAttribute("themeDisplay", themeDisplay);
041 pageContext.setAttribute("company", themeDisplay.getCompany());
042 pageContext.setAttribute("account", themeDisplay.getAccount());
043 pageContext.setAttribute("user", themeDisplay.getUser());
044 pageContext.setAttribute("realUser", themeDisplay.getRealUser());
045 pageContext.setAttribute("contact", themeDisplay.getContact());
046
047 if (themeDisplay.getLayout() != null) {
048 pageContext.setAttribute("layout", themeDisplay.getLayout());
049 }
050
051 if (themeDisplay.getLayouts() != null) {
052 pageContext.setAttribute("layouts", themeDisplay.getLayouts());
053 }
054
055 pageContext.setAttribute("plid", new Long(themeDisplay.getPlid()));
056
057 if (themeDisplay.getLayoutTypePortlet() != null) {
058 pageContext.setAttribute(
059 "layoutTypePortlet", themeDisplay.getLayoutTypePortlet());
060 }
061
062 pageContext.setAttribute(
063 "scopeGroupId", new Long(themeDisplay.getScopeGroupId()));
064 pageContext.setAttribute(
065 "permissionChecker", themeDisplay.getPermissionChecker());
066 pageContext.setAttribute("locale", themeDisplay.getLocale());
067 pageContext.setAttribute("timeZone", themeDisplay.getTimeZone());
068 pageContext.setAttribute("theme", themeDisplay.getTheme());
069 pageContext.setAttribute("colorScheme", themeDisplay.getColorScheme());
070 pageContext.setAttribute(
071 "portletDisplay", themeDisplay.getPortletDisplay());
072
073
074
075 pageContext.setAttribute(
076 "portletGroupId", new Long(themeDisplay.getScopeGroupId()));
077
078 return SKIP_BODY;
079 }
080
081 }