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 11, 2024
2 parents 4a893b6 + 5ef9c3b commit 9cceb87
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- IDEMPIERE-6248
SELECT register_migration_script('202409231821_IDEMPIERE-6248_DelSysConfig.sql') FROM dual;

SET SQLBLANKLINES ON
SET DEFINE OFF

DELETE FROM AD_SysConfig WHERE AD_SysConfig_ID = 200250
;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- IDEMPIERE-6248
SELECT register_migration_script('202409231821_IDEMPIERE-6248_DelSysConfig.sql') FROM dual;

DELETE FROM AD_SysConfig WHERE AD_SysConfig_ID = 200250
;
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ protected String doIt() throws Exception {
.append(" WHERE ").append(uuidCol).append("=?");
int cnt = DB.executeUpdateEx(updUUIDSB.toString(), new Object[] {p_UUID_To, p_UUID_From}, get_TrxName());
if (cnt <= 0) {
msg = "@Error@: UUID " + p_UUID_From + " not found on table " + l_tableName;
msg = "@Error@ UUID " + p_UUID_From + " not found on table " + l_tableName;
} else {
int id = -1;
msg = "UUID changed on table " + l_tableName + " from " + p_UUID_From + " to " + p_UUID_To;
Expand Down Expand Up @@ -144,7 +144,7 @@ protected String doIt() throws Exception {
// convert ID
int cnt = updID(l_tableName, idCol, true);
if (cnt <= 0) {
msg = "@Error@: ID " + p_ID_From + " not found on table " + l_tableName;
msg = "@Error@ ID " + p_ID_From + " not found on table " + l_tableName;
} else {
msg = "ID changed on table " + l_tableName + " from " + p_ID_From + " to " + p_ID_To;
addBufferLog(0, null, null, msg, p_AD_Table_ID, p_ID_To);
Expand Down
1 change: 0 additions & 1 deletion org.adempiere.base/src/org/compiere/model/MSysConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class SystemProperties {
private static final String org_idempiere_db_debug_convert = "org.idempiere.db.debug.convert";
private static final String org_idempiere_db_debug_filter = "org.idempiere.db.debug.filter";
private static final String org_idempiere_FileLogPrefix = "org.idempiere.FileLogPrefix";
private static final String org_idempiere_FullExceptionTraceInLog = "org.idempiere.FullExceptionTraceInLog";
private static final String org_idempiere_postgresql_URLParameters = "org.idempiere.postgresql.URLParameters";
private static final String org_idempiere_po_useOptimisticLocking = "org.idempiere.po.useOptimisticLocking";
private static final String PostgreSQLNative = "PostgreSQLNative";
Expand Down Expand Up @@ -277,4 +278,11 @@ public static boolean isTraceNullTrxConnection() {
return "true".equals(System.getProperty(TRACE_NULL_TRX_CONNECTION));
}

/**
* org_idempiere_FullExceptionTraceInLog=true to not cut trace log
* @return
*/
public static boolean isFullExceptionTraceInLog() {
return "true".equals(System.getProperty(org_idempiere_FullExceptionTraceInLog));
}
}
46 changes: 39 additions & 7 deletions org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.logging.Level;

import org.compiere.model.GridField;
import org.compiere.model.I_AD_PrintFormatItem;
import org.compiere.model.MRole;
import org.compiere.model.X_AD_PrintFormatItem;
import org.compiere.util.CCache;
Expand All @@ -49,9 +50,9 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem implements ImmutableP
/**
* generated serial id
*/
private static final long serialVersionUID = 2950704375830865408L;
private static final long serialVersionUID = -971583490682254014L;

/**
/**
* UUID based Constructor
* @param ctx Context
* @param AD_PrintFormatItem_UU UUID key
Expand Down Expand Up @@ -179,20 +180,51 @@ public MPrintFormatItem(Properties ctx, MPrintFormatItem copy, String trxName)

private static CLogger s_log = CLogger.getCLogger (MPrintFormatItem.class);

public String getPrintName (boolean useNameWhenEmpty) {
String printName = getPrintName();
if (Util.isEmpty(printName, true) && useNameWhenEmpty) {
return getName();
}

return printName;
}
/**
* Get print name with language
* Get print name with language<br/>
* Order of alternative values when encountering empty value<br/>
* <ul>
* <li>print name with language</li>
* <li>print name</li>
* <li>name with language</li>
* <li>name</li>
* </ul>
* @param language language - ignored if IsMultiLingualDocument not 'Y'
* @return print name
*/
public String getPrintName (Language language)
{
if (language == null || Env.isBaseLanguage(language, "AD_PrintFormatItem"))
return getPrintName();
return getPrintName(true);
loadTranslations();
String retValue = (String)m_translationLabel.get(language.getAD_Language());
if (retValue == null || retValue.length() == 0)
return getPrintName();
return retValue;
String altValue = retValue;

// try print name on base language
if (Util.isEmpty(altValue, true))
altValue = getPrintName();

// try translate of name
if (Util.isEmpty(altValue, true))
altValue = get_Translation(I_AD_PrintFormatItem.COLUMNNAME_Name, language.getAD_Language());

// try name on base language
if (Util.isEmpty(altValue, true))
altValue = getName();

// put value to cache
if (Util.isEmpty(retValue, true) && !Util.isEmpty(altValue, true))
m_translationLabel.put(language.getAD_Language(), altValue);

return altValue;
} // getPrintName

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ private PrintElement layoutTable (MPrintFormat format, PrintData printData,
}
columnHeader[col] = new ValueNamePair(item.getColumnName(),
item.getPrintName(format.getLanguage()));
colPositions.put(item.getPrintName(), col);
colPositions.put(item.getPrintName(true), col);
columnMaxWidth[col] = item.getMaxWidth();
fixedWidth[col] = (columnMaxWidth[col] != 0 && item.isFixedWidth());
colSuppressRepeats[col] = item.isSuppressRepeats();
Expand Down
4 changes: 2 additions & 2 deletions org.adempiere.base/src/org/compiere/process/SvrProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,15 @@ private boolean process()
@SuppressWarnings("unchecked")
List<String> errorsBP = (List<String>) eventBP.getProperty(IEventManager.EVENT_ERROR_MESSAGES);
if (errorsBP != null && !errorsBP.isEmpty()) {
msg = "@Error@:" + errorsBP.get(0);
msg = "@Error@" + errorsBP.get(0);
} else {
msg = doIt();
if (msg != null && ! msg.startsWith("@Error@")) {
Event eventAP = sendProcessEvent(IEventTopics.AFTER_PROCESS);
@SuppressWarnings("unchecked")
List<String> errorsAP = (List<String>) eventAP.getProperty(IEventManager.EVENT_ERROR_MESSAGES);
if (errorsAP != null && !errorsAP.isEmpty()) {
msg = "@Error@:" + errorsAP.get(0);
msg = "@Error@" + errorsAP.get(0);
}
}
}
Expand Down
5 changes: 1 addition & 4 deletions org.adempiere.base/src/org/compiere/util/CLogFormatter.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
*****************************************************************************/
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 @@ -27,7 +25,6 @@
import java.util.logging.Level;
import java.util.logging.LogRecord;

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

/**
Expand Down Expand Up @@ -303,7 +300,7 @@ private static void fillExceptionTrace (StringBuffer sb, String hdr, Throwable t
if (adempiereTrace)
sb.append("\tat ").append(trace[i]).append(NL);
}
else if (!MSysConfig.getBooleanValue(FULL_EXCEPTION_TRACE_IN_LOG, false) && (i > 20 || (i > 10 && adempiereTraceNo > 8)))
else if (!SystemProperties.isFullExceptionTraceInLog() && (i > 20 || (i > 10 && adempiereTraceNo > 8)))
break;
else
sb.append("\tat ").append(trace[i]).append(NL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private void installPackages(String folders) {
addLog(Level.WARNING, msg);
if (getProcessInfo() != null) {
getProcessInfo().setError(true);
getProcessInfo().setSummary("@Error@: " + msg);
getProcessInfo().setSummary("@Error@ " + msg);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.logging.Level;

import org.adempiere.base.Core;
import org.adempiere.webui.apps.AEnv;
import org.adempiere.webui.window.ZkReportViewer;
import org.compiere.print.ReportEngine;
import org.compiere.tools.FileUtil;
Expand Down Expand Up @@ -91,7 +90,7 @@ public AMedia renderMedia(ZkReportViewer viewer, boolean export) {
File file = FileUtil.createTempFile(prefix, "."+getFileExtension(), new File(path));
IReportRenderer<IReportRendererConfiguration> renderer = Core.getReportRenderer(getId());
CSVReportRendererConfiguration config = new CSVReportRendererConfiguration()
.setLanguage(AEnv.getLanguage(Env.getCtx()))
.setLanguage(reportEngine.getPrintFormat().getLanguage())
.setOutputFile(file);
renderer.renderReport(reportEngine, config);
return new AMedia(file.getName(), getFileExtension(), getContentType(), file, false);
Expand Down

0 comments on commit 9cceb87

Please sign in to comment.