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 public int doStartTag() {
029 HttpServletRequest request =
030 (HttpServletRequest)pageContext.getRequest();
031
032 ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
033 WebKeys.THEME_DISPLAY);
034
035 if (themeDisplay != null) {
036 pageContext.setAttribute("themeDisplay", themeDisplay);
037 pageContext.setAttribute("company", themeDisplay.getCompany());
038 pageContext.setAttribute("account", themeDisplay.getAccount());
039 pageContext.setAttribute("user", themeDisplay.getUser());
040 pageContext.setAttribute("realUser", themeDisplay.getRealUser());
041 pageContext.setAttribute("contact", themeDisplay.getContact());
042
043 if (themeDisplay.getLayout() != null) {
044 pageContext.setAttribute("layout", themeDisplay.getLayout());
045 }
046
047 if (themeDisplay.getLayouts() != null) {
048 pageContext.setAttribute("layouts", themeDisplay.getLayouts());
049 }
050
051 pageContext.setAttribute("plid", new Long(themeDisplay.getPlid()));
052
053 if (themeDisplay.getLayoutTypePortlet() != null) {
054 pageContext.setAttribute(
055 "layoutTypePortlet", themeDisplay.getLayoutTypePortlet());
056 }
057
058 pageContext.setAttribute(
059 "scopeGroupId", new Long(themeDisplay.getScopeGroupId()));
060 pageContext.setAttribute(
061 "permissionChecker", themeDisplay.getPermissionChecker());
062 pageContext.setAttribute("locale", themeDisplay.getLocale());
063 pageContext.setAttribute("timeZone", themeDisplay.getTimeZone());
064 pageContext.setAttribute("theme", themeDisplay.getTheme());
065 pageContext.setAttribute(
066 "colorScheme", themeDisplay.getColorScheme());
067 pageContext.setAttribute(
068 "portletDisplay", themeDisplay.getPortletDisplay());
069
070
071
072 pageContext.setAttribute(
073 "portletGroupId", new Long(themeDisplay.getScopeGroupId()));
074 }
075
076 return SKIP_BODY;
077 }
078
079 }