Class ThemeFactory

java.lang.Object
org.apache.ofbiz.widget.model.ThemeFactory

public final class ThemeFactory extends Object
Widget Theme Library - Theme factory class
  • Method Details

    • getThemeXmlFiles

      public static List<File> getThemeXmlFiles() throws IOException
      Scan all Theme.xml definition
      Returns:
      Throws:
      IOException
    • getVisualThemeFromId

      public static VisualTheme getVisualThemeFromId(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(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 List<VisualTheme> getAvailableThemes(Delegator delegator, 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: