ColdFusion UG Tour coming to St. Paul June 11

I'm thrilled to report that Ben Forta is visiting the Twin Cities again as part of the Adobe worldwide user group tour for the upcoming versions of ColdFusion and Flex. I got the official word a few weeks ago and have been head down in planning mode ever since. Figuring attendance will bust down the doors at Easel Solutions, we needed a bigger venue, so I made a bunch of calls, sent emails, and even visited one potential location. In the end we choose the University of St. Thomas, St. Paul Campus and I think it is going to work out great.

I want to thank the TCCFUG's co-manager, Ben Ellefson, for major work on the event registration website. It's now live and I urge you to get this on your calendar and register now. This is one user group meeting you will not want to miss, plus you'll be fed and could win an IPod touch to boot.

Hope to see you there!

Completed my first Flash project

Over the past two months, I've been working with a new client on a Flash project. She happens to be a former co-worker in my Creative Internet Solutions days back in 1999-2000. We reconnected on Facebook and I learned about a new women's handbag system she was developing and needed a Flash demo for her website. We met for lunch so I could see the prototype handbags firsthand and she had a basic script on paper of how she wanted it to look and flow. From there I dove into some Lynda.com training and also picked up some best practices from a couple Flash gurus I know. After a few revisions, she had exactly what she wanted and was very happy with the end result.

Heddy Freddy handbag system Flash demo

Client quote: "Thanks so much for the great animation, it's just what I imagined!"

How to send a fax using Ooma

We just got an Ooma VOIP phone system ($220 deal right now at Costco) and I've been testing exactly how I'll position the Hub and Scout in our house. I also wanted to make sure our fax machine will work. We don't fax very often, but it's sure nice to have when when needed (usually about once a month.) Ooma says to position a fax machine with direct phone line connection to the Hub. I tried this, but it wasn't working. I could hear the high pitch "faxing sound", but after that, the connection would fail. I found a web forum with an easy solution, simply prefix the number you are dialing with *99 and it works! Here is the Ooma forum link. Ok, now I just need to get our home phone number ported and it will be time to drop Comcast phone service and save $40 per month!

ColdFusion page added to SalesForce wiki

Today I added a section for Adobe ColdFusion to the SalesForce Developer Wiki under the Web Services API section.

I then added the first code sample article, showing how to do a Basic Web2Lead Implementation. I looked at a similar PHP sample done by Wayne Abbott as the basis for my article.

Hopefully this will spur others in the CF Community to start adding more content to this wiki and spread the knowledge of CF as a viable web development platform.

Tips for testing web-to-lead on SalesForce sandbox server

The SalesForce Web-to-Lead URL is well known to be: https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8

If you have access to a Sandbox server to do your development, you may want to test Web-to-Lead against it. You first should go into the setup area to find your OID (Organization ID) which will differ from your production OID. Find this from SalesForce's top "Setup" link. Then drill down into the left navigation menu:
App Setup / Customize / Leads / Web-to-Lead
Make sure the checkbox for Web-to-Lead Enabled is checked. Then click the "Create Web-to-Lead Form" button. On the next page, keep all selected fields as defaults and click the "Generate" button. Look in the generated HTML output for your unique OID which is given in the first hidden form field. You should see lines of code like this:

<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: Please add the following <META> element to your page <HEAD>. -->
<!-- If necessary, please modify the charset parameter to specify the -->
<!-- character set of your HTML page. -->
<!-- ---------------------------------------------------------------------- -->

<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">

<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: Please add the following <FORM> element to your page. -->
<!-- ---------------------------------------------------------------------- -->

<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

<input type=hidden name="oid" value="youroidhere">

Remember, you are developing for tests against the Sandbox server, so you will need to modify the Form action to match the URL of your Sandbox homepage. Look at your Sandbox url and replace "www" with the proper subdomain, such as "cs2" in this example.
Example Sandbox homepage: https://cs2.salesforce.com/home/home.jsp
New Web-to-Lead Form action: https://cs2.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8

Update your Twitter status from ColdFusion using a JSP tag library

Today I wanted to find an easy way to put a status update into my Twitter account using ColdFusion. I went searching the API docs, and found this page.

http://apiwiki.twitter.com/Libraries

Unfortunately, there are no CF examples listed, boo! However, there are some for Java, so I continued my search in that direction. Eventually I found this JSP taglib, and decided to give it a "Twirl" :)

http://www.servletsuite.com/servlets/twittertag.htm

To use any JSP taglib, you simply drop the .jar file into your /webroot/WEB-INF/lib/ directory. I believe it also requires the Enterprise edition of ColdFusion. A good article that fully explains their usage was done by Charlie Arehart back in May 2002.

After copying the file, you must then restart ColdFusion. This is a must or you will get an error when attempting to import the library.

That's it, I was now ready to test a Twitter post. Here is the sample code I used that will put a new status message in my Twitter account. I saved this in a file twitter.cfm, then browsed to the page on my local machine as http://localhost/twitter.cfm

<cfimport taglib="/WEB-INF/lib/twittertag.jar" prefix="twitter">
<twitter:update user="your_username_here" password="your_password_here" id="result">
My posting to Twitter from CF <cfoutput>#now()#</cfoutput>
</twitter:update>

Upon success, an XML dataset is returned in the "result" variable. If you cfdump it, looks like this.

<?xml version="1.0" encoding="UTF-8"?> <status> <created_at>Wed Feb 04 21:29:26 +0000 2009</created_at> <id>1177644114</id> <text>My posting to Twitter from CF {ts '2009-02-04 15:29:28'}</text> <source>web</source> <truncated>false</truncated> <in_reply_to_status_id></in_reply_to_status_id> <in_reply_to_user_id></in_reply_to_user_id> <favorited>false</favorited> <in_reply_to_screen_name></in_reply_to_screen_name> <user> <id>20062919</id> <name>Twin Cities CFUG</name> <screen_name>TCCFUG</screen_name> <location>St. Paul, MN USA</location> <description>Adobe ColdFusion User Group -of Minneapolis / St. Paul, Minnesota</description> <profile_image_url>http://s3.amazonaws.com/twitter_production/profile_images/75391930/colderfusion_twitter_normal.jpg</profile_image_url> <url>http://groups.adobe.com/groups/bd9082a926/</url> <protected>false</protected> <followers_count>0</followers_count> </user> </status>

If you fail to restart CF, you will see this TagExtraInfo error message:

The TagExtraInfo class com.cj.twitter.strVariable for the update tag could not be found.

The CFML compiler was processing:
* A cfimport tag beginning on line 1, column 2.

This is not the best solution if you are in a shared hosting environment, as they may not install the twittertag.jar file for you. I'm curious what other methods developers have found to accomplish status posts to Twitter.

ColdFusion UDFs long2ip() and ip2long()

Yesterday I was working on porting some PHP code into ColdFusion. The PHP code was using a function called long2ip(), and I researched this PHP Manual website to learn more about it. I needed this function in CF, but couldn't find it at cflib or anywhere else doing a few Google searches. The closest I came was this blog post by Brandon Purcell, which got me started in the right direction. I learned from what Brandon wrote, along with the comments input by Gabriel Malca (if the function doesn't exist) at the PHP Manual site and came up with the logic for my CF version of the function. After I had this working, I figured I better implement the opposite conversion function as well, so I also created ip2long(). Again I found a user comment for when the function doesn't exist to base my function's logic. I submitted these to cflib.org today, so look for them soon.

Examples:
long2ip(3401190660) = 202.186.13.4
ip2long(202.186.13.4) = 3401190660

Here is the code for UDFs below:

<cfscript>
/**
* Generates an (IPv4) Internet Protocol dotted address (aaa.bbb.ccc.ddd) from the proper address representation. Returns 0 if error occurs.
*
* @param longip Numeric value of the address you want to convert. (Required)
* @return Returns a String.
* @author Troy Pullis (tpullis@yahoo.com)
* @version 1, Jan 5, 2009
*/
function long2ip(longip)
{
   var ip = "";
   var i = "";
if (longip < 0 || longip > 4294967295)
      return 0;
for (i=3;i>=0;i--) {
ip = ip & int(longip / 256^i);
longip = longip - int(longip / 256^i) * 256^i;
if (i>0)
         ip = ip & ".";
}
return ip;
}

/**
* Converts a string containing an (IPv4) Internet Protocol dotted address (aaa.bbb.ccc.ddd) into a proper address representation. Returns 0 if error occurs.
*
* @param ip Dotted address value you want to convert. (Required)
* @return Returns a String.
* @author Troy Pullis (tpullis@yahoo.com)
* @version 1, Jan 5, 2009
*/
function ip2long(ip) {
   var iparr = ListToArray(ip,".");
   if (ArrayLen(iparr) != 4)
      return 0;
   else
       return iparr[1]*256^3 + iparr[2]*256^2 + iparr[3]*256 + iparr[4];
}
</cfscript>

CFC for Building a Zip Code Proximity Search with ColdFusion

Back in Oct 2005, SysCon published an article I wrote in CFDJ magazine. Unfortunately, the Webmonkey.com tutorial I originally based my article on has been removed by Wired. I contacted them and hopefully they'll dig it up and repost it under their new wiki site. In the meantime, here is a link to the CFC file zipfinder.cfc used in that article.

One more note... if you make use of my code examples from the CFDJ article, please write your queries using cfqueryparam, which I should have done in the first place.

Twin Cities CFUG November meeting taking shape

We have a great meeting planned for both intermediate as well as brand new CF developers. This meeting is Wednesday, Nov 5th at Easel Training.

Room 1) Kurt Wiersma - BlazeDS
Have you ever wondered what BlazeDS is and what it can do? If so this session is for you. We will cover how you can install BlazeDS inside of CF and how CF can communicate with BlazeDS to make Flex applications get real time messages from ColdFusion.

Room 2) Jason Dean - New Developer Breakout Session
This break out session will be an informal meeting for new developers and for developers who are new to CFML. Bring your questions or just learn the basics of ColdFusion.

Both topics will be presented simultaneously in different rooms. Learn more at colderfusion.com

Dispute with web host gisol.com

Today I got into a financial dispute with my hosting provider of the last 8 months, Global Internet Solutions, gisol.com. They totally misrepresented a special rebate offer, whereby I was supposed to get my hosting plan at only $3.57/month. Apparently, they've done this to countless others, as this "report-gisol.com" website I found today has documented. Warning to all CF developers, never host with this company, they are crooks!

Therefore, this blog is probably going away for the short term until I get going with another host. If/when they shut me down, you can visit my site here, setup under my Comcast ISP hosting. Hopefully I'll be back soon.

More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.9.002. Contact Blog Owner