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

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


                resourceScope = ResourceScope.PORTLET;
            } else {
                resourceScope = ResourceScope.PORTAL;
            }
            ResourceId id = new ResourceId(resourceScope, resourceName);
            FetchMode fetchMode;
            String group = null;

            Element resourceElt = XMLTools.getUniqueChild(element, MODULE_TAG, false);
            if (resourceElt != null) {
                fetchMode = FetchMode.ON_LOAD;
                if (XMLTools.getUniqueChild(resourceElt, URL_TAG, false) == null) {
                    group = parseGroup(resourceElt);
                }
            } else {
                resourceElt = XMLTools.getUniqueChild(element, SCRIPTS_TAG, false);
                fetchMode = FetchMode.IMMEDIATE;
            }

            if (resourceElt != null) {
                ScriptResourceDescriptor desc = scripts.get(id);
                if (desc == null) {
                    desc = new ScriptResourceDescriptor(id, fetchMode, parseOptString(element, AS_TAG), group);
                } else {
                    desc.fetchMode = fetchMode;
                }
                parseDesc(resourceElt, desc);
                scripts.put(id, desc);
            }
        } else if (MODULE_TAG.equals(element.getTagName()) || SCRIPTS_TAG.equals(element.getTagName())) {
            String resourceName = XMLTools.asString(XMLTools.getUniqueChild(element, "name", true));
            ResourceId id = new ResourceId(ResourceScope.SHARED, resourceName);
            FetchMode fetchMode;
            String group = null;

            if (MODULE_TAG.equals(element.getTagName())) {
                fetchMode = FetchMode.ON_LOAD;
                if (XMLTools.getUniqueChild(element, URL_TAG, false) == null) {
View Full Code Here


                resourceScope = ResourceScope.PORTLET;
            } else {
                resourceScope = ResourceScope.PORTAL;
            }
            ResourceId id = new ResourceId(resourceScope, resourceName);
            FetchMode fetchMode;
            String group = null;

            Element resourceElt = XMLTools.getUniqueChild(element, MODULE_TAG, false);
            if (resourceElt != null) {
                fetchMode = FetchMode.ON_LOAD;
                if (XMLTools.getUniqueChild(resourceElt, URL_TAG, false) == null) {
                    group = parseGroup(resourceElt);
                }
            } else {
                resourceElt = XMLTools.getUniqueChild(element, SCRIPTS_TAG, false);
                fetchMode = FetchMode.IMMEDIATE;
            }

            if (resourceElt != null) {
                ScriptResourceDescriptor desc = scripts.get(id);
                if (desc == null) {
                    Element nativeAmdTag = XMLTools.getUniqueChild(element, NATIVE_AMD_TAG, false);
                    boolean isNativeAmd = nativeAmdTag != null && Boolean.parseBoolean(XMLTools.asString(nativeAmdTag, true).toLowerCase());
                    desc = new ScriptResourceDescriptor(id, fetchMode, parseOptString(element, AS_TAG), group, isNativeAmd);
                } else {
                    desc.fetchMode = fetchMode;
                }
                parseDesc(resourceElt, desc);
                scripts.put(id, desc);
            }
        } else if (MODULE_TAG.equals(element.getTagName()) || SCRIPTS_TAG.equals(element.getTagName())) {
            String resourceName = XMLTools.asString(XMLTools.getUniqueChild(element, "name", true));
            ResourceId id = new ResourceId(ResourceScope.SHARED, resourceName);
            FetchMode fetchMode;
            String group = null;

            if (MODULE_TAG.equals(element.getTagName())) {
                fetchMode = FetchMode.ON_LOAD;
                if (XMLTools.getUniqueChild(element, URL_TAG, false) == null) {
View Full Code Here

         else
         {
            resourceScope = ResourceScope.PORTAL;
         }
         ResourceId id = new ResourceId(resourceScope, resourceName);
         FetchMode fetchMode;
         String group = null;
        
         Element resourceElt = XMLTools.getUniqueChild(element, MODULE_TAG, false);
         if (resourceElt != null)
         {
            fetchMode = FetchMode.ON_LOAD;
            if (XMLTools.getUniqueChild(resourceElt, URL_TAG, false) == null)
            {
               group = parseGroup(resourceElt);
            }
         }
         else
         {
            resourceElt = XMLTools.getUniqueChild(element, SCRIPTS_TAG, false);
            fetchMode = FetchMode.IMMEDIATE;
         }
        
         if (resourceElt != null)
         {
            ScriptResourceDescriptor desc = scripts.get(id);
            if (desc == null)
            {
               desc = new ScriptResourceDescriptor(id, fetchMode, parseOptString(element, AS_TAG), group);
            }
            else
            {
               desc.fetchMode = fetchMode;
            }
            parseDesc(resourceElt, desc);
            scripts.put(id, desc);
         }
      }
      else if (MODULE_TAG.equals(element.getTagName()) || SCRIPTS_TAG.equals(element.getTagName()))
      {
         String resourceName = XMLTools.asString(XMLTools.getUniqueChild(element, "name", true));
         ResourceId id = new ResourceId(ResourceScope.SHARED, resourceName);        
         FetchMode fetchMode;
         String group = null;
        
         if (MODULE_TAG.equals(element.getTagName()))
         {
            fetchMode = FetchMode.ON_LOAD;
View Full Code Here

         else
         {
            resourceScope = ResourceScope.PORTAL;
         }
         ResourceId id = new ResourceId(resourceScope, resourceName);
         FetchMode fetchMode;
         Element resourceElt = XMLTools.getUniqueChild(element, MODULE_TAG, false);
         if (resourceElt != null)
         {
            fetchMode = FetchMode.ON_LOAD;
         }
         else
         {
            resourceElt = XMLTools.getUniqueChild(element, SCRIPTS_TAG, false);
            fetchMode = FetchMode.IMMEDIATE;
         }

         if (resourceElt != null)
         {
            ScriptResourceDescriptor desc = scripts.get(id);
            if (desc == null)
            {
               scripts.put(id, desc = new ScriptResourceDescriptor(id, fetchMode, parseAlias(element)));
            }
            else
            {
               desc.fetchMode = fetchMode;
            }
            parseDesc(resourceElt, desc);
         }
      }
      else if (MODULE_TAG.equals(element.getTagName()) || SCRIPTS_TAG.equals(element.getTagName()))
      {
         String resourceName = XMLTools.asString(XMLTools.getUniqueChild(element, "name", true));
         ResourceId id = new ResourceId(ResourceScope.SHARED, resourceName);
         FetchMode fetchMode = MODULE_TAG.equals(element.getTagName()) ? FetchMode.ON_LOAD : FetchMode.IMMEDIATE;
         ScriptResourceDescriptor desc = scripts.get(id);
         if (desc == null)
         {
            scripts.put(id, desc = new ScriptResourceDescriptor(id, fetchMode, parseAlias(element)));
         }
View Full Code Here

         ScriptResource resource = getResource(ids.keySet().iterator().next());
               
         //
         if (resource != null)
         {
            FetchMode mode = resource.getFetchMode();
            List<Module> modules = resource.getModules();
            if (modules.size() > 0 && modules.get(0) instanceof Module.Remote)
            {
               urls.put(((Module.Remote)modules.get(0)).getURI(), mode);
            }
View Full Code Here

                resourceScope = ResourceScope.PORTLET;
            } else {
                resourceScope = ResourceScope.PORTAL;
            }
            ResourceId id = new ResourceId(resourceScope, resourceName);
            FetchMode fetchMode;
            String group = null;

            Element resourceElt = XMLTools.getUniqueChild(element, MODULE_TAG, false);
            if (resourceElt != null) {
                fetchMode = FetchMode.ON_LOAD;
                if (XMLTools.getUniqueChild(resourceElt, URL_TAG, false) == null) {
                    group = parseGroup(resourceElt);
                }
            } else {
                resourceElt = XMLTools.getUniqueChild(element, SCRIPTS_TAG, false);
                fetchMode = FetchMode.IMMEDIATE;
            }

            if (resourceElt != null) {
                ScriptResourceDescriptor desc = scripts.get(id);
                if (desc == null) {
                    desc = new ScriptResourceDescriptor(id, fetchMode, parseOptString(element, AS_TAG), group);
                } else {
                    desc.fetchMode = fetchMode;
                }
                parseDesc(resourceElt, desc);
                scripts.put(id, desc);
            }
        } else if (MODULE_TAG.equals(element.getTagName()) || SCRIPTS_TAG.equals(element.getTagName())) {
            String resourceName = XMLTools.asString(XMLTools.getUniqueChild(element, "name", true));
            ResourceId id = new ResourceId(ResourceScope.SHARED, resourceName);
            FetchMode fetchMode;
            String group = null;

            if (MODULE_TAG.equals(element.getTagName())) {
                fetchMode = FetchMode.ON_LOAD;
                if (XMLTools.getUniqueChild(element, URL_TAG, false) == null) {
View Full Code Here

                resourceScope = ResourceScope.PORTLET;
            } else {
                resourceScope = ResourceScope.PORTAL;
            }
            ResourceId id = new ResourceId(resourceScope, resourceName);
            FetchMode fetchMode;
            String group = null;

            Element resourceElt = XMLTools.getUniqueChild(element, MODULE_TAG, false);
            if (resourceElt != null) {
                fetchMode = FetchMode.ON_LOAD;
                if (XMLTools.getUniqueChild(resourceElt, URL_TAG, false) == null) {
                    group = parseGroup(resourceElt);
                }
            } else {
                resourceElt = XMLTools.getUniqueChild(element, SCRIPTS_TAG, false);
                fetchMode = FetchMode.IMMEDIATE;
            }

            if (resourceElt != null) {
                ScriptResourceDescriptor desc = scripts.get(id);
                if (desc == null) {
                    desc = new ScriptResourceDescriptor(id, fetchMode, parseOptString(element, AS_TAG), group);
                } else {
                    desc.fetchMode = fetchMode;
                }
                parseDesc(resourceElt, desc);
                scripts.put(id, desc);
            }
        } else if (MODULE_TAG.equals(element.getTagName()) || SCRIPTS_TAG.equals(element.getTagName())) {
            String resourceName = XMLTools.asString(XMLTools.getUniqueChild(element, "name", true));
            ResourceId id = new ResourceId(ResourceScope.SHARED, resourceName);
            FetchMode fetchMode;
            String group = null;

            if (MODULE_TAG.equals(element.getTagName())) {
                fetchMode = FetchMode.ON_LOAD;
                if (XMLTools.getUniqueChild(element, URL_TAG, false) == null) {
View Full Code Here

         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);
View Full Code Here

         else
         {
            resourceScope = ResourceScope.PORTAL;
         }
         ResourceId id = new ResourceId(resourceScope, resourceName);
         FetchMode fetchMode;
         Element resourceElt = XMLTools.getUniqueChild(element, MODULE_TAG, false);
         if (resourceElt != null)
         {
            fetchMode = FetchMode.ON_LOAD;
         }
         else
         {
            resourceElt = XMLTools.getUniqueChild(element, SCRIPTS_TAG, false);
            fetchMode = FetchMode.IMMEDIATE;
         }

         if (resourceElt != null)
         {
            ScriptResourceDescriptor desc = scripts.get(id);
            if (desc == null)
            {
               scripts.put(id, desc = new ScriptResourceDescriptor(id, fetchMode));
            }
            else
            {
               desc.fetchMode = fetchMode;
            }
            parseDesc(resourceElt, desc);
         }
      }
      else if (MODULE_TAG.equals(element.getTagName()) || SCRIPTS_TAG.equals(element.getTagName()))
      {
         String resourceName = XMLTools.asString(XMLTools.getUniqueChild(element, "name", true));
         ResourceId id = new ResourceId(ResourceScope.SHARED, resourceName);
         FetchMode fetchMode = MODULE_TAG.equals(element.getTagName()) ? FetchMode.ON_LOAD : FetchMode.IMMEDIATE;
         ScriptResourceDescriptor desc = scripts.get(id);
         if (desc == null)
         {
            scripts.put(id, desc = new ScriptResourceDescriptor(id, fetchMode));
         }
View Full Code Here

TOP

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

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.