Class WebAssetsUtils

java.lang.Object
com.jalios.jcms.uicomponent.WebAssetsUtils

public final class WebAssetsUtils extends Object
Utils class to handle the web assets (CSS, JavaScript and image files ...) of the external libraries.
Author:
ndossantos, sdevaux
  • Method Details

    • addScrollbarWebAssets

      public static void addScrollbarWebAssets(JcmsJspContext jcmsContext)
      Add web assets for the scrollbar library.
      Parameters:
      jcmsContext - the context to fill with new JS/CSS resources
    • addWebAssets

      public static void addWebAssets(JcmsJspContext jcmsContext, String feature)
      Adds given feature web assets to given context.

      Feature assets are declared using properties syntax:

       jcms.front.resources.{feature-id}.js: relative JS file list, comma separated
       jcms.front.resources.{feature-id}.css: relative CSS file list, comma separated
       
      Parameters:
      jcmsContext - the context to fill with new JS/CSS resources
      feature - a feature id, declared using properties
      Since:
      jcms-10.0.2
    • addJSResources

      protected static void addJSResources(JcmsJspContext jcmsContext, String feature)
      Adds JS resources to jcmsContext resources declared using feature id.
      Parameters:
      jcmsContext - the context to fill with new JS/CSS resources
      feature - the feature id
      Since:
      jcms-10.0.2
    • addCSSResources

      protected static void addCSSResources(JcmsJspContext jcmsContext, String feature)
      Adds CSS resources to jcmsContext resources declared using feature id.
      Parameters:
      jcmsContext - the context to fill with new JS/CSS resources
      feature - the feature id
      Since:
      jcms-10.0.2
    • getResources

      protected static Collection<String> getResources(String property)
      Loads a collection of ordered (web assets) resources given the property.
      Parameters:
      property - the property to load associated resources
      Returns:
      a collection of JS or CSS resources paths
      Since:
      jcms-10.0.2