Rob Gonda's Blog

CFUnited Preconference Classes posted

CFUnited just posted the list of pre-conference classes. I will be teaching an Ajax Intensive For ColdFusion Developers. If you have a chance, do not miss this hot topic! The session will teach you to implement Ajax from the ground up, providing you all the fundations to successfully deploy secure and robust Ajax sites/components.

CU214 - Ajax intensive for ColdFusion Developers
Ajax, Web 2.0, RIAs, single-page-applications are just a few buzzwords that every developer needs to know in 2006. Learn the history of Ajax, what it means to you, why you should pay attention, who is using it, what is available, and how to implement it. This session will get you up to speed with Ajax, compare the different existing frameworks, and provide you helpful tips of do’s and do not’s with Ajax.

Learn how to enrich your users experience by the use of AJAX. Examples start at --hello world-- and build up all the way to object oriented MVC applications. By the end of this session, you will know how to enhance your site through simple AJAX widgets or build full AJAX application including enhanced security and debugging techniques. Learn common mistakes such as delegating business logic to the client side, and learn to avoid them by keeping your logic in the server and loading scripts on-demand.

Find below the full list of classes:

CU210
Leader of the Pack (strategies for building better software) - Simon Horwith - Monday 6/26
CU211 Fundamentals of Relational Database - Kurtis D. Leatham - Monday 6/26
CU212 ColdFusion Server Administration: JRun J2EE Deployment - Adam Wayne Lehman - Monday 6/26
CU213 Testing ColdFusion - John Paul Ashenfelter - Monday 6/26

CU214 Ajax intensive for ColdFusion Developers - Rob Gonda - Tuesday 6/27
CU215 XML, XPath, and XSLT for ColdFusion Developers - Jeff Peters - Tuesday 6/27
CU216 Domain Modeling - Hal Helms - Tuesday 6/27
CU217 Beyond Basic SQL for CF - Nate Nelson - Tuesday 6/27

help: coldfusion+soap

ColdFusion has a nice integration with web services when a WSDL is present, and it's great with REST web services too. However, it's extremely difficult to integrate with regular soap, why?!

I tried using cfx_soap and it just doesn't work. I also found a way to 'trick' cf by creating a local web services and then add soap headers to it... but it's too complicated, and only works for cfmx6.1. Of course I could manually code all the xml envelop and use regular cfhttp calls, but who wants to do that?

Has anyone successfully implemented any soap integration with CF? If so, could so share it with the community? Just to think that perl can use soap::lite modules and CF can't... how depressing.

Thanks.

ColdFusion Open Source list now using ajaxCFC

The ColdFusion community open source projects list is growing, and there are several individuals helping the cause. Brian Rinaldi put together a very nice list of open source projects. After I changed my license, he chose to incorporate it to the site and use it for category filtering, and as expected, it's much faster than page reloads. Read how difficult was the experience from download to deploy on a very useful beginner's review of ajaxCFC.

Ajax: XMLHttpRequest Vs. iFrames

In my resent presentation in the CFUG someone asked me why should he switch from using iframes to XHR and I stumbled a little. There is not better or worse when comparing these two techniques, but they are certainly different. While both of them allow you to communicate with the server in the background, you should choose the appropriate for your situation depending on a few questions: Do you want the back-forward buttons to work? Do you plan to perform more than one simultaneous request? Do you need cross-site calls? Do you need to monitor the status of your calls?

I'm pretty sure there are more differences, and way around the ones I will mention for either technique, but out of the box, here are the differences:

                            XHR           iFrame
Multithread:       yes             no
Back button      no               yes
Cross-site        no               yes
Statuses           yes             no

Some people use iframes because it's easier to monitor… all you have to do is to show the hidden iframe and voila, you see the responses. On the other hand, I use several http traffic sniffers that give me even more accurate information, and they're extremely easy to use. So that's not a plus for me.

Multithread is huge... you could achieve this with iframes if you create a framework that will create a new iframe using dom, use it for the call and delete it once it's completed. When using XHR, you can easily create a new remote request with simple scripting.

The back button breaks by default when using XHR. Sometimes it is actually good, f.e, if I populate a city and state using a zip code, or check if an email has been taken prior to submitting a form I wouldn't like to add a history step, so I'm glad the back button doesn't recognize that request. There are ways around it too if you do need it to work. I will post some solutions/possibilities soon.

Cross-site scripting ... while you would like this to work to use web services, they do not really work with iframes either. When scripting with iframe you need to explicitly call a function in the parent or top window, so unless you control both sites, this advantage is useless. You can implement a server side web service proxy relatively easy and I would suggest doing that if you need to use WS.

Finally, statuses... with an iframe you do not know in that status your call is. With XHR you have 5 different ones: 0 = uninitialized, 1 = loading, 2 = loaded, 3 = interactive, 4 = complete. They are useful to provide the user with more accurate information.

In conclusion, most of the times XHR is preferable over iframes, but there are cases and cases. Google maps uses iframes, while google suggest uses XHR.

ajaxCFC engine update

upon request, I just incorporated the latest changes from DRW's engine. It went from v1.76 to v1.83.

Below are the changes:

183. safari fix from 1.1
182. Fixing improper merging of call meta-data
181. make nested sync calls work properly
180. safari2 fix
179. experimental dwr filetype to help webstats
178. Rolled in fix for safari2
177. nested generic parameter handling

CFUG Ajax Presentation Files

I really enjoyed speaking last night at the cfug, and I had a great audience. I met a couple of the attendees, which actually may incline me to attend to more meetings :)

As promised, I'm providing here the presentation files I used (enclosed). If you need me to elaborate on any slide, please do not hesitate to ask.

For those of you who didn't make it for any reason, the presentation covers ajax101; I kept it basic and universal. Starts with definition, story, advantages, who's using it, gets a little into the xmlHttpRequest, mention some available frameworks, and provide a simple example using ajaxCFC.

Enjoy.

p.s. I also emails the presentation to Ron, so it will get posted at the South Florida CFUG site too.

* updated. Download the PDF version here if you don't have PPT 2003 installed.

CFunited Marriott sold-out, and alternatives

I already booked my CFUnited room, but for those who haven't check the following information that was provided by Joshua Cyr

It turns out that Marriott is booked solid. Doh! I just did some research. There is a very close hotell called Park Inn Rockville, but it is being closed permenantly next week.

The two others that seem within walking distance are the DoubleTree and Ramada Inn. The Ramada in is only $125 a night (give or take), where the Doubletree was about $225.
Joshua, thanks for looking out.

CFUG speech first followup

I received a few questions after my speech last night at the South Florida CFUG; some by email, some by comments so I decided to address them in a new post. This is the first post, but more will come. Yaron asks:

1. DWREngine._execute function sends the callback function the structure received from the component. Is it possible to pass an additional element to that function as well?
Example: Call back function ReportInventory(getInventory) receives a query structure, but I would also like to pass a form field (e.g. Form.Sizes) for further manipulation within that function. Is this possible?

2. You mentioned, but did not have enough time to show us, a tool you use for debugging. I believe you called it an HTTP spoofer…can you tell me a little bit about it.
1. It is a good question, but unfortunately, it is not possible to pass additional arguments to the call handler. That change could be quite complicated, because the framework manages unlimited simultaneous requests in a batch, so I would have to create an additional structure to support additional information, link it to the request ID, check for it in the callback handler, and invoke your function passing the additional arguments.... I can add that to my to-do list, but honestly it may take a while. For now you can overcome it in two different ways: 1) you can save a globally accessible var in JS, or 2) you can send the values you need to CF and have it send them back with the response. The project is open source, and I am receiving some nice add-ons lately, so I encourage anyone who wants to take this challenge to give it a try.

2. To debug AJAX requests I use what is called HTTP sniffers. There are a couple of good ones out there and it will require a full post to explain them all and how to use them. For now I will recommend using HTTP Live headers if you use FireFox, or Fiddler if you use IE. A third, more complicated, and more powerful tool is Ethereal, but it goes way beyond HTTP traffic. I recently started using FireBug for Firefox too. It's really nice, I just wish you could detach it from the main browser.

Some sniffers will follow the request and response and provide all information in a centralized place, others will just show you the request, but if you're using the 'get' verb (default on ajaxCFC), you can copy/paste that request in a browser and call it directly. Doing this way you will see ColdFusion errors too.

When you're really to deploy your app live, change a few settings in ajaxCFC: use 'post' verbs, make it check referrer, and check sessions.

** updated, added Firebug for the http traffic sniffers

ColdFusion, sql, and time zones

so I was researching globalization the other day, more specifically, timezones.... and let tell you something, it gets complicated. All this different timezones, day time saving, more savings are 1h, some are 2h, countries change from DTS to not in different dates... It seems like one of the best ways is to use the timeZone classes built-in the JVM. BTW, I found that some of the provided info is wrong and I reported it to Sun.

I actually wanted to find a solution built in SQL because I'd like to be able to query for specific times for different user profiles without having to update them to UTC every so often ... does anyone have any better solution?

I built a database table with all the different timezones, pointed them to countries, added DST and offset hours... but I'm 100% convinced that it is the best approach. Suggestions?

I found a few good links:

Macromedia Talks about it
Blog dedicated to globalization
CFC providing nice funcionality

P.S. I do not want to rely on external web services.

Advanced CF/Flex Contest Announced

Ray Camden announced today yet another contest. After the success of the beginner and intermediate coldfusion contest, this one deviated to another direction: you must use flex 2.0.

If I have time I'll get it this one, but I was expecting it to by ColdFusion.

More Entries

This blog is running version 5.9.003. Contact Blog Owner