Re: Direct Action vs. Component Action...
Hi Guido, Thanks for this very illuminating data point. deepak On Jul 27, 2006, at 11:53 AM, Guido Neitzer wrote: On 27.07.2006, at 20:26 Uhr, Deepak Nulu wrote: Thanks for your response. I am glad to hear that "the difference is not one that ought to invoke fear in your when choosing an implementation" :-). I've switched an application which does about 40k page views per day from an old G4 from component actions to direct actions and in fact it got a little bit slower because I couldn't cache stuff in the session that I normally get from the database once per visit. The performance dropped from about 100ms average transaction time in Monitor to about 130ms average transaction time. Just to give you a feeling for that. 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/deepak.nulu% 40gmail.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
Re: Database update and insert optimizations?
Further to my post, here's an interesting article I found about why using Prepared Statements are good and how to use them properly:http://www.theserverside.com/tt/articles/article.tss?l=Prepared-StatmentsThanks, Brendan Duddridge | CTO | 403-277-5591 x24 | [EMAIL PROTECTED] ClickSpace Interactive Inc. Suite L100, 239 - 10th Ave. SE Calgary, AB T2G 0V9 http://www.clickspace.com On Jul 27, 2006, at 5:52 PM, Brendan Duddridge wrote:Hi,Has anyone done any work to optimize the way EOF saves to the database?To be more specific, I was wondering if it would be possible to coerce EOF to use prepared statements instead of individual statements for each operation?So instead of:INSERT INTO table1 (col1, col2) values (1,2);INSERT INTO table1 (col1, col2) values (3,4);each executed as independent statements within a transaction,EOF could issue:PreparedStatement insertOp = con.prepareStatement("INSERT INTO table1 (col1, col2) values (?, ?)");and then pass all the values using lower level jdbc:insertOp.setInt(1, 1);insertOp.setInt(1, 2);etc...I'm not sure of the exact jdbc syntax involved in doing this correctly. I just found a few notes about prepared statements on the Net.Has something like this been done or is it even possible?I would think this king of approach would make inserts, updates, and deletes faster.Thanks, Brendan Duddridge | CTO | 403-277-5591 x24 | [EMAIL PROTECTED] ClickSpace Interactive Inc. Suite L100, 239 - 10th Ave. SE Calgary, AB T2G 0V9 http://www.clickspace.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 archive@mail-archive.com
Database update and insert optimizations?
Hi,Has anyone done any work to optimize the way EOF saves to the database?To be more specific, I was wondering if it would be possible to coerce EOF to use prepared statements instead of individual statements for each operation?So instead of:INSERT INTO table1 (col1, col2) values (1,2);INSERT INTO table1 (col1, col2) values (3,4);each executed as independent statements within a transaction,EOF could issue:PreparedStatement insertOp = con.prepareStatement("INSERT INTO table1 (col1, col2) values (?, ?)");and then pass all the values using lower level jdbc:insertOp.setInt(1, 1);insertOp.setInt(1, 2);etc...I'm not sure of the exact jdbc syntax involved in doing this correctly. I just found a few notes about prepared statements on the Net.Has something like this been done or is it even possible?I would think this king of approach would make inserts, updates, and deletes faster.Thanks, Brendan Duddridge | CTO | 403-277-5591 x24 | [EMAIL PROTECTED] ClickSpace Interactive Inc. Suite L100, 239 - 10th Ave. SE Calgary, AB T2G 0V9 http://www.clickspace.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 archive@mail-archive.com
Re: databases and bool values
I just store booleans in a one character field (which you should define as a protoype in EOModeler in the EOPrototypes entity as Value Class NSString, Value Class (Java) String, external type char, width 1, in case this definition ever needs to change). Then the code looks like: static String true_string = "T"; static String false_string = "F"; and if linked to a button, provide these routines in your class that extends the class generated by EOGenerator: public boolean is_a_manager_button () { return is_a_manager ().equals (true_string); } public void setIs_a_manager_button (boolean value) { setIs_a_manager (value? true_string: false_string); } Ian On 28/07/2006, at 2:42 AM, Theodore Petrosky wrote: I am relatively new to WO and I don't understand how to handle boolean values. I am just starting to play with a database (postgresql) that I normally access from a cocoa app that I wrote. When I use EOModeller to reverse engineer the table(s), the booleans come across as NSNumber class. however postgresql stores the value as 't' or 'f'. I don't understand how to handle these booleans? What am I missing in my understanding of how to talk to the database? Is there any documentation available (or examples)? Thanks, Ted __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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/ian.joyner% 40sportstec.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
Re: Direct to Web Services Caching Problem
That's a good document to read. It solves my problem and now it works like a charm. Thank you, Chuck! On 7/26/06 5:34 PM, "Chuck Hill" <[EMAIL PROTECTED]> wrote: > > On Jul 26, 2006, at 5:28 PM, Xia, Wen wrote: > >> Hi all, >> >> Recently I created a Direct to Web Service application, and used >> WebServiceAssistant to add services and operations. There is >> absolutely no >> coding and it works great until the following problem occurred: >> >> Even though I added "-WOCachingEnabled NO" for the web service >> instance, it >> still somehow caches the old data. > > That setting is not for data caching. It is for WOComponent template > caching. > > >> Only when the web service instance is >> restarted, it will re-fetch and get the latest information. I >> wonder where >> the data is cached and how to prevent such caching? Do I need to >> write my >> own code to handle it? Any settings or application properties to >> include? >> >> This is my first web service application. Please help me if you >> know how to >> solve it. > > Possibly more than you ever wanted to know: > > http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Using_EOF/ > Caching_and_Freshness > > Chuck > > -- > Coming in 2006 - an introduction to web applications using WebObjects > and Xcode http://www.global-village.net/wointro > > Practical WebObjects - for developers who want to increase their > overall knowledge of WebObjects or who are trying to solve specific > problems.http://www.global-village.net/products/practical_webobjects > > > > ___ 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: Dynamic images broken
WOResourceManager only caches the image data for the first request. If something on your page is causing the request to be re-issued, that would explain it. Is there a meta-refresh tag? Some bad HTML? You can override dispatchRequest in Application to log the request URI. This is a good way of tracking this down. Chuck On Jul 27, 2006, at 1:37 PM, Ian Coleman wrote: Hi, I am trying to use WOActiveImage to display one of two images which is being decided in the java class by the variables method. So the variable either returns the data of one image or the other. It works okay on safari but not in anything else(firefox, explorer, etc.). This is what shows up in the page source: Any ideas why it works in safari only? thanks ian coleman [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/chill% 40global-village.net This email sent to [EMAIL PROTECTED] -- Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.http://www.global-village.net/products/practical_webobjects ___ 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
Dynamic images broken
Hi, I am trying to use WOActiveImage to display one of two images which is being decided in the java class by the variables method. So the variable either returns the data of one image or the other. It works okay on safari but not in anything else(firefox, explorer, etc.). This is what shows up in the page source: Any ideas why it works in safari only? thanks ian coleman [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
Re: WOHTTPConnection & WORequest
David, I use Apache's HttpClient class for this. Here is an old article I wrote on it: http://homepage.mac.com/kelleherk/iblog/C149402102/E773353034/index.html HTH, Kieran On Jul 27, 2006, at 7:36 AM, David Griffith wrote: Hi all, I want to allow a user to enter details into a HTML Form (in a WOComponent) and when they click the Submit button, I would like to open a connection to a standard HTTP server with a specific URL and pass it the form values that the user entered. Can someone tell me an easy way to do this? I can create the WOHTTPConnection but I think I need a WORequest to send to it and I can't figure out how to get the form values into that request. It's probably easy I'm sure :-) Thanks for any help, Regards, David. ___ 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
Re: Direct Action vs. Component Action...
On 27.07.2006, at 20:26 Uhr, Deepak Nulu wrote: Thanks for your response. I am glad to hear that "the difference is not one that ought to invoke fear in your when choosing an implementation" :-). I've switched an application which does about 40k page views per day from an old G4 from component actions to direct actions and in fact it got a little bit slower because I couldn't cache stuff in the session that I normally get from the database once per visit. The performance dropped from about 100ms average transaction time in Monitor to about 130ms average transaction time. Just to give you a feeling for that. 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: Direct Action vs. Component Action...
Hi Chuck, Thanks for your response. I am glad to hear that "the difference is not one that ought to invoke fear in your when choosing an implementation" :-). deepak On Jul 27, 2006, at 10:45 AM, Chuck Hill wrote: Hi, On Jul 27, 2006, at 9:23 AM, Deepak Nulu wrote: Hi David, Thanks for your quick response (and for your articles in your blog). I did learn from your articles that direct actions have static bookmarkable URLs. But I was wondering if: (1) I did not need static bookmarkable URLs, and (2) I needed a session to track user state, and (3) I am using WOComponent objects to create the web pages, and (4) the site would have a lot of users at the same time, then which would be more efficient (from a scalability standpoint): component actions or direct actions? It is not properly a scalability question. It is an appropriate technology question. Direct Action actions associate one specific URL with one specific method in one specific class. When that URL arrives, that method is run. This is ideal for adding additional entry points, providing consistent, editable URLs and generally making applications more web friendly. When the needs of your application mesh with the services and constraints of direct actions, they are a great choice. They have an additional advantage of being potentially stateless and not requiring a session. The downside of direct actions is that you need to be concerned about whether there is a session or not and need to handle form values yourself. Component actions are always stateful and hence require a session. Having a session is more expensive than not having a session, but the difference is not one that ought to invoke fear in your when choosing an implementation. If you need state then you need state. You can still have state and choose between (or use both of) direct and component actions. Component actions are easier to use as WO does more of the work for you. And for the same 4 "requirements" of the site, my other question was whether I need a session object if all I want to do is make sure that the user is a registered user. Or can the HTTP server take care of this. If the answer is either, which is better (again from a scalability standpoint)? You could use the standard http authentication, or authenticate and store the result in a cookie to meet your authentication goals and not require a session. Chuck On Jul 27, 2006, at 6:47 AM, David LeBer wrote: On 26-Jul-06, at 11:11 PM, Deepak Nulu wrote: Hi, The first part of David LeBer's articles on Direct Actions (http://david.codeferous.com/?p=63) says the following about component actions: "each visitor will receive a relatively heavyweight Session object, so they may not be appropriate if you expect a lot of visitors and/or you do not need to track their state. Direct Action are designed for these situtations." So if I have a direct action which (1) requires a session object, and (2) returns a WOComponent object, will it be as heavy weight as a component action? If not, what is it that makes component actions relatively heavyweight? If I have a site where multiple things can be accessed via direct actions, and if I want some of these things to be available only to registered users, would I need a session object for these direct actions? Deepak, To be clear, DirectActions have two primary differences between ComponentActions: 1. They have static (bookmarkable) URLs. 2. The use of a Session is optional. Sessions are not bad, there are just times when you do not need one, so why incur the expense? If you need to track user state, a Session is an easy way to do that and for most applications that's where it ends. -- ;david -- David LeBer Codeferous Software 'co-defer-ous' adj. producing or containing code site: http://www.codeferous.com blog: http://david.codeferous.com -- Toronto Area Cocoa / WebObjects developers group: http://www.tacow.org ___ 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/chill% 40global-village.net This email sent to [EMAIL PROTECTED] -- Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.http://www.global-village.net/products/ practical_webobjects ___ 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.co
Re: WOHTTPConnection & WORequest
On Jul 27, 2006, at 12:44 PM, [EMAIL PROTECTED] wrote: Subject: Re: WOHTTPConnection & WORequest To: "Jerry W. Walker" <[EMAIL PROTECTED]> Hi Jerry, Well, I have no control over the other website. What I need to do is this: In my own WO App, I have a page which displays some information from the database about a domain name and who it is associated with. Before you guys get too carried away... sounds like what you want to do is submit a "GET" style form request like: http://www.someDomain.com/doSomething?arg1=foo&arg2=bar trivial example off the top of my head... public String sendUrlToHostOnPort(String urlString, String host, int port) { NSData content = null; WOHTTPConnection connection = new WOHTTPConnection(host, port)); NSDictionary headers = new NSDictionary(new Object[] {"text/ html", "text/html"}, new Object[] {"Accept", "Content-Type"}); WORequest request = new WORequest("GET", urlString, "HTTP/ 1.0", headers, content, null); connection.sendRequest(request); WOResponse response = connection.readResponse(); if (response == null) { System.out.println("WOResponse object is null"); return null; } NSData contentData = = response.content(); if (contentData == null) { System.out.println("No content in the WOResponse object"); return null; } return new String(contentData.bytes(0, contentData.length())); } HTH! abc __alex cone ceo c o d e f a b inc [EMAIL PROTECTED] 212.465.8484 x101 http://www.codefab.com If you are not living on the edge, you are taking up too much space. ___ 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: Direct Action vs. Component Action...
Hi, On Jul 27, 2006, at 9:23 AM, Deepak Nulu wrote: Hi David, Thanks for your quick response (and for your articles in your blog). I did learn from your articles that direct actions have static bookmarkable URLs. But I was wondering if: (1) I did not need static bookmarkable URLs, and (2) I needed a session to track user state, and (3) I am using WOComponent objects to create the web pages, and (4) the site would have a lot of users at the same time, then which would be more efficient (from a scalability standpoint): component actions or direct actions? It is not properly a scalability question. It is an appropriate technology question. Direct Action actions associate one specific URL with one specific method in one specific class. When that URL arrives, that method is run. This is ideal for adding additional entry points, providing consistent, editable URLs and generally making applications more web friendly. When the needs of your application mesh with the services and constraints of direct actions, they are a great choice. They have an additional advantage of being potentially stateless and not requiring a session. The downside of direct actions is that you need to be concerned about whether there is a session or not and need to handle form values yourself. Component actions are always stateful and hence require a session. Having a session is more expensive than not having a session, but the difference is not one that ought to invoke fear in your when choosing an implementation. If you need state then you need state. You can still have state and choose between (or use both of) direct and component actions. Component actions are easier to use as WO does more of the work for you. And for the same 4 "requirements" of the site, my other question was whether I need a session object if all I want to do is make sure that the user is a registered user. Or can the HTTP server take care of this. If the answer is either, which is better (again from a scalability standpoint)? You could use the standard http authentication, or authenticate and store the result in a cookie to meet your authentication goals and not require a session. Chuck On Jul 27, 2006, at 6:47 AM, David LeBer wrote: On 26-Jul-06, at 11:11 PM, Deepak Nulu wrote: Hi, The first part of David LeBer's articles on Direct Actions (http://david.codeferous.com/?p=63) says the following about component actions: "each visitor will receive a relatively heavyweight Session object, so they may not be appropriate if you expect a lot of visitors and/or you do not need to track their state. Direct Action are designed for these situtations." So if I have a direct action which (1) requires a session object, and (2) returns a WOComponent object, will it be as heavy weight as a component action? If not, what is it that makes component actions relatively heavyweight? If I have a site where multiple things can be accessed via direct actions, and if I want some of these things to be available only to registered users, would I need a session object for these direct actions? Deepak, To be clear, DirectActions have two primary differences between ComponentActions: 1. They have static (bookmarkable) URLs. 2. The use of a Session is optional. Sessions are not bad, there are just times when you do not need one, so why incur the expense? If you need to track user state, a Session is an easy way to do that and for most applications that's where it ends. -- ;david -- David LeBer Codeferous Software 'co-defer-ous' adj. producing or containing code site: http://www.codeferous.com blog: http://david.codeferous.com -- Toronto Area Cocoa / WebObjects developers group: http://www.tacow.org ___ 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/chill% 40global-village.net This email sent to [EMAIL PROTECTED] -- Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.http://www.global-village.net/products/practical_webobjects ___ 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: EOObjectNotAvailableException
Ken, thanks for understanding my pain. I am in the situation that you described. However, I think that I may have found a delegate entry point to trap the fault. If I use the databaseContextShouldFetchObjectFault, I am hoping that I can get enough information from the fault to determine if it is one of my optional relationships, and put a marker on the ThreadLocal. Then when the databaseContextFailedToFetchObject method is invoked, I can check for the marker, and supress the exception. Just thought that I would run this by the list to see if there are any flaws in my idea. I am getting ready to run a simple test on it now. Thanks Garry -Original Message- From: Ken Anderson [mailto:[EMAIL PROTECTED] Sent: Thursday, July 27, 2006 10:10 AM To: Anjo Krank Cc: Watkins, Garry; webobjects-dev@lists.apple.com Subject: Re: EOObjectNotAvailableException Anjo, Unfortunately, that's not always possible. On my last big project, EOF came long after the database schema was defined and in-use. It's not uncommon for there to be a primary row, with multiple optional rows, all with the same primary key. This was considered normal and acceptable before unique integer primary keys were being used. So, to paraphrase, I understand Garry's pain :) Ken On Jul 27, 2006, at 1:11 AM, Anjo Krank wrote: > > Am 25.07.2006 um 17:20 schrieb Watkins, Garry: > >> Really not the answer that I wanted. Personally, I think that it is >> a bug in EO, if the relationship is defined as NOT mandatory, and it >> encounters a EOObjectNotAvailableException it should return null. >> However, I want to continue to use EOGenericRecords since it is >> mainly a reporting type application. Does anyone know where the >> Fault is triggered inside the EO stack so that I might be able to >> trap the operation with AspectJ? This would also require that I have >> the EORelationship that triggered the fault. > > If you have a key that points into nirvana, your data is broken and > should be fixed. EOF certainly should *not* return null in this case. > > You could probably write an accessor to your relationship and trap the > exception there or get the committed snapshot in the EODBC or EODB and > patch it to be null. But the easiest route is to fix your data. > > Cheers, Anjo > > ___ > 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/lists% > 40anderhome.com > > This email sent to [EMAIL PROTECTED] Confidential & Privileged Unless otherwise indicated or obvious from its nature, the information contained in this communication is attorney-client privileged and confidential information/work product. This communication is intended for the use of the individual or entity named above. If the reader of this communication is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies--electronic, paper or otherwise--which you may have of this communication. ___ 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: WOHTTPConnection & WORequest
Hi, David, From the responses to your last post to this list, it sounds like Robert Walker has what you're looking for. I'll back out of the loop unless his code isn't what you're looking for. Though, since he's from the Walker clan, I don't see how it could fail to satisfy. :-) Regards, Jerry (the other Walker) On Jul 27, 2006, at 12:43 PM, David Griffith wrote: Hi Jerry, Well, I have no control over the other website. What I need to do is this: In my own WO App, I have a page which displays some information from the database about a domain name and who it is associated with. I would like to have a button on that page that can be clicked which will then send a request to the 3rd party web site (which is just a standard website). I want to submit a form to it as if I had gone to the page, entered my details in the form and clicked submit. Except I don't want to manually enter my details, I want to submit the form without going to the actual webpage itself (so effectively I want to create a page that emulates the actual page on that webserver and submit it with form values filled in already (rather than anyone having to manually enter them). Obviously that webserver will return a normal HTTP response page (HTML page) which is the page that I want to get back to my original WO App whereupon I will parse it for the information I need and place that information on my WOComponent as necessary. I have done this with another programming tool in the past and built Google's language tools into my own application. I am trying to do something similar with WebObjects but just can't find the correct way to do it. Perhaps WebServices is what I need. I will look into it further. To give a more step-by-step idea of what I am trying to do: User looks up a record in my app which contains a variable called 'domainname'. They click the button that says 'Lookup'. My WOApp then needs to generate a HTML form that can be submitted with some form field values to a URL that I specify, but with no user interaction of any kind. I need to get the response page (HTML) from that URL back into my WO App. From there I have no problem as I can parse it and get the info I need. Regards, David. On 27 Jul 2006, at 17:55, Jerry W. Walker wrote: Hi, David, Whew! If I understand you correctly, I'm not sure that's doable, and if it is, would require a greater network knowledge than my own. So, here's your requirement as I infer it: From a WebObjects application at www.xxx.com, you created and sent out a response to John Smith's browser with the following page: WOComponent Form Field1 Field2 Field3 Field4 ... SubmitButton If Field3 contains a domain name that John Smith entered into the form, say "www.yyy.com", you want the browser containing the above page to send the form values from that page as a standard HTTP request to www.yyy.com rather than back to your WOApp. You want some application there (a WO app?) to parse the request from John Smith's browser for its form values, and to generate a response that it will somehow smush into a pseudo-request containing the form values (or some transformation of them) which it will send directly to your WOApp at www.xxx.com. Your WOApp (the one which generated the original page to which John Smith is responding) will accept this pseudo-request from www.yyy.com, parse the form values therein and send its response back, not to www.yyy.com, but to John Smith's browser as if it were responding to the request the browser sent to www.yyy.com. I'm presuming that you have some control over the application at www.yyy.com, else how would you get it to take a request from John Smith's browser and return its response to your app? If this is a reasonable interpretation of your requirement, then, if it's doable at all, it's solution will require a grievous distortion of the standard HTTP network protocols on the part two web applications and some JavaScript hacking (in the page you originally sent out) on John Smith's web browser. Again, if this is your requirement, may I suggest an alternative approach which will avoid all these distortions? I suggest that the form be returned to your original WOApp (as every party in this chain expects), and that your WOApp engage in a Web Services transaction with the application at www.yyy.com to send the form values and obtain its parsing services before returning the expected response to John Smith's browser. Web Services is set up for exactly this kind of interaction. If you have no control over the application at www.yyy.com, and it will only respond to HTTP requests containing standard HTML forms, it's possible to jimmy up what Web Services can send out from your WOApp to look like an HTTP request, but I'm not sure how you would get your WOApp to accept it's response. I'
Re: WOHTTPConnection & WORequest
David,If you are interested send me a request "off-list" and I can provide you with example code that does exactly what your are trying to do. My sample code uses some Apache commons libraries, to make it more flexible, and to provide support for submitting the request to secured (SSL, TLS) forms.--Robert Walker[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
Re: WOHTTPConnection & WORequest
On 27 Jul 2006, at 17:43, David Griffith wrote: Hi Jerry, Well, I have no control over the other website. What I need to do is this: In my own WO App, I have a page which displays some information from the database about a domain name and who it is associated with. I would like to have a button on that page that can be clicked which will then send a request to the 3rd party web site (which is just a standard website). I want to submit a form to it as if I had gone to the page, entered my details in the form and clicked submit. Except I don't want to manually enter my details, I want to submit the form without going to the actual webpage itself (so effectively I want to create a page that emulates the actual page on that webserver and submit it with form values filled in already (rather than anyone having to manually enter them). Obviously that webserver will return a normal HTTP response page (HTML page) which is the page that I want to get back to my original WO App whereupon I will parse it for the information I need and place that information on my WOComponent as necessary. I have done this with another programming tool in the past and built Google's language tools into my own application. I am trying to do something similar with WebObjects but just can't find the correct way to do it. Perhaps WebServices is what I need. I will look into it further. To give a more step-by-step idea of what I am trying to do: User looks up a record in my app which contains a variable called 'domainname'. They click the button that says 'Lookup'. My WOApp then needs to generate a HTML form that can be submitted with some form field values to a URL that I specify, but with no user interaction of any kind. I need to get the response page (HTML) from that URL back into my WO App. From there I have no problem as I can parse it and get the info I need. Regards, David. Of course, if you were really devious, you could adapt AJAX technology to do what you need. http://developer.apple.com/internet/webcontent/xmlhttpreq.html 'domainname' -- are you by chance getting someone to type in their email address, and then trying to validate an MX record to see if it's real or not? --- Regards Patrick OneStep Solutions Plc www.onestep.co.uk ___ 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: databases and bool values
See if this helps some: http://en.wikibooks.org/wiki/Programming:WebObjects/EOF/Modeling/ Booleans On Jul 27, 2006, at 12:42 PM, Theodore Petrosky wrote: I am relatively new to WO and I don't understand how to handle boolean values. I am just starting to play with a database (postgresql) that I normally access from a cocoa app that I wrote. When I use EOModeller to reverse engineer the table(s), the booleans come across as NSNumber class. however postgresql stores the value as 't' or 'f'. I don't understand how to handle these booleans? What am I missing in my understanding of how to talk to the database? Is there any documentation available (or examples)? Thanks, Ted __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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/mschrag% 40mdimension.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
Re: WOHTTPConnection & WORequest
Hi Jerry, Well, I have no control over the other website. What I need to do is this: In my own WO App, I have a page which displays some information from the database about a domain name and who it is associated with. I would like to have a button on that page that can be clicked which will then send a request to the 3rd party web site (which is just a standard website). I want to submit a form to it as if I had gone to the page, entered my details in the form and clicked submit. Except I don't want to manually enter my details, I want to submit the form without going to the actual webpage itself (so effectively I want to create a page that emulates the actual page on that webserver and submit it with form values filled in already (rather than anyone having to manually enter them). Obviously that webserver will return a normal HTTP response page (HTML page) which is the page that I want to get back to my original WO App whereupon I will parse it for the information I need and place that information on my WOComponent as necessary. I have done this with another programming tool in the past and built Google's language tools into my own application. I am trying to do something similar with WebObjects but just can't find the correct way to do it. Perhaps WebServices is what I need. I will look into it further. To give a more step-by-step idea of what I am trying to do: User looks up a record in my app which contains a variable called 'domainname'. They click the button that says 'Lookup'. My WOApp then needs to generate a HTML form that can be submitted with some form field values to a URL that I specify, but with no user interaction of any kind. I need to get the response page (HTML) from that URL back into my WO App. From there I have no problem as I can parse it and get the info I need. Regards, David. On 27 Jul 2006, at 17:55, Jerry W. Walker wrote: Hi, David, Whew! If I understand you correctly, I'm not sure that's doable, and if it is, would require a greater network knowledge than my own. So, here's your requirement as I infer it: From a WebObjects application at www.xxx.com, you created and sent out a response to John Smith's browser with the following page: WOComponent Form Field1 Field2 Field3 Field4 ... SubmitButton If Field3 contains a domain name that John Smith entered into the form, say "www.yyy.com", you want the browser containing the above page to send the form values from that page as a standard HTTP request to www.yyy.com rather than back to your WOApp. You want some application there (a WO app?) to parse the request from John Smith's browser for its form values, and to generate a response that it will somehow smush into a pseudo-request containing the form values (or some transformation of them) which it will send directly to your WOApp at www.xxx.com. Your WOApp (the one which generated the original page to which John Smith is responding) will accept this pseudo-request from www.yyy.com, parse the form values therein and send its response back, not to www.yyy.com, but to John Smith's browser as if it were responding to the request the browser sent to www.yyy.com. I'm presuming that you have some control over the application at www.yyy.com, else how would you get it to take a request from John Smith's browser and return its response to your app? If this is a reasonable interpretation of your requirement, then, if it's doable at all, it's solution will require a grievous distortion of the standard HTTP network protocols on the part two web applications and some JavaScript hacking (in the page you originally sent out) on John Smith's web browser. Again, if this is your requirement, may I suggest an alternative approach which will avoid all these distortions? I suggest that the form be returned to your original WOApp (as every party in this chain expects), and that your WOApp engage in a Web Services transaction with the application at www.yyy.com to send the form values and obtain its parsing services before returning the expected response to John Smith's browser. Web Services is set up for exactly this kind of interaction. If you have no control over the application at www.yyy.com, and it will only respond to HTTP requests containing standard HTML forms, it's possible to jimmy up what Web Services can send out from your WOApp to look like an HTTP request, but I'm not sure how you would get your WOApp to accept it's response. I'm not that much of a Web Services guru. If you have the control over the two web apps to use this approach, it would work with network protocols appropriately rather than trying to violate them, and would probably provide you with a good deal more flexibility in your parsing and response. Additionally, down the line, when the requirements change, you can address the
databases and bool values
I am relatively new to WO and I don't understand how to handle boolean values. I am just starting to play with a database (postgresql) that I normally access from a cocoa app that I wrote. When I use EOModeller to reverse engineer the table(s), the booleans come across as NSNumber class. however postgresql stores the value as 't' or 'f'. I don't understand how to handle these booleans? What am I missing in my understanding of how to talk to the database? Is there any documentation available (or examples)? Thanks, Ted __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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 archive@mail-archive.com
Re: Direct Action vs. Component Action...
Hi David, Thanks for your quick response (and for your articles in your blog). I did learn from your articles that direct actions have static bookmarkable URLs. But I was wondering if: (1) I did not need static bookmarkable URLs, and (2) I needed a session to track user state, and (3) I am using WOComponent objects to create the web pages, and (4) the site would have a lot of users at the same time, then which would be more efficient (from a scalability standpoint): component actions or direct actions? And for the same 4 "requirements" of the site, my other question was whether I need a session object if all I want to do is make sure that the user is a registered user. Or can the HTTP server take care of this. If the answer is either, which is better (again from a scalability standpoint)? Thanks. deepak On Jul 27, 2006, at 6:47 AM, David LeBer wrote: On 26-Jul-06, at 11:11 PM, Deepak Nulu wrote: Hi, The first part of David LeBer's articles on Direct Actions (http:// david.codeferous.com/?p=63) says the following about component actions: "each visitor will receive a relatively heavyweight Session object, so they may not be appropriate if you expect a lot of visitors and/or you do not need to track their state. Direct Action are designed for these situtations." So if I have a direct action which (1) requires a session object, and (2) returns a WOComponent object, will it be as heavy weight as a component action? If not, what is it that makes component actions relatively heavyweight? If I have a site where multiple things can be accessed via direct actions, and if I want some of these things to be available only to registered users, would I need a session object for these direct actions? Deepak, To be clear, DirectActions have two primary differences between ComponentActions: 1. They have static (bookmarkable) URLs. 2. The use of a Session is optional. Sessions are not bad, there are just times when you do not need one, so why incur the expense? If you need to track user state, a Session is an easy way to do that and for most applications that's where it ends. -- ;david -- David LeBer Codeferous Software 'co-defer-ous' adj. producing or containing code site: http://www.codeferous.com blog: http://david.codeferous.com -- Toronto Area Cocoa / WebObjects developers group: http://www.tacow.org ___ 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: WOHTTPConnection & WORequest
Hi, David, Whew! If I understand you correctly, I'm not sure that's doable, and if it is, would require a greater network knowledge than my own. So, here's your requirement as I infer it: From a WebObjects application at www.xxx.com, you created and sent out a response to John Smith's browser with the following page: WOComponent Form Field1 Field2 Field3 Field4 ... SubmitButton If Field3 contains a domain name that John Smith entered into the form, say "www.yyy.com", you want the browser containing the above page to send the form values from that page as a standard HTTP request to www.yyy.com rather than back to your WOApp. You want some application there (a WO app?) to parse the request from John Smith's browser for its form values, and to generate a response that it will somehow smush into a pseudo-request containing the form values (or some transformation of them) which it will send directly to your WOApp at www.xxx.com. Your WOApp (the one which generated the original page to which John Smith is responding) will accept this pseudo-request from www.yyy.com, parse the form values therein and send its response back, not to www.yyy.com, but to John Smith's browser as if it were responding to the request the browser sent to www.yyy.com. I'm presuming that you have some control over the application at www.yyy.com, else how would you get it to take a request from John Smith's browser and return its response to your app? If this is a reasonable interpretation of your requirement, then, if it's doable at all, it's solution will require a grievous distortion of the standard HTTP network protocols on the part two web applications and some JavaScript hacking (in the page you originally sent out) on John Smith's web browser. Again, if this is your requirement, may I suggest an alternative approach which will avoid all these distortions? I suggest that the form be returned to your original WOApp (as every party in this chain expects), and that your WOApp engage in a Web Services transaction with the application at www.yyy.com to send the form values and obtain its parsing services before returning the expected response to John Smith's browser. Web Services is set up for exactly this kind of interaction. If you have no control over the application at www.yyy.com, and it will only respond to HTTP requests containing standard HTML forms, it's possible to jimmy up what Web Services can send out from your WOApp to look like an HTTP request, but I'm not sure how you would get your WOApp to accept it's response. I'm not that much of a Web Services guru. If you have the control over the two web apps to use this approach, it would work with network protocols appropriately rather than trying to violate them, and would probably provide you with a good deal more flexibility in your parsing and response. Additionally, down the line, when the requirements change, you can address the changed requirements immediately within the architecture rather than taking a long backwards step to figure out what the H*** was going on here between this browser and these two systems before even looking at the changes requested. And if you're not the one making the changes, you might save your own skin from the enmity of the programmer who follows you into this mine field. Sorry I couldn't provide more direct help to your question. Regards, Jerry On Jul 27, 2006, at 10:40 AM, David Griffith wrote: Hi Jerry, Thanks for the detailed response. Actually I am already aware of all of this and no I don't find the answer patronising as it is great to see someone answer any question in such detail! However, what I am trying to do is this: On a WOComponent that already exists and contains a domain name in one of the form fields, I want to have a button that when clicked will take the domain name from the existing field (or variable) on the WOComponent, construct a page that can be submitted transparently to another server (not the WO server) and receive a response from that server which I can then parse and display the relevant pieces of information on the original WOComponent. Kind regards, David. On 27 Jul 2006, at 16:00, Jerry W. Walker wrote: Hi, David, Are you asking how to submit a form to a WOApplication from one of its WOComponents? Or are you asking for something much more involved? If your question is the former, then do the following: * Create a WOForm in your WOComponent. * Embed all the WOForm elements that take form values (WOTextField, WOTextArea, WOCheckBox, etc.) within that form along with at least one WOSubmitButton or WOImageButton. This is most easily done using WebObjects Builder. * If you are using multiple submit and/or image buttons, be sure to set the multipleSubmit binding on your WOForm to true. * Bind each of your WOForm eleme
Re: NSTimestamp calculations?
On Jul 27, 2006, at 10:17 AM, [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] Subject: NSTimestamp calculations? Whats the easiest way to subtract NSTimestamps from each other? The methods getMinutes() etc both from NSTimestamp and Date are unfortunately deprecated :-( The getTime() method is your friend! here are a few useful methods from my NSTimestampHelper bag-o-tricks... public static int deltaDays( NSTimestamp one, NSTimestamp two ) { long diff = two.getTime() - one.getTime(); // diff is in milliseconds long roundingOffset = ( diff >= 0 ) ? 12 : -12; // if diff is positive, offset up, if negative, offset down // next, convert diff to hours, offset by .5 days to round the end result, divide by 24 and truncate. long days = ( ( diff / ( 1000 * 60 * 60 ) ) + roundingOffset ) / 24; return (int)days; } public static int deltaHours( NSTimestamp one, NSTimestamp two ) { long diff = two.getTime() - one.getTime(); // diff is in milliseconds long roundingOffset = ( diff >= 0 ) ? 30 : -30; // if diff is positive, offset up, if negative, offset down // next, convert diff to minutes, offset by .5 hour to round the end result, divide by 60 and truncate. long hours = ( ( diff / ( 1000 * 60 ) ) + roundingOffset ) / 60; return (int)hours; } public static int deltaMinutes( NSTimestamp one, NSTimestamp two ) { long diff = two.getTime() - one.getTime(); // diff is in milliseconds long roundingOffset = ( diff >= 0 ) ? 30 : -30; // if diff is positive, offset up, if negative, offset down // next, convert diff to seconds, offset by .5 minute to round the end result, divide by 60 and truncate. long minutes = ( ( diff / ( 1000 ) ) + roundingOffset ) / 60; return (int)minutes; } Enjoy!! Alex __alex cone ceo c o d e f a b inc [EMAIL PROTECTED] 212.465.8484 x101 http://www.codefab.com "The perversity of the universe tends towards a maximum." Entropy, expressed as Finagle's (Murphy's) 1st Law ___ 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: WOHTTPConnection & WORequest
Hi Jerry, Thanks for the detailed response. Actually I am already aware of all of this and no I don't find the answer patronising as it is great to see someone answer any question in such detail! However, what I am trying to do is this: On a WOComponent that already exists and contains a domain name in one of the form fields, I want to have a button that when clicked will take the domain name from the existing field (or variable) on the WOComponent, construct a page that can be submitted transparently to another server (not the WO server) and receive a response from that server which I can then parse and display the relevant pieces of information on the original WOComponent. Kind regards, David. On 27 Jul 2006, at 16:00, Jerry W. Walker wrote: Hi, David, Are you asking how to submit a form to a WOApplication from one of its WOComponents? Or are you asking for something much more involved? If your question is the former, then do the following: * Create a WOForm in your WOComponent. * Embed all the WOForm elements that take form values (WOTextField, WOTextArea, WOCheckBox, etc.) within that form along with at least one WOSubmitButton or WOImageButton. This is most easily done using WebObjects Builder. * If you are using multiple submit and/or image buttons, be sure to set the multipleSubmit binding on your WOForm to true. * Bind each of your WOForm elements to keys (iVar or method names) in your WOComponent's Java file. * Bind each of your submit and/or image buttons to an action method in your Java file (a method that takes no arguments and returns a WOComponent value representing the page you want displayed when that button is clicked). * Vend the page (WOComponent containing your WOForm). When the user fills out your form fields and clicks on the submit button, the browser sends the page with an HTML POST request. The WOAdaptor turns the HTML request into a WORequest and sends it to your application in the first two of the following three messages of the Request/Response cycle: * takeValuesFromRequest - which WO uses to extract the values from any of the form elements (contained in the form that also contains the button that was clicked) and automatically inserts them into the bound elements of your code. * invokeAction - which WO uses to identify the submit button element that was clicked and messages the action method which you've bound to that submit button. * appendToResponse - which WO uses to build a WOResponse that the WOAdaptor translates into HTML and sends out through the web server to render the next page. The next page is determined by which page your action method returns. You can put anything you want on that next page, including only the values of the form elements of the previous page containing the WOForm. All of this automatic behavior is built into WO and you don't have to do anything explicit like creating a WOHTTPConnection or a WORequest. These are done for you. If this answers your question, then I strongly urge you to go through the WO tutorials and introductory material, otherwise you will end up misusing WO and hating it. If you are asking for something much more sophisticated than that (like sending the page to a different server dynamically chosen at the time the button is clicked, or something), then you will have to be much more explicit about what you're trying to do when you ask the question. I hope that you didn't find the above information patronizing, but if yours was a simple question, then that should answer it without another round of "What are you really trying to do?" If it wasn't a simple question, hit us again. Regards, Jerry On Jul 27, 2006, at 9:29 AM, David Griffith wrote: Hi Paul, Because ultimately I will be submitting values that are already part of the WO app and will be parsing the response to get the various values I need. I do not want the user to see the actual response page, only the pieces that I will extract from the response. Kind regards, David. On 27 Jul 2006, at 14:50, Paul Suh wrote: On Jul 27, 2006, at 7:36 AM, David Griffith wrote: Hi all, I want to allow a user to enter details into a HTML Form (in a WOComponent) and when they click the Submit button, I would like to open a connection to a standard HTTP server with a specific URL and pass it the form values that the user entered. Can someone tell me an easy way to do this? I can create the WOHTTPConnection but I think I need a WORequest to send to it and I can't figure out how to get the form values into that request. It's probably easy I'm sure :-) David, Stupid question, but is there a particular reason why you need to send it through your WO app? Why not point your form's URL straight to the other HTTP server? --Paul Paul Suh http://www.ps-ena
Re: NSTimestamp calculations?
You can use getTime() [EMAIL PROTECTED] schrieb: Whats the easiest way to subtract NSTimestamps from each other? The methods getMinutes() etc both from NSTimestamp and Date are unfortunately deprecated :-( ___ 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/stefan.klein%40kess-gmbh.de 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
Re: NSTimestamp calculations?
First off, you can not reply to another message and change the subject - it messes up people who view by thread, and also screws up the archived version of the list.To answer your question, there are a few ways. If I have minutes or hours that I want to add or subject from an existing timestamp, I use:timestampByAddingGregorianUnits(int years, int months, int days, int hours, int minutes, int seconds) If you have 2 timestamps and you want to do some manipulations, you really should convert it to GregorianCalendar - I typically do this:NSTimestamp settlementDateTime = (NSTimestamp) frame.valueForKey(Definition.settlementDate);GregorianCalendar cal = new GregorianCalendar();cal.setTime(settlementDateTime);int year = cal.get(GregorianCalendar.YEAR);int dayOfMonth = cal.get(GregorianCalendar.DAY_OF_MONTH);int month = cal.get(GregorianCalendar.MONTH);NSTimestamp settlementDate = new NSTimestamp(year, month+1, dayOfMonth, 0, 0, 0, TimeZone.getTimeZone("GMT"));KenOn Jul 27, 2006, at 10:16 AM, [EMAIL PROTECTED] wrote:Whats the easiest way to subtract NSTimestamps from each other?The methods getMinutes() etc both from NSTimestamp and Date are unfortunately deprecated :-( ___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/lists%40anderhome.comThis 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
NSTimestamp calculations?
Whats the easiest way to subtract NSTimestamps from each other? The methods getMinutes() etc both from NSTimestamp and Date are unfortunately deprecated :-( ___ 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: EOObjectNotAvailableException
Anjo, Unfortunately, that's not always possible. On my last big project, EOF came long after the database schema was defined and in-use. It's not uncommon for there to be a primary row, with multiple optional rows, all with the same primary key. This was considered normal and acceptable before unique integer primary keys were being used. So, to paraphrase, I understand Garry's pain :) Ken On Jul 27, 2006, at 1:11 AM, Anjo Krank wrote: Am 25.07.2006 um 17:20 schrieb Watkins, Garry: Really not the answer that I wanted. Personally, I think that it is a bug in EO, if the relationship is defined as NOT mandatory, and it encounters a EOObjectNotAvailableException it should return null. However, I want to continue to use EOGenericRecords since it is mainly a reporting type application. Does anyone know where the Fault is triggered inside the EO stack so that I might be able to trap the operation with AspectJ? This would also require that I have the EORelationship that triggered the fault. If you have a key that points into nirvana, your data is broken and should be fixed. EOF certainly should *not* return null in this case. You could probably write an accessor to your relationship and trap the exception there or get the committed snapshot in the EODBC or EODB and patch it to be null. But the easiest route is to fix your data. Cheers, Anjo ___ 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/lists% 40anderhome.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
Re: WOHTTPConnection & WORequest
Hi, David, Are you asking how to submit a form to a WOApplication from one of its WOComponents? Or are you asking for something much more involved? If your question is the former, then do the following: * Create a WOForm in your WOComponent. * Embed all the WOForm elements that take form values (WOTextField, WOTextArea, WOCheckBox, etc.) within that form along with at least one WOSubmitButton or WOImageButton. This is most easily done using WebObjects Builder. * If you are using multiple submit and/or image buttons, be sure to set the multipleSubmit binding on your WOForm to true. * Bind each of your WOForm elements to keys (iVar or method names) in your WOComponent's Java file. * Bind each of your submit and/or image buttons to an action method in your Java file (a method that takes no arguments and returns a WOComponent value representing the page you want displayed when that button is clicked). * Vend the page (WOComponent containing your WOForm). When the user fills out your form fields and clicks on the submit button, the browser sends the page with an HTML POST request. The WOAdaptor turns the HTML request into a WORequest and sends it to your application in the first two of the following three messages of the Request/Response cycle: * takeValuesFromRequest - which WO uses to extract the values from any of the form elements (contained in the form that also contains the button that was clicked) and automatically inserts them into the bound elements of your code. * invokeAction - which WO uses to identify the submit button element that was clicked and messages the action method which you've bound to that submit button. * appendToResponse - which WO uses to build a WOResponse that the WOAdaptor translates into HTML and sends out through the web server to render the next page. The next page is determined by which page your action method returns. You can put anything you want on that next page, including only the values of the form elements of the previous page containing the WOForm. All of this automatic behavior is built into WO and you don't have to do anything explicit like creating a WOHTTPConnection or a WORequest. These are done for you. If this answers your question, then I strongly urge you to go through the WO tutorials and introductory material, otherwise you will end up misusing WO and hating it. If you are asking for something much more sophisticated than that (like sending the page to a different server dynamically chosen at the time the button is clicked, or something), then you will have to be much more explicit about what you're trying to do when you ask the question. I hope that you didn't find the above information patronizing, but if yours was a simple question, then that should answer it without another round of "What are you really trying to do?" If it wasn't a simple question, hit us again. Regards, Jerry On Jul 27, 2006, at 9:29 AM, David Griffith wrote: Hi Paul, Because ultimately I will be submitting values that are already part of the WO app and will be parsing the response to get the various values I need. I do not want the user to see the actual response page, only the pieces that I will extract from the response. Kind regards, David. On 27 Jul 2006, at 14:50, Paul Suh wrote: On Jul 27, 2006, at 7:36 AM, David Griffith wrote: Hi all, I want to allow a user to enter details into a HTML Form (in a WOComponent) and when they click the Submit button, I would like to open a connection to a standard HTTP server with a specific URL and pass it the form values that the user entered. Can someone tell me an easy way to do this? I can create the WOHTTPConnection but I think I need a WORequest to send to it and I can't figure out how to get the form values into that request. It's probably easy I'm sure :-) David, Stupid question, but is there a particular reason why you need to send it through your WO app? Why not point your form's URL straight to the other HTTP server? --Paul Paul Suh http://www.ps-enable.com/ [EMAIL PROTECTED] (240) 672-4212 ___ 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/jerrywwalker% 40gmail.com This email sent to [EMAIL PROTECTED] -- __ Jerry W. Walker, WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems [EMAIL PROTECTED] 203 278-4085office ___ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Uns
Re: Direct Action vs. Component Action...
On 26-Jul-06, at 11:11 PM, Deepak Nulu wrote: Hi, The first part of David LeBer's articles on Direct Actions (http:// david.codeferous.com/?p=63) says the following about component actions: "each visitor will receive a relatively heavyweight Session object, so they may not be appropriate if you expect a lot of visitors and/or you do not need to track their state. Direct Action are designed for these situtations." So if I have a direct action which (1) requires a session object, and (2) returns a WOComponent object, will it be as heavy weight as a component action? If not, what is it that makes component actions relatively heavyweight? If I have a site where multiple things can be accessed via direct actions, and if I want some of these things to be available only to registered users, would I need a session object for these direct actions? Deepak, To be clear, DirectActions have two primary differences between ComponentActions: 1. They have static (bookmarkable) URLs. 2. The use of a Session is optional. Sessions are not bad, there are just times when you do not need one, so why incur the expense? If you need to track user state, a Session is an easy way to do that and for most applications that's where it ends. -- ;david -- David LeBer Codeferous Software 'co-defer-ous' adj. producing or containing code site: http://www.codeferous.com blog: http://david.codeferous.com -- Toronto Area Cocoa / WebObjects developers group: http://www.tacow.org smime.p7s Description: S/MIME cryptographic signature ___ 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: WOHTTPConnection & WORequest
Hi Paul, Because ultimately I will be submitting values that are already part of the WO app and will be parsing the response to get the various values I need. I do not want the user to see the actual response page, only the pieces that I will extract from the response. Kind regards, David. On 27 Jul 2006, at 14:50, Paul Suh wrote: On Jul 27, 2006, at 7:36 AM, David Griffith wrote: Hi all, I want to allow a user to enter details into a HTML Form (in a WOComponent) and when they click the Submit button, I would like to open a connection to a standard HTTP server with a specific URL and pass it the form values that the user entered. Can someone tell me an easy way to do this? I can create the WOHTTPConnection but I think I need a WORequest to send to it and I can't figure out how to get the form values into that request. It's probably easy I'm sure :-) David, Stupid question, but is there a particular reason why you need to send it through your WO app? Why not point your form's URL straight to the other HTTP server? --Paul Paul Suh http://www.ps-enable.com/ [EMAIL PROTECTED] (240) 672-4212 ___ 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: Re: Web Services - A newbie
On Jul 27, 2006, at 1:15 AM, [EMAIL PROTECTED] wrote: From: Roy <[EMAIL PROTECTED]> Subject: Re: Re: Web Services - A newbie To: "Mike Schrag" <[EMAIL PROTECTED]> Hi Mike, Thanks a lot for the help. I really got a starting point. But I am having a strange problem, I followed to the point where a provider was asked to setup. I did what was there exactly but then I tried to access my server after sytarting to get the WSDL document it simply throws up a blank page. It is running fine but no auto generated WSDL document. I am sure missing something. Can you please help ? View Source! Thanks Roy ___alex b cone___ ceo codefab inc 212 465-8484 x101 [EMAIL PROTECTED] http://www.codefab.com "New Orleans food is as delicious as the less criminal forms of sin." ---Mark Twain, 1884 ___ 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: WOHTTPConnection & WORequest
On Jul 27, 2006, at 7:36 AM, David Griffith wrote: Hi all, I want to allow a user to enter details into a HTML Form (in a WOComponent) and when they click the Submit button, I would like to open a connection to a standard HTTP server with a specific URL and pass it the form values that the user entered. Can someone tell me an easy way to do this? I can create the WOHTTPConnection but I think I need a WORequest to send to it and I can't figure out how to get the form values into that request. It's probably easy I'm sure :-) David, Stupid question, but is there a particular reason why you need to send it through your WO app? Why not point your form's URL straight to the other HTTP server? --Paul Paul Suh http://www.ps-enable.com/ [EMAIL PROTECTED] (240) 672-4212 smime.p7s Description: S/MIME cryptographic signature ___ 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
WOHTTPConnection & WORequest
Hi all, I want to allow a user to enter details into a HTML Form (in a WOComponent) and when they click the Submit button, I would like to open a connection to a standard HTTP server with a specific URL and pass it the form values that the user entered. Can someone tell me an easy way to do this? I can create the WOHTTPConnection but I think I need a WORequest to send to it and I can't figure out how to get the form values into that request. It's probably easy I'm sure :-) Thanks for any help, Regards, David. ___ 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: EO Model graphic schema question
OmniGraffle? But from my experience this ER view is only usable for a *very* small amount of entities in the first place. I´d rather use EOGenerator or the other thing from rubycode to create textual docs. Cheers, Anjo Am 27.07.2006 um 11:35 schrieb Amedeo Mantica: How to print it on paper (my model is very large) and bot EOModeler and Xcode are unable to manage it Suggestion ? ___ 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/krank% 40logicunited.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
EO Model graphic schema question
How to print it on paper (my model is very large) and bot EOModeler and Xcode are unable to manage it Suggestion ? ___ 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: JDBC connection failed for org.postgresql.Driver for EOMOdeler
EOModeler use JVM 1.1.8 so make sure postgres.jar run with this. I use normally two different JDBC drivers. The one for EOModeler in C:\Apple\Library\Java and one in the extension dir. [EMAIL PROTECTED] schrieb: Thanks! I added the jar file explicitly within this plist file now. Still no luck. I still get the same error message. Within the error message it now even mentions the new addition within the classpathC:/Apple/Library/Java/Extensions/postgresql.jar in the end... and that is where the file also resides. Original-Nachricht Datum: Thu, 27 Jul 2006 10:32:49 +0200 Von: Stefan Klein <[EMAIL PROTECTED]> An: Betreff: Re: JDBC connection failed for org.postgresql.Driver for EOMOdeler On Windows you need to add the jar's to %NEXT_ROOT%\Library\Java\JavaConfig.plist. But, I have never tried postgresql under Windows. [EMAIL PROTECTED] schrieb: When I try to show data within the EOModeler, I get an error message as it can not find the driver 'org.postgresql.Driver' in the Java Runtime. I put the postgresql.jar in the following directories: - %JAVA_HOME%\lib - %NEXT_ROOT%\lib\java - %NEXT_ROOT%\lib\java\extensions - %NEXT_ROOT%\libraray\jdk\lib - %NEXT_ROOT%\libraray\WebObjects\extensions - %NEXT_ROOT%\libraray\WebObjects\lib Still no luck :-( ___ 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/munich%40fantasymail.de 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
Re: Re: JDBC connection failed for org.postgresql.Driver for EOMOdeler
Thanks! I added the jar file explicitly within this plist file now. Still no luck. I still get the same error message. Within the error message it now even mentions the new addition within the classpathC:/Apple/Library/Java/Extensions/postgresql.jar in the end... and that is where the file also resides. Original-Nachricht Datum: Thu, 27 Jul 2006 10:32:49 +0200 Von: Stefan Klein <[EMAIL PROTECTED]> An: Betreff: Re: JDBC connection failed for org.postgresql.Driver for EOMOdeler > On Windows you need to add the jar's to > %NEXT_ROOT%\Library\Java\JavaConfig.plist. > But, I have never tried postgresql under Windows. > > [EMAIL PROTECTED] schrieb: > > >When I try to show data within the EOModeler, I get an error message > >as it can not find the driver 'org.postgresql.Driver' in the Java > Runtime. > > > >I put the postgresql.jar in the following directories: > > > >- %JAVA_HOME%\lib > >- %NEXT_ROOT%\lib\java > >- %NEXT_ROOT%\lib\java\extensions > >- %NEXT_ROOT%\libraray\jdk\lib > >- %NEXT_ROOT%\libraray\WebObjects\extensions > >- %NEXT_ROOT%\libraray\WebObjects\lib > > > >Still no luck :-( > > > > > > > > > ___ > 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/munich%40fantasymail.de > > 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
Re: JDBC connection failed for org.postgresql.Driver for EOMOdeler
On Windows you need to add the jar's to %NEXT_ROOT%\Library\Java\JavaConfig.plist. But, I have never tried postgresql under Windows. [EMAIL PROTECTED] schrieb: When I try to show data within the EOModeler, I get an error message as it can not find the driver 'org.postgresql.Driver' in the Java Runtime. I put the postgresql.jar in the following directories: - %JAVA_HOME%\lib - %NEXT_ROOT%\lib\java - %NEXT_ROOT%\lib\java\extensions - %NEXT_ROOT%\libraray\jdk\lib - %NEXT_ROOT%\libraray\WebObjects\extensions - %NEXT_ROOT%\libraray\WebObjects\lib Still no luck :-( ___ 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
JDBC connection failed for org.postgresql.Driver for EOMOdeler
When I try to show data within the EOModeler, I get an error message as it can not find the driver 'org.postgresql.Driver' in the Java Runtime. I put the postgresql.jar in the following directories: - %JAVA_HOME%\lib - %NEXT_ROOT%\lib\java - %NEXT_ROOT%\lib\java\extensions - %NEXT_ROOT%\libraray\jdk\lib - %NEXT_ROOT%\libraray\WebObjects\extensions - %NEXT_ROOT%\libraray\WebObjects\lib Still no luck :-( ___ 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