Package org.gatein.portal.controller.resource

Examples of org.gatein.portal.controller.resource.ResourceId


        for (Element moduleElt : XMLTools.getChildren(element, "depends")) {
            Element dependencyElt = XMLTools.getUniqueChild(moduleElt, "module", false);
            if (dependencyElt == null) {
                dependencyElt = XMLTools.getUniqueChild(moduleElt, "scripts", false);
            }
            ResourceId resourceId = new ResourceId(ResourceScope.SHARED, XMLTools.asString(dependencyElt));
            DependencyDescriptor dependency = new DependencyDescriptor(resourceId, parseOptString(moduleElt, AS_TAG),
                    parseOptString(moduleElt, RESOURCE_TAG));
            desc.dependencies.add(dependency);
        }
    }
View Full Code Here


                }

                String url;
                ScriptGroup group = resource.getGroup();
                if (group != null) {
                    ResourceId grpId = group.getId();
                    url = groupURLs.get(grpId);
                    if (url == null) {
                        url = buildURL(grpId, controllerContext, locale);
                        groupURLs.put(grpId, url);
                    }
View Full Code Here

      }
      if (name == null)
      {
         throw new IllegalArgumentException("name can't be null");
      }
      resourceIds.add(new ResourceId(scope, name), null);
   }
View Full Code Here

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

               }

               Javascript js;
               if (portalName == null)
               {
                  js = Javascript.create(new ResourceId(ResourceScope.SHARED, LEGACY_JAVA_SCRIPT), js_module, js_path, contextPath, priority);
               }
               else
               {
                  js = Javascript.create(new ResourceId(ResourceScope.PORTAL, portalName), js_module, js_path, contextPath, priority);
               }
              
               //
               ScriptResourceDescriptor desc = scripts.get(js.getResource());
               if (desc == null)
               {
                  scripts.put(js.getResource(), desc = new ScriptResourceDescriptor(js.getResource(), FetchMode.IMMEDIATE));
               }
               desc.modules.add(js);
            }
         }
         catch (Exception ex)
         {
            log.error(ex.getMessage(), ex);
         }
      }
      else if (PORTAL_TAG.equals(element.getTagName()) || PORTLET_TAG.equals(element.getTagName()))
      {
         String resourceName = XMLTools.asString(XMLTools.getUniqueChild(element, "name", true));
         ResourceScope resourceScope;
         if (PORTLET_TAG.equals(element.getTagName()))
         {
            resourceName = contextPath.substring(1) + "/" + resourceName;
            resourceScope = ResourceScope.PORTLET;
         }
         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

         Element dependencyElt = XMLTools.getUniqueChild(moduleElt, "module", false);
         if(dependencyElt == null)
         {
            dependencyElt = XMLTools.getUniqueChild(moduleElt, "scripts", false);
         }
         ResourceId resourceId = new ResourceId(ResourceScope.SHARED, XMLTools.asString(dependencyElt));
         DependencyDescriptor dependency = new DependencyDescriptor(resourceId);
         desc.dependencies.add(dependency);
      }
   }
View Full Code Here

TOP

Related Classes of org.gatein.portal.controller.resource.ResourceId

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.