Skip to content

Commit

Permalink
Merge branch 'master' into bndtools
Browse files Browse the repository at this point in the history
  • Loading branch information
hengsin committed Oct 5, 2024
2 parents 75c5a4e + 323571d commit f57471d
Show file tree
Hide file tree
Showing 40 changed files with 1,171 additions and 411 deletions.
10 changes: 10 additions & 0 deletions migration/iD11/oracle/202409231820_IDEMPIERE-6248.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- IDEMPIERE-6248
SELECT register_migration_script('202409231820_IDEMPIERE-6248.sql') FROM dual;

SET SQLBLANKLINES ON
SET DEFINE OFF

-- Sep 23, 2024, 6:20:30 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200250,0,0,TO_TIMESTAMP('2024-09-23 18:20:29','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-23 18:20:29','YYYY-MM-DD HH24:MI:SS'),10,10,'Y','FULL_EXCEPTION_TRACE_IN_LOG','N','If set to Y, the stack trace is not cut in the log (see https://idempiere.atlassian.net/browse/IDEMPIERE-6248)','D','S','8308ac18-d0a6-479f-ab59-7edd0bcb0b54')
;

14 changes: 14 additions & 0 deletions migration/iD11/oracle/202409241248_IDEMPIERE-5760.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- IDEMPIERE-5760 Manage mail.smtp.timeout using SysConfig
SELECT register_migration_script('202409241248_IDEMPIERE-5760.sql') FROM dual;

SET SQLBLANKLINES ON
SET DEFINE OFF

-- Sep 24, 2024, 12:48:56 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200253,0,0,TO_TIMESTAMP('2024-09-24 12:48:55','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 12:48:55','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAIL_SMTP_CONNECTIONTIMEOUT','-1','Timeout in milliseconds to wait for SMTP connection, -1 leaves the java default','D','C','36be68b7-7b4b-4725-9a51-aeb11bb7b699')
;

-- Sep 24, 2024, 12:49:10 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200254,0,0,TO_TIMESTAMP('2024-09-24 12:49:09','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 12:49:09','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAIL_SMTP_WRITETIMEOUT','-1','Timeout in milliseconds to wait for writing on SMTP connection, -1 leaves the java default','D','C','e11d83c4-8500-400a-b9d2-358c30c910fb')
;

7 changes: 7 additions & 0 deletions migration/iD11/postgresql/202409231820_IDEMPIERE-6248.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- IDEMPIERE-6248
SELECT register_migration_script('202409231820_IDEMPIERE-6248.sql') FROM dual;

-- Sep 23, 2024, 6:20:30 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200250,0,0,TO_TIMESTAMP('2024-09-23 18:20:29','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-23 18:20:29','YYYY-MM-DD HH24:MI:SS'),10,10,'Y','FULL_EXCEPTION_TRACE_IN_LOG','N','If set to Y, the stack trace is not cut in the log (see https://idempiere.atlassian.net/browse/IDEMPIERE-6248)','D','S','8308ac18-d0a6-479f-ab59-7edd0bcb0b54')
;

11 changes: 11 additions & 0 deletions migration/iD11/postgresql/202409241248_IDEMPIERE-5760.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- IDEMPIERE-5760 Manage mail.smtp.timeout using SysConfig
SELECT register_migration_script('202409241248_IDEMPIERE-5760.sql') FROM dual;

-- Sep 24, 2024, 12:48:56 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200253,0,0,TO_TIMESTAMP('2024-09-24 12:48:55','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 12:48:55','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAIL_SMTP_CONNECTIONTIMEOUT','-1','Timeout in milliseconds to wait for SMTP connection, -1 leaves the java default','D','C','36be68b7-7b4b-4725-9a51-aeb11bb7b699')
;

-- Sep 24, 2024, 12:49:10 PM CEST
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200254,0,0,TO_TIMESTAMP('2024-09-24 12:49:09','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 12:49:09','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','MAIL_SMTP_WRITETIMEOUT','-1','Timeout in milliseconds to wait for writing on SMTP connection, -1 leaves the java default','D','C','e11d83c4-8500-400a-b9d2-358c30c910fb')
;

