* 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() {
|
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
|
||||||
|
if (dir) {
|
||||||
for (var i = 0; i < dir.length; i++) {
|
for (var i = 0; i < dir.length; i++) {
|
||||||
if (dir[i].toLowerCase() != "cvs" && dir[i].indexOf(".") == -1)
|
if (dir[i].isDirectory() && dir[i].name.toLowerCase() != "cvs") {
|
||||||
arr[arr.length] = this.getApp(dir[i]);
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue