Package org.exoplatform.web.application.javascript

Examples of org.exoplatform.web.application.javascript.JavascriptConfigService$NormalizeJSReader


      {
         throw new IllegalArgumentException("name can't be null");
      }
      ResourceId id = new ResourceId(scope, name);
      ExoContainer container = ExoContainerContext.getCurrentContainer();
      JavascriptConfigService service = (JavascriptConfigService)container.getComponentInstanceOfType(JavascriptConfigService.class);
      ScriptResource resource = service.getResource(id);
      if (resource != null)
      {
         if (FetchMode.IMMEDIATE.equals(resource.getFetchMode()))
         {
            resourceIds.add(id, null);        
         }
         else
         {
            Map<ResourceId, FetchMode> tmp = new HashMap<ResourceId, FetchMode>();
            tmp.put(id, null);
            for (ScriptResource res : service.resolveIds(tmp).keySet())
            {
               require(res.getId().toString());
            }
         }        
      }
View Full Code Here


        if (name == null) {
            throw new IllegalArgumentException("name can't be null");
        }
        ResourceId id = new ResourceId(scope, name);
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        JavascriptConfigService service = (JavascriptConfigService) container
                .getComponentInstanceOfType(JavascriptConfigService.class);
        ScriptResource resource = service.getResource(id);
        if (resource != null) {
            if (FetchMode.IMMEDIATE.equals(resource.getFetchMode())) {
                resourceIds.add(id, null);
            } else {
                Map<ResourceId, FetchMode> tmp = new HashMap<ResourceId, FetchMode>();
                tmp.put(id, null);
                for (ScriptResource res : service.resolveIds(tmp).keySet()) {
                    require(res.getId().toString());
                }
            }
        }
    }
View Full Code Here

class ScriptLoader implements Loader<ScriptKey, ScriptResult, ControllerContext>
{

   public ScriptResult retrieve(ControllerContext context, ScriptKey key) throws Exception
   {
      JavascriptConfigService service = (JavascriptConfigService) PortalContainer.getComponent(JavascriptConfigService.class);

      //
      Reader script;
      String sourceName;
      if (key.module != null)
      {
         script = service.getScript(key.id, key.module, key.locale);
         sourceName = key.id.getScope() + "/" + key.id.getName() + "/" + key.module  + ".js";
      }
      else
      {
         script = service.getScript(key.id, key.locale);
         sourceName = key.id.getScope() + "/" + key.id.getName() + ".js";
      }

      //
      if (script != null)
View Full Code Here

   @Deprecated
   public void importJavascript(CharSequence s)
   {
      String moduleName = s.toString();
      JavascriptConfigService jsSrevice_ =
         (JavascriptConfigService)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(
            JavascriptConfigService.class);
      ScriptResource res = jsSrevice_.getResourceIncludingModule(moduleName);
      if (res != null)
      {
         try
         {
            ResourceId id = res.getId();
View Full Code Here

   @Deprecated
   public void importJavascript(String s, String location)
   {
      if (s != null)
      {
         JavascriptConfigService jsSrevice_ =
            (JavascriptConfigService)ExoContainerContext.getCurrentContainer().getComponentInstanceOfType(
               JavascriptConfigService.class);
         if (!jsSrevice_.isModuleLoaded(s) || PropertyManager.isDevelopping())
         {
            if (location == null)
            {
               location = "/eXoResources/javascript/";
            }

            String path = location + s.replaceAll("\\.", "/") + ".js";
            if (!jsSrevice_.isJavascriptLoaded(path) || PropertyManager.isDevelopping())
            {
               importedScripts.add(path);
            }
         }
      }
View Full Code Here

TOP

Related Classes of org.exoplatform.web.application.javascript.JavascriptConfigService$NormalizeJSReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.