* Make Root.getAllApplications() include the apps defined in apps.properties.

Requires a fresh Helma snapshot (1.6.2+). 
  Fixes bug 520 <http://helma.org/bugs/show_bug.cgi?id=520>
This commit is contained in:
hns 2008-04-04 11:48:15 +00:00
parent ce30c5aac4
commit dc88734294

View file

@ -26,13 +26,24 @@ function renderApi(appName) {
*/ */
function getAllApplications() { function getAllApplications() {
var appsDir = this.getAppsHome(); var appsDir = this.getAppsHome();
var dir = appsDir.list(); var dir = appsDir.listFiles();
var arr = new Array(); var arr = new Array();
if (!dir) var seen = {};
return arr; // first check apps directory for apps directories
for (var i = 0; i < dir.length; i++) { if (dir) {
if (dir[i].toLowerCase() != "cvs" && dir[i].indexOf(".") == -1) for (var i = 0; i < dir.length; i++) {
arr[arr.length] = this.getApp(dir[i]); if (dir[i].isDirectory() && dir[i].name.toLowerCase() != "cvs") {
arr[arr.length] = this.getApp(dir[i].name);
seen[dir[i].name] = true;
}
}
}
// then check entries in apps.properties for apps not currently running
var props = wrapJavaMap(root.getAppsProperties(null));
for (var i in props) {
if (i.indexOf(".") < 0 && !seen[i] && !root.getApplication(i)) {
arr[arr.length] = this.getApp(i);
}
} }
return arr; return arr;
} }