Class ThemeFactory


  • public class ThemeFactory
    extends java.lang.Object
    Widget Theme Library - Theme factory class
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String module  
    • Constructor Summary

      Constructors 
      Constructor Description
      ThemeFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<VisualTheme> getAvailableThemes​(Delegator delegator, java.lang.String visualThemeSetId)
      Return all visual theme available corresponding to all entries on the entity VisualTheme who have linked to a modelTheme
      static ModelTheme getModelThemeFromLocation​(java.lang.String resourceName)
      From a theme file location, resolve the modelTheme related from the cache.
      static VisualTheme getVisualThemeFromId​(java.lang.String visualThemeId)
      From a visualThemeId return the VisualTheme object corresponding in cache If it's empty, reload the cache from all Theme definition
      static VisualTheme resolveVisualTheme​(HttpServletRequest request)
      Resolve the enabled VisualTheme with this find order If a user is logged 1.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • module

        public static final java.lang.String module
    • Constructor Detail

      • ThemeFactory

        public ThemeFactory()
    • Method Detail

      • getVisualThemeFromId

        public static VisualTheme getVisualThemeFromId​(java.lang.String visualThemeId)
        From a visualThemeId return the VisualTheme object corresponding in cache If it's empty, reload the cache from all Theme definition
        Parameters:
        visualThemeId -
        Returns:
      • getModelThemeFromLocation

        public static ModelTheme getModelThemeFromLocation​(java.lang.String resourceName)
        From a theme file location, resolve the modelTheme related from the cache. If empty, load the modeTheme definition and put it in cache
        Parameters:
        resourceName -
        Returns:
      • getAvailableThemes

        public static java.util.List<VisualTheme> getAvailableThemes​(Delegator delegator,
                                                                     java.lang.String visualThemeSetId)
                                                              throws GenericEntityException
        Return all visual theme available corresponding to all entries on the entity VisualTheme who have linked to a modelTheme
        Parameters:
        delegator -
        visualThemeSetId -
        Returns:
        Throws:
        GenericEntityException
      • resolveVisualTheme

        public static VisualTheme resolveVisualTheme​(HttpServletRequest request)
        Resolve the enabled VisualTheme with this find order If a user is logged 1. Check if present en session with key "visualTheme" 2. Check from user preference If user isn't logged or visualTheme not find with logged user 3. Check if visualThemeId has been set on the webapp attribute 4. Check the general.properties VISUAL_THEME 5. return COMMON
        Parameters:
        request -
        Returns: