Fixes IDEMPIERE-5684 Bad naming of Automatic 2Packs stop the whole process (#1794)

This commit is contained in:
Carlos Ruiz 2023-04-23 07:19:38 +02:00 committed by GitHub
parent d954b926a2
commit d201650cf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -122,6 +122,11 @@ public abstract class AbstractActivator implements BundleActivator, ServiceTrack
int clientId = Env.getAD_Client_ID(Env.getCtx());
if (version == null) {
String [] parts = fileName.split("_");
if (parts.length < 2) {
logger.warning("Wrong name, ignored " + fileName);
return false;
}
logger.warning(fileName);
String clientValue = parts[1];
clientId = DB.getSQLValueEx(null, "SELECT AD_Client_ID FROM AD_Client WHERE Value=?", clientValue);
if (clientId < 0)

View File

@ -150,12 +150,14 @@ public class PackInApplicationActivator extends AbstractActivator{
private boolean packIn(File packinFile) {
if (packinFile != null) {
String fileName = packinFile.getName();
logger.warning("Installing " + fileName + " ...");
// The convention for package names is: yyyymmddHHMM_ClientValue_InformationalDescription.zip
String [] parts = fileName.split("_");
if (parts.length < 2) {
logger.warning("Wrong name, ignored " + fileName);
return false;
}
logger.warning("Installing " + fileName + " ...");
String clientValue = parts[1];
boolean allClients = clientValue.startsWith("ALL-CLIENTS");
int[] clientIDs;