* 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:
parent
ce30c5aac4
commit
dc88734294
1 changed files with 17 additions and 6 deletions
|
@ -26,13 +26,24 @@ function renderApi(appName) {
|
|||
*/
|
||||
function getAllApplications() {
|
||||
var appsDir = this.getAppsHome();
|
||||
var dir = appsDir.list();
|
||||
var dir = appsDir.listFiles();
|
||||
var arr = new Array();
|
||||
if (!dir)
|
||||
return arr;
|
||||
for (var i = 0; i < dir.length; i++) {
|
||||
if (dir[i].toLowerCase() != "cvs" && dir[i].indexOf(".") == -1)
|
||||
arr[arr.length] = this.getApp(dir[i]);
|
||||
var seen = {};
|
||||
// first check apps directory for apps directories
|
||||
if (dir) {
|
||||
for (var i = 0; i < dir.length; 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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue