2

Simple login form using existing Google or Yahoo account

I spent all of this morning write a demostration ColdFusion page for integrating with RPX API to allow users to use their existing Google or Yahoo accounts to sign in to my website. By using this API, I could get basic user information such as their names and gender. Actually, I only could get their names through their Google accounts, in addition to their gender if they signed in through their Yahoo accounts. I could get more of user information if I upgrade my RPX account. The ColdFusion page is a basic demo that shows a login link to the RPX login AJAX popup. Once the user logged in, he/she will see their names as well as some related information of their provider. In addition to Google and Yahoo, there is also an OpenID login option. Unfortunately, I cannot test OpenID because I don’t know how to implement my own OpenID since Google is also use OpenID implementation.

You can view the demostration page at the following URL:

http://160.253.0.40/Students/Students/0111/OpenIDapi.cfm

Here is the download URL for the source code of this page:

http://ca288-final-spring-2010-mc.googlecode.com/files/OpenIDapi.cfm

2

Google Maps API and ColdFusion

While I was experimenting with Google API for my CA 288 ColdFusion class final project, I discovered that the ColdFusion variables can be used within the script tag. So I tried it out. I put the cfoutput tag outside the script tag in order to use the ColdFusion variables inside the script tag. And then I added cfif statement inside script tag to set the default latitude and longitude values to New York if there is no URL variables. Here is the cfelse part of the code:

var co_lat=#URL.a#;
var co_long=#URL.o#;
initialLocation = new google.maps.LatLng(co_lat,co_long);
var marker = new google.maps.Marker({
position: initialLocation,
map: map
});
contentString = “<br />#URL.d#:” + “<br />” + “Latitude: ” + co_lat + “<br />” + “Longitude: ” + co_long;
map.setCenter(initialLocation);
infowindow.setContent(contentString);
infowindow.setPosition(initialLocation);
infowindow.open(map);

I also used ColdFusion variables to convert them into the JavaScript variables as you can see on the first two lines of code. I also added a marker to the map to show the accurate location for the data provided. This is best used for creating maps from a list of places. For usage example, go to http://160.253.0.40/Students/Students/0111/browserGeo.cfm?d=Addo%20Entrance&a=-33.44431&o=25.73872. To download the source code, visit http://code.google.com/p/ca288-final-spring-2010-mc/downloads/list