Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Theme System API has two main interfaces: IThemeManager and IThemeResolver.

Image Added

org.pentaho.platform.api.ui.IThemeManager (Source)

The name "manager" is a bit of a misnomer. It simply serves to provide all known themes in the system. The manager delegates this discovery to the next interface: IThemeResolverIThemeManager api is designed to have a list if IThemeResolvers injected into it, which is consults to find all available themes in the system.

getSystemThemeIds() is called when a list of available themes (onyx, crystal, etc.). Later calls to getSystemTheme() and getModuleTheme() return the respective definitions for the System or "global" Theme and the Module or "local" Theme.

org.pentaho.platform.api.ui.IThemeResolver (Source)

Theme Resolvers are called upon to find all themes they can.Image Removedin the system.

Implementations

org.pentaho.platform.web.html.themes.DefaultThemeManager (Source)

This Manager caches all The default implementation of the IThemeManager caches results from the resolvers in the Platform CacheManager to reduce memory overhead.

org.pentaho.platform.web.html.themes.PluginThemeResolver (Source)

The Plugin This resolver finds theme definitions within Platform Plugins.

org.pentaho.platform.web.html.themes.ServletContextThemeResolver (Source)

ServletContext resolver finds themes from top-level folders in the Pentaho WAR.

Note: Both of these stock resolvers use the same theme.xml file format to describe theme assets

Known limitations / Weaknesses

  1. Concept of "local" theme breaks down with common extension points like Visualizations, which while not part of the core are also not plugin specific
  2. Impossible to contribute to existing Global or Local themes. This forces customers to modify the theme.xml files from our plugins

Future Plans