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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionA loader that reads scripts from the container'sJavascriptConfigServiceand minifies each one at each load.ScriptLoader(JavascriptConfigService service, MinifiedScriptCache minifiedScripts) -
Method Summary
-
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'sJavascriptConfigServiceand minifies each one at each load. -
ScriptLoader
- Parameters:
service- the service that builds the scripts' sources; when null, the container's oneminifiedScripts- where minified scripts are kept; when null, each load minifies again
-
-
Method Details
-
retrieve
- Specified by:
retrievein interfaceorg.exoplatform.commons.cache.future.Loader<ScriptKey, ScriptContent, Object>- Throws:
Exception
-
compilerOptions
- Returns:
- every option
compile(String, String)sets, part of each minified script's key
-