Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
You can subscribe to this list here.
2002 |
Jan
|
Feb
(239) |
Mar
(153) |
Apr
(426) |
May
(146) |
Jun
(207) |
Jul
(217) |
Aug
(292) |
Sep
(261) |
Oct
(343) |
Nov
(372) |
Dec
(468) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(378) |
Feb
(136) |
Mar
(243) |
Apr
(110) |
May
(166) |
Jun
(80) |
Jul
(6) |
Aug
(168) |
Sep
(379) |
Oct
(98) |
Nov
(132) |
Dec
(34) |
2004 |
Jan
(115) |
Feb
(161) |
Mar
(283) |
Apr
(185) |
May
(67) |
Jun
(71) |
Jul
(46) |
Aug
(52) |
Sep
(65) |
Oct
(39) |
Nov
(45) |
Dec
(96) |
2005 |
Jan
(58) |
Feb
(71) |
Mar
(36) |
Apr
(37) |
May
(74) |
Jun
(16) |
Jul
(54) |
Aug
(99) |
Sep
(111) |
Oct
(81) |
Nov
(42) |
Dec
(27) |
2006 |
Jan
(162) |
Feb
(30) |
Mar
(156) |
Apr
(122) |
May
(132) |
Jun
(135) |
Jul
(172) |
Aug
(170) |
Sep
(307) |
Oct
(322) |
Nov
(181) |
Dec
(349) |
2007 |
Jan
(390) |
Feb
(436) |
Mar
(208) |
Apr
(214) |
May
(833) |
Jun
(320) |
Jul
(296) |
Aug
(377) |
Sep
(131) |
Oct
(179) |
Nov
(261) |
Dec
(94) |
2008 |
Jan
(337) |
Feb
(414) |
Mar
(275) |
Apr
(410) |
May
(548) |
Jun
(217) |
Jul
(290) |
Aug
(160) |
Sep
(115) |
Oct
(180) |
Nov
(231) |
Dec
(138) |
2009 |
Jan
(117) |
Feb
(135) |
Mar
(203) |
Apr
(244) |
May
(173) |
Jun
(177) |
Jul
(167) |
Aug
(154) |
Sep
(269) |
Oct
(208) |
Nov
(238) |
Dec
(153) |
2010 |
Jan
(171) |
Feb
(197) |
Mar
(84) |
Apr
(103) |
May
(92) |
Jun
(103) |
Jul
(117) |
Aug
(132) |
Sep
(334) |
Oct
(240) |
Nov
(139) |
Dec
(83) |
2011 |
Jan
(92) |
Feb
(78) |
Mar
(44) |
Apr
(4) |
May
(19) |
Jun
(4) |
Jul
(5) |
Aug
(1) |
Sep
(1) |
Oct
(6) |
Nov
(12) |
Dec
(1) |
2012 |
Jan
|
Feb
(15) |
Mar
(9) |
Apr
(1) |
May
(27) |
Jun
(3) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(9) |
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
|
|
1
(26) |
2
(2) |
3
|
4
|
5
(3) |
6
(6) |
7
(2) |
8
(7) |
9
|
10
(1) |
11
(1) |
12
(3) |
13
(1) |
14
(1) |
15
(1) |
16
|
17
|
18
|
19
(11) |
20
(220) |
21
(19) |
22
(9) |
23
(14) |
24
|
25
(18) |
26
(7) |
27
(13) |
28
(7) |
29
|
30
|
From: Camille Troillard <tuscland@us...> - 2002-11-28 22:52:00
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail In directory sc8-pr-cvs1:/tmp/cvs-serv31219 Modified Files: ERJavaMail.java Log Message: Simplified smtp host and Properties settings. Index: ERJavaMail.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERJavaMail.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ERJavaMail.java 28 Nov 2002 10:57:37 -0000 1.8 --- ERJavaMail.java 28 Nov 2002 22:51:58 -0000 1.9 *************** *** 7,19 **** package er.javamail; - import er.extensions.*; - import java.util.*; - import org.apache.oro.text.regex.*; - import com.webobjects.foundation.*; import com.webobjects.eocontrol.EOEnterpriseObject; public class ERJavaMail extends ERXFrameworkPrincipal { ! public static final ERXLogger log = ERXLogger.getERXLogger (ERJavaMail.class); static { --- 7,25 ---- package er.javamail; import com.webobjects.eocontrol.EOEnterpriseObject; + import er.extensions.ERXFrameworkPrincipal; + import er.extensions.ERXLogger; + import er.extensions.ERXProperties; + import er.extensions.ERXValidationFactory; + import org.apache.oro.text.regex.MalformedPatternException; + import org.apache.oro.text.regex.Pattern; + import org.apache.oro.text.regex.Perl5Compiler; + import org.apache.oro.text.regex.Perl5Matcher; + import java.util.Properties; public class ERJavaMail extends ERXFrameworkPrincipal { ! ! private static final ERXLogger log = ERXLogger.getERXLogger (ERJavaMail.class); static { *************** *** 30,34 **** // Mail Validation ivars ! protected static final String EMAIL_VALIDATION_PATTERN = "^[A-Za-z0-9_\\-]+([.][A-Za-z0-9_\\-]+)*[@][A-Za-z0-9_\\-]+([.][A-Za-z0-9_\\-]+)+$"; protected Perl5Matcher _matcher; protected Pattern _pattern = null; --- 36,41 ---- // Mail Validation ivars ! protected static final String EMAIL_VALIDATION_PATTERN = ! "^[A-Za-z0-9_\\-]+([.][A-Za-z0-9_\\-]+)*[@][A-Za-z0-9_\\-]+([.][A-Za-z0-9_\\-]+)+$"; protected Perl5Matcher _matcher; protected Pattern _pattern = null; *************** *** 38,90 **** log.debug ("Initializing Framework."); ! Perl5Compiler compiler = new Perl5Compiler (); ! _matcher = new Perl5Matcher (); ! try { ! _pattern = compiler.compile (EMAIL_VALIDATION_PATTERN); ! } catch (MalformedPatternException e) { ! throw new RuntimeException ("The compilation of the ORO Regexp pattern failed in ERJavaMail!"); ! } ! this.initializeFrameworkFromSystemProperties (); ! log.info ("ERJavaMail: finished initialization"); } public void initializeFrameworkFromSystemProperties () { ! // Admin Email ! String adminEmail = System.getProperty ("er.javamail.adminEmail"); ! if ((adminEmail == null) || (adminEmail.length () == 0)) throw new RuntimeException ("ERJavaMail: the property er.javamail.adminEmail is not specified!"); this.setAdminEmail (adminEmail); ! log.debug ("er.javamail.adminEmail: " + _adminEmail); ! // JavaMail Debug Enabled ? ! boolean debug = ERXProperties.booleanForKey ("er.javamail.debugEnabled"); this.setDebugEnabled (debug); ! log.debug ("er.javamail.debugEnabled: " + debug); ! // Centralize mails ? boolean centralize = ERXProperties.booleanForKey ("er.javamail.centralize"); ! this.setCentralize (centralize); ! log.debug ("er.javamail.centralize: " + centralize); ! // Time to wait when sender if overflowed ! int milliswait = ERXProperties.intForKey ("er.javamail.milliSecondsWaitIfSenderOverflowed"); if (milliswait > 1000) ! this.setMilliSecondsWaitIfSenderOverflowed (milliswait); ! log.debug ("er.javamail.milliSecondsWaitIfSenderOverflowed: " + milliswait); ! ! // Smtp host ! String smtpHost = System.getProperty ("er.javamail.smtpHost"); ! if ((smtpHost == null) || (smtpHost.length () == 0)) ! throw new RuntimeException ("ERJavaMail: You must specify a SMTP host for outgoing mail with the property 'er.javamail.smtpHost'"); ! log.debug ("er.javamail.smtpHost: " + smtpHost); ! // With the smtp-host, we can setup the session ! Properties props = new Properties (); ! props.put ("mail.smtp.host", smtpHost); ! this.setDefaultProperties (props); ! javax.mail.Session session = javax.mail.Session.getDefaultInstance (this.defaultProperties (), null); ! this.setDefaultSession (session); // Default X-Mailer header --- 45,88 ---- log.debug ("Initializing Framework."); ! Perl5Compiler compiler = new Perl5Compiler (); ! _matcher = new Perl5Matcher (); ! try { ! _pattern = compiler.compile (EMAIL_VALIDATION_PATTERN); ! } catch (MalformedPatternException e) { ! throw new RuntimeException ("The compilation of the ORO Regexp pattern failed in ERJavaMail!"); ! } ! this.initializeFrameworkFromSystemProperties (); ! log.info ("ERJavaMail: finished initialization"); } public void initializeFrameworkFromSystemProperties () { ! // Admin Email ! String adminEmail = System.getProperty ("er.javamail.adminEmail"); ! if ((adminEmail == null) || (adminEmail.length () == 0)) throw new RuntimeException ("ERJavaMail: the property er.javamail.adminEmail is not specified!"); this.setAdminEmail (adminEmail); ! log.debug ("er.javamail.adminEmail: " + _adminEmail); ! // JavaMail Debug Enabled ? ! boolean debug = ERXProperties.booleanForKey ("er.javamail.debugEnabled"); this.setDebugEnabled (debug); ! log.debug ("er.javamail.debugEnabled: " + debug); ! // Centralize mails ? boolean centralize = ERXProperties.booleanForKey ("er.javamail.centralize"); ! this.setCentralize (centralize); ! log.debug ("er.javamail.centralize: " + centralize); ! // Time to wait when sender if overflowed ! int milliswait = ERXProperties.intForKey ("er.javamail.milliSecondsWaitIfSenderOverflowed"); if (milliswait > 1000) ! this.setMilliSecondsWaitIfSenderOverflowed (milliswait); ! log.debug ("er.javamail.milliSecondsWaitIfSenderOverflowed: " + milliswait); ! // Smtp host ! this.setupSmtpHostSafely (); ! this.setDefaultSession (this.newSession ()); // Default X-Mailer header *************** *** 93,108 **** } ! protected Properties _defaultProperties; ! ! public void setDefaultProperties (Properties javaMailProperties) { ! _defaultProperties = javaMailProperties; ! } ! ! public Properties defaultProperties () { ! return _defaultProperties; } - protected javax.mail.Session _defaultSession; --- 91,111 ---- } + protected void setupSmtpHostSafely () { + // Smtp host + String smtpHost = System.getProperty ("er.javamail.smtpHost"); + if ((smtpHost == null) || (smtpHost.length () == 0)) { + // Try to fail back to default java config + smtpHost = System.getProperty ("mail.smtp.host"); + + if ((smtpHost == null) || (smtpHost.length () == 0)) { + throw new RuntimeException ("ERJavaMail: You must specify a SMTP host for outgoing mail with the property 'er.javamail.smtpHost'"); + } else + System.setProperty ("er.javamail.smtpHost", smtpHost); + } else + System.setProperty ("mail.smtp.host", smtpHost); ! log.debug ("er.javamail.smtpHost: " + smtpHost); } protected javax.mail.Session _defaultSession; *************** *** 123,129 **** } ! /** Return a newly allocated Session object from the default Properties */ public javax.mail.Session newSession () { ! return javax.mail.Session.getInstance (this.defaultProperties ()); } --- 126,132 ---- } ! /** Return a newly allocated Session object from the System Properties */ public javax.mail.Session newSession () { ! return javax.mail.Session.getInstance (System.getProperties ()); } *************** *** 204,209 **** public String validateEmail (EOEnterpriseObject object, String key, String email) { if (email != null) { ! if (!isValidEmail(email)) ! throw ERXValidationFactory.defaultFactory ().createException (object, key, email, "malformedEmail"); } --- 207,213 ---- public String validateEmail (EOEnterpriseObject object, String key, String email) { if (email != null) { ! if (!this.isValidEmail(email)) ! throw ERXValidationFactory.defaultFactory ().createException ! (object, key, email, "malformedEmail"); } *************** *** 217,225 **** return _matcher.matches (email, _pattern); return false; - } - - /** Define a standard ERJavMail exception */ - public static class Exception extends java.lang.Exception { - public Exception (String message) { super (message); } } } --- 221,224 ---- |
From: Camille Troillard <tuscland@us...> - 2002-11-28 22:51:34
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail In directory sc8-pr-cvs1:/tmp/cvs-serv30774 Modified Files: ERMailUtils.java Log Message: Reorganized imports. Set the logger to private. Index: ERMailUtils.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailUtils.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ERMailUtils.java 28 Nov 2002 10:57:37 -0000 1.3 --- ERMailUtils.java 28 Nov 2002 22:51:31 -0000 1.4 *************** *** 7,26 **** package er.javamail; ! import com.webobjects.foundation.*; import com.webobjects.appserver.*; import com.webobjects.eocontrol.*; ! ! import javax.mail.internet.InternetAddress; ! import javax.mail.internet.AddressException; ! import java.util.Enumeration; import er.extensions.ERXLogger; ! import er.extensions.ERXUtilities; public class ERMailUtils extends Object { ! static ERXLogger log = ERXLogger.getERXLogger (ERMailUtils.class); - /** The shared mail deliverer */ private static ERMailDeliveryHTML _sharedDeliverer; --- 7,24 ---- package er.javamail; ! import com.webobjects.appserver.*; import com.webobjects.eocontrol.*; ! import com.webobjects.foundation.*; import er.extensions.ERXLogger; ! import java.util.Enumeration; ! import javax.mail.internet.AddressException; ! import javax.mail.internet.InternetAddress; public class ERMailUtils extends Object { ! private static ERXLogger log = ERXLogger.getERXLogger (ERMailUtils.class); /** The shared mail deliverer */ private static ERMailDeliveryHTML _sharedDeliverer; *************** *** 103,106 **** --- 101,107 ---- while (en.hasMoreElements ()) { String key = (String)en.nextElement (); + + if (log.isDebugEnabled ()) + log.debug ("Setting dictionary value in session"); Object object = dict.objectForKey (key); |
From: Camille Troillard <tuscland@us...> - 2002-11-28 18:37:17
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv11758/er/extensions Modified Files: ERXValidationFactory.java Log Message: Added a condition over log.isDebugEnabled () for performance issues. Index: ERXValidationFactory.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXValidationFactory.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** ERXValidationFactory.java 20 Nov 2002 02:50:48 -0000 1.22 --- ERXValidationFactory.java 28 Nov 2002 18:37:13 -0000 1.23 *************** *** 353,358 **** } ! log.debug("templateForException with entityName: " + entityName + "; property: " + property + "; type: " + type + "; targetLanguage: " + targetLanguage); ! ERXMultiKey k = new ERXMultiKey(new Object[] {entityName, property, type,targetLanguage}); template = (String)_cache.get(k); --- 353,359 ---- } ! if (log.isDebugEnabled ()) ! log.debug("templateForException with entityName: " + entityName + "; property: " + property + "; type: " + type + "; targetLanguage: " + targetLanguage); ! ERXMultiKey k = new ERXMultiKey (new Object[] {entityName, property, type,targetLanguage}); template = (String)_cache.get(k); |
From: David Teran <davidteran@us...> - 2002-11-28 17:53:00
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv14483/Sources/er/extensions Modified Files: ERXCompilerProxy.java Log Message: "1.0" as protocol does not work with WORequest, changed it to "HTTP/1.0" Index: ERXCompilerProxy.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXCompilerProxy.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** ERXCompilerProxy.java 1 Nov 2002 10:14:08 -0000 1.18 --- ERXCompilerProxy.java 28 Nov 2002 17:52:56 -0000 1.19 *************** *** 51,54 **** --- 51,56 ---- static boolean _raiseOnError = false; + static private boolean initialized = false; + /** Holds the files to watch. */ *************** *** 146,149 **** --- 148,155 ---- */ public void initialize() { + if (initialized) { + return; + } + initialized = true; if(WOApplication.application()!=null && WOApplication.application().isCachingEnabled()) { log.info("I assume this is deployment mode, rapid-turnaround mode is disabled"); *************** *** 323,327 **** } if(WOComponent.class.isAssignableFrom(class_)) { ! WOContext context = new WOContext(new WORequest("GET", "/", "1.0", null, null, null)); WOApplication.application().pageWithName(cacheEntry.className(), context)._componentDefinition().componentInstanceInContext(context); // mark an instance as locked } --- 329,333 ---- } if(WOComponent.class.isAssignableFrom(class_)) { ! WOContext context = new WOContext(new WORequest("GET", "/", "HTTP/1.1", null, null, null)); WOApplication.application().pageWithName(cacheEntry.className(), context)._componentDefinition().componentInstanceInContext(context); // mark an instance as locked } *************** *** 627,629 **** return aurl; } ! } \ No newline at end of file --- 633,635 ---- return aurl; } ! } |
From: Anjo Krank <anjo@us...> - 2002-11-28 12:24:13
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv24981 Modified Files: ERXApplication.java Log Message: allowing for overriding reportException() to return a different error page (and send mails or whatever) Index: ERXApplication.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXApplication.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ERXApplication.java 27 Nov 2002 22:57:11 -0000 1.30 --- ERXApplication.java 28 Nov 2002 12:24:09 -0000 1.31 *************** *** 330,333 **** --- 330,350 ---- return extraInfo; } + + + /** + * Reports an exception. This method only logs the error and could be + * overriden to return a valid error page. + * @param exception to be reported + * @param extraInfo dictionary of extra information about what was + * happening when the exception was thrown. + * @return a valid response to display or null. In that case the superclasses + * {@link handleException(Exception, NSDictionary) is called + */ + public WOResponse reportException(Throwable exception, NSDictionary extraInfo) { + log.error("Exception caught, " + exception.getMessage() + " extra info: " + + extraInfo, exception instanceof NSForwardException ? + ((NSForwardException) exception).originalException() : exception); + return null; + } /** *************** *** 345,353 **** NSDictionary extraInfo = extraInformationForExceptionInContext(exception, context); ! log.error("Exception caught, " + exception.getMessage() + " extra info: " ! + extraInfo, exception instanceof NSForwardException ? ! ((NSForwardException) exception).originalException() : exception); ! ! return super.handleException(exception, context); } --- 362,369 ---- NSDictionary extraInfo = extraInformationForExceptionInContext(exception, context); ! WOResponse response = reportException(exception, extraInfo); ! if(response == null) ! response = super.handleException(exception, context); ! return response; } |
From: Camille Troillard <tuscland@us...> - 2002-11-28 10:57:40
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail In directory sc8-pr-cvs1:/tmp/cvs-serv772/Sources/er/javamail Modified Files: ERJavaMail.java ERMailDelivery.java ERMailDeliveryComponentBased.java ERMailDeliveryHTML.java ERMailDeliveryJapanesePlainText.java ERMailDeliveryPlainText.java ERMailDeliveryWOComponentPlainText.java ERMailSender.java ERMailUtils.java Log Message: Cleaned the whole framework and corrected encoding inconsistencies. Added the ability to save session state in ERMailDeliveryComponentBased for future use in a mail (does not seems to work, though). Index: ERJavaMail.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERJavaMail.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ERJavaMail.java 26 Nov 2002 18:05:34 -0000 1.7 --- ERJavaMail.java 28 Nov 2002 10:57:37 -0000 1.8 *************** *** 40,44 **** Perl5Compiler compiler = new Perl5Compiler (); _matcher = new Perl5Matcher (); ! try { _pattern = compiler.compile (EMAIL_VALIDATION_PATTERN); --- 40,44 ---- Perl5Compiler compiler = new Perl5Compiler (); _matcher = new Perl5Matcher (); ! try { _pattern = compiler.compile (EMAIL_VALIDATION_PATTERN); *************** *** 46,50 **** throw new RuntimeException ("The compilation of the ORO Regexp pattern failed in ERJavaMail!"); } ! this.initializeFrameworkFromSystemProperties (); log.info ("ERJavaMail: finished initialization"); --- 46,50 ---- throw new RuntimeException ("The compilation of the ORO Regexp pattern failed in ERJavaMail!"); } ! this.initializeFrameworkFromSystemProperties (); log.info ("ERJavaMail: finished initialization"); *************** *** 86,94 **** this.setDefaultProperties (props); javax.mail.Session session = javax.mail.Session.getDefaultInstance (this.defaultProperties (), null); ! this.setDefaultSession (session); ! // Default X-Mailer header ! this.setDefaultXMailerHeader (System.getProperty ("er.javamail.XMailerHeader")); ! log.debug ("er.javamail.smtpHost: " + smtpHost); } --- 86,94 ---- this.setDefaultProperties (props); javax.mail.Session session = javax.mail.Session.getDefaultInstance (this.defaultProperties (), null); ! this.setDefaultSession (session); ! // Default X-Mailer header ! this.setDefaultXMailerHeader (System.getProperty ("er.javamail.XMailerHeader")); ! log.debug ("er.javamail.XMailHeader: " + this.defaultXMailerHeader ()); } *************** *** 115,119 **** return _defaultSession; } ! /** Return a newly allocated Session object from the given Properties */ public javax.mail.Session newSession (Properties props) { --- 115,119 ---- return _defaultSession; } ! /** Return a newly allocated Session object from the given Properties */ public javax.mail.Session newSession (Properties props) { *************** *** 142,146 **** } ! protected boolean _debugEnabled = true; --- 142,146 ---- } ! protected boolean _debugEnabled = true; *************** *** 154,175 **** ! /** This property sets the default header for the X-Mailer property */ ! protected String _defaultXMailerHeader = null; ! /** ! * Gets the default X-Mailer header to use for * sending mails. Pulls the value out of the * property: er.javamail.XMailerHeader * @return default X-Mailer header */ ! public String defaultXMailerHeader () { ! return _defaultXMailerHeader; ! } - public void setDefaultXMailerHeader (String header) { - _defaultXMailerHeader = header; - } - /** Used to send mail to adminEmail only. Useful for debugging issues */ protected boolean _centralize = true; --- 154,175 ---- ! /** This property sets the default header for the X-Mailer property */ ! protected String _defaultXMailerHeader = null; ! /** ! * Gets the default X-Mailer header to use for * sending mails. Pulls the value out of the * property: er.javamail.XMailerHeader * @return default X-Mailer header */ ! public String defaultXMailerHeader () { ! return _defaultXMailerHeader; ! } ! ! public void setDefaultXMailerHeader (String header) { ! _defaultXMailerHeader = header; ! } /** Used to send mail to adminEmail only. Useful for debugging issues */ protected boolean _centralize = true; *************** *** 198,205 **** // MAIL VALIDATION /** Validates an enterprise object's attribute (accessed via key). ! @param object the object to be validated ! @param key the attribute's name ! @param email the email value ! @return the email if correct */ public String validateEmail (EOEnterpriseObject object, String key, String email) { if (email != null) { --- 198,205 ---- // MAIL VALIDATION /** Validates an enterprise object's attribute (accessed via key). ! @param object the object to be validated ! @param key the attribute's name ! @param email the email value ! @return the email if correct */ public String validateEmail (EOEnterpriseObject object, String key, String email) { if (email != null) { Index: ERMailDelivery.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailDelivery.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ERMailDelivery.java 26 Nov 2002 18:05:35 -0000 1.4 --- ERMailDelivery.java 28 Nov 2002 10:57:37 -0000 1.5 *************** *** 17,20 **** --- 17,21 ---- import com.webobjects.foundation.NSArray; + import com.webobjects.foundation.NSData; import com.webobjects.foundation.NSForwardException; import com.webobjects.foundation.NSMutableArray; *************** *** 49,53 **** public abstract class ERMailDelivery { ! static ERXLogger log = ERXLogger.getERXLogger (ERMailDelivery.class); /** JavaMail session */ --- 50,54 ---- public abstract class ERMailDelivery { ! private static ERXLogger log = ERXLogger.getERXLogger (ERMailDelivery.class); /** JavaMail session */ *************** *** 70,74 **** public static String callBackMethodName = null; ! public static String DefaultCharset = "iso-8859-1"; /** callbackObject to refer to in the calling program */ --- 71,76 ---- public static String callBackMethodName = null; ! public static String DefaultCharset = "ISO-8859-1"; ! public String _charset = DefaultCharset; /** callbackObject to refer to in the calling program */ *************** *** 81,84 **** --- 83,94 ---- } + public String charset () { + return _charset; + } + + public void setCharset (String charset) { + _charset = charset; + } + protected javax.mail.Session session () { return _session; *************** *** 192,196 **** String encoded = null; try { ! encoded = MimeUtility.encodeText (subject, DefaultCharset, null); } catch (Exception e) { encoded = subject; --- 202,206 ---- String encoded = null; try { ! encoded = MimeUtility.encodeText (subject, charset(), !charset().equals(DefaultCharset) ? "B" : null); } catch (Exception e) { encoded = subject; *************** *** 200,204 **** /** ! * Sets the X-Mailer header for the message. Useful for tracking * which mailers are sending messages. * @param xMailer value to set --- 210,214 ---- /** ! * Sets the X-Mailer header for the message. Useful for tracking * which mailers are sending messages. * @param xMailer value to set *************** *** 209,213 **** /** ! * Gets the X-Mailer header set on the * MimeMessage. * @return X-Mailer header if it is set --- 219,223 ---- /** ! * Gets the X-Mailer header set on the * MimeMessage. * @return X-Mailer header if it is set *************** *** 215,223 **** public String xMailerHeader() throws MessagingException { String[] headers = this.mimeMessage ().getHeader ("X-Mailer"); ! return headers.length > 0 ? headers[0] : null; } /** ! * Builds an ERMessage for the current MimeMessage. * @return ERMessage for the current MimeMessage. */ --- 225,233 ---- public String xMailerHeader() throws MessagingException { String[] headers = this.mimeMessage ().getHeader ("X-Mailer"); ! return headers != null && headers.length > 0 ? headers[0] : null; } /** ! * Builds an ERMessage for the current MimeMessage. * @return ERMessage for the current MimeMessage. */ *************** *** 230,234 **** /** ! * Sends the mail immediately. The message is put in a FIFO queue managed * by a static threaded inner class */ --- 240,244 ---- /** ! * Sends the mail immediately. The message is put in a FIFO queue managed * by a static threaded inner class */ *************** *** 236,326 **** try { sendMail (false); ! } catch (ERMailSender.ForwardException e) { ! log.warn ("Sending mail in a non-blocking manner and a forward exception was thrown: " ! + ERXUtilities.stackTrace (e)); } } /** ! * Method used to construct a MimeMessage and then send * it. This method can be specified to block until the * message is sent or to add the message to a queue and have * a callback object handle any exceptions that happen. * If sending is blocking then any exception thrown will be ! * wrapped in a general {@link ERMailSender.ForwardException ForwardException}. * @param shouldBlock boolean to indicate if the message should be * added to a queue or sent directly. */ ! public void sendMail (boolean shouldBlock) throws ERMailSender.ForwardException { ! try { ! // add the current message to the message stack ! boolean mailAccepted = false; ! ! this.finishMessagePreparation (); ! ! while (!mailAccepted) { ! this.mimeMessage ().setSentDate (new Date ()); ! try { ! ERMailSender.sharedMailSender ().sendMessage (this.buildMessage (), shouldBlock); ! mailAccepted = true; ! } catch (ERMailSender.SizeOverflowException e) { ! // The mail sender is overflowed, we need to wait try { ! // Ask the current thread to stop computing for a little while ! Thread.currentThread ().sleep (ERJavaMail.sharedInstance ().milliSecondsWaitIfSenderOverflowed ()); ! } catch (InterruptedException ie) { ! log.warn ("Caught InterruptedException in ERMailDelivery:"); ! log.warn (ERXUtilities.stackTrace (ie)); } ! } catch (ERMailSender.Exception e) { ! log.warn ("ERMailSender.Exception exception caught, re-throwing exception."); ! throw new ERMailSender.ForwardException (e); ! } ! } ! } catch (MessagingException e) { ! log.warn ("MessagingException exception caught, re-throwing exception."); ! throw new ERMailSender.ForwardException (e); ! } finally { ! this.setMimeMessage (null); ! } } protected void finishMessagePreparation () throws MessagingException { ! DataHandler messageDataHandler = messageDataHandler = this.prepareMail (); ! // Add all the attachements to the javamail message ! if (this.attachments ().count () > 0) { ! // Create a Multipart that will hold the prepared multipart and the attachments ! MimeMultipart multipart = new MimeMultipart (); ! // Create the main body part ! BodyPart mainBodyPart = new MimeBodyPart (); ! mainBodyPart.setDataHandler (messageDataHandler); ! // add the main body part to the content of the message ! multipart.addBodyPart (mainBodyPart); ! // add each attachments to the former multipart ! Enumeration en = this.attachments ().objectEnumerator (); ! while (en.hasMoreElements ()) { ! ERMailAttachment attachment = (ERMailAttachment)en.nextElement (); ! BodyPart bp = attachment.getBodyPart (); ! bp.setDisposition (Part.ATTACHMENT); ! multipart.addBodyPart (bp); ! } ! this.mimeMessage ().setContent (multipart); ! } else { ! this.mimeMessage ().setDataHandler (messageDataHandler); ! } ! // If the xMailer property has not been set, check if one has been provided ! // in the System properties ! if ((this.xMailerHeader () == null) && ! (ERJavaMail.sharedInstance ().defaultXMailerHeader () != null)) ! this.setXMailerHeader (ERJavaMail.sharedInstance ().defaultXMailerHeader ()); ! ! this.mimeMessage ().saveChanges (); } --- 246,340 ---- try { sendMail (false); ! } catch (NSForwardException e) { ! log.warn ("Sending mail in a non-blocking manner and a forward exception was thrown.", e); } } /** ! * Method used to construct a MimeMessage and then send * it. This method can be specified to block until the * message is sent or to add the message to a queue and have * a callback object handle any exceptions that happen. * If sending is blocking then any exception thrown will be ! * wrapped in a general {@link NSForwardException}. * @param shouldBlock boolean to indicate if the message should be * added to a queue or sent directly. */ ! public void sendMail (boolean shouldBlock) { ! try { ! this.finishMessagePreparation (); ! ERMailSender sender = ERMailSender.sharedMailSender (); ! ERMessage message = this.buildMessage (); ! if (shouldBlock) ! sender.sendMessageNow (message); ! else { ! // add the current message to the message stack ! boolean mailAccepted = false; ! while (!mailAccepted) { try { ! sender.sendMessageDeffered (message); ! mailAccepted = true; ! } catch (ERMailSender.SizeOverflowException e) { ! // The mail sender is overflowed, we need to wait ! try { ! // Ask the current thread to stop ! // computing for a little while. ! // Here, we make the assumption that ! // the current thread is the one that ! // feeds the ERMailSender. ! Thread.currentThread ().sleep ! (ERJavaMail.sharedInstance ().milliSecondsWaitIfSenderOverflowed ()); ! } catch (InterruptedException ie) { ! log.warn ("Caught InterruptedException.", ie); ! } } ! } ! } ! } catch (MessagingException e) { ! log.warn ("MessagingException exception caught, re-throwing exception.", e); ! throw new NSForwardException (e); ! } finally { ! this.setMimeMessage (null); ! } } protected void finishMessagePreparation () throws MessagingException { ! DataHandler messageDataHandler = messageDataHandler = this.prepareMail (); ! // Add all the attachements to the javamail message ! if (this.attachments ().count () > 0) { ! // Create a Multipart that will hold the prepared multipart and the attachments ! MimeMultipart multipart = new MimeMultipart (); ! // Create the main body part ! BodyPart mainBodyPart = new MimeBodyPart (); ! mainBodyPart.setDataHandler (messageDataHandler); ! // add the main body part to the content of the message ! multipart.addBodyPart (mainBodyPart); ! // add each attachments to the former multipart ! Enumeration en = this.attachments ().objectEnumerator (); ! while (en.hasMoreElements ()) { ! ERMailAttachment attachment = (ERMailAttachment)en.nextElement (); ! BodyPart bp = attachment.getBodyPart (); ! bp.setDisposition (Part.ATTACHMENT); ! multipart.addBodyPart (bp); ! } ! this.mimeMessage ().setContent (multipart); ! } else { ! this.mimeMessage ().setDataHandler (messageDataHandler); ! } ! // If the xMailer property has not been set, check if one has been provided ! // in the System properties ! if ((this.xMailerHeader () == null) && ! (ERJavaMail.sharedInstance ().defaultXMailerHeader () != null)) ! this.setXMailerHeader (ERJavaMail.sharedInstance ().defaultXMailerHeader ()); ! ! this.mimeMessage ().setSentDate (new Date ()); ! this.mimeMessage ().saveChanges (); } *************** *** 328,343 **** private void setAddresses (NSArray addressesArray, Message.RecipientType type) throws MessagingException, AddressException { ! InternetAddress [] addresses = null; ! ! if (!ERJavaMail.sharedInstance ().centralize ()) ! addresses = ERMailUtils.convertNSArrayToInternetAddresses (addressesArray); ! else ! addresses = new InternetAddress [] { new InternetAddress (ERJavaMail.sharedInstance ().adminEmail ()) }; ! this.mimeMessage ().setRecipients (type, addresses); ! } /** ! * Abstract method called by subclasses for doing pre-processing before sending the mail. * @return the multipart used to put in the mail. */ --- 342,357 ---- private void setAddresses (NSArray addressesArray, Message.RecipientType type) throws MessagingException, AddressException { ! InternetAddress [] addresses = null; ! if (!ERJavaMail.sharedInstance ().centralize ()) ! addresses = ERMailUtils.convertNSArrayToInternetAddresses (addressesArray); ! else ! addresses = new InternetAddress [] { new InternetAddress (ERJavaMail.sharedInstance ().adminEmail ()) }; + this.mimeMessage ().setRecipients (type, addresses); + } + /** ! * Abstract method called by subclasses for doing pre-processing before sending the mail. * @return the multipart used to put in the mail. */ Index: ERMailDeliveryComponentBased.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailDeliveryComponentBased.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ERMailDeliveryComponentBased.java 25 Nov 2002 18:20:54 -0000 1.1 --- ERMailDeliveryComponentBased.java 28 Nov 2002 10:57:37 -0000 1.2 *************** *** 18,21 **** --- 18,27 ---- protected WOComponent _component; + /** Variable that stores the state of the session. + In the case the component was instanciated with + ERMailUtils.instanciatePage, the session may be new and hence, + would lack its dictionary properties. */ + protected NSDictionary _sessionDictionary = NSDictionary.EmptyDictionary; + /** Sets the WOComponent used to render the HTML message. @deprecated use setComponent instead.*/ *************** *** 32,34 **** --- 38,63 ---- return _component; } + + /** Accessor for the sessionDictionary property */ + public NSDictionary sessionDictionary () { + return _sessionDictionary; + } + + /** Accessor for the sessionDictionary property */ + public void setSessionDictionary (NSDictionary dict) { + _sessionDictionary = dict; + } + + /** Generates the output string used in messages */ + protected String componentContentString () { + WOContext context = this.component ().context (); + + // CHECKME: It's probably not a good idea to do this here + // since the context could also have been generating relative URLs + // unless the context is created from scratch + context._generateCompleteURLs (); + WOMessage response = this.component ().generateResponse (); + return response.contentString (); + } + } Index: ERMailDeliveryHTML.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailDeliveryHTML.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ERMailDeliveryHTML.java 25 Nov 2002 18:20:54 -0000 1.4 --- ERMailDeliveryHTML.java 28 Nov 2002 10:57:37 -0000 1.5 *************** *** 26,39 **** /** Plain text preamble set in top of HTML source so that non-HTML compliant mail readers can at least display this message. */ ! private String hiddenPlainTextContent = ""; /** True if this the current message has a plain text preamble. */ ! private boolean hasHiddenPlainTextContent = false; /** Sets the Plain text preamble that will be displayed set in top of HTML source. Non-HTML compliant mail readers can at least display this message. */ public void setHiddenPlainTextContent (String content) { ! hiddenPlainTextContent = content + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; ! hasHiddenPlainTextContent = true; } --- 26,39 ---- /** Plain text preamble set in top of HTML source so that non-HTML compliant mail readers can at least display this message. */ ! private String _hiddenPlainTextContent = ""; /** True if this the current message has a plain text preamble. */ ! private boolean _hasHiddenPlainTextContent = false; /** Sets the Plain text preamble that will be displayed set in top of HTML source. Non-HTML compliant mail readers can at least display this message. */ public void setHiddenPlainTextContent (String content) { ! _hiddenPlainTextContent = content + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; ! _hasHiddenPlainTextContent = true; } *************** *** 51,55 **** public void newMail () { super.newMail (); ! hasHiddenPlainTextContent = false; _htmlContent = null; } --- 51,55 ---- public void newMail () { super.newMail (); ! _hasHiddenPlainTextContent = false; _htmlContent = null; } *************** *** 57,73 **** protected String htmlContent () { String htmlContent = null; ! ! if (this.component () != null) { ! WOContext context = this.component ().context (); ! ! // CHECKME: It's probably not a good idea to do this here ! // since the context could also have been generating relative URLs ! // unless the context is created from scratch ! context._generateCompleteURLs (); ! WOMessage response = this.component ().generateResponse (); ! htmlContent = response.contentString (); ! } else { htmlContent = _htmlContent; - } return htmlContent; --- 57,64 ---- protected String htmlContent () { String htmlContent = null; ! if (this.component () != null) ! htmlContent = this.componentContentString (); ! else htmlContent = _htmlContent; return htmlContent; *************** *** 85,91 **** // set the plain text part ! if (hasHiddenPlainTextContent) { textPart = new MimeBodyPart (); ! textPart.setText (hiddenPlainTextContent, ERMailDelivery.DefaultCharset); multipart.addBodyPart (textPart); } --- 76,82 ---- // set the plain text part ! if (_hasHiddenPlainTextContent) { textPart = new MimeBodyPart (); ! textPart.setText (_hiddenPlainTextContent); multipart.addBodyPart (textPart); } *************** *** 97,101 **** htmlPart.setContent (this.htmlContent (), "text/html"); multipart.addBodyPart (htmlPart); ! // Inline attachements if (this.inlineAttachments ().count () > 0) { --- 88,92 ---- htmlPart.setContent (this.htmlContent (), "text/html"); multipart.addBodyPart (htmlPart); ! // Inline attachements if (this.inlineAttachments ().count () > 0) { Index: ERMailDeliveryJapanesePlainText.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailDeliveryJapanesePlainText.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ERMailDeliveryJapanesePlainText.java 21 Oct 2002 17:29:31 -0000 1.2 --- ERMailDeliveryJapanesePlainText.java 28 Nov 2002 10:57:37 -0000 1.3 *************** *** 14,59 **** import javax.mail.internet.*; ! public class ERMailDeliveryJapanesePlainText extends ERMailDelivery { ! ! /** String Message content */ ! private String _iso2022jpTextContent; ! ! /** Sets the subject for the current message instance */ ! public void setSubject (String subject) throws MessagingException { ! String encoded = null; ! try { ! encoded = MimeUtility.encodeText (subject, "ISO-2022-JP", "B"); ! } catch (Exception e) { ! encoded = subject; ! } ! this.mimeMessage ().setSubject (encoded); ! } ! ! /** Sets the text content of the current message. */ ! public void setTextContent (String text) { ! _iso2022jpTextContent = unicodeToISO2022JP (text); ! } ! ! /** Pre-processes the mail before it gets sent. ! @see ERMailDelivery#prepareMail */ ! // protected DataHandler prepareMail() { ! public DataHandler prepareMail() { ! return new DataHandler(_iso2022jpTextContent, "text/plain; charset=\"ISO-2022-JP\""); ! } ! ! /** Encodes Unicode strings into ISO-2022-JP string. */ ! public static String unicodeToISO2022JP (String unicodeString) { ! String iso2022jpString = null; ! ! try { ! byte[] byteArray = unicodeString.getBytes("ISO2022JP"); ! iso2022jpString = new String(byteArray); ! } catch (java.io.UnsupportedEncodingException ex) { ! iso2022jpString = unicodeString; ! } ! return iso2022jpString; } - } --- 14,22 ---- import javax.mail.internet.*; ! public class ERMailDeliveryJapanesePlainText extends ERMailDeliveryPlainText { ! public ERMailDeliveryJapanesePlainText() { ! setCharset("ISO-2022-JP"); } } Index: ERMailDeliveryPlainText.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailDeliveryPlainText.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ERMailDeliveryPlainText.java 25 Nov 2002 18:20:54 -0000 1.3 --- ERMailDeliveryPlainText.java 28 Nov 2002 10:57:37 -0000 1.4 *************** *** 29,33 **** @see ERMailDelivery#prepareMail */ protected DataHandler prepareMail () throws MessagingException { - // FIXME: We must set the good charset return new DataHandler (textContent, "text/plain"); } --- 29,32 ---- Index: ERMailDeliveryWOComponentPlainText.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailDeliveryWOComponentPlainText.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ERMailDeliveryWOComponentPlainText.java 25 Nov 2002 18:20:54 -0000 1.3 --- ERMailDeliveryWOComponentPlainText.java 28 Nov 2002 10:57:37 -0000 1.4 *************** *** 23,32 **** /** Pre-processes the mail before it gets sent. ! @see ERMailDelivery#prepareMail */ ! protected DataHandler prepareMail () throws MessagingException { ! // Generate text ! NSData data = this.component ().generateResponse ().content (); ! String messageContent = new String (data.bytes (0, data.length ())); ! return new DataHandler (messageContent, "text/plain"); } } --- 23,30 ---- /** Pre-processes the mail before it gets sent. ! @see ERMailDelivery#prepareMail */ ! protected DataHandler prepareMail () { ! String messageContent = this.componentContentString (); ! return new DataHandler (messageContent, "text/plain"); } } Index: ERMailSender.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailSender.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ERMailSender.java 25 Nov 2002 18:20:54 -0000 1.3 --- ERMailSender.java 28 Nov 2002 10:57:37 -0000 1.4 *************** *** 36,72 **** private int milliSecondsWaitRunLoop = 5000; - public static class Exception extends java.lang.Exception { - public Exception () { super (); } - } - - public static class SizeOverflowException extends ERMailSender.Exception { - public SizeOverflowException () { super (); } - } - /** ! * Exception class for forwarding javax.mail exceptions. */ ! public static class ForwardException extends ERMailSender.Exception { ! ! /** holds the forwarded exception */ ! protected java.lang.Exception forwardException; ! ! /** ! * Public constructor for a forwarded ! * exception. ! * @param e forwared exception ! */ ! public ForwardException (java.lang.Exception e) { ! super (); ! forwardException = e; ! } ! ! /** ! * Gets the forwarded exception. ! * @return forwarded exception. ! */ ! public java.lang.Exception forwardException () { ! return forwardException; ! } } --- 36,44 ---- private int milliSecondsWaitRunLoop = 5000; /** ! * Exception class for alerting about a stack overflow */ ! public static class SizeOverflowException extends Exception { ! public SizeOverflowException () { super (); } } *************** *** 92,112 **** } ! /** ! * Sends a message with the option to block until the message is sent. ! * If blocking is specified then this method will forward on any exceptions ! * using a {@link ForwardException}. If non-blocking is specified then ! * the message is pushed into a queue to be sent immediately. ! * @param message to be sent ! * @param shouldBlock flag to indicate if this method should block until the message ! * is sent or if the message should be put into a queue. ! */ ! public void sendMessage (ERMessage message, boolean shouldBlock) throws ERMailSender.Exception { ! if (!shouldBlock) sendMessageDeffered (message); ! else sendMessageNow (message); ! } ! ! /** Sends a message in a non-blocking way.<br> ! This means that the thread won't be blocked, but the message will be queued before being delivered. */ ! public void sendMessageDeffered (ERMessage message) throws ERMailSender.Exception { try { log.debug ("Adding a message in the queue"); --- 64,71 ---- } ! /** Sends a message in a non-blocking way.<br> This means that the ! thread won't be blocked, but the message will be queued before ! being delivered. */ ! public void sendMessageDeffered (ERMessage message) throws ERMailSender.SizeOverflowException { try { log.debug ("Adding a message in the queue"); *************** *** 127,131 **** /** Sends a message immediately.<br> This means that the thread could be blocked if the message takes time to be delivered. */ ! public void sendMessageNow (ERMessage message) throws ERMailSender.Exception { Transport transport = this._connectedTransportForSession (ERJavaMail.sharedInstance ().defaultSession ()); --- 86,90 ---- /** Sends a message immediately.<br> This means that the thread could be blocked if the message takes time to be delivered. */ ! public void sendMessageNow (ERMessage message) { Transport transport = this._connectedTransportForSession (ERJavaMail.sharedInstance ().defaultSession ()); *************** *** 134,140 **** } catch (MessagingException e) { if (log.isDebugEnabled ()) ! log.debug ("Caught exception when sending mail in a non-blocking manner: " ! + ERXUtilities.stackTrace (e)); ! throw new ERMailSender.ForwardException (e); } finally { // CHECKME (camille): --- 93,98 ---- } catch (MessagingException e) { if (log.isDebugEnabled ()) ! log.debug ("Caught exception when sending mail in a non-blocking manner.", e); ! throw new NSForwardException (e); } finally { // CHECKME (camille): *************** *** 147,151 **** } catch (MessagingException e) { // Fatal exception ... we must at least notify the use ! log.error (ERXUtilities.stackTrace (e)); throw new RuntimeException ("Unable to open nor close the messaging transport channel."); } --- 105,109 ---- } catch (MessagingException e) { // Fatal exception ... we must at least notify the use ! log.error ("Caught exception when closing transport.", e); throw new RuntimeException ("Unable to open nor close the messaging transport channel."); } *************** *** 166,171 **** encapsulated in a ERMailSender.ForwardException, and thrown to the user. */ ! protected void _sendMessageNow (ERMessage message, Transport transport) ! throws MessagingException { MimeMessage aMessage = message.mimeMessage (); Object callbackObject = message.callbackObject (); --- 124,128 ---- encapsulated in a ERMailSender.ForwardException, and thrown to the user. */ ! protected void _sendMessageNow (ERMessage message, Transport transport) throws MessagingException { MimeMessage aMessage = message.mimeMessage (); Object callbackObject = message.callbackObject (); *************** *** 209,213 **** transport.connect(); } catch (MessagingException e) { ! log.error ("Unable to connect to SMTP Transport. Reason: " + ERXUtilities.stackTrace (e)); } --- 166,170 ---- transport.connect(); } catch (MessagingException e) { ! log.error ("Unable to connect to SMTP Transport.", e); } *************** *** 228,231 **** --- 185,190 ---- } catch (InterruptedException e) { log.warn ("ERMailSender thread has been interrupted."); + threadSuspended = true; + return; } *************** *** 242,246 **** } catch (MessagingException e) { // Notify error in logs ! log.error ("Unable to connect transport, reason: " + ERXUtilities.stackTrace (e)); // Exit run loop --- 201,205 ---- } catch (MessagingException e) { // Notify error in logs ! log.error ("Unable to connect transport.", e); // Exit run loop *************** *** 256,272 **** // not 'SendFailedException's. // All we can do is warn the admin. ! log.error (ERXUtilities.stackTrace (e)); } } ! try { if (transport != null) transport.close (); } catch (MessagingException e) /* once again ... */ { ! log.warn ("Unable to close transport. Perhaps it has already been closed?"); ! log.warn ("Reason: " + ERXUtilities.stackTrace (e)); } ! } ! threadSuspended = true; --- 215,229 ---- // not 'SendFailedException's. // All we can do is warn the admin. ! log.error ("Fatal Messaging Exception. Can't send the mail.", e); } } ! try { if (transport != null) transport.close (); } catch (MessagingException e) /* once again ... */ { ! log.warn ("Unable to close transport. Perhaps it has already been closed?", e); } ! } threadSuspended = true; *************** *** 291,296 **** throw new NSForwardException (nsme); } catch (java.lang.Exception e) { ! log.error ("Exception occured: " + e.getMessage() + ! "\nStackTrace:\n" + ERXUtilities.stackTrace (e)); throw new NSForwardException (e); } --- 248,252 ---- throw new NSForwardException (nsme); } catch (java.lang.Exception e) { ! log.error ("Exception occured: " + e.getMessage(), e); throw new NSForwardException (e); } Index: ERMailUtils.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailUtils.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ERMailUtils.java 25 Nov 2002 18:20:54 -0000 1.2 --- ERMailUtils.java 28 Nov 2002 10:57:37 -0000 1.3 *************** *** 33,45 **** /** Used to instanciate a WOComponent when no context is available, ! * typically ouside of a session * * @param pageName - The name of the WOComponent that must be instanciated. */ ! public static WOComponent instanciatePage (String pageName) { // Create a context from a fake request WOContext context = new WOContext (new WORequest ("GET", "", "HTTP/1.1", null, null, null)); ! return WOApplication.application ().pageWithName (pageName, context); } --- 33,50 ---- /** Used to instanciate a WOComponent when no context is available, ! * typically ouside of a session. An optional argument ! * sessionDictionary can be provided in order to set objects/keys ! * in the newly create session of the component. * * @param pageName - The name of the WOComponent that must be instanciated. */ ! public static WOComponent instanciatePage (String pageName, NSDictionary sessionDictionary) { // Create a context from a fake request WOContext context = new WOContext (new WORequest ("GET", "", "HTTP/1.1", null, null, null)); ! WOComponent component = WOApplication.application ().pageWithName (pageName, context); ! if (sessionDictionary != null) ! setDictionaryValuesInSession (sessionDictionary, component.session ()); ! return component; } *************** *** 55,59 **** String emailFrom, String emailTo, String emailReplyTo, String subject) { ! WOComponent mailPage = (WOComponent)ERMailUtils.instanciatePage (pageName); delivery.newMail (); --- 60,65 ---- String emailFrom, String emailTo, String emailReplyTo, String subject) { ! WOComponent mailPage = (WOComponent)ERMailUtils.instanciatePage (pageName, ! delivery.sessionDictionary ()); delivery.newMail (); *************** *** 62,68 **** if (alternatePageName != null) { String alternateString = null; ! WOComponent alternateMailTemplate = (WOComponent)ERMailUtils.instanciatePage (alternatePageName); ! alternateString = alternateMailTemplate.generateResponse ().contentString (); ! if (alternateString != null) { delivery.setHiddenPlainTextContent (alternateString); alternateMailTemplate.session ().terminate (); --- 68,77 ---- if (alternatePageName != null) { String alternateString = null; ! WOComponent alternateMailTemplate = ! (WOComponent)ERMailUtils.instanciatePage (alternatePageName, ! delivery.sessionDictionary ()); ! alternateString = alternateMailTemplate.generateResponse ().contentString (); ! ! if (alternateString != null) { delivery.setHiddenPlainTextContent (alternateString); alternateMailTemplate.session ().terminate (); *************** *** 78,82 **** } catch (javax.mail.MessagingException e) { // we must handle this exception correctly because the mail cannot be sent ! log.warn (ERXUtilities.stackTrace (e)); } finally { // We need to force the termination of the sessions because there is some --- 87,91 ---- } catch (javax.mail.MessagingException e) { // we must handle this exception correctly because the mail cannot be sent ! log.warn ("While trying to sendMail: ", e); } finally { // We need to force the termination of the sessions because there is some *************** *** 85,89 **** mailPage.session ().terminate (); } ! } public static void sendHTMLMail (String pageName, String alternatePageName, --- 94,112 ---- mailPage.session ().terminate (); } ! } ! ! public static void setDictionaryValuesInSession (NSDictionary dict, WOSession session) { ! if ((dict == null) || (session == null)) ! return; ! ! Enumeration en = dict.keyEnumerator (); ! while (en.hasMoreElements ()) { ! String key = (String)en.nextElement (); ! ! Object object = dict.objectForKey (key); ! if (object != null) ! session.setObjectForKey (object, key); ! } ! } public static void sendHTMLMail (String pageName, String alternatePageName, |
From: Anjo Krank <anjo@us...> - 2002-11-28 07:50:04
|
Update of /cvsroot/wonder/Wonder/Experimental/DevStudio/Build In directory sc8-pr-cvs1:/tmp/cvs-serv21003 Modified Files: build.xml Log Message: using generic.xml now Index: build.xml =================================================================== RCS file: /cvsroot/wonder/Wonder/Experimental/DevStudio/Build/build.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** build.xml 23 Oct 2002 21:03:19 -0000 1.1 --- build.xml 28 Nov 2002 07:50:01 -0000 1.2 *************** *** 1,41 **** ! <project name="DevStudio" default="all" basedir=".."> <property name="project.name" value="${ant.project.name}" /> <property name="project.principal.class" value="ag.kcmedia.Application" /> <!-- don't touch from here on --> <property name="project.dir" value="${basedir}" /> <property name="build.compiler" value="jikes" /> <property name="build.compiler.emacs" value="true" /> <property name="wo.system.root" value="/System/Library/Frameworks" /> <property name="wo.local.root" value="/Library/Frameworks" /> <property name="wo.server.root" value="/Library/WebServer/Documents/WebObjects/Frameworks" /> <property name="application.name" value="${project.name}.woa" /> <property name="build.root" value="${user.home}/Roots" /> <property name="build.classes" value="${build.root}/classes/${project.name}" /> <property name="build.application.dir" value="${build.root}/${application.name}" /> <property name="build.jar.file" value="${build.application.dir}/Contents/Resources/Java/${project.name}.jar" /> <!--property name="application.dir" value="${wo.local.root}" if="env.INSTALL"/--> <path id="project.class.path"> <fileset dir="${build.root}"> <include name="ER*.framework/Resources/Java/*.jar" /> </fileset> <fileset dir="${wo.system.root}"> <include name="Java**/Resources/Java/*.jar" /> </fileset> <fileset dir="Libraries"> <include name="*.jar" /> </fileset> <!--pathelement location="${tmp}" /--> </path> <target name="usage"> <echo message="-------------------------------------"/> <echo message="Valid target-commands" /> <echo message="---------------------" /> <echo message=" all --> create framework in ${build.root} "/> <echo message=" install --> copy framework to ${wo.local.root} "/> <echo message=" web --> copy framework to ${wo.server.root} "/> <echo message=" clean --> remove .classes and .framework"/> <echo message=" allclean --> remove .classes and .framework and installed framework"/> <echo message="--------------------------------------"/> </target> <target name="prepare"> <mkdir dir="${build.root}"/> <mkdir dir="${build.application.dir}"/> <mkdir dir="${build.classes}"/> </target> <target name="checkupdate"> <uptodate property="no.changes" targetfile="${build.jar.file}"> <srcfiles dir="${project.dir}" includes="Sources/**/*.java" /> </uptodate> </target> <target name="compile" depends="prepare,checkupdate" description="Default compile target" unless="no.changes"> <mkdir dir="${build.classes}"/> <javac srcdir="${project.dir}" destdir="${build.classes}" includes="Sources/**/*.java" debug="on" optimize="off" deprecation="on"> <classpath refid="project.class.path" /> </javac> </target> <target name="application" depends="compile" description="Default compile target"> <taskdef name="woapplication" classname="org.objectstyle.woproject.ant.WOApplication"> ! <classpath refid="project.class.path" /> ! </taskdef> ! <woapplication name="${project.name}" destDir="${build.root}" principalClass="${project.principal.class}" jarName="${project.name}"> ! <classes dir="${build.classes}"> ! <include name="**/*.class" /> ! </classes> ! <resources dir="${project.dir}/Components"> ! <include name="**.api" /> ! <include name="**/*.wo/**" /> ! </resources> ! <resources dir="${project.dir}/Resources"> ! <include name="*.eomodeld/**" /> ! <include name="**/*.plist" /> ! <include name="**/*.d2wmodel" /> ! <include name="**/*.strings" /> ! <include name="**/*.sh" /> ! </resources> ! <lib dir="${project.dir}/Libraries"> ! <include name="**.jar" /> ! </lib> ! <frameworks root="${build.root}"> ! <include name="JavaWO*.framework"/> ! <include name="ER*.framework"/> ! <exclude name="ERNeutralLook.framework"/> ! </frameworks> ! <frameworks root="${wo.local.root}"> ! <include name="Mysql*.framework"/> ! </frameworks> ! <frameworks root="${wo.system.root}"> ! <include name="Java*.framework"/> ! <exclude name="Java*Cocoa.framework"/> ! <exclude name="JavaOpen*.framework"/> ! <exclude name="JavaWOExtensions.framework"/> ! <exclude name="JavaEOGeneration*.framework"/> ! <exclude name="JavaEOApplication*.framework"/> ! <exclude name="JavaEO*Interface*.framework"/> ! <exclude name="JavaEODistribution.framework"/> ! </frameworks> ! </woapplication> ! <exec dir="${build.application.dir}" executable="chmod"> <arg line="a+x ${project.name} Contents/MacOS/${project.name}"/> </exec> </target> <target name="install" depends="all"> <copy todir="${wo.local.root}/${application.name}"> <fileset dir="${build.application.dir}" /> </copy> </target> <target name="web" depends="application"> <copy todir="${wo.server.root}/${application.name}/WebServerResources"> <fileset dir="${build.application.dir}/WebServerResources" /> </copy> </target> <target name="clean"> <delete dir="${build.classes}"/> <delete dir="${build.application.dir}"/> </target> <target name="all" depends="application"/> </project> \ No newline at end of file --- 1,22 ---- ! <project name="DevStudio" default="all" basedir=".."> <property name="wonder.root" value="${user.home}/Wonder" /> ! <property name="wo.localroot" value="/" /> ! ! <!-- DevStudio --> ! <target name="all"> ! <ant antFile="${wonder.root}/Build/build/generic.xml" target="generic.all" > ! <property name="project.name" value="DevStudio" /> ! <property name="project.type" value="application" /> ! <property name="project.principal.class" value="ag.kcmedia.Application" /> ! <property name="project.dir" value="${wonder.root}/experimental/DevStudio" /> ! <property name="use.webobjects.d2w" value="true" /> ! <property name="use.wonder.core" value="true" /> ! <property name="use.wonder.d2w" value="true" /> ! <property name="use.mysql" value="true" /> ! </ant> ! </target> ! <target name="clean"> ! <ant antFile="${wonder.root}/Build/build/generic.xml" target="generic.clean" > ! <property name="project.name" value="DevStudio" /> ! <property name="project.type" value="application" /> ! </ant> ! </target> </project> \ No newline at end of file |
From: Bruno Posokhow <posokhow@us...> - 2002-11-27 23:15:28
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERDirectToWeb/Resources In directory sc8-pr-cvs1:/tmp/cvs-serv15402/Resources Modified Files: d2w.d2wmodel Log Message: adding the default value for the noChoiceAvailableMessage rule Index: d2w.d2wmodel =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERDirectToWeb/Resources/d2w.d2wmodel,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** d2w.d2wmodel 20 Nov 2002 03:24:29 -0000 1.40 --- d2w.d2wmodel 27 Nov 2002 23:15:25 -0000 1.41 *************** *** 3284,3287 **** --- 3284,3296 ---- rhs = { class = "com.webobjects.directtoweb.Assignment"; + keyPath = noChoiceAvailableMessage; + value = ""; + }; + }, + { + author = 0; + class = "com.webobjects.directtoweb.Rule"; + rhs = { + class = "com.webobjects.directtoweb.Assignment"; keyPath = noSelectionString; value = "- none -"; |
From: Bruno Posokhow <posokhow@us...> - 2002-11-27 22:57:14
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv8254/ERExtensions/Sources/er/extensions Modified Files: ERXApplication.java Log Message: adding instantiatePage convenience method Index: ERXApplication.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXApplication.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ERXApplication.java 23 Nov 2002 00:39:05 -0000 1.29 --- ERXApplication.java 27 Nov 2002 22:57:11 -0000 1.30 *************** *** 197,200 **** --- 197,212 ---- } + /** Used to instanciate a WOComponent when no context is available, + * typically ouside of a session + * + * @param pageName - The name of the WOComponent that must be instanciated. + */ + public static WOComponent instantiatePage (String pageName) { + // Create a context from a fake request + WOContext context = new WOContext + (new WORequest ("GET", "", "HTTP/1.1", null, null, null)); + return WOApplication.application ().pageWithName (pageName, context); + } + /** * Stops the application from handling any new requests. Will still handle |
From: Bruno Posokhow <posokhow@us...> - 2002-11-27 22:56:07
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERCoreBusinessLogic/Sources/er/corebusinesslogic In directory sc8-pr-cvs1:/tmp/cvs-serv7768/ERCoreBusinessLogic/Sources/er/corebusinesslogic Modified Files: ERCMailDelivery.java Log Message: using the new instantiatePage method in ERExtensions Index: ERCMailDelivery.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERCoreBusinessLogic/Sources/er/corebusinesslogic/ERCMailDelivery.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ERCMailDelivery.java 27 Nov 2002 01:10:25 -0000 1.5 --- ERCMailDelivery.java 27 Nov 2002 22:56:04 -0000 1.6 *************** *** 188,193 **** NSDictionary bindings, EOEditingContext ec) { ! WOContext context = new WOContext(new WORequest("POST", "", "HTTP/1.1", null, null, null)); ! WOComponent component = WOApplication.application().pageWithName(componentName, context); if (bindings != null && bindings.count() > 0) EOKeyValueCodingAdditions.DefaultImplementation.takeValuesFromDictionary(component, bindings); --- 188,192 ---- NSDictionary bindings, EOEditingContext ec) { ! WOComponent component = ERXApplication.instantiatePage(componentName); if (bindings != null && bindings.count() > 0) EOKeyValueCodingAdditions.DefaultImplementation.takeValuesFromDictionary(component, bindings); |
From: Bruno Posokhow <posokhow@us...> - 2002-11-27 17:48:51
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv25833 Modified Files: ERXUtilities.java ERXStringUtilities.java Log Message: moving escapeSpace Index: ERXUtilities.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXUtilities.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ERXUtilities.java 26 Nov 2002 23:50:04 -0000 1.25 --- ERXUtilities.java 27 Nov 2002 17:48:48 -0000 1.26 *************** *** 709,717 **** } - public static String escapeSpace(String aString){ - NSArray parts = NSArray.componentsSeparatedByString(aString," "); - return parts.componentsJoinedByString(""); - } - /** * Simply utility method to create a concreate --- 709,712 ---- Index: ERXStringUtilities.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXStringUtilities.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ERXStringUtilities.java 28 Oct 2002 15:06:47 -0000 1.13 --- ERXStringUtilities.java 27 Nov 2002 17:48:48 -0000 1.14 *************** *** 479,482 **** } return convertedString.toString(); ! } } --- 479,491 ---- } return convertedString.toString(); ! } ! ! /** ! * Removes the spaces in a given String ! * @return string removing all spaces in it. ! */ ! public static String escapeSpace(String aString){ ! NSArray parts = NSArray.componentsSeparatedByString(aString," "); ! return parts.componentsJoinedByString(""); ! } } |
From: Anjo Krank <anjo@us...> - 2002-11-27 14:07:27
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv4087 Modified Files: ERXSimpleTemplateParser.java Log Message: better error reporting Index: ERXSimpleTemplateParser.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXSimpleTemplateParser.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ERXSimpleTemplateParser.java 21 Oct 2002 17:31:11 -0000 1.13 --- ERXSimpleTemplateParser.java 27 Nov 2002 14:07:24 -0000 1.14 *************** *** 183,187 **** obj = NSKeyValueCodingAdditions.Utility.valueForKeyPath(otherObject, element); } else { ! throw new RuntimeException("Could not find a value for \"" + element + "\" of a template in either the object or extra data"); } } catch (Throwable t1) { --- 183,187 ---- obj = NSKeyValueCodingAdditions.Utility.valueForKeyPath(otherObject, element); } else { ! throw new RuntimeException("Could not find a value for \"" + element + "\" of a template in either the object or extra data: " + t.getMessage()); } } catch (Throwable t1) { |
From: Anjo Krank <anjo@us...> - 2002-11-27 14:06:00
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv3501 Modified Files: ERXFixedLengthString.java Log Message: fixed index exception Index: ERXFixedLengthString.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXFixedLengthString.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ERXFixedLengthString.java 20 Nov 2002 10:36:52 -0000 1.5 --- ERXFixedLengthString.java 27 Nov 2002 14:05:57 -0000 1.6 *************** *** 133,136 **** --- 133,138 ---- String value=(String)valueForBinding("value"); StringTokenizer tokenizer = new StringTokenizer(value, "<", false); + if(value.length() < 1) + return null; int token = value.charAt(0) == '<' ? 0 : 1; String nextPart = null; *************** *** 138,142 **** int l=length(); int currentLength = result.length(); ! while (tokenizer.hasMoreTokens() && currentLength < l) { if(token == 0) nextPart = tokenizer.nextToken(">"); --- 140,144 ---- int l=length(); int currentLength = result.length(); ! while (tokenizer.hasMoreTokens() && currentLength < l && currentLength < value.length()) { if(token == 0) nextPart = tokenizer.nextToken(">"); |
From: Camille Troillard <tuscland@us...> - 2002-11-27 09:55:12
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Build In directory sc8-pr-cvs1:/tmp/cvs-serv6716 Modified Files: build.xml Log Message: Modified build.xml so that it builds correctly when ran locally. Index: build.xml =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Build/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.xml 21 Sep 2002 15:29:38 -0000 1.4 --- build.xml 27 Nov 2002 09:55:09 -0000 1.5 *************** *** 1 **** ! <project name="ERExtensions" default="all" basedir=".."> <property name="project.principal.class" value="er.extensions.ERExtensions" /> <property name="project.name" value="${ant.project.name}" /> <!-- dont touch from here on <property name="project.dir" value="${basedir}" /> <property name="wonder.root" value="${project.dir}" />--> <!-- ==================================================== --> <!-- Sets up base properties --> <!-- ==================================================== --> <target name="macosx"> <condition property="is-macosx"> <and> <os family="mac" /> <os family="unix" /> </and> </condition> </target> <target name="windows"> <condition property="is-windows"> <os family="windows" /> </condition> </target> <target name="unix"> <condition property="is-unix"> <and> <os family="unix" /> <not><os family="mac" /></not> </and> </condition> </target> <target name="check-macosx" if="is-macosx" depends="macosx"> <echo message="is Mac OS X ..." /> <property name="next.root" value="/System" /> <property name="wo.woroot" value="${next.root}" /> <property name="wo.localroot" value="/" /> <property name="build.root" value="${user.home}/Roots" /> </target> <target name="check-windows" if="is-windows" depends="windows"> <echo message="is Windows ..." /> <property environment="env" /> <property name="next.root" value="${env.NEXT_ROOT}" /> <property name="wo.woroot" value="${next.root}" /> <property name="wo.localroot" value="${next.root}/Local" /> <property name="build.root" value="C:/Roots" /> </target> <target name="check-unix" if="is-unix" depends="unix"> <echo message="is Unix ..." /> <property name="next.root" value="/" /> <property name="wo.woroot" value="${next.root}" /> <property name="wo.localroot" value="${next.root}/Local" /> <property name="build.root" value="${user.home}/Roots" /> </target> <target name="init" depends="check-macosx, check-windows, check-unix" unless="init" description="initialize properties"> <property name="wo.system.root" value="${wo.woroot}/Library/Frameworks" /> <property name="wo.local.root" value="${wo.localroot}/Library/Frameworks" /> <property name="wo.server.root" value="/Library/WebServer/Documents/WebObjects/Frameworks" /> <property name="wonder.root" value="${basedir}" /> </target> <target name="clean" depends="init"> <ant antfile="../../../Build/build/common.xml" target="${ant.project.name}.clean" /> </target> <target name="install" depends="init"> <ant antfile="../../../Build/build/common.xml" target="install" /> </target> <target name="usage" depends="init"> <ant antfile="../../../Build/build/common.xml" target="usage" /> </target> <target name="all" depends="init"> <ant antfile="../../../Build/build/common.xml" target="${ant.project.name}.all" /> </target> </project> \ No newline at end of file --- 1 ---- ! <project name="ERExtensions" default="all" basedir="../../../.."> <property name="project.principal.class" value="er.extensions.ERExtensions" /> <property name="project.name" value="${ant.project.name}" /> <!-- dont touch from here on <property name="project.dir" value="${basedir}" /> <property name="wonder.root" value="${project.dir}" />--> <!-- ==================================================== --> <!-- Sets up base properties --> <!-- ==================================================== --> <target name="macosx"> <condition property="is-macosx"> <and> <os family="mac" /> <os family="unix" /> </and> </condition> </target> <target name="windows"> <condition property="is-windows"> <os family="windows" /> </condition> </target> <target name="unix"> <condition property="is-unix"> <and> <os family="unix" /> <not><os family="mac" /></not> </and> </condition> </target> <target name="check-macosx" if="is-macosx" depends="macosx"> <echo message="is Mac OS X ..." /> <property name="next.root" value="/System" /> <property name="wo.woroot" value="${next.root}" /> <property name="wo.localroot" value="/" /> <property name="build.root" value="${user.home}/Roots" /> </target> <target name="check-windows" if="is-windows" depends="windows"> <echo message="is Windows ..." /> <property environment="env" /> <property name="next.root" value="${env.NEXT_ROOT}" /> <property name="wo.woroot" value="${next.root}" /> <property name="wo.localroot" value="${next.root}/Local" /> <property name="build.root" value="C:/Roots" /> </target> <target name="check-unix" if="is-unix" depends="unix"> <echo message="is Unix ..." /> <property name="next.root" value="/" /> <property name="wo.woroot" value="${next.root}" /> <property name="wo.localroot" value="${next.root}/Local" /> <property name="build.root" value="${user.home}/Roots" /> </target> <target name="init" depends="check-macosx, check-windows, check-unix" unless="init" description="initialize properties"> <property name="wo.system.root" value="${wo.woroot}/Library/Frameworks" /> <property name="wo.local.root" value="${wo.localroot}/Library/Frameworks" /> <property name="wo.server.root" value="/Library/WebServer/Documents/WebObjects/Frameworks" /> <property name="wonder.root" value="${basedir}" /> </target> <target name="clean" depends="init"> <ant antfile="Build/build/common.xml" target="${ant.project.name}.clean" /> </target> <target name="install" depends="init"> <ant antfile="Build/build/common.xml" target="install" /> </target> <target name="usage" depends="init"> <ant antfile="Build/build/common.xml" target="usage" /> </target> <target name="all" depends="init"> <ant antfile="Build/build/common.xml" target="${ant.project.name}.all" /> </target> </project> \ No newline at end of file |
From: Camille Troillard <tuscland@us...> - 2002-11-27 09:53:40
|
Update of /cvsroot/wonder/Wonder/Build/build In directory sc8-pr-cvs1:/tmp/cvs-serv6202 Modified Files: common.xml Log Message: Modified Build/lib path so that it begins with ${wonder.root}. Index: common.xml =================================================================== RCS file: /cvsroot/wonder/Wonder/Build/build/common.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** common.xml 27 Nov 2002 01:25:09 -0000 1.29 --- common.xml 27 Nov 2002 09:53:36 -0000 1.30 *************** *** 13,17 **** <include name="BT*.framework/Resources/Java/*.jar" /> </fileset> ! <fileset dir="Build/lib"> <include name="woproject.jar" /> </fileset> --- 13,17 ---- <include name="BT*.framework/Resources/Java/*.jar" /> </fileset> ! <fileset dir="${wonder.root}/Build/lib"> <include name="woproject.jar" /> </fileset> |
From: Camille Troillard <camille@od...> - 2002-11-27 08:46:11
|
Hello, On Wednesday, November 27, 2002, at 02:10 AM, Bruno Posokhow wrote: > Update of > /cvsroot/wonder/Wonder/Common/Frameworks/ERCoreBusinessLogic/Sources/ > er/corebusinesslogic > In directory > sc8-pr-cvs1:/tmp/cvs-serv19083/ERCoreBusinessLogic/Sources/er/ > corebusinesslogic > > Modified Files: > ERCMailDelivery.java > Log Message: > apparently WO5.2 doesn t allow to have nulls in the method, http > version and url any more also if > er.corebusinesslogic.ERCUseMailFacility is false throwing, it should > be checked before > ! WOContext context = new WOContext(new WORequest("POST", "", > "HTTP/1.1", null, null, null)); There's a static method (er.javamail.ERMailUtils.instanciatePage) that is typically used to instanciate a page this way. You'd better use this one. Also in ERMailUtils, there's sendMail that should also be used, because it takes care of all the things to do when sending a basic mail. We could eventually refactor it in order to have more generic parts that can be used in other frameworks like ERC. Camille |
From: Camille Troillard <tuscland@us...> - 2002-11-27 01:25:12
|
Update of /cvsroot/wonder/Wonder/Build/build In directory sc8-pr-cvs1:/tmp/cvs-serv23068 Modified Files: common.xml Log Message: Adding woproject to classpath so that Emacs JDE environment can build when usign ant server. Index: common.xml =================================================================== RCS file: /cvsroot/wonder/Wonder/Build/build/common.xml,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** common.xml 26 Oct 2002 16:15:45 -0000 1.28 --- common.xml 27 Nov 2002 01:25:09 -0000 1.29 *************** *** 9,15 **** <path id="project.class.path"> ! <fileset dir="${build.root}"> <include name="ER*.framework/Resources/Java/*.jar" /> <include name="BT*.framework/Resources/Java/*.jar" /> </fileset> <fileset dir="${wo.woroot}/Library/Frameworks"> --- 9,18 ---- <path id="project.class.path"> ! <fileset dir="${build.root}"> <include name="ER*.framework/Resources/Java/*.jar" /> <include name="BT*.framework/Resources/Java/*.jar" /> + </fileset> + <fileset dir="Build/lib"> + <include name="woproject.jar" /> </fileset> <fileset dir="${wo.woroot}/Library/Frameworks"> |
From: Bruno Posokhow <posokhow@us...> - 2002-11-27 01:15:04
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERNeutralLook/Components/Nonlocalized.lproj/ERNEUInspectPage.wo In directory sc8-pr-cvs1:/tmp/cvs-serv20453/ERNeutralLook/Components/Nonlocalized.lproj/ERNEUInspectPage.wo Modified Files: ERNEUInspectPage.wod ERNEUInspectPage.html Log Message: when editing shouldn t use submit buttons since there is no form Index: ERNEUInspectPage.wod =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERNeutralLook/Components/Nonlocalized.lproj/ERNEUInspectPage.wo/ERNEUInspectPage.wod,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ERNEUInspectPage.wod 21 Nov 2002 01:45:34 -0000 1.5 --- ERNEUInspectPage.wod 27 Nov 2002 01:14:56 -0000 1.6 *************** *** 65,86 **** } - Conditional4: WOConditional { - condition = session.browser.isIE; - negate = true; - } - - Conditional5: WOConditional { - condition = session.browser.isIE; - } - - Conditional6: WOConditional { - condition = session.browser.isIE; - negate = true; - } - - Conditional7: WOConditional { - condition = session.browser.isIE; - } - Conditional8: WOConditional { condition = session.browser.isIE; --- 65,68 ---- *************** *** 251,264 **** action = submitAction; value = "Save"; - } - - SubmitButton3: WOSubmitButton { - action = editAction; - value = "Edit"; - } - - SubmitButton4: WOSubmitButton { - action = nextPage; - value = "Return"; } --- 233,236 ---- Index: ERNEUInspectPage.html =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERNeutralLook/Components/Nonlocalized.lproj/ERNEUInspectPage.wo/ERNEUInspectPage.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ERNEUInspectPage.html 16 Oct 2002 00:35:49 -0000 1.4 --- ERNEUInspectPage.html 27 Nov 2002 01:14:56 -0000 1.5 *************** *** 53,57 **** </WEBOBJECT> <WEBOBJECT NAME=IsNotEditingConditional> ! <WEBOBJECT NAME=ShowCancel><WEBOBJECT NAME=Conditional7><WEBOBJECT NAME=SubmitButton4></WEBOBJECT></WEBOBJECT><WEBOBJECT NAME=Conditional6><WEBOBJECT NAME=ReturnLink><WEBOBJECT NAME=ReturnButton></WEBOBJECT></WEBOBJECT></WEBOBJECT></WEBOBJECT> </WEBOBJECT> </TD> --- 53,57 ---- </WEBOBJECT> <WEBOBJECT NAME=IsNotEditingConditional> ! <WEBOBJECT NAME=ShowCancel><WEBOBJECT NAME=ReturnLink><WEBOBJECT NAME=ReturnButton></WEBOBJECT></WEBOBJECT></WEBOBJECT> </WEBOBJECT> </TD> *************** *** 64,68 **** <WEBOBJECT NAME=IsEntityWritable2> <WEBOBJECT NAME=IsNotEditingConditional2> ! <WEBOBJECT NAME=Conditional5><WEBOBJECT NAME=SubmitButton3></WEBOBJECT></WEBOBJECT><WEBOBJECT NAME=Conditional4><WEBOBJECT NAME=EditLink><WEBOBJECT NAME=EditImage></WEBOBJECT></WEBOBJECT></WEBOBJECT> </WEBOBJECT> </WEBOBJECT> --- 64,68 ---- <WEBOBJECT NAME=IsEntityWritable2> <WEBOBJECT NAME=IsNotEditingConditional2> ! <WEBOBJECT NAME=EditLink><WEBOBJECT NAME=EditImage></WEBOBJECT></WEBOBJECT> </WEBOBJECT> </WEBOBJECT> |
From: Bruno Posokhow <posokhow@us...> - 2002-11-27 01:10:30
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERCoreBusinessLogic/Sources/er/corebusinesslogic In directory sc8-pr-cvs1:/tmp/cvs-serv19083/ERCoreBusinessLogic/Sources/er/corebusinesslogic Modified Files: ERCMailDelivery.java Log Message: apparently WO5.2 doesn t allow to have nulls in the method, http version and url any more also if er.corebusinesslogic.ERCUseMailFacility is false throwing, it should be checked before Index: ERCMailDelivery.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERCoreBusinessLogic/Sources/er/corebusinesslogic/ERCMailDelivery.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ERCMailDelivery.java 21 Nov 2002 02:26:01 -0000 1.4 --- ERCMailDelivery.java 27 Nov 2002 01:10:25 -0000 1.5 *************** *** 85,96 **** String message, EOEditingContext ec) { ! ERCMailMessage mailMessage = (ERCMailMessage)ERCMailMessage.mailMessageClazz().createAndInsertObject(ec); ! String safeTitle=title!=null ? ( title.length() > 200 ? title.substring(0,198) : title ) : null; ! mailMessage.setTitle(safeTitle); ! mailMessage.setFromAddress(from); ! mailMessage.setToAddresses(commaSeparatedListFromArray(to)); ! mailMessage.setCcAddresses(commaSeparatedListFromArray(cc)); ! mailMessage.setBccAddresses(commaSeparatedListFromArray(bcc)); ! mailMessage.setText(message); return mailMessage; } --- 85,104 ---- String message, EOEditingContext ec) { ! ERCMailMessage mailMessage = null; ! boolean usesMail = ERXProperties.booleanForKey("er.corebusinesslogic.ERCUseMailFacility"); ! if(usesMail){ ! mailMessage = (ERCMailMessage)ERCMailMessage.mailMessageClazz().createAndInsertObject(ec); ! String safeTitle=title!=null ? ( title.length() > 200 ? title.substring(0,198) : title ) : null; ! mailMessage.setTitle(safeTitle); ! mailMessage.setFromAddress(from); ! mailMessage.setToAddresses(commaSeparatedListFromArray(to)); ! mailMessage.setCcAddresses(commaSeparatedListFromArray(cc)); ! mailMessage.setBccAddresses(commaSeparatedListFromArray(bcc)); ! mailMessage.setText(message); ! }else{ ! throw new RuntimeException("The application doesn't use the ERCUseMailFacility."+ ! "You can either set er.corebusinesslogic.ERCUseMailFacility in your properties or better check for that property before trying to compose the email"); ! } ! return mailMessage; } *************** *** 180,184 **** NSDictionary bindings, EOEditingContext ec) { ! WOContext context = new WOContext(new WORequest(null, null, null, null, null, null)); WOComponent component = WOApplication.application().pageWithName(componentName, context); if (bindings != null && bindings.count() > 0) --- 188,192 ---- NSDictionary bindings, EOEditingContext ec) { ! WOContext context = new WOContext(new WORequest("POST", "", "HTTP/1.1", null, null, null)); WOComponent component = WOApplication.application().pageWithName(componentName, context); if (bindings != null && bindings.count() > 0) |
From: Bruno Posokhow <posokhow@us...> - 2002-11-27 01:08:38
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERDirectToWeb/Components/Nonlocalized.lproj/ERD2WEditToManyRelationship.wo In directory sc8-pr-cvs1:/tmp/cvs-serv18483/ERDirectToWeb/Components/Nonlocalized.lproj/ERD2WEditToManyRelationship.wo Modified Files: ERD2WEditToManyRelationship.wod ERD2WEditToManyRelationship.html Log Message: if the noChoiceAvailableMessage is set display override ERXLocalizedString Index: ERD2WEditToManyRelationship.wod =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERDirectToWeb/Components/Nonlocalized.lproj/ERD2WEditToManyRelationship.wo/ERD2WEditToManyRelationship.wod,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ERD2WEditToManyRelationship.wod 1 Nov 2002 11:00:06 -0000 1.3 --- ERD2WEditToManyRelationship.wod 27 Nov 2002 01:08:35 -0000 1.4 *************** *** 8,11 **** --- 8,20 ---- } + AreThereChoices3: ERXNonZeroConditional { + condition = d2wContext.noChoiceAvailableMessage.length; + negate = true; + } + + AreThereChoices4: ERXNonZeroConditional { + condition = d2wContext.noChoiceAvailableMessage.length; + } + CollapseContainer: D2WCollapsibleComponentContent { _unroll = true; *************** *** 30,33 **** --- 39,46 ---- shouldShowSelectAllButtons = shouldShowSelectAllButtons; localizeDisplayKeys = d2wContext.localizeDisplayKeys; + } + + String1: WOString { + value = d2wContext.noChoiceAvailableMessage; } Index: ERD2WEditToManyRelationship.html =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERDirectToWeb/Components/Nonlocalized.lproj/ERD2WEditToManyRelationship.wo/ERD2WEditToManyRelationship.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ERD2WEditToManyRelationship.html 5 May 2002 20:59:45 -0000 1.2 --- ERD2WEditToManyRelationship.html 27 Nov 2002 01:08:35 -0000 1.3 *************** *** 1 **** ! <WEBOBJECT NAME=CollapseContainer><WEBOBJECT NAME=AreThereChoices><WEBOBJECT NAME=EditToManyRelationship></WEBOBJECT></WEBOBJECT><WEBOBJECT NAME=AreThereChoices2><FONT COLOR=#ff0000><WEBOBJECT NAME=noChoiceAvaliable></WEBOBJECT></FONT></WEBOBJECT></WEBOBJECT> \ No newline at end of file --- 1 ---- ! <WEBOBJECT NAME=CollapseContainer><WEBOBJECT NAME=AreThereChoices><WEBOBJECT NAME=EditToManyRelationship></WEBOBJECT></WEBOBJECT><WEBOBJECT NAME=AreThereChoices2><WEBOBJECT NAME=AreThereChoices3><FONT COLOR="#ff0000"><FONT COLOR="#ff0000"><WEBOBJECT NAME=noChoiceAvaliable></WEBOBJECT></FONT></FONT></WEBOBJECT><WEBOBJECT NAME=AreThereChoices4><WEBOBJECT NAME=String1></WEBOBJECT></WEBOBJECT></WEBOBJECT></WEBOBJECT> \ No newline at end of file |
From: Bruno Posokhow <posokhow@us...> - 2002-11-26 23:50:08
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv25881/Sources/er/extensions Modified Files: ERXUtilities.java Log Message: adding escapeSpace that removes spaces in a string Index: ERXUtilities.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERExtensions/Sources/er/extensions/ERXUtilities.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ERXUtilities.java 20 Nov 2002 02:50:48 -0000 1.24 --- ERXUtilities.java 26 Nov 2002 23:50:04 -0000 1.25 *************** *** 709,712 **** --- 709,717 ---- } + public static String escapeSpace(String aString){ + NSArray parts = NSArray.componentsSeparatedByString(aString," "); + return parts.componentsJoinedByString(""); + } + /** * Simply utility method to create a concreate |
From: Michael Sacket <msacket@us...> - 2002-11-26 18:58:14
|
Update of /cvsroot/wonder/Wonder/Validity/Frameworks/Validity/Sources/com/gammastream/validity In directory sc8-pr-cvs1:/tmp/cvs-serv1068 Modified Files: GSVEngine.java GSVEntity.java GSVModel.java Log Message: Some updates submitted by David Teran which deal with syncing entities and attributes from the EOModel with the Validity model. Deleting an attribute or entity from an EOModel will now delete also delete the same corresponding item from the Validity model. Index: GSVEngine.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Validity/Frameworks/Validity/Sources/com/gammastream/validity/GSVEngine.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GSVEngine.java 15 Jun 2002 18:09:59 -0000 1.1 --- GSVEngine.java 26 Nov 2002 18:58:09 -0000 1.2 *************** *** 349,352 **** --- 349,353 ---- model = (GSVModel)WOXMLDecoder.decoder().decodeRootObject(gsvModelPath); model.setEomodelPath(eoModelPath); //not sure why we need to do this? + model.init(eomodel, eoObject); model.saveModel(); //not sure why we need to do this? //now cache *************** *** 371,375 **** } */ - System.out.println("Validity 1.0 (Modeler and Framework)"); _expired = false; } --- 372,375 ---- Index: GSVEntity.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Validity/Frameworks/Validity/Sources/com/gammastream/validity/GSVEntity.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GSVEntity.java 15 Jun 2002 18:09:59 -0000 1.1 --- GSVEntity.java 26 Nov 2002 18:58:09 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- import com.webobjects.eoaccess.*; import java.lang.*; + import java.util.*; import java.net.*; import java.math.*; *************** *** 163,167 **** } } - } --- 164,202 ---- } } + + public void init(GSVModel model, EOEntity eoentity) { + NSArray myattributes = attributes().immutableClone(); + for ( Enumeration e = myattributes.objectEnumerator(); e.hasMoreElements();) { + GSVAttribute attribute = (GSVAttribute)e.nextElement(); + NSLog.debug.appendln("checking attribute"+eoentity.name()+"."+attribute.name()); + EOAttribute a = eoentity.attributeNamed(attribute.name()); + EORelationship p = eoentity.relationshipNamed(attribute.name()); + + if (a == null) { + NSLog.out.appendln("attribute "+attribute.name() + " does not exist in entity " + name() + " (anymore?), deleted from Valididy model"); + removeAttribute(attribute); + } else if (p != null) { + NSLog.out.appendln("attribute "+attribute.name() + " in entity " + name() + " is (now?) an relationship which cannot have a validation rule, deleted from Valididy model"); + removeAttribute(attribute); + } else { + try { + if (attribute == null) { + NSLog.debug.appendln("attribute == null"); + } else if (attribute.name() == null) { + NSLog.debug.appendln("attribute.name() == null, attribute = "+attribute); + } else { + NSLog.debug.appendln("checking eo="+eoentity.name()+", attributename="+attribute.name()); + EOClassDescription eoclassdescription = EOClassDescription.classDescriptionForEntityName(eoentity.name()); + EOEnterpriseObject eoenterpriseobject = eoclassdescription.createInstanceWithEditingContext(null, null); + eoenterpriseobject.valueForKeyPath(attribute.name()); + } + } catch (com.webobjects.foundation.NSKeyValueCoding$UnknownKeyException e1) { + NSLog.debug.appendln(e1); + NSLog.out.appendln("attribute "+attribute.name() + " does not exist in entity " + name() + " anymore, deleted from Valididy model"); + removeAttribute(attribute); + } + } + } + } } Index: GSVModel.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Validity/Frameworks/Validity/Sources/com/gammastream/validity/GSVModel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GSVModel.java 15 Jun 2002 18:09:59 -0000 1.1 --- GSVModel.java 26 Nov 2002 18:58:09 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- import com.webobjects.eoaccess.*; import java.io.*; + import java.util.*; /** *************** *** 101,107 **** fos.write(codedString.getBytes()); fos.close(); return true; } catch(IOException e) { ! System.out.println(e); return false; } --- 102,109 ---- fos.write(codedString.getBytes()); fos.close(); + NSLog.out.appendln("did save model to file"); return true; } catch(IOException e) { ! NSLog.out.appendln(e); return false; } *************** *** 295,298 **** --- 297,314 ---- return null; } + } + + public void init(EOModel eomodel, EOEnterpriseObject eo) { + for (Enumeration e = entities().objectEnumerator(); e.hasMoreElements();) { + GSVEntity entity = (GSVEntity)e.nextElement(); + EOEntity eoentity = eomodel.entityNamed(entity.name()); + NSLog.debug.appendln("checking gsventity"+entity.name()); + if ( eoentity == null) { + removeEntity(entity); + NSLog.debug.appendln("removed obsolete gsventity"+entity.name()); + } else { + entity.init(this, eoentity); + } + } } |
From: Camille Troillard <tuscland@us...> - 2002-11-26 18:06:08
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Resources In directory sc8-pr-cvs1:/tmp/cvs-serv11100/Resources Modified Files: Properties Log Message: Added the System property er.javamail.XMailerHeader. Added defaultXMailerHeader in ERJavaMail. Index: Properties =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Resources/Properties,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Properties 30 Sep 2002 09:51:16 -0000 1.1 --- Properties 26 Nov 2002 18:05:34 -0000 1.2 *************** *** 20,21 **** --- 20,24 ---- # * Time to wait when mail sender queue is overflowed er.javamail.milliSecondsWaitIfSenderOverflowed = 6000 + + # Used to set a default X-Mailer + #er.javamail.mailer.XMailerHeader = |
From: Camille Troillard <tuscland@us...> - 2002-11-26 18:05:40
|
Update of /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail In directory sc8-pr-cvs1:/tmp/cvs-serv11100/Sources/er/javamail Modified Files: ERJavaMail.java ERMailDelivery.java Log Message: Added the System property er.javamail.XMailerHeader. Added defaultXMailerHeader in ERJavaMail. Index: ERJavaMail.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERJavaMail.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ERJavaMail.java 25 Nov 2002 18:20:54 -0000 1.6 --- ERJavaMail.java 26 Nov 2002 18:05:34 -0000 1.7 *************** *** 38,86 **** log.debug ("Initializing Framework."); ! Perl5Compiler compiler = new Perl5Compiler (); ! _matcher = new Perl5Matcher (); ! ! try { ! _pattern = compiler.compile (EMAIL_VALIDATION_PATTERN); ! } catch (MalformedPatternException e) { ! throw new RuntimeException ("The compilation of the ORO Regexp pattern failed in ERJavaMail!"); ! } ! ! this.initializeFrameworkFromSystemProperties (); ! log.info ("ERJavaMail: finished initialization"); } public void initializeFrameworkFromSystemProperties () { ! String adminEmail = System.getProperty ("er.javamail.adminEmail"); ! if ((adminEmail == null) || (adminEmail.length () == 0)) throw new RuntimeException ("ERJavaMail: the property er.javamail.adminEmail is not specified!"); this.setAdminEmail (adminEmail); ! log.debug ("er.javamail.adminEmail: " + _adminEmail); ! boolean debug = ERXProperties.booleanForKey ("er.javamail.debugEnabled"); this.setDebugEnabled (debug); ! log.debug ("er.javamail.debugEnabled: " + debug); boolean centralize = ERXProperties.booleanForKey ("er.javamail.centralize"); ! this.setCentralize (centralize); ! log.debug ("er.javamail.centralize: " + centralize); ! int milliswait = ERXProperties.intForKey ("er.javamail.milliSecondsWaitIfSenderOverflowed"); if (milliswait > 1000) ! this.setMilliSecondsWaitIfSenderOverflowed (milliswait); ! log.debug ("er.javamail.milliSecondsWaitIfSenderOverflowed: " + milliswait); ! // Finish intialization ! String smtpHost = System.getProperty ("er.javamail.smtpHost"); if ((smtpHost == null) || (smtpHost.length () == 0)) throw new RuntimeException ("ERJavaMail: You must specify a SMTP host for outgoing mail with the property 'er.javamail.smtpHost'"); ! log.debug ("er.javamail.smtpHost: " + smtpHost); Properties props = new Properties (); props.put ("mail.smtp.host", smtpHost); this.setDefaultProperties (props); - javax.mail.Session session = javax.mail.Session.getDefaultInstance (this.defaultProperties (), null); ! this.setDefaultSession (session); } --- 38,94 ---- log.debug ("Initializing Framework."); ! Perl5Compiler compiler = new Perl5Compiler (); ! _matcher = new Perl5Matcher (); ! ! try { ! _pattern = compiler.compile (EMAIL_VALIDATION_PATTERN); ! } catch (MalformedPatternException e) { ! throw new RuntimeException ("The compilation of the ORO Regexp pattern failed in ERJavaMail!"); ! } ! ! this.initializeFrameworkFromSystemProperties (); ! log.info ("ERJavaMail: finished initialization"); } public void initializeFrameworkFromSystemProperties () { ! // Admin Email ! String adminEmail = System.getProperty ("er.javamail.adminEmail"); ! if ((adminEmail == null) || (adminEmail.length () == 0)) throw new RuntimeException ("ERJavaMail: the property er.javamail.adminEmail is not specified!"); this.setAdminEmail (adminEmail); ! log.debug ("er.javamail.adminEmail: " + _adminEmail); ! // JavaMail Debug Enabled ? ! boolean debug = ERXProperties.booleanForKey ("er.javamail.debugEnabled"); this.setDebugEnabled (debug); ! log.debug ("er.javamail.debugEnabled: " + debug); + // Centralize mails ? boolean centralize = ERXProperties.booleanForKey ("er.javamail.centralize"); ! this.setCentralize (centralize); ! log.debug ("er.javamail.centralize: " + centralize); ! // Time to wait when sender if overflowed ! int milliswait = ERXProperties.intForKey ("er.javamail.milliSecondsWaitIfSenderOverflowed"); if (milliswait > 1000) ! this.setMilliSecondsWaitIfSenderOverflowed (milliswait); ! log.debug ("er.javamail.milliSecondsWaitIfSenderOverflowed: " + milliswait); ! // Smtp host ! String smtpHost = System.getProperty ("er.javamail.smtpHost"); if ((smtpHost == null) || (smtpHost.length () == 0)) throw new RuntimeException ("ERJavaMail: You must specify a SMTP host for outgoing mail with the property 'er.javamail.smtpHost'"); ! log.debug ("er.javamail.smtpHost: " + smtpHost); + // With the smtp-host, we can setup the session Properties props = new Properties (); props.put ("mail.smtp.host", smtpHost); this.setDefaultProperties (props); javax.mail.Session session = javax.mail.Session.getDefaultInstance (this.defaultProperties (), null); ! this.setDefaultSession (session); ! ! // Default X-Mailer header ! this.setDefaultXMailerHeader (System.getProperty ("er.javamail.XMailerHeader")); ! log.debug ("er.javamail.smtpHost: " + smtpHost); } *************** *** 134,137 **** --- 142,146 ---- } + protected boolean _debugEnabled = true; *************** *** 145,148 **** --- 154,175 ---- + /** This property sets the default header for the X-Mailer property */ + protected String _defaultXMailerHeader = null; + + /** + * Gets the default X-Mailer header to use for + * sending mails. Pulls the value out of the + * property: er.javamail.XMailerHeader + * @return default X-Mailer header + */ + public String defaultXMailerHeader () { + return _defaultXMailerHeader; + } + + public void setDefaultXMailerHeader (String header) { + _defaultXMailerHeader = header; + } + + /** Used to send mail to adminEmail only. Useful for debugging issues */ protected boolean _centralize = true; *************** *** 171,178 **** // MAIL VALIDATION /** Validates an enterprise object's attribute (accessed via key). ! @param object the object to be validated ! @param key the attribute's name ! @param email the email value ! @return the email if correct */ public String validateEmail (EOEnterpriseObject object, String key, String email) { if (email != null) { --- 198,205 ---- // MAIL VALIDATION /** Validates an enterprise object's attribute (accessed via key). ! @param object the object to be validated ! @param key the attribute's name ! @param email the email value ! @return the email if correct */ public String validateEmail (EOEnterpriseObject object, String key, String email) { if (email != null) { *************** *** 194,198 **** /** Define a standard ERJavMail exception */ public static class Exception extends java.lang.Exception { ! public Exception (String message) { super (message); } } } --- 221,225 ---- /** Define a standard ERJavMail exception */ public static class Exception extends java.lang.Exception { ! public Exception (String message) { super (message); } } } Index: ERMailDelivery.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Frameworks/ERJavaMail/Sources/er/javamail/ERMailDelivery.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ERMailDelivery.java 25 Nov 2002 18:20:54 -0000 1.3 --- ERMailDelivery.java 26 Nov 2002 18:05:35 -0000 1.4 *************** *** 1,7 **** /* ! $Id$ ! ERMailDelivery.java - Camille Troillard - tuscland@... ! */ package er.javamail; --- 1,7 ---- /* ! $Id$ ! ERMailDelivery.java - Camille Troillard - tuscland@... ! */ package er.javamail; *************** *** 21,35 **** /** This is the main class for sending mail with the JavaMail API. ! You typically don't create instances of this class since it is abstract. ! You should create instances of its subclasses that fitted with specifical ! use cases.<BR> ! Here is an example of its usage. ! <PRE> ! ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); ! mail.setWOComponentContent (mailPage); ! try { mail.newMail (); mail.setFromAddress (emailFrom); --- 21,35 ---- /** This is the main class for sending mail with the JavaMail API. ! You typically don't create instances of this class since it is abstract. ! You should create instances of its subclasses that fitted with specifical ! use cases.<BR> ! Here is an example of its usage. ! <PRE> ! ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); ! mail.setWOComponentContent (mailPage); ! try { mail.newMail (); mail.setFromAddress (emailFrom); *************** *** 40,49 **** // Send the mail mail.sendMail (); ! } catch (Exception e) { // do something ... ! } ! </PRE> ! @author Camille Troillard <tuscland@...> */ public abstract class ERMailDelivery { --- 40,49 ---- // Send the mail mail.sendMail (); ! } catch (Exception e) { // do something ... ! } ! </PRE> ! @author Camille Troillard <tuscland@...> */ public abstract class ERMailDelivery { *************** *** 80,84 **** callBackMethodName = methodName; } ! protected javax.mail.Session session () { return _session; --- 80,84 ---- callBackMethodName = methodName; } ! protected javax.mail.Session session () { return _session; *************** *** 107,111 **** this.setMimeMessage (new MimeMessage (this.session ())); } ! protected MimeMessage mimeMessage () { return _mimeMessage; --- 107,111 ---- this.setMimeMessage (new MimeMessage (this.session ())); } ! protected MimeMessage mimeMessage () { return _mimeMessage; *************** *** 125,133 **** protected NSMutableArray _inlineAttachments () { ! if (_inlineAttachments == null) ! _inlineAttachments = new NSMutableArray (); return _inlineAttachments; } ! public NSArray inlineAttachments () { return this._inlineAttachments (); --- 125,133 ---- protected NSMutableArray _inlineAttachments () { ! if (_inlineAttachments == null) ! _inlineAttachments = new NSMutableArray (); return _inlineAttachments; } ! public NSArray inlineAttachments () { return this._inlineAttachments (); *************** *** 135,140 **** protected NSMutableArray _attachments () { ! if (_attachments == null) ! _attachments = new NSMutableArray (); return _attachments; } --- 135,140 ---- protected NSMutableArray _attachments () { ! if (_attachments == null) ! _attachments = new NSMutableArray (); return _attachments; } *************** *** 157,162 **** public void setReplyToAddress (String replyToAddress) throws MessagingException, AddressException { this.mimeMessage ().setReplyTo (new InternetAddress [] { ! new InternetAddress (replyToAddress) ! }); } --- 157,162 ---- public void setReplyToAddress (String replyToAddress) throws MessagingException, AddressException { this.mimeMessage ().setReplyTo (new InternetAddress [] { ! new InternetAddress (replyToAddress) ! }); } *************** *** 200,204 **** /** ! * Sets the X-Mailer header for the message. Useful for tracking * which mailers are sending messages. * @param xMailer value to set --- 200,204 ---- /** ! * Sets the X-Mailer header for the message. Useful for tracking * which mailers are sending messages. * @param xMailer value to set *************** *** 209,213 **** /** ! * Gets the X-Mailer header set on the * MimeMessage. * @return X-Mailer header if it is set --- 209,213 ---- /** ! * Gets the X-Mailer header set on the * MimeMessage. * @return X-Mailer header if it is set *************** *** 219,223 **** /** ! * Builds an ERMessage for the current MimeMessage. * @return ERMessage for the current MimeMessage. */ --- 219,223 ---- /** ! * Builds an ERMessage for the current MimeMessage. * @return ERMessage for the current MimeMessage. */ *************** *** 230,234 **** /** ! * Sends the mail immediately. The message is put in a FIFO queue managed * by a static threaded inner class */ --- 230,234 ---- /** ! * Sends the mail immediately. The message is put in a FIFO queue managed * by a static threaded inner class */ *************** *** 240,247 **** + ERXUtilities.stackTrace (e)); } ! } /** ! * Method used to construct a MimeMessage and then send * it. This method can be specified to block until the * message is sent or to add the message to a queue and have --- 240,247 ---- + ERXUtilities.stackTrace (e)); } ! } /** ! * Method used to construct a MimeMessage and then send * it. This method can be specified to block until the * message is sent or to add the message to a queue and have *************** *** 253,269 **** */ public void sendMail (boolean shouldBlock) throws ERMailSender.ForwardException { ! try { ! // add the current message to the message stack ! boolean mailAccepted = false; ! this.finishMessagePreparation (); while (!mailAccepted) { ! this.mimeMessage ().setSentDate (new Date ()); try { ! ERMailSender.sharedMailSender ().sendMessage (this.buildMessage (), shouldBlock); ! mailAccepted = true; ! } catch (ERMailSender.SizeOverflowException e) { // The mail sender is overflowed, we need to wait try { --- 253,269 ---- */ public void sendMail (boolean shouldBlock) throws ERMailSender.ForwardException { ! try { ! // add the current message to the message stack ! boolean mailAccepted = false; ! this.finishMessagePreparation (); while (!mailAccepted) { ! this.mimeMessage ().setSentDate (new Date ()); try { ! ERMailSender.sharedMailSender ().sendMessage (this.buildMessage (), shouldBlock); ! mailAccepted = true; ! } catch (ERMailSender.SizeOverflowException e) { // The mail sender is overflowed, we need to wait try { *************** *** 275,320 **** } } catch (ERMailSender.Exception e) { ! log.warn ("ERMailSender.Exception exception caught, re-throwing exception."); ! throw new ERMailSender.ForwardException (e); } - } - } catch (MessagingException e) { - log.warn ("MessagingException exception caught, re-throwing exception."); - throw new ERMailSender.ForwardException (e); - } finally { - this.setMimeMessage (null); - } } protected void finishMessagePreparation () throws MessagingException { ! DataHandler messageDataHandler = messageDataHandler = this.prepareMail (); ! // Add all the attachements to the javamail message ! if (this.attachments ().count () > 0) { ! // Create a Multipart that will hold the prepared multipart and the attachments ! MimeMultipart multipart = new MimeMultipart (); ! // Create the main body part ! BodyPart mainBodyPart = new MimeBodyPart (); ! mainBodyPart.setDataHandler (messageDataHandler); ! // add the main body part to the content of the message ! multipart.addBodyPart (mainBodyPart); ! // add each attachments to the former multipart ! Enumeration en = this.attachments ().objectEnumerator (); ! while (en.hasMoreElements ()) { ! ERMailAttachment attachment = (ERMailAttachment)en.nextElement (); ! BodyPart bp = attachment.getBodyPart (); ! bp.setDisposition (Part.ATTACHMENT); ! multipart.addBodyPart (bp); ! } ! this.mimeMessage ().setContent (multipart); ! } else { ! this.mimeMessage ().setDataHandler (messageDataHandler); ! } ! this.mimeMessage ().saveChanges (); } --- 275,326 ---- } } catch (ERMailSender.Exception e) { ! log.warn ("ERMailSender.Exception exception caught, re-throwing exception."); ! throw new ERMailSender.ForwardException (e); ! } ! } ! } catch (MessagingException e) { ! log.warn ("MessagingException exception caught, re-throwing exception."); ! throw new ERMailSender.ForwardException (e); ! } finally { ! this.setMimeMessage (null); } } protected void finishMessagePreparation () throws MessagingException { ! DataHandler messageDataHandler = messageDataHandler = this.prepareMail (); ! // Add all the attachements to the javamail message ! if (this.attachments ().count () > 0) { ! // Create a Multipart that will hold the prepared multipart and the attachments ! MimeMultipart multipart = new MimeMultipart (); ! // Create the main body part ! BodyPart mainBodyPart = new MimeBodyPart (); ! mainBodyPart.setDataHandler (messageDataHandler); ! // add the main body part to the content of the message ! multipart.addBodyPart (mainBodyPart); ! // add each attachments to the former multipart ! Enumeration en = this.attachments ().objectEnumerator (); ! while (en.hasMoreElements ()) { ! ERMailAttachment attachment = (ERMailAttachment)en.nextElement (); ! BodyPart bp = attachment.getBodyPart (); ! bp.setDisposition (Part.ATTACHMENT); ! multipart.addBodyPart (bp); ! } ! this.mimeMessage ().setContent (multipart); ! } else { ! this.mimeMessage ().setDataHandler (messageDataHandler); ! } ! // If the xMailer property has not been set, check if one has been provided ! // in the System properties ! if ((this.xMailerHeader () == null) && ! (ERJavaMail.sharedInstance ().defaultXMailerHeader () != null)) ! this.setXMailerHeader (ERJavaMail.sharedInstance ().defaultXMailerHeader ()); ! ! this.mimeMessage ().saveChanges (); } *************** *** 322,337 **** private void setAddresses (NSArray addressesArray, Message.RecipientType type) throws MessagingException, AddressException { ! InternetAddress [] addresses = null; ! if (!ERJavaMail.sharedInstance ().centralize ()) ! addresses = ERMailUtils.convertNSArrayToInternetAddresses (addressesArray); ! else ! addresses = new InternetAddress [] { new InternetAddress (ERJavaMail.sharedInstance ().adminEmail ()) }; ! this.mimeMessage ().setRecipients (type, addresses); ! } /** ! * Abstract method called by subclasses for doing pre-processing before sending the mail. * @return the multipart used to put in the mail. */ --- 328,343 ---- private void setAddresses (NSArray addressesArray, Message.RecipientType type) throws MessagingException, AddressException { ! InternetAddress [] addresses = null; ! if (!ERJavaMail.sharedInstance ().centralize ()) ! addresses = ERMailUtils.convertNSArrayToInternetAddresses (addressesArray); ! else ! addresses = new InternetAddress [] { new InternetAddress (ERJavaMail.sharedInstance ().adminEmail ()) }; ! this.mimeMessage ().setRecipients (type, addresses); ! } /** ! * Abstract method called by subclasses for doing pre-processing before sending the mail. * @return the multipart used to put in the mail. */ |
From: Camille Troillard <tuscland@us...> - 2002-11-26 18:04:24
|
Update of /cvsroot/wonder/Wonder/Common/Applications/ERMailer/Sources/er/javamail/mailer In directory sc8-pr-cvs1:/tmp/cvs-serv10719/Sources/er/javamail/mailer Modified Files: ERMailer.java ERMailerUtilities.java Log Message: Moved down defaultXMailerHeader to er.javamail. Also moved the property er.javamail.mailer.XMailerHeader to er.javamail.XMailerHeader. Index: ERMailer.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Applications/ERMailer/Sources/er/javamail/mailer/ERMailer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ERMailer.java 25 Oct 2002 18:12:27 -0000 1.1 --- ERMailer.java 26 Nov 2002 18:04:20 -0000 1.2 *************** *** 93,105 **** } } - - /** - * Gets the default X-Mailer header to use for - * sending mails. Pulls the value out of the - * property: er.javamail.mailer.XMailerHeader - * @return default X-Mailer header - */ - public String defaultXMailerHeader() { - return System.getProperty("er.javamail.mailer.XMailerHeader"); - } } --- 93,95 ---- Index: ERMailerUtilities.java =================================================================== RCS file: /cvsroot/wonder/Wonder/Common/Applications/ERMailer/Sources/er/javamail/mailer/ERMailerUtilities.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ERMailerUtilities.java 25 Oct 2002 18:12:27 -0000 1.1 --- ERMailerUtilities.java 26 Nov 2002 18:04:20 -0000 1.2 *************** *** 45,52 **** // Set the xMailer if one is specified if (message.xMailer() != null) mail.setXMailerHeader(message.xMailer()); - else if (ERMailer.instance().defaultXMailerHeader() != null) - mail.setXMailerHeader(ERMailer.instance().defaultXMailerHeader()); // Set the content --- 45,52 ---- // Set the xMailer if one is specified + // Note (tuscland): setXMailerHeader has a higher precedence over + // System property er.javamail.XMailerHeader if (message.xMailer() != null) mail.setXMailerHeader(message.xMailer()); // Set the content |