org.jboss.portal.server.impl
Class ThemeServerImpl

java.lang.Object
  extended by org.jboss.portal.server.impl.ThemeServerImpl
All Implemented Interfaces:
ThemeServer, org.jboss.system.Service

public class ThemeServerImpl
extends java.lang.Object
implements ThemeServer, org.jboss.system.Service

TODO: A description of this class.


Constructor Summary
ThemeServerImpl()
           
 
Method Summary
 void addTheme(ThemeRegistrationMetaData metaData)
          Add a theme.
 void create()
           
 void destroy()
           
 PortalTheme getTheme(ServerRegistrationID themeID, boolean defaultOnNull)
          Get a reference to a theme.
 PortalTheme getTheme(java.lang.String name, boolean defaultOnNull)
          Lookup the theme with the provided name and return it.
 java.util.Collection getThemeNames()
          Get a Collection of all the registered theme's names
 java.util.Collection getThemes()
          Get a Collection of all registered themes.
 void removeTheme(ServerRegistrationID themeID)
          Remove the theme from the available themes.
 void removeTheme(java.lang.String name)
           
 void removeThemes(java.lang.String appName)
          Remove all themes for the given WebApp (ServletContext).
 void setDefault(ServerRegistrationID themeID)
          Set the default theme on a global scope.
 void setDefault(java.lang.String name)
          Set the default theme.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThemeServerImpl

public ThemeServerImpl()
Method Detail

create

public void create()
            throws java.lang.Exception
Specified by:
create in interface org.jboss.system.Service
Throws:
java.lang.Exception

destroy

public void destroy()
Specified by:
destroy in interface org.jboss.system.Service

start

public void start()
           throws java.lang.Exception
Specified by:
start in interface org.jboss.system.Service
Throws:
java.lang.Exception

stop

public void stop()
Specified by:
stop in interface org.jboss.system.Service

addTheme

public void addTheme(ThemeRegistrationMetaData metaData)
              throws ThemeException
Description copied from interface: ThemeServer
Add a theme.

Specified by:
addTheme in interface ThemeServer
Parameters:
metaData - the meta data about the theme
Throws:
ThemeException

removeTheme

public void removeTheme(java.lang.String name)

removeTheme

public void removeTheme(ServerRegistrationID themeID)
Description copied from interface: ThemeServer
Remove the theme from the available themes.

Specified by:
removeTheme in interface ThemeServer
Parameters:
themeID - the registration id of the theme to be removed

removeThemes

public void removeThemes(java.lang.String appName)
Remove all themes for the given WebApp (ServletContext).

In case a web app gets removed (undeployed), and this web app contains registered portal themes, all themes of that web app, need to be removed to prevent unresolvable links, etc.

Specified by:
removeThemes in interface ThemeServer
Parameters:
appName - the name of the application that contains the themes that need to be removed

setDefault

public void setDefault(ServerRegistrationID themeID)
                throws ThemeException
Description copied from interface: ThemeServer
Set the default theme on a global scope.

Specified by:
setDefault in interface ThemeServer
Parameters:
themeID - the registration id of the theme to be the new default theme
Throws:
ThemeException - if the theme with this id is not available in the list of currently registered themes

setDefault

public void setDefault(java.lang.String name)
                throws ThemeException
Set the default theme.

Parameters:
name - the name of the theme that is to be set as default
Throws:
ThemeException - if the theme is not part of the available themes

getTheme

public PortalTheme getTheme(ServerRegistrationID themeID,
                            boolean defaultOnNull)
Description copied from interface: ThemeServer
Get a reference to a theme.

Specified by:
getTheme in interface ThemeServer
Parameters:
themeID - the registration id of the theme to retrieve
defaultOnNull - true, when the server should return the default theme, in case the requested is not found
Returns:
the requested theme, null, or the default theme if defaultOnNull was provided as true

getTheme

public PortalTheme getTheme(java.lang.String name,
                            boolean defaultOnNull)
Lookup the theme with the provided name and return it.

Specified by:
getTheme in interface ThemeServer
Parameters:
name - the theme to look for
defaultOnNull - if true, return the default theme if the theme with the provided name is not available
Returns:
the theme that matches the provided name, or the default theme, if defaultOnNull is true, and there is no theme with the provided name
Throws:
java.lang.IllegalArgumentException - if the provided name is null or empty

getThemes

public java.util.Collection getThemes()
Description copied from interface: ThemeServer
Get a Collection of all registered themes.

Specified by:
getThemes in interface ThemeServer
Returns:
a Collection of all registered themes

getThemeNames

public java.util.Collection getThemeNames()
Description copied from interface: ThemeServer
Get a Collection of all the registered theme's names

Specified by:
getThemeNames in interface ThemeServer
Returns:
a collection of theme names