Package org.gatein.portal.controller.resource.script

Examples of org.gatein.portal.controller.resource.script.ScriptResource


        }

        //
        if (resource != null) {
            if (resource instanceof ScriptResource) {
                ScriptResource rs = (ScriptResource) resource;

                List<Module> modules = rs.getModules();
                if (modules.size() > 0 && modules.get(0) instanceof Module.Remote) {
                    return ((Module.Remote) modules.get(0)).getURI();
                }
            }
View Full Code Here


      return paths;
   }

   public Reader getScript(ResourceId id, String name, Locale locale)
   {
      ScriptResource script = getResource(id);
      if (script != null && !"merged".equals(name))
      {
         return getJavascript(script, name, locale);
      }
      else
View Full Code Here

      }
   }

   public Reader getScript(ResourceId resourceId, Locale locale)
   {
      ScriptResource resource = getResource(resourceId);
      if (resource != null)
      {
         List<Module> modules = new ArrayList<Module>(resource.getModules());
         Collections.sort(modules, MODULE_COMPARATOR);
         ArrayList<Reader> readers = new ArrayList<Reader>(modules.size() * 2);
         for (Module js :modules)
         {
            if (!js.isRemote())
View Full Code Here

      Map<ScriptResource, FetchMode> resources = scripts.resolve(ids);

      //
      for (Map.Entry<ScriptResource, FetchMode> entry : resources.entrySet())
      {
         ScriptResource resource = entry.getKey();

         //
         if (!resource.isEmpty())
         {
            FetchMode mode = entry.getValue();
            for (Module module : resource.getModules())
            {
               if (module instanceof Module.Remote)
               {
                  urls.put(((Module.Remote)module).getURI(), mode);
               }
            }
            controllerContext.renderURL(resource.getParameters(minified, locale), writer);
            urls.put(buffer.toString(), mode);
            buffer.setLength(0);
            writer.reset(buffer);
         }
      }
View Full Code Here

   {
      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();
            loadScriptResource(id.getScope(), id.getName());
            if (log.isWarnEnabled())
            {
               log.warn("This method is deprecated. You could loadScriptResource " + res.getId() + " instead of importJavascript " + moduleName);
            }
         }
         catch (Exception ex)
         {
            //Spare me, Sonar! This importJavascript is to be deleted soon
View Full Code Here

   public void execute(JavascriptConfigService service, ServletContext scontext)
   {
      for (ScriptResourceDescriptor desc : descriptors)
      {
         ScriptResource resource = service.scripts.addResource(desc.id, desc.fetchMode);
         if (resource != null)
         {
            for (Javascript module : desc.modules)
            {
               module.addModuleTo(resource);
            }
            for (Locale locale : desc.getSupportedLocales())
            {
               resource.addSupportedLocale(locale);
            }
            for (DependencyDescriptor dependency : desc.dependencies)
            {
               resource.addDependency(dependency.getResourceId());
            }           
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.gatein.portal.controller.resource.script.ScriptResource

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.