18 changes: 18 additions & 0 deletions migration/iD12/oracle/202409241649_IDEMPIERE-6242.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- IDEMPIERE-6242 Info window, image fieldtype doesn't work
SELECT register_migration_script('202409241649_IDEMPIERE-6242.sql') FROM dual;

SET SQLBLANKLINES ON
SET DEFINE OFF

-- Sep 24, 2024, 4:49:49 PM MYT
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200251,0,0,TO_TIMESTAMP('2024-09-24 16:49:48','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 16:49:48','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ZK_THUMBNAIL_IMAGE_HEIGHT','100','Height of thumbnail image for info window and grid view','D','C','9ecbe9aa-25e0-4933-ba33-50da6f66875a')
;

-- Sep 24, 2024, 4:50:12 PM MYT
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200252,0,0,TO_TIMESTAMP('2024-09-24 16:50:11','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 16:50:11','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ZK_THUMBNAIL_IMAGE_WIDTH','100','Width of thumbnail image for info window and grid view','D','C','27ad8a0d-7ffa-4058-9cae-187ffdfc6dfa')
;

-- Sep 24, 2024, 4:52:35 PM MYT
INSERT INTO AD_Reference (AD_Reference_ID,Name,Description,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU,ShowInactive) VALUES (200271,'Image URL','Web URL of an image','D',0,0,'Y',TO_TIMESTAMP('2024-09-24 16:52:35','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-24 16:52:35','YYYY-MM-DD HH24:MI:SS'),100,'D','N','27a6d876-b451-4fdb-ae4b-584ef6022838','N')
;

15 changes: 15 additions & 0 deletions migration/iD12/postgresql/202409241649_IDEMPIERE-6242.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-- IDEMPIERE-6242 Info window, image fieldtype doesn't work
SELECT register_migration_script('202409241649_IDEMPIERE-6242.sql') FROM dual;

-- Sep 24, 2024, 4:49:49 PM MYT
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200251,0,0,TO_TIMESTAMP('2024-09-24 16:49:48','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 16:49:48','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ZK_THUMBNAIL_IMAGE_HEIGHT','100','Height of thumbnail image for info window and grid view','D','C','9ecbe9aa-25e0-4933-ba33-50da6f66875a')
;

-- Sep 24, 2024, 4:50:12 PM MYT
INSERT INTO AD_SysConfig (AD_SysConfig_ID,AD_Client_ID,AD_Org_ID,Created,Updated,CreatedBy,UpdatedBy,IsActive,Name,Value,Description,EntityType,ConfigurationLevel,AD_SysConfig_UU) VALUES (200252,0,0,TO_TIMESTAMP('2024-09-24 16:50:11','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2024-09-24 16:50:11','YYYY-MM-DD HH24:MI:SS'),100,100,'Y','ZK_THUMBNAIL_IMAGE_WIDTH','100','Width of thumbnail image for info window and grid view','D','C','27ad8a0d-7ffa-4058-9cae-187ffdfc6dfa')
;

