站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.2 API 英文版文档

ThemeService - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.theme
Interface ThemeService

All Known Implementing Classes:
ThemeServiceImpl

public interface ThemeService

The ThemeService is the location where all the available themes are stored and retrieved.

The theme server works together with a deployer to register and unregister themes. The portal can access the theme server via the server manager, and query it for available themes.


Method Summary
 void addTheme(ThemeRegistrationMetaData metaData)
          Add a theme.
 PortalTheme getTheme(ServerRegistrationID themeID, boolean defaultOnNull)
          Get a reference to a theme.
 PortalTheme getTheme(java.lang.String name, boolean defaultOnNull)
          Get a reference to a theme.
 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 removeThemes(java.lang.String applicationName)
          Remove all themes that are registered with the provided application.
 void setDefault(ServerRegistrationID themeID)
          Set the default theme on a global scope.
 

Method Detail

addTheme

public void addTheme(ThemeRegistrationMetaData metaData)
              throws ThemeException
Add a theme.

Parameters:
metaData - the meta data about the theme
Throws:
ThemeException

setDefault

public void setDefault(ServerRegistrationID themeID)
                throws ThemeException
Set the default theme on a global scope.

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

removeTheme

public void removeTheme(ServerRegistrationID themeID)
                 throws ThemeException
Remove the theme from the available themes.

Parameters:
themeID - the registration id of the theme to be removed
Throws:
ThemeException - if the theme with this id is not available in the list of currently registered themes

removeThemes

public void removeThemes(java.lang.String applicationName)
                  throws ThemeException
Remove all themes that are registered with the provided application.

On deployment of a new application, the theme descriptor (if any present) in that application is parsed for themes that are to be registered with the theme server. For each entry in the descriptor, a new theme is registered with the theme server. Uppon undeployment of that same application, all themes must be deregistered. This method is a convenient way to achieve this.

Parameters:
applicationName - the name of the application that hosts the themes to unregister
Throws:
ThemeException - if there are no themes registered with this application, or if an error occurs during the remove

getTheme

public PortalTheme getTheme(ServerRegistrationID themeID,
                            boolean defaultOnNull)
Get a reference to a theme.

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
Throws:
java.lang.IllegalArgumentException - if the themeID is null

getTheme

public PortalTheme getTheme(java.lang.String name,
                            boolean defaultOnNull)
Get a reference to a theme.

Parameters:
name - the name 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
Throws:
java.lang.IllegalArgumentException - if the themeID is null

getThemes

public java.util.Collection getThemes()
Get a Collection of all registered themes.

Returns:
a Collection of all registered themes

getThemeNames

public java.util.Collection getThemeNames()
Get a Collection of all the registered theme's names

Returns:
a collection of theme names