Re: How does one call Application.setSMTPHost from the client side?
Re: How does one call Application.setSMTPHost from the client side?
- Subject: Re: How does one call Application.setSMTPHost from the client side?
- From: "B. Shank" <email@hidden>
- Date: Fri, 30 May 2003 12:05:31 -0700
On Friday, May 30, 2003, at 11:56 AM, Scott Ellsworth wrote:
> This should be simple.
>
> I want to set the SMTP server from a client side FormController. I
> can see how to do this if there were a way to set it from the server
> side Session object, or if there were a way to get at the server side
> Application object from the client side FormController. Sessions, as
> best as I can tell, do not have access to the Application, and client
> side form controllers do not have access to it either. (Unless I
> missed something.)
Try: public static WOApplication application ()
Brent
>
> Why do I want this: I was working with the Admissions tutorial, and
> wanted to set the appropriate SMTP server via a database call at
> runtime. Calling Application.setSMTPHost in the Application
> constructor works fine, but I want to simulate different user profiles
> with different SMTP servers and the like.
>
> Here is the code from my client side custom form controller:
>
> public void sendRecordViaEmail() {
> SelectServer smtpServer=new SelectServer(username);
> String smtpServerName = smtpServer.selectSMTPServer();
>
> //_distributedObjectStore().invokeRemoteMethodWithKeyPath(new
> EOEditingContext(), "application", "clientSideRequestSetSmtpServer",
> new Class[] {String.class}, new Object[] { smtpServerName}, true);
>
> SelectEmail emailAddresses=new SelectEmail();
> NSArray emailAddressIDs = emailAddresses.selectEmailAddresses();
>
> _distributedObjectStore().invokeRemoteMethodWithKeyPath(new
> EOEditingContext(), "session", "clientSideRequestSendRecordViaEmail",
> new Class[] {EOEnterpriseObject.class, NSArray.class}, new Object[] {
> selectedObject(), emailAddressIDs}, true);
> }
>
> SelectServer successfully reads the appropriate SMTP server for the
> username, but calling invokeRemoteMethodWithKeyPath on the application
> object as the commented out code above does results in an access > error.
>
> I can move the method to the server's session object, but it does not
> have access to the Application object, and it is in the Application
> object that the setSMTPHost call lives.
>
> What am I missing?
>
> Scott
> _______________________________________________
> webobjects-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/webobjects-dev
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.