-- Sep 24, 2024, 4:52:35 PM MYT
INSERT INTO AD_Reference (AD_Reference_ID,Name,Description,ValidationType,AD_Client_ID,AD_Org_ID,IsActive,Created,CreatedBy,Updated,UpdatedBy,EntityType,IsOrderByValue,AD_Reference_UU,ShowInactive) VALUES (200271,'Image URL','Web URL of an image','D',0,0,'Y',TO_TIMESTAMP('2024-09-24 16:52:35','YYYY-MM-DD HH24:MI:SS'),100,TO_TIMESTAMP('2024-09-24 16:52:35','YYYY-MM-DD HH24:MI:SS'),100,'D','N','27a6d876-b451-4fdb-ae4b-584ef6022838','N')
;

Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ public MMeasureCalc markImmutable() {
@Override
public String getWhereClause() {
String whereClause = super.getWhereClause();
if (! whereClause.toLowerCase().startsWith("where "))
if (! whereClause.matches("(?si)\\s*where\\s+.*"))
whereClause = "WHERE " + whereClause;
return whereClause;
}
Expand Down
8 changes: 6 additions & 2 deletions org.adempiere.base/src/org/compiere/model/MRole.java
Original file line number Diff line number Diff line change
Expand Up @@ -2141,7 +2141,7 @@ public String addAccessSQL (String SQL, String TableNameIn,
keyColumnName += getIdColumnName(TableName);

//log.fine("addAccessSQL - " + TableName + "(" + AD_Table_ID + ") " + keyColumnName);
String recordWhere = getRecordWhere (AD_Table_ID, keyColumnName, rw);
String recordWhere = getRecordWhere (AD_Table_ID, keyColumnName, rw, TableName, ti[i].getSynonym());
if (recordWhere.length() > 0)
{
retSQL.append(" AND ").append(recordWhere);
Expand Down Expand Up @@ -2476,9 +2476,11 @@ private int getAD_Table_ID (String tableName)
* @param AD_Table_ID table
* @param keyColumnName (fully qualified) key column name
* @param rw true if read write
* @param tableName
* @param alias
* @return where clause or ""
*/
private String getRecordWhere (int AD_Table_ID, String keyColumnName, boolean rw)
private String getRecordWhere (int AD_Table_ID, String keyColumnName, boolean rw, String tableName, String alias)
{
loadRecordAccess(false);
//
Expand Down Expand Up @@ -2540,6 +2542,8 @@ else if (!rw || !m_recordAccess[i].isReadOnly()) // include
if (sb.length() > 0)
sb.append(" AND ");
String wherevr = Env.parseContext(p_ctx, 0, tvr.getCode(), false);
if (! Util.isEmpty(alias) && ! alias.equals(tableName))
wherevr = wherevr.replaceAll("\\b" + tableName + "\\b", alias);
sb.append(" (").append(wherevr).append(") ");
}

Expand Down
7 changes: 6 additions & 1 deletion org.adempiere.base/src/org/compiere/model/MSysConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class MSysConfig extends X_AD_SysConfig
/**
*
*/
private static final long serialVersionUID = 5739824752288579881L;
private static final long serialVersionUID = -2729894615883031395L;

/** Constant for Predefine System Configuration Names (in alphabetical order) */

Expand Down Expand Up @@ -120,6 +120,7 @@ public class MSysConfig extends X_AD_SysConfig
public static final String FORM_SQL_QUERY_LOG_ISSUE = "FORM_SQL_QUERY_LOG_ISSUE";
public static final String FORM_SQL_QUERY_MAX_RECORDS = "FORM_SQL_QUERY_MAX_RECORDS";
public static final String FORM_SQL_QUERY_TIMEOUT_IN_SECONDS = "FORM_SQL_QUERY_TIMEOUT_IN_SECONDS";
public static final String FULL_EXCEPTION_TRACE_IN_LOG = "FULL_EXCEPTION_TRACE_IN_LOG";
public static final String GLOBAL_MAX_QUERY_RECORDS = "GLOBAL_MAX_QUERY_RECORDS";
public static final String GLOBAL_MAX_REPORT_RECORDS = "GLOBAL_MAX_REPORT_RECORDS";
public static final String GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS = "GRIDTABLE_LOAD_TIMEOUT_IN_SECONDS";
Expand Down Expand Up @@ -153,7 +154,9 @@ public class MSysConfig extends X_AD_SysConfig
public static final String MAIL_SEND_BCC_TO_ADDRESS = "MAIL_SEND_BCC_TO_ADDRESS";
public static final String MAIL_SEND_BCC_TO_FROM = "MAIL_SEND_BCC_TO_FROM";
public static final String MAIL_SEND_CREDENTIALS = "MAIL_SEND_CREDENTIALS";
public static final String MAIL_SMTP_CONNECTIONTIMEOUT = "MAIL_SMTP_CONNECTIONTIMEOUT";
public static final String MAIL_SMTP_TIMEOUT = "MAIL_SMTP_TIMEOUT";
public static final String MAIL_SMTP_WRITETIMEOUT = "MAIL_SMTP_WRITETIMEOUT";
public static final String MAX_ACTIVITIES_IN_LIST = "MAX_ACTIVITIES_IN_LIST";
public static final String MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER = "MAX_RESULTS_PER_SEARCH_IN_DOCUMENT_CONTROLLER";
public static final String MAX_ROWS_IN_TABLE_COMBOLIST = "MAX_ROWS_IN_TABLE_COMBOLIST";
Expand Down Expand Up @@ -271,6 +274,8 @@ public class MSysConfig extends X_AD_SysConfig
public static final String ZK_SESSION_TIMEOUT_IN_SECONDS = "ZK_SESSION_TIMEOUT_IN_SECONDS";
public static final String ZK_THEME = "ZK_THEME";
public static final String ZK_THEME_USE_FONT_ICON_FOR_IMAGE = "ZK_THEME_USE_FONT_ICON_FOR_IMAGE";
public static final String ZK_THUMBNAIL_IMAGE_HEIGHT = "ZK_THUMBNAIL_IMAGE_HEIGHT";
public static final String ZK_THUMBNAIL_IMAGE_WIDTH = "ZK_THUMBNAIL_IMAGE_WIDTH";
public static final String ZK_TOOLBAR_SHOW_MORE_VERTICAL = "ZK_TOOLBAR_SHOW_MORE_VERTICAL";
public static final String ZK_USE_PDF_JS_VIEWER = "ZK_USE_PDF_JS_VIEWER";
public static final String ZOOM_ACROSS_QUERY_TIMEOUT = "ZOOM_ACROSS_QUERY_TIMEOUT";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ public boolean evaluate(String whereClause)

MTable table = MTable.get(Env.getCtx(), getAD_Table_ID());
String tableName = table.getTableName();
StringBuilder builder = new StringBuilder("SELECT Count(*) FROM ");
StringBuilder builder = new StringBuilder("SELECT 1 FROM ");
builder.append(tableName)
.append(" WHERE ")
.append(whereClause)
Expand Down
1 change: 1 addition & 0 deletions org.adempiere.base/src/org/compiere/model/SystemIDs.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ public class SystemIDs
public final static int REFERENCE_DATATYPE_ID = 13;
public final static int REFERENCE_DATATYPE_UUID = 200231;
public final static int REFERENCE_DATATYPE_IMAGE = 32;
public final static int REFERENCE_DATATYPE_IMAGE_URL = 200271;
public final static int REFERENCE_DATATYPE_INTEGER = 11;
public final static int REFERENCE_DATATYPE_LIST = 17;
public final static int REFERENCE_DATATYPE_LOCATION = 21;
Expand Down
8 changes: 5 additions & 3 deletions org.adempiere.base/src/org/compiere/util/CLogFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*****************************************************************************/
package org.compiere.util;

import static org.compiere.model.MSysConfig.FULL_EXCEPTION_TRACE_IN_LOG;

import java.awt.Toolkit;
import java.rmi.ServerException;
import java.sql.SQLException;
Expand All @@ -25,6 +27,7 @@
import java.util.logging.Level;
import java.util.logging.LogRecord;

import org.compiere.model.MSysConfig;
import org.compiere.model.SystemProperties;

/**
Expand Down Expand Up @@ -293,15 +296,14 @@ private static void fillExceptionTrace (StringBuffer sb, String hdr, Throwable t
int adempiereTraceNo = 0;
for (int i=0; i < trace.length; i++)
{
adempiereTrace = trace[i].getClassName().startsWith("org.compiere.");
adempiereTrace = trace[i].getClassName().startsWith("org.compiere.") || trace[i].getClassName().startsWith("org.adempiere.") || trace[i].getClassName().startsWith("org.idempiere.");
if (thrown instanceof ServerException // RMI
|| adempiereTrace)
{
if (adempiereTrace)
sb.append("\tat ").append(trace[i]).append(NL);
}
else if (i > 20
|| (i > 10 && adempiereTraceNo > 8))
else if (!MSysConfig.getBooleanValue(FULL_EXCEPTION_TRACE_IN_LOG, false) && (i > 20 || (i > 10 && adempiereTraceNo > 8)))
break;
else
sb.append("\tat ").append(trace[i]).append(NL);
Expand Down
8 changes: 7 additions & 1 deletion org.adempiere.base/src/org/compiere/util/DisplayType.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import static org.compiere.model.SystemIDs.REFERENCE_DATATYPE_FILEPATH;
import static org.compiere.model.SystemIDs.REFERENCE_DATATYPE_ID;
import static org.compiere.model.SystemIDs.REFERENCE_DATATYPE_IMAGE;
import static org.compiere.model.SystemIDs.REFERENCE_DATATYPE_IMAGE_URL;
import static org.compiere.model.SystemIDs.REFERENCE_DATATYPE_INTEGER;
import static org.compiere.model.SystemIDs.REFERENCE_DATATYPE_LIST;
import static org.compiere.model.SystemIDs.REFERENCE_DATATYPE_LOCATION;
Expand Down Expand Up @@ -154,6 +155,8 @@ public final class DisplayType
public static final int Locator = REFERENCE_DATATYPE_LOCATOR;
/** Display Type 32 Image */
public static final int Image = REFERENCE_DATATYPE_IMAGE;
/** Display Type Image URL */
public static final int ImageURL = REFERENCE_DATATYPE_IMAGE_URL;
/** Display Type 33 Assignment */
public static final int Assignment = REFERENCE_DATATYPE_ASSIGNMENT;
/** Display Type 34 Memo */
Expand Down Expand Up @@ -422,7 +425,8 @@ public static boolean isText(int displayType)
|| displayType == ChosenMultipleSelectionSearch
|| displayType == TimeZoneId
|| displayType == UUID || displayType == RecordUU
|| displayType == TableDirUU || displayType == TableUU || displayType == SearchUU)
|| displayType == TableDirUU || displayType == TableUU || displayType == SearchUU
|| displayType == ImageURL)
return true;

//not custom type, don't have to check factory
Expand Down Expand Up @@ -1137,6 +1141,8 @@ public static String getDescription (int displayType)
return "ID";
case Image:
return "Image";
case ImageURL:
return "Image URL";
case Integer:
return "Integer";
case List:
Expand Down
6 changes: 6 additions & 0 deletions org.adempiere.base/src/org/compiere/util/EMail.java
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ public String send(boolean throwException) throws Exception
props.put("mail.host", m_smtpHost);
//Timeout for sending the email defaulted to 20 seconds if not defined in a SysConfig Key
props.put("mail.smtp.timeout", MSysConfig.getIntValue(MSysConfig.MAIL_SMTP_TIMEOUT, 20000, Env.getAD_Client_ID(m_ctx)));
int mail_smtp_connectiontimeout = MSysConfig.getIntValue(MSysConfig.MAIL_SMTP_CONNECTIONTIMEOUT, -1, Env.getAD_Client_ID(m_ctx));
if (mail_smtp_connectiontimeout >= 0)
props.put("mail.smtp.connectiontimeout", mail_smtp_connectiontimeout);
int mail_smtp_writetimeout = MSysConfig.getIntValue(MSysConfig.MAIL_SMTP_WRITETIMEOUT, -1, Env.getAD_Client_ID(m_ctx));
if (mail_smtp_writetimeout >= 0)
props.put("mail.smtp.writetimeout", mail_smtp_writetimeout);

if (CLogMgt.isLevelFinest())
props.put("mail.debug", "true");
Expand Down
Loading

0 comments on commit f57471d

Please sign in to comment.