From 06eec4149412b9761b589bfb5218cedf68c6ad7a Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Fri, 14 Sep 2007 09:21:26 +0000 Subject: [PATCH] FR [ 1724662 ] Support Email should contain model validators info http://sourceforge.net/tracker/index.php?func=detail&aid=1724662&group_id=176962&atid=879335 --- .../compiere/model/ModelValidationEngine.java | 48 +++++++++++++++++++ client/src/org/compiere/apps/ADialog.java | 10 ++-- 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/base/src/org/compiere/model/ModelValidationEngine.java b/base/src/org/compiere/model/ModelValidationEngine.java index 47c34a5052..f70f866fe9 100644 --- a/base/src/org/compiere/model/ModelValidationEngine.java +++ b/base/src/org/compiere/model/ModelValidationEngine.java @@ -26,6 +26,11 @@ import org.compiere.util.*; * * @author Jorg Janke * @version $Id: ModelValidationEngine.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $ + * + * @author Teo Sarca, SC ARHIPAC SERVICE SRL + *
  • FR [ 1670025 ] ModelValidator.afterLoadPreferences will be useful + *
  • BF [ 1679692 ] fireDocValidate doesn't treat exceptions as errors + *
  • FR [ 1724662 ] Support Email should contain model validators info */ public class ModelValidationEngine { @@ -311,6 +316,49 @@ public class ModelValidationEngine return sb.toString(); } // toString + /** + * Create Model Validators Info + * @param sb optional string buffer + * @param ctx context + * @return Model Validators Info + * + * @author Teo Sarca, FR [ 1724662 ] + */ + public StringBuffer getInfoDetail(StringBuffer sb, Properties ctx) { + if (sb == null) + sb = new StringBuffer(); + sb.append("=== ModelValidationEngine ===").append(Env.NL); + sb.append("Validators #").append(m_validators.size()).append(Env.NL); + for (ModelValidator mv : m_validators) { + sb.append(mv.toString()).append(Env.NL); + } + sb.append(Env.NL).append(Env.NL); + // + sb.append("ModelChange #").append(m_modelChangeListeners.size()).append(Env.NL); + Iterator it = m_modelChangeListeners.keySet().iterator(); + while(it.hasNext()) { + String key = it.next(); + ArrayList list = m_modelChangeListeners.get(key); + for (ModelValidator mv : list) { + sb.append(key).append(": ").append(mv.toString()).append(Env.NL); + } + } + sb.append(Env.NL).append(Env.NL); + // + sb.append("DocValidate #").append(m_docValidateListeners.size()).append(Env.NL); + it = m_docValidateListeners.keySet().iterator(); + while(it.hasNext()) { + String key = it.next(); + ArrayList list = m_docValidateListeners.get(key); + for (ModelValidator mv : list) { + sb.append(key).append(": ").append(mv.toString()).append(Env.NL); + } + } + sb.append(Env.NL).append(Env.NL); + // + return sb; + } + /** * After Load Preferences into Context for selected client. * @param ctx context diff --git a/client/src/org/compiere/apps/ADialog.java b/client/src/org/compiere/apps/ADialog.java index b798f668b5..464b306e53 100644 --- a/client/src/org/compiere/apps/ADialog.java +++ b/client/src/org/compiere/apps/ADialog.java @@ -378,10 +378,10 @@ public final class ADialog /************************************************************************* /** - * Create Support EMail - * @param owner owner - * @param subject subkect - * @param message message + * Create Support EMail + * @param owner owner + * @param subject subkect + * @param message message */ public static void createSupportEMail(Dialog owner, String subject, String message) { @@ -393,6 +393,7 @@ public final class ADialog myMessage.append("\n"); CLogMgt.getInfo(myMessage); CLogMgt.getInfoDetail(myMessage, Env.getCtx()); + ModelValidationEngine.get().getInfoDetail(myMessage, Env.getCtx()); // teo_sarca - FR [ 1724662 ] EMailDialog emd = new EMailDialog(owner, Msg.getMsg(Env.getCtx(), "EMailSupport"), @@ -415,6 +416,7 @@ public final class ADialog myMessage.append("\n"); CLogMgt.getInfo(myMessage); CLogMgt.getInfoDetail(myMessage, Env.getCtx()); + ModelValidationEngine.get().getInfoDetail(myMessage, Env.getCtx()); // teo_sarca - FR [ 1724662 ] EMailDialog emd = new EMailDialog(owner, Msg.getMsg(Env.getCtx(), "EMailSupport"),