Changeset 9142

Show
Ignore:
Timestamp:
07/02/08 15:13:00 (2 months ago)
Author:
hannes
Message:

Implement global getResources() that returns a list of all resources
contained in a repository path.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • helma-ng/trunk/src/org/helma/javascript/GlobalFunctions.java

    r8988 r9142  
    4747                              "importJar", 
    4848                              "getResource", 
     49                              "getResources", 
    4950                              "parseSkin" 
    5051                             }, 
  • helma-ng/trunk/src/org/helma/javascript/RhinoEngine.java

    r9108 r9142  
    342342    } 
    343343 
     344 
     345    public ScriptableObject getTopLevelScope() { 
     346        return topLevelScope; 
     347    } 
     348 
    344349    /** 
    345350     * Get the repository associated with the scope or one of its prototypes 
     
    395400     */ 
    396401    public List<Resource> getResources(String path) { 
     402        for (Repository repo: repositories) { 
     403            Repository repository = repo.getChildRepository(path); 
     404            if (repository.exists()) { 
     405                return repo.getAllResources(); 
     406            } 
     407        } 
    397408        return repositories.get(0).getResources(path); 
    398409    }