Class WebAssetsUtils


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

      Fields 
      Modifier and Type Field Description
      static java.lang.String REVISION  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static void addCSSResources​(JcmsJspContext jcmsContext, java.lang.String feature)
      Adds CSS resources to jcmsContext resources declared using feature id.
      protected static void addJSResources​(JcmsJspContext jcmsContext, java.lang.String feature)
      Adds JS resources to jcmsContext resources declared using feature id.
      static void addScrollbarWebAssets​(JcmsJspContext jcmsContext)
      Add web assets for the scrollbar library.
      static void addWebAssets​(JcmsJspContext jcmsContext, java.lang.String feature)
      Adds given feature web assets to given context.
      protected static java.util.Collection<java.lang.String> getResources​(java.lang.String property)
      Loads a collection of ordered (web assets) resources given the property.
      • Methods inherited from class java.lang.Object

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

      • 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,
                                        java.lang.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,
                                             java.lang.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,
                                              java.lang.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 java.util.Collection<java.lang.String> getResources​(java.lang.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