IDEMPIERE-3551 External (non-plugin) 2Pack automation / fix problem reprocessing zip files from tenants

This commit is contained in:
Carlos Ruiz 2018-12-04 19:19:17 +01:00
parent 7c023a5ac3
commit e8b0df69d3
1 changed files with 11 additions and 2 deletions

View File

@ -87,8 +87,17 @@ public abstract class AbstractActivator implements BundleActivator, ServiceTrack
protected boolean installedPackage(String version) { protected boolean installedPackage(String version) {
StringBuilder where = new StringBuilder("AD_Client_ID=? AND Name=? AND PK_Status='Completed successfully'"); StringBuilder where = new StringBuilder("AD_Client_ID=? AND Name=? AND PK_Status='Completed successfully'");
List<Object> params = new ArrayList<Object>(); List<Object> params = new ArrayList<Object>();
params.add(Env.getAD_Client_ID(Env.getCtx())); String fileName = getName();
params.add(getName()); int clientId = Env.getAD_Client_ID(Env.getCtx());
if (version == null) {
String [] parts = fileName.split("_");
String clientValue = parts[1];
clientId = DB.getSQLValueEx(null, "SELECT AD_Client_ID FROM AD_Client WHERE Value=?", clientValue);
if (clientId < 0)
clientId = 0;
}
params.add(clientId);
params.add(fileName);
if (version != null) { if (version != null) {
where.append(" AND PK_Version LIKE ?"); where.append(" AND PK_Version LIKE ?");
params.add(version + "%"); params.add(version + "%");