String dir = Application.lookup().getBaseAppDirectory() + "/" + getPanelDriversDir();
File fdir = new File(dir);
log.info("Loading panels. Scanning dir: " + fdir.getCanonicalPath());
DirectoriesScanner scanner = new DirectoriesScanner("panel");
File[] files = scanner.findFiles(fdir);
for (int i = 0; i < files.length; i++) {
File f = files[i];
log.info("Reading file: " + f);
PanelProvider p = null;
try {
p = loadPanelProvider(f);
p.initialize();
} catch (Exception e) {
log.error("Error loading panel from file " + f, e);
}
if (p != null) {
panels.put(p.getId(), p);
} else {
log.error("File format is not valid: " + f);
}
}
DirectoriesScanner scannerHelp = new DirectoriesScanner("phelp");
File[] helpFiles = scannerHelp.findFiles(fdir);
for (int i = 0; i < helpFiles.length; i++) {
File helpFile = helpFiles[i];
PanelHelp pHelp = null;
try {
pHelp = loadHelpFile(helpFile);