FR [ 1724662 ] Support Email should contain model validators info

http://sourceforge.net/tracker/index.php?func=detail&aid=1724662&group_id=176962&atid=879335
This commit is contained in:
teo_sarca 2007-09-14 09:21:26 +00:00
parent 7cecbcf3a7
commit 06eec41494
2 changed files with 54 additions and 4 deletions

View File

@ -26,6 +26,11 @@ import org.compiere.util.*;
* *
* @author Jorg Janke * @author Jorg Janke
* @version $Id: ModelValidationEngine.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $ * @version $Id: ModelValidationEngine.java,v 1.2 2006/07/30 00:58:38 jjanke Exp $
*
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>FR [ 1670025 ] ModelValidator.afterLoadPreferences will be useful
* <li>BF [ 1679692 ] fireDocValidate doesn't treat exceptions as errors
* <li>FR [ 1724662 ] Support Email should contain model validators info
*/ */
public class ModelValidationEngine public class ModelValidationEngine
{ {
@ -311,6 +316,49 @@ public class ModelValidationEngine
return sb.toString(); return sb.toString();
} // 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<String> it = m_modelChangeListeners.keySet().iterator();
while(it.hasNext()) {
String key = it.next();
ArrayList<ModelValidator> 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<ModelValidator> 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. * After Load Preferences into Context for selected client.
* @param ctx context * @param ctx context

View File

@ -378,10 +378,10 @@ public final class ADialog
/************************************************************************* /*************************************************************************
/** /**
* Create Support EMail * Create Support EMail
* @param owner owner * @param owner owner
* @param subject subkect * @param subject subkect
* @param message message * @param message message
*/ */
public static void createSupportEMail(Dialog owner, String subject, String message) public static void createSupportEMail(Dialog owner, String subject, String message)
{ {
@ -393,6 +393,7 @@ public final class ADialog
myMessage.append("\n"); myMessage.append("\n");
CLogMgt.getInfo(myMessage); CLogMgt.getInfo(myMessage);
CLogMgt.getInfoDetail(myMessage, Env.getCtx()); CLogMgt.getInfoDetail(myMessage, Env.getCtx());
ModelValidationEngine.get().getInfoDetail(myMessage, Env.getCtx()); // teo_sarca - FR [ 1724662 ]
EMailDialog emd = new EMailDialog(owner, EMailDialog emd = new EMailDialog(owner,
Msg.getMsg(Env.getCtx(), "EMailSupport"), Msg.getMsg(Env.getCtx(), "EMailSupport"),
@ -415,6 +416,7 @@ public final class ADialog
myMessage.append("\n"); myMessage.append("\n");
CLogMgt.getInfo(myMessage); CLogMgt.getInfo(myMessage);
CLogMgt.getInfoDetail(myMessage, Env.getCtx()); CLogMgt.getInfoDetail(myMessage, Env.getCtx());
ModelValidationEngine.get().getInfoDetail(myMessage, Env.getCtx()); // teo_sarca - FR [ 1724662 ]
EMailDialog emd = new EMailDialog(owner, EMailDialog emd = new EMailDialog(owner,
Msg.getMsg(Env.getCtx(), "EMailSupport"), Msg.getMsg(Env.getCtx(), "EMailSupport"),