org.springframework.extensions.surf.site
Class ThemeUtil

java.lang.Object
  extended by org.springframework.extensions.surf.site.ThemeUtil

public class ThemeUtil
extends Object

A helper class for working with themes. This basically assists in synchronizing the current theme between the request and the session. It is useful for determining the current theme id during the execution of a JSP component, for example, or within a custom Java bean.

Author:
muzquiano

Constructor Summary
ThemeUtil()
           
 
Method Summary
static void applyTheme(RequestContext context, javax.servlet.http.HttpServletRequest request)
          This method is called by the dispatcher servlet to "push" the current theme from the session into the request-scoped RequestContext
static Theme getCurrentTheme(RequestContext context)
          Gets the current theme.
static String getCurrentThemeId(RequestContext context)
          Gets the current theme id.
static void setCurrentThemeId(RequestContext context, String themeId)
          Sets the current theme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThemeUtil

public ThemeUtil()
Method Detail

getCurrentThemeId

public static String getCurrentThemeId(RequestContext context)
Gets the current theme id.

Parameters:
context - the context
Returns:
the current theme id

getCurrentTheme

public static Theme getCurrentTheme(RequestContext context)
Gets the current theme.

Parameters:
context - the context
Returns:
the current theme

setCurrentThemeId

public static void setCurrentThemeId(RequestContext context,
                                     String themeId)
Sets the current theme.

Parameters:
context - the context
themeId - the theme id

applyTheme

public static void applyTheme(RequestContext context,
                              javax.servlet.http.HttpServletRequest request)
This method is called by the dispatcher servlet to "push" the current theme from the session into the request-scoped RequestContext

Parameters:
context - the context
request - the request


Copyright © 2009 SpringSource, Inc. All Rights Reserved.