Class JavascriptConfigService

java.lang.Object
org.exoplatform.portal.resource.AbstractResourceService
org.exoplatform.web.application.javascript.JavascriptConfigService
All Implemented Interfaces:
org.picocontainer.Startable

public class JavascriptConfigService extends AbstractResourceService implements org.picocontainer.Startable
  • Field Details

    • JS_ID_PATTERN

      public static final Pattern JS_ID_PATTERN
    • RESERVED_MODULE

      public static final List<String> RESERVED_MODULE
  • Constructor Details

    • JavascriptConfigService

      public JavascriptConfigService(org.exoplatform.container.ExoContainerContext context, ResourceCompressor compressor)
  • Method Details

    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • stop

      public void stop()
      Specified by:
      stop in interface org.picocontainer.Startable
    • initData

      public void initData()
      Cache data after startup
    • scheduleReload

      public Future<Void> scheduleReload()
      Submits a rebuild of every script, URL and the configuration, swapped in once complete: until then, pages keep the previous ones. When a URL fails, the previous ones stay.
      Returns:
      the rebuild, done once swapped or dropped
    • getJavascriptKeys

      public Collection<String> getJavascriptKeys()
    • reloadJavascripts

      public void reloadJavascripts()
    • reloadJavascript

      public void reloadJavascript(String jsModule)
    • getScriptContent

      public ScriptContent getScriptContent(ResourceScope scope, String module, boolean compress)
    • getScript

      public Reader getScript(ResourceId resourceId, Locale locale) throws Exception
      Throws:
      Exception
    • getCompositeScript

      public org.exoplatform.commons.utils.CompositeReader getCompositeScript(ResourceId resourceId, Locale locale) throws Exception
      Throws:
      Exception
    • generateUrl

      public String generateUrl(ScriptResource resource)
    • generateUrl

      public String generateUrl(ResourceId id)
    • resolveIds

      public Map<ScriptResource,FetchMode> resolveIds(Map<ResourceId,FetchMode> ids)
    • getJSConfig

      public org.json.JSONObject getJSConfig()
    • getResource

      public ScriptResource getResource(ResourceId resource)