Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.theme
Class AbstractThemeManager

java.lang.Object
  extended by com.jivesoftware.base.theme.AbstractThemeManager
All Implemented Interfaces:
ThemeManager
Direct Known Subclasses:
ForumThemeManager

public abstract class AbstractThemeManager
extends java.lang.Object
implements ThemeManager


Nested Class Summary
static class AbstractThemeManager.ThemePutTask
           
static class AbstractThemeManager.ThemeRemoveTask
           
 
Field Summary
protected static Theme globalTheme
           
protected static java.lang.String THEME_CONFIG_FILENAME
           
protected static java.util.Map themeMaps
           
protected static java.util.Map themes
           
protected static java.io.File themesDir
           
 
Constructor Summary
AbstractThemeManager()
           
 
Method Summary
 void addThemeMap(java.lang.String theme, ThemeMap themeMap)
          Adds a theme mapping to the system.
 void deleteThemeMap(ThemeMap themeMap)
          Removes a theme mapping from the system.
abstract  Theme determineTheme(com.opensymphony.xwork.ActionContext context, javax.servlet.http.HttpServletRequest request)
          Returns the Theme corresponding to the given parameters, or null if no theme meets the criteria.
 Theme getGlobalTheme()
          Returns the Theme object that is currently installed as the 'Global' theme, or null if a global theme is not installed.
protected  Theme getTheme(java.util.Locale locale)
          Used to determine a theme given a locale.
protected  Theme getTheme(java.lang.String url)
          Used to determine a theme given a url
 Theme getTheme(ThemeMap themeMap)
          Returns the Theme object corresponding to the provided themeMap, or null if no association is found.
protected  Theme getThemeByName(java.lang.String themeName)
          Used to get a theme by the theme name.
 java.lang.String getThemeHome()
          Returns the absolute path to the theme home directory.
 java.util.Map getThemeMaps()
          Returns a Map of theme name -> ThemeMap objects.
 java.util.Collection getThemes()
          Returns a Collection of Theme objects for all the themes in the system.
protected abstract  boolean isNumValue(ThemeMap themeMap)
          Returns true if the themeMap is using a number value, false if it's using a string value.
 void reloadThemeMaps()
          Used to force a reload (and resort) of theme maps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THEME_CONFIG_FILENAME

protected static final java.lang.String THEME_CONFIG_FILENAME
See Also:
Constant Field Values

themesDir

protected static java.io.File themesDir

themes

protected static java.util.Map themes

themeMaps

protected static java.util.Map themeMaps

globalTheme

protected static Theme globalTheme
Constructor Detail

AbstractThemeManager

public AbstractThemeManager()
Method Detail

getThemeHome

public java.lang.String getThemeHome()
Description copied from interface: ThemeManager
Returns the absolute path to the theme home directory. By default this will be located at jiveHome/themes however this can be changed by specifying a fully qualified path as the value to the jive property 'themes.directory'.

Specified by:
getThemeHome in interface ThemeManager
Returns:
the absolute path to the theme home directory.

getThemes

public java.util.Collection getThemes()
Description copied from interface: ThemeManager
Returns a Collection of Theme objects for all the themes in the system.

Specified by:
getThemes in interface ThemeManager
Returns:
a Collection of Theme objects for all the themes in the system.

getThemeMaps

public java.util.Map getThemeMaps()
Description copied from interface: ThemeManager
Returns a Map of theme name -> ThemeMap objects.

Specified by:
getThemeMaps in interface ThemeManager
Returns:
a map of theme name -> ThemeMap objects.
See Also:
ThemeMap

getGlobalTheme

public Theme getGlobalTheme()
Description copied from interface: ThemeManager
Returns the Theme object that is currently installed as the 'Global' theme, or null if a global theme is not installed.

Specified by:
getGlobalTheme in interface ThemeManager
Returns:
the Theme object corresponding to the currently installed as the 'Global' theme, or null if a global theme is not installed.

getTheme

public Theme getTheme(ThemeMap themeMap)
Description copied from interface: ThemeManager
Returns the Theme object corresponding to the provided themeMap, or null if no association is found.

Specified by:
getTheme in interface ThemeManager
Parameters:
themeMap - the theme map to use to retrieve the theme
Returns:
the Theme object corresponding to the provided themeMap, or null if no association is found

determineTheme

public abstract Theme determineTheme(com.opensymphony.xwork.ActionContext context,
                                     javax.servlet.http.HttpServletRequest request)
Description copied from interface: ThemeManager
Returns the Theme corresponding to the given parameters, or null if no theme meets the criteria.

Specified by:
determineTheme in interface ThemeManager
Parameters:
context - the action context
request - the servlet request
Returns:
the Theme corresponding to the given parameters, or null if no theme meets the criteria
See Also:
Theme

addThemeMap

public void addThemeMap(java.lang.String theme,
                        ThemeMap themeMap)
Description copied from interface: ThemeManager
Adds a theme mapping to the system.

Specified by:
addThemeMap in interface ThemeManager
Parameters:
theme - the name of the theme
themeMap - the ThemeMap containing the criteria used to determine when to use the theme

deleteThemeMap

public void deleteThemeMap(ThemeMap themeMap)
Description copied from interface: ThemeManager
Removes a theme mapping from the system.

Specified by:
deleteThemeMap in interface ThemeManager
Parameters:
themeMap - the ThemeMap to remove.

reloadThemeMaps

public void reloadThemeMaps()
Used to force a reload (and resort) of theme maps. This method should be called whenever the ForumThemeType priorities have been changed.

Specified by:
reloadThemeMaps in interface ThemeManager

isNumValue

protected abstract boolean isNumValue(ThemeMap themeMap)
Returns true if the themeMap is using a number value, false if it's using a string value.

Parameters:
themeMap - the ThemeMap to check the value for
Returns:
true if the themeMap is using a number value, false if it's using a string value.

getTheme

protected Theme getTheme(java.lang.String url)
Used to determine a theme given a url

Parameters:
url - the url to use to determine the theme
Returns:
the theme corresponding to the url or null if no match exists

getTheme

protected Theme getTheme(java.util.Locale locale)
Used to determine a theme given a locale.

Parameters:
locale - the locale to use to determine the theme
Returns:
the theme corresponding to the locale or null if no match exists

getThemeByName

protected Theme getThemeByName(java.lang.String themeName)
Used to get a theme by the theme name.

Parameters:
themeName - the name of the theme.
Returns:
the theme corresponding to the theme name or null if the theme name is null.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.