This content has been marked as final.
Show 2 replies
-
1. Re: Changing theme dynamically
bvogt Feb 13, 2009 3:29 AM (in response to binnyg)we did it by using a custom:
org.jboss.portal.core.aspects.controller.PageCustomizerInterceptor
which determines the users theme and provides it into the request:... serverInvocation.getServerContext().getClientRequest().setAttribute(ATTR_VIEW_THEME, theme); ...
and a custom:org.jboss.portal.theme.tag.ThemeTagHandler
which reads the theme out of the request:... PageContext pageContext = (PageContext) getJspContext(); HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); PortalTheme theme = (PortalTheme) request.getAttribute(PageCustomizerInterceptor.ATTR_VIEW_THEME); ...
and writes its elements onto the page:... JspWriter outWriter = pageContext.getOut(); Iterator it = theme.getElements().iterator(); while (it.hasNext()) { ThemeElement te = (ThemeElement) it.next(); String elementString = te.getElement(); ... outWriter.println(elementString); } ...
-
2. Re: Changing theme dynamically
binnyg Feb 13, 2009 7:11 AM (in response to binnyg)Thank you. This is what I am looking for and will try this approach.