Re: setting properties ??
Hi Ted, I am doing this if I want different settings from the application properties: ERJavaMail jm = ERJavaMail.sharedInstance(); Properties props = jm.defaultSession().getProperties(); props.put(mail.smtp.host, smtpHost); props.put(mail.smtp.auth, smtpAuth); props.put(mail.smtp.user, smtpUser); props.put(mail.smtp.password, smtpPassword); Session session = jm.newSession(props); ERMailDeliveryPlainText mail = new ERMailDeliveryPlainText(session); ... jw Am 29.10.2011 um 00:35 schrieb Theodore Petrosky: but how do you handle the situation where you don't know the smtp server, or the smtp server is changing? I want to store the smtp server (and port) as an attribute in my database then I can adjust it as needed. Am I thinking about this 'wrong'? TEd -- Message: 1 Date: Tue, 25 Oct 2011 00:34:43 +0200 From: Philippe Rabier prab...@me.com Subject: Re: setting properties ?? To: WebObjects Development webobjects-dev@lists.apple.com Message-ID: 476a4ac8-52de-4901-aa2f-df45dd3d4...@me.com Content-Type: text/plain; CHARSET=US-ASCII Theodore, I'm afraid you use properties the wrong way. Personally, I never set properties in my own code, only read them (except for frameworks I wrote of course). Properties are used to initialize informations. By setting default values in your framework, you can change them in your application. And you can have several properties files in your have with a different suffix (Properties.staging, Properties.production for example). Then you can set a user through the WOMonitor in the additional arguments like -Duser.name=staging and the right file will be opened. I hope you read the wiki because there are useful informations like http://wiki.objectstyle.org/confluence/display/WO/Project+Wonder+Properties+Files Now if you want to modify on the fly ERJavaMail, use the accessors like setCentralize(boolean) for example because properties can be read once during initialization. If you don't find an accessor, maybe you can't change it. I wouldn't be surprised if the smtp host is one of them. Philippe On 24 oct. 2011, at 16:39, Theodore Petrosky wrote: --- On Sun, 10/23/11, Kieran Kelleher kelleh...@gmail.com wrote: From: Kieran Kelleher kelleh...@gmail.com Subject: Re: setting properties ?? To: Theodore Petrosky tedp...@yahoo.com Cc: webobjects-dev@lists.apple.com Date: Sunday, October 23, 2011, 10:42 PM You can specify the properties in your Properties file (inside Resources folder in your project), for example: er.javamail.centralize=false what I am discovering is that there are some ERJavaMail attributes that can be adjusted on the fly. centralize is not one of them. I have a little dummy app for testing and after I put the er.javamail.centralize=false in the Properties file, I can put: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); in my component and it will use this mail server. however if it is commented out, it will not find a mail server and the sending will fail. Now I will experiment to discover what other attributes MUST be in the Properties file and which can be adjusted on the fly. Ted On Oct 23, 2011, at 7:34 AM, Theodore Petrosky wrote: I am working with sending email notifications when my users save edits to EOs. I discovered that I can update the properties from my app (in the application constructor) with: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); ERXProperties.setStringForKey(35, mail.smtp.port); ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetrosky, er.javamail.smtpUser); ERXProperties.setStringForKey(, er.javamail.smtpPassword); ERXProperties.setStringForKey(true, er.javamail.smtpAuth); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); so (as I am just playing because I need to learn more) I added some log statements in my save method: public WOActionResults saveChangesToItem() { . . . . . ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); IOChangeEmail component = pageWithName(IOChangeEmail.class); mail.setComponent(component); System.out.println(inside try mail.smtp.host = + ERXProperties.stringForKey(mail.smtp.host)); System.out.println(inside try mail.smtp.port = + ERXProperties.stringForKey(mail.smtp.port)); System.out.println(inside try er.javamail.centralize = + ERXProperties.stringForKey(er.javamail.centralize)); System.out.println(inside try er.javamail.adminEmail = + ERXProperties.stringForKey(er.javamail.adminEmail)); mail.newMail(); mail.setToAddress(tedp...@yahoo.com, Theodore Petrosky); mail.setFromAddress(tpetro...@agencysacks.com, Ted
Re: setting properties ??
but how do you handle the situation where you don't know the smtp server, or the smtp server is changing? I want to store the smtp server (and port) as an attribute in my database then I can adjust it as needed. Am I thinking about this 'wrong'? TEd -- Message: 1 Date: Tue, 25 Oct 2011 00:34:43 +0200 From: Philippe Rabier prab...@me.com Subject: Re: setting properties ?? To: WebObjects Development webobjects-dev@lists.apple.com Message-ID: 476a4ac8-52de-4901-aa2f-df45dd3d4...@me.com Content-Type: text/plain; CHARSET=US-ASCII Theodore, I'm afraid you use properties the wrong way. Personally, I never set properties in my own code, only read them (except for frameworks I wrote of course). Properties are used to initialize informations. By setting default values in your framework, you can change them in your application. And you can have several properties files in your have with a different suffix (Properties.staging, Properties.production for example). Then you can set a user through the WOMonitor in the additional arguments like -Duser.name=staging and the right file will be opened. I hope you read the wiki because there are useful informations like http://wiki.objectstyle.org/confluence/display/WO/Project+Wonder+Properties+Files Now if you want to modify on the fly ERJavaMail, use the accessors like setCentralize(boolean) for example because properties can be read once during initialization. If you don't find an accessor, maybe you can't change it. I wouldn't be surprised if the smtp host is one of them. Philippe On 24 oct. 2011, at 16:39, Theodore Petrosky wrote: --- On Sun, 10/23/11, Kieran Kelleher kelleh...@gmail.com wrote: From: Kieran Kelleher kelleh...@gmail.com Subject: Re: setting properties ?? To: Theodore Petrosky tedp...@yahoo.com Cc: webobjects-dev@lists.apple.com Date: Sunday, October 23, 2011, 10:42 PM You can specify the properties in your Properties file (inside Resources folder in your project), for example: er.javamail.centralize=false what I am discovering is that there are some ERJavaMail attributes that can be adjusted on the fly. centralize is not one of them. I have a little dummy app for testing and after I put the er.javamail.centralize=false in the Properties file, I can put: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); in my component and it will use this mail server. however if it is commented out, it will not find a mail server and the sending will fail. Now I will experiment to discover what other attributes MUST be in the Properties file and which can be adjusted on the fly. Ted On Oct 23, 2011, at 7:34 AM, Theodore Petrosky wrote: I am working with sending email notifications when my users save edits to EOs. I discovered that I can update the properties from my app (in the application constructor) with: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); ERXProperties.setStringForKey(35, mail.smtp.port); ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetrosky, er.javamail.smtpUser); ERXProperties.setStringForKey(, er.javamail.smtpPassword); ERXProperties.setStringForKey(true, er.javamail.smtpAuth); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); so (as I am just playing because I need to learn more) I added some log statements in my save method: public WOActionResults saveChangesToItem() { . . . . . ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); IOChangeEmail component = pageWithName(IOChangeEmail.class); mail.setComponent(component); System.out.println(inside try mail.smtp.host = + ERXProperties.stringForKey(mail.smtp.host)); System.out.println(inside try mail.smtp.port = + ERXProperties.stringForKey(mail.smtp.port)); System.out.println(inside try er.javamail.centralize = + ERXProperties.stringForKey(er.javamail.centralize)); System.out.println(inside try er.javamail.adminEmail = + ERXProperties.stringForKey(er.javamail.adminEmail)); mail.newMail(); mail.setToAddress(tedp...@yahoo.com, Theodore Petrosky); mail.setFromAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setReplyToAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setSubject(An IO was edited and saved!!); mail.sendMail(); . . . . } this is the console: Oct 23 02:27:06 ASChelseaLoginGrid[56901] DEBUG NSLog - === Commit Internal Transaction inside try mail.smtp.host = mail.agencysacks.com inside try mail.smtp.port = 35 inside try er.javamail.centralize = false
Re: setting properties ??
Hi Ted, try following: NSProperties.sharedInstance().setPropertyForKey(value-from-db, desired-key); Farrukh On 2011-10-29, at 1:35 AM, Theodore Petrosky wrote: but how do you handle the situation where you don't know the smtp server, or the smtp server is changing? I want to store the smtp server (and port) as an attribute in my database then I can adjust it as needed. Am I thinking about this 'wrong'? TEd -- Message: 1 Date: Tue, 25 Oct 2011 00:34:43 +0200 From: Philippe Rabier prab...@me.com Subject: Re: setting properties ?? To: WebObjects Development webobjects-dev@lists.apple.com Message-ID: 476a4ac8-52de-4901-aa2f-df45dd3d4...@me.com Content-Type: text/plain; CHARSET=US-ASCII Theodore, I'm afraid you use properties the wrong way. Personally, I never set properties in my own code, only read them (except for frameworks I wrote of course). Properties are used to initialize informations. By setting default values in your framework, you can change them in your application. And you can have several properties files in your have with a different suffix (Properties.staging, Properties.production for example). Then you can set a user through the WOMonitor in the additional arguments like -Duser.name=staging and the right file will be opened. I hope you read the wiki because there are useful informations like http://wiki.objectstyle.org/confluence/display/WO/Project+Wonder+Properties+Files Now if you want to modify on the fly ERJavaMail, use the accessors like setCentralize(boolean) for example because properties can be read once during initialization. If you don't find an accessor, maybe you can't change it. I wouldn't be surprised if the smtp host is one of them. Philippe On 24 oct. 2011, at 16:39, Theodore Petrosky wrote: --- On Sun, 10/23/11, Kieran Kelleher kelleh...@gmail.com wrote: From: Kieran Kelleher kelleh...@gmail.com Subject: Re: setting properties ?? To: Theodore Petrosky tedp...@yahoo.com Cc: webobjects-dev@lists.apple.com Date: Sunday, October 23, 2011, 10:42 PM You can specify the properties in your Properties file (inside Resources folder in your project), for example: er.javamail.centralize=false what I am discovering is that there are some ERJavaMail attributes that can be adjusted on the fly. centralize is not one of them. I have a little dummy app for testing and after I put the er.javamail.centralize=false in the Properties file, I can put: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); in my component and it will use this mail server. however if it is commented out, it will not find a mail server and the sending will fail. Now I will experiment to discover what other attributes MUST be in the Properties file and which can be adjusted on the fly. Ted On Oct 23, 2011, at 7:34 AM, Theodore Petrosky wrote: I am working with sending email notifications when my users save edits to EOs. I discovered that I can update the properties from my app (in the application constructor) with: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); ERXProperties.setStringForKey(35, mail.smtp.port); ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetrosky, er.javamail.smtpUser); ERXProperties.setStringForKey(, er.javamail.smtpPassword); ERXProperties.setStringForKey(true, er.javamail.smtpAuth); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); so (as I am just playing because I need to learn more) I added some log statements in my save method: public WOActionResults saveChangesToItem() { . . . . . ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); IOChangeEmail component = pageWithName(IOChangeEmail.class); mail.setComponent(component); System.out.println(inside try mail.smtp.host = + ERXProperties.stringForKey(mail.smtp.host)); System.out.println(inside try mail.smtp.port = + ERXProperties.stringForKey(mail.smtp.port)); System.out.println(inside try er.javamail.centralize = + ERXProperties.stringForKey(er.javamail.centralize)); System.out.println(inside try er.javamail.adminEmail = + ERXProperties.stringForKey(er.javamail.adminEmail)); mail.newMail(); mail.setToAddress(tedp...@yahoo.com, Theodore Petrosky); mail.setFromAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setReplyToAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setSubject(An IO was edited and saved!!); mail.sendMail(); . . . . } this is the console: Oct 23 02:27:06 ASChelseaLoginGrid[56901] DEBUG NSLog - === Commit Internal Transaction inside try mail.smtp.host
Re: setting properties ??
Am 23.10.2011 um 13:34 schrieb Theodore Petrosky: […] er.javamail.centralize was set to false in the application constructor. However it was ignored and when I looked at the logs in the mail server I see that the toAddress was ad...@yourhost.com. which was odd as I was setting the adminEmail in the application constructor also. After experimenting I find that these two properties do not 'stick' even though my log statements claim that the values are correct. ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); bottom line, I got things to work, just not as I expected. Is this correct? Should I be adjusting the properties in the application constructor? If not, then where. Or maybe the better question is, Is there a better way to do this? Ted I would suppose that ERJavaMail was already initialized when you reached the application constructor so your property changes did not modify those values for the framework anymore. Kieran's suggestion should resolve your problem. jw ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: setting properties ??
--- On Sun, 10/23/11, Kieran Kelleher kelleh...@gmail.com wrote: From: Kieran Kelleher kelleh...@gmail.com Subject: Re: setting properties ?? To: Theodore Petrosky tedp...@yahoo.com Cc: webobjects-dev@lists.apple.com Date: Sunday, October 23, 2011, 10:42 PM You can specify the properties in your Properties file (inside Resources folder in your project), for example: er.javamail.centralize=false what I am discovering is that there are some ERJavaMail attributes that can be adjusted on the fly. centralize is not one of them. I have a little dummy app for testing and after I put the er.javamail.centralize=false in the Properties file, I can put: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); in my component and it will use this mail server. however if it is commented out, it will not find a mail server and the sending will fail. Now I will experiment to discover what other attributes MUST be in the Properties file and which can be adjusted on the fly. Ted On Oct 23, 2011, at 7:34 AM, Theodore Petrosky wrote: I am working with sending email notifications when my users save edits to EOs. I discovered that I can update the properties from my app (in the application constructor) with: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); ERXProperties.setStringForKey(35, mail.smtp.port); ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetrosky, er.javamail.smtpUser); ERXProperties.setStringForKey(, er.javamail.smtpPassword); ERXProperties.setStringForKey(true, er.javamail.smtpAuth); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); so (as I am just playing because I need to learn more) I added some log statements in my save method: public WOActionResults saveChangesToItem() { . . . . . ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); IOChangeEmail component = pageWithName(IOChangeEmail.class); mail.setComponent(component); System.out.println(inside try mail.smtp.host = + ERXProperties.stringForKey(mail.smtp.host)); System.out.println(inside try mail.smtp.port = + ERXProperties.stringForKey(mail.smtp.port)); System.out.println(inside try er.javamail.centralize = + ERXProperties.stringForKey(er.javamail.centralize)); System.out.println(inside try er.javamail.adminEmail = + ERXProperties.stringForKey(er.javamail.adminEmail)); mail.newMail(); mail.setToAddress(tedp...@yahoo.com, Theodore Petrosky); mail.setFromAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setReplyToAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setSubject(An IO was edited and saved!!); mail.sendMail(); . . . . } this is the console: Oct 23 02:27:06 ASChelseaLoginGrid[56901] DEBUG NSLog - === Commit Internal Transaction inside try mail.smtp.host = mail.agencysacks.com inside try mail.smtp.port = 35 inside try er.javamail.centralize = false inside try er.javamail.adminEmail = tpetro...@agencysacks.com Oct 23 02:27:09 ASChelseaLoginGrid[56901] DEBUG NSLog - === Begin Internal Transaction er.javamail.centralize was set to false in the application constructor. However it was ignored and when I looked at the logs in the mail server I see that the toAddress was ad...@yourhost.com. which was odd as I was setting the adminEmail in the application constructor also. After experimenting I find that these two properties do not 'stick' even though my log statements claim that the values are correct. ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); bottom line, I got things to work, just not as I expected. Is this correct? Should I be adjusting the properties in the application constructor? If not, then where. Or maybe the better question is, Is there a better way to do this? Ted ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com This email sent to kelleh...@gmail.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: setting properties ??
Theodore, I'm afraid you use properties the wrong way. Personally, I never set properties in my own code, only read them (except for frameworks I wrote of course). Properties are used to initialize informations. By setting default values in your framework, you can change them in your application. And you can have several properties files in your have with a different suffix (Properties.staging, Properties.production for example). Then you can set a user through the WOMonitor in the additional arguments like -Duser.name=staging and the right file will be opened. I hope you read the wiki because there are useful informations like http://wiki.objectstyle.org/confluence/display/WO/Project+Wonder+Properties+Files Now if you want to modify on the fly ERJavaMail, use the accessors like setCentralize(boolean) for example because properties can be read once during initialization. If you don't find an accessor, maybe you can't change it. I wouldn't be surprised if the smtp host is one of them. Philippe On 24 oct. 2011, at 16:39, Theodore Petrosky wrote: --- On Sun, 10/23/11, Kieran Kelleher kelleh...@gmail.com wrote: From: Kieran Kelleher kelleh...@gmail.com Subject: Re: setting properties ?? To: Theodore Petrosky tedp...@yahoo.com Cc: webobjects-dev@lists.apple.com Date: Sunday, October 23, 2011, 10:42 PM You can specify the properties in your Properties file (inside Resources folder in your project), for example: er.javamail.centralize=false what I am discovering is that there are some ERJavaMail attributes that can be adjusted on the fly. centralize is not one of them. I have a little dummy app for testing and after I put the er.javamail.centralize=false in the Properties file, I can put: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); in my component and it will use this mail server. however if it is commented out, it will not find a mail server and the sending will fail. Now I will experiment to discover what other attributes MUST be in the Properties file and which can be adjusted on the fly. Ted On Oct 23, 2011, at 7:34 AM, Theodore Petrosky wrote: I am working with sending email notifications when my users save edits to EOs. I discovered that I can update the properties from my app (in the application constructor) with: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); ERXProperties.setStringForKey(35, mail.smtp.port); ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetrosky, er.javamail.smtpUser); ERXProperties.setStringForKey(, er.javamail.smtpPassword); ERXProperties.setStringForKey(true, er.javamail.smtpAuth); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); so (as I am just playing because I need to learn more) I added some log statements in my save method: public WOActionResults saveChangesToItem() { . . . . . ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); IOChangeEmail component = pageWithName(IOChangeEmail.class); mail.setComponent(component); System.out.println(inside try mail.smtp.host = + ERXProperties.stringForKey(mail.smtp.host)); System.out.println(inside try mail.smtp.port = + ERXProperties.stringForKey(mail.smtp.port)); System.out.println(inside try er.javamail.centralize = + ERXProperties.stringForKey(er.javamail.centralize)); System.out.println(inside try er.javamail.adminEmail = + ERXProperties.stringForKey(er.javamail.adminEmail)); mail.newMail(); mail.setToAddress(tedp...@yahoo.com, Theodore Petrosky); mail.setFromAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setReplyToAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setSubject(An IO was edited and saved!!); mail.sendMail(); . . . . } this is the console: Oct 23 02:27:06 ASChelseaLoginGrid[56901] DEBUG NSLog - === Commit Internal Transaction inside try mail.smtp.host = mail.agencysacks.com inside try mail.smtp.port = 35 inside try er.javamail.centralize = false inside try er.javamail.adminEmail = tpetro...@agencysacks.com Oct 23 02:27:09 ASChelseaLoginGrid[56901] DEBUG NSLog - === Begin Internal Transaction er.javamail.centralize was set to false in the application constructor. However it was ignored and when I looked at the logs in the mail server I see that the toAddress was ad...@yourhost.com. which was odd as I was setting the adminEmail in the application constructor also. After experimenting I find that these two properties do not 'stick' even though my log statements claim that the values are correct. ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); bottom line, I got things to work, just
setting properties ??
I am working with sending email notifications when my users save edits to EOs. I discovered that I can update the properties from my app (in the application constructor) with: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); ERXProperties.setStringForKey(35, mail.smtp.port); ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetrosky, er.javamail.smtpUser); ERXProperties.setStringForKey(, er.javamail.smtpPassword); ERXProperties.setStringForKey(true, er.javamail.smtpAuth); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); so (as I am just playing because I need to learn more) I added some log statements in my save method: public WOActionResults saveChangesToItem() { . . . . . ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); IOChangeEmail component = pageWithName(IOChangeEmail.class); mail.setComponent(component); System.out.println(inside try mail.smtp.host = + ERXProperties.stringForKey(mail.smtp.host)); System.out.println(inside try mail.smtp.port = + ERXProperties.stringForKey(mail.smtp.port)); System.out.println(inside try er.javamail.centralize = + ERXProperties.stringForKey(er.javamail.centralize)); System.out.println(inside try er.javamail.adminEmail = + ERXProperties.stringForKey(er.javamail.adminEmail)); mail.newMail(); mail.setToAddress(tedp...@yahoo.com, Theodore Petrosky); mail.setFromAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setReplyToAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setSubject(An IO was edited and saved!!); mail.sendMail(); . . . . } this is the console: Oct 23 02:27:06 ASChelseaLoginGrid[56901] DEBUG NSLog - === Commit Internal Transaction inside try mail.smtp.host = mail.agencysacks.com inside try mail.smtp.port = 35 inside try er.javamail.centralize = false inside try er.javamail.adminEmail = tpetro...@agencysacks.com Oct 23 02:27:09 ASChelseaLoginGrid[56901] DEBUG NSLog - === Begin Internal Transaction er.javamail.centralize was set to false in the application constructor. However it was ignored and when I looked at the logs in the mail server I see that the toAddress was ad...@yourhost.com. which was odd as I was setting the adminEmail in the application constructor also. After experimenting I find that these two properties do not 'stick' even though my log statements claim that the values are correct. ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); bottom line, I got things to work, just not as I expected. Is this correct? Should I be adjusting the properties in the application constructor? If not, then where. Or maybe the better question is, Is there a better way to do this? Ted ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: setting properties ??
You can specify the properties in your Properties file (inside Resources folder in your project), for example: er.javamail.centralize=false On Oct 23, 2011, at 7:34 AM, Theodore Petrosky wrote: I am working with sending email notifications when my users save edits to EOs. I discovered that I can update the properties from my app (in the application constructor) with: ERXProperties.setStringForKey(mail.agencysacks.com, mail.smtp.host); ERXProperties.setStringForKey(35, mail.smtp.port); ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetrosky, er.javamail.smtpUser); ERXProperties.setStringForKey(, er.javamail.smtpPassword); ERXProperties.setStringForKey(true, er.javamail.smtpAuth); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); so (as I am just playing because I need to learn more) I added some log statements in my save method: public WOActionResults saveChangesToItem() { . . . . . ERMailDeliveryHTML mail = new ERMailDeliveryHTML (); IOChangeEmail component = pageWithName(IOChangeEmail.class); mail.setComponent(component); System.out.println(inside try mail.smtp.host = + ERXProperties.stringForKey(mail.smtp.host)); System.out.println(inside try mail.smtp.port = + ERXProperties.stringForKey(mail.smtp.port)); System.out.println(inside try er.javamail.centralize = + ERXProperties.stringForKey(er.javamail.centralize)); System.out.println(inside try er.javamail.adminEmail = + ERXProperties.stringForKey(er.javamail.adminEmail)); mail.newMail(); mail.setToAddress(tedp...@yahoo.com, Theodore Petrosky); mail.setFromAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setReplyToAddress(tpetro...@agencysacks.com, Ted Petrosky); mail.setSubject(An IO was edited and saved!!); mail.sendMail(); . . . . } this is the console: Oct 23 02:27:06 ASChelseaLoginGrid[56901] DEBUG NSLog - === Commit Internal Transaction inside try mail.smtp.host = mail.agencysacks.com inside try mail.smtp.port = 35 inside try er.javamail.centralize = false inside try er.javamail.adminEmail = tpetro...@agencysacks.com Oct 23 02:27:09 ASChelseaLoginGrid[56901] DEBUG NSLog - === Begin Internal Transaction er.javamail.centralize was set to false in the application constructor. However it was ignored and when I looked at the logs in the mail server I see that the toAddress was ad...@yourhost.com. which was odd as I was setting the adminEmail in the application constructor also. After experimenting I find that these two properties do not 'stick' even though my log statements claim that the values are correct. ERXProperties.setStringForKey(false, er.javamail.centralize); ERXProperties.setStringForKey(tpetro...@agencysacks.com, er.javamail.adminEmail); bottom line, I got things to work, just not as I expected. Is this correct? Should I be adjusting the properties in the application constructor? If not, then where. Or maybe the better question is, Is there a better way to do this? Ted ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/kelleherk%40gmail.com This email sent to kelleh...@gmail.com ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Trouble setting properties in ERJavaMail
I'm struggling trying to figure out where the properties file is supposed to be that loads in settings for ERJavaMail. I have searched and found listings of the properties I should set to fix my problem, but I can't figure out where to put them. I have tried putting them in the properties file in my project directory, and I have tried putting them in the properties file in the framework itself. No matter where I put this, # * Enables ERJavaMail to send all the mails to only one destination # This is useful when debugging er.javamail.centralize = false I still get this, Exception sending email: java.lang.IllegalArgumentException: When setting 'er.javamail.centralize=true' (which means you just test sending mails), you must also give a valid '[EMAIL PROTECTED]' to which the mails are sent. I have downloaded the latest build of Project Wonder as well since I found an old thread that suggested there was bug loading properties. Can anyone point me in the right direction. Thanks, Kevin ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to archive@mail-archive.com
Re: Trouble setting properties in ERJavaMail
On 29.03.2007, at 10:38, Kevin Windham wrote: # * Enables ERJavaMail to send all the mails to only one destination # This is useful when debugging er.javamail.centralize = false I still get this, Exception sending email: java.lang.IllegalArgumentException: When setting 'er.javamail.centralize=true' (which means you just test sending mails), you must also give a valid '[EMAIL PROTECTED]' to which the mails are sent. The setting goes to one of your Properties file. Either in a framework or in the application itself. If your settings are not loaded and you use Eclipse you should check your pattern sets whether Properties are actually included (we had a case yesterday where they were not included). And by the way: there is a Wonder discussion list. cug ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to archive@mail-archive.com
Re: Trouble setting properties in ERJavaMail
In your project there is a file named Properties in the Resources folder. If using Eclipse, you may need to adjust the project explorer filter settings since it may be hidden if you don't see it. Anyway, you can put property settings in there. You can put custom ones for your app, WebObjects and/or also override properties that are used in any Frameworks. For example if you look at the Wonder frameworks, most properties are in the Properties file in those frameworks, often with default values and/or commented out just so you know the Properties exist. Of course to learn what a property does in Project Wonder, you should search the framework source to see its usage and then you know what it does! don't worry, searching Wonder source is good for you and will teach you more about WebObjects *and* Project Wonder! Also, as you examine the source, you will discover undocumented useful properties that you can use. The main thing is to override and set Wonder Properties in your app Properties file. Changing the Properties file inside the Wonder frameworks is not good since it will be blown away when you download new version. HTH, Kieran On Mar 29, 2007, at 12:38 PM, Kevin Windham wrote: I'm struggling trying to figure out where the properties file is supposed to be that loads in settings for ERJavaMail. I have searched and found listings of the properties I should set to fix my problem, but I can't figure out where to put them. I have tried putting them in the properties file in my project directory, and I have tried putting them in the properties file in the framework itself. No matter where I put this, # * Enables ERJavaMail to send all the mails to only one destination # This is useful when debugging er.javamail.centralize = false I still get this, Exception sending email: java.lang.IllegalArgumentException: When setting 'er.javamail.centralize=true' (which means you just test sending mails), you must also give a valid '[EMAIL PROTECTED]' to which the mails are sent. I have downloaded the latest build of Project Wonder as well since I found an old thread that suggested there was bug loading properties. Can anyone point me in the right direction. Thanks, Kevin ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists% 40mac.com This email sent to [EMAIL PROTECTED] ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to archive@mail-archive.com