VersionUtility.setPool(this);
// Craete a new ImportModule instance which will be used to check
// depencecies and to process the installation
final ImportModule im = new ImportModule(this, vars.getSessionValue("#sourcePath"), vars);
im.setInstallLocal(islocal);
try {
// check the dependenies and obtain the modules to install/update
if (!islocal) {
final String[] installableModules = { module != null ? module.getModuleVersionID() : "" };
check = im.checkDependenciesId(installableModules, updateModules);
} else {
check = im.checkDependenciesFile(obx);
}
// Check commercial modules can be installed
if (check) { // dependencies are statisfied, show modules to install
// installOrig includes also the module to install
final Module[] installOrig = im.getModulesToInstall();
// check commercial modules and show error page if not allowed to install
if (!checkCommercialModules(im, response, vars)) {
return;
}
if (installOrig == null || installOrig.length == 0)
discard[0] = "modulesToinstall";
else {
if (!islocal && module != null) {
inst = new Module[installOrig.length - 1]; // to remove
// the module
// itself
// check if the version for the selected module is the
// selected one
int j = 0;
for (int i = 0; i < installOrig.length; i++) {
found = installOrig[i].getModuleID().equals(module.getModuleID());
if (found && !module.getModuleVersionID().equals(installOrig[i].getModuleVersionID())) {
message = new OBError();
message.setType("Warning");
message.setTitle(Utility.messageBD(this, message.getType(), vars.getLanguage()));
message.setMessage(module.getName()
+ " "
+ module.getVersionNo()
+ " "
+ Utility.messageBD(this, "OtherModuleVersionToinstallOrigall", vars
.getLanguage()) + " " + installOrig[i].getVersionNo());
}
if (found) {
module = installOrig[i];
} else {
inst[j] = installOrig[i];
j++;
}
}
} else {
inst = installOrig;
}
}
upd = im.getModulesToUpdate();
// after all the checks, save the ImportModule object in session
// to take it in next steps
vars.setSessionObject("InstallModule|ImportModule", im);
} else { // Dependencies not satisfied, do not show continue button
message = im.getCheckError();
discard[5] = "discardContinue";
}
if (upd == null || upd.length == 0)
discard[1] = "updateModules";
if (inst == null || inst.length == 0)