code: private Set<String> getJSHeadIncludes(CmsObject cms, CmsResource resource) throws CmsLoaderException {
  
          I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(resource.getTypeId());
          if (resType instanceof CmsResourceTypeXmlContent) {
              try {
                  CmsXmlContentDefinition contentDefinition = CmsXmlContentDefinition.getContentDefinitionForResource(
                      cms,
                      resource);
                  return contentDefinition.getContentHandler().getJSHeadIncludes(cms, resource);
              } catch (CmsException e) {
                  LOG.warn(e.getLocalizedMessage(), e);
                  // NOOP, use the empty set
              }
          }
          return Collections.emptySet();
      }
docs: Returns the schema configured JavaScript head include resources.<p>
  
  @param cms the current cms context
  @param resource the resource
  
  @return the configured JavaScript head include resources
  
  @throws CmsLoaderException if something goes wrong reading the resource type