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