Class ScriptLoader

java.lang.Object
org.gatein.portal.controller.resource.ScriptLoader
All Implemented Interfaces:
org.exoplatform.commons.cache.future.Loader<ScriptKey, ScriptContent, Object>

public class ScriptLoader extends Object implements org.exoplatform.commons.cache.future.Loader<ScriptKey, ScriptContent, Object>
Loads a script's served content: its composite source, minified unless developing, kept in a file named after the content's SHA-256, so that the same content is written once whatever the number of loaders and reloads.
  • Field Details

    • LOG

      protected static final org.exoplatform.services.log.Log LOG
  • Constructor Details

    • ScriptLoader

      public ScriptLoader()
      A loader that reads scripts from the container's JavascriptConfigService and minifies each one at each load.
    • ScriptLoader

      public ScriptLoader(JavascriptConfigService service, MinifiedScriptCache minifiedScripts)
      Parameters:
      service - the service that builds the scripts' sources; when null, the container's one
      minifiedScripts - where minified scripts are kept; when null, each load minifies again
  • Method Details