919 - 926 - 9847

So how did you get started in ColdFusion?

My journey to ColdFusion stared in 2001. I was working at getting a BA in order to escape the inability to break into the "computer" world. As part of my internship for school, I got to choose where I got the privilege of paying $300 to work for free (yay education system), and that place was EXTOL International Inc. in Pottsville, PA. My in-laws worked as AS400 developers there (still do), and it seemed like a great place to start out. At any rate, it was a "foot in the door" situation that I couldn't pass up, and just 15 minutes up the road.

I started work under Mark Dempshey, the then current product manager and webmaster, and was given the task of learning about ColdFusion and the network in general. So for 40 hours a week, which was double the requirement, I spent 9 weeks working full time (for free) learning the ropes in the computer world, as well as my 3-11 paid job. It was a challenge, but well worth it as I was able to translate that internship into a paid position.

We started out on ColdFusion 4.01 and Access (good lord, why??), and when I left in 2006 we had moved to ColdFusion MX 6.1 against MSSQL. We grew from a home grown, gnarly CMS, to the FarCry CMS. I've discovered that I have no real ambition to EVER work under the NJ/NY mind-set again (you didn't read my mind and make that webform already?? We sent it to print!! We'll send you a graphic soon). Sadly they've since moved to a hosted solution that's either ASP or PHP, but that's just the way the ball bounces sometimes. There really wasn't anywhere to go "up", so I had to leave PA in order find better prospects. Still, they kept me on for 9 months as a consultant. I miss the area, but the opportunities presented in the Triangle area should keep me covered for a good number of years to come.

Where would I be without ColdFusion? Probably as a java/php/asp developer. I personally like being a CF dev and wouldn't change it for the world.

PNG not showing using Built-in JRun webserver

My friend Michael blogged about an issue he was having with viewing PNG files when using the built-in JRun webserver. Just in case this should ever happen to you, here's the link.

It appears I didn't get the link right. It's fixed now.

Error when entering lots of text view the body tag of a FarCry content item

I forgot that I've seen this before, but I had a client trying to enter text (quite a bit, in fact) and it kept failing. After finally getting all of the information on the incident, it turns out that the following error was being generated:

ErrorContext WDDX packet parse error at line 1, column 32001.
Message WDDX packet parse error at line 1, column 32001. XML
document structures must start and end within the same entity..
StackTrace coldfusion.wddx.WddxDeserializationException: WDDX
packet parse error at line 1, column 32001. XML document
structures must start and end within the same entity

I google'd around a bit before I found the answer. We're storing the body field as a CLOB (at least, I'm pretty sure that's what it is). The default buffer size for this in the ColdFusion administrator is 32k. My text input went beyond that. Whoops. So, I made sure to check the box for CLOB (and turned on BLOB for good measure) and set the size to 128k. Problem solved, and now they can enter a very long string of text into the database. Just throwing this out there in case anyone else stumbles upon this issue.

Quick and dirty uptime monitor

Although we use FusionReactor to determine the health of our servers on our team, the environment as a whole is still monitored by another group. And they cannot access FusionReactor. Our previous method of monitoring just a URL worked fine when the servers were not clustered. Now, however, you can't really be sure what instance you're on. Therefore, we get false up/down messages for a specific instance.

What I've done is this, I've got a new monitor.cfm file such as the one below:

    System = createObject("java","java.lang.System");
JRun = createObject("java","jrunx.kernel.JRun");
<cfset this_servername = JRun.getServerName()>
    Instance: #this_servername#<br>
    Server Name: #cgi.Server_Name#<br>
<!--- Change timeout behavior if more than one instance is displayed --->
<cfif isdefined('url.all')>
    <cfset timeoutBehavior=15>
    <cfset timeoutBehavior=28>
<!--- Ensure that url.instance is defined --->
<cfparam name="url.instance" default="all">

<cfif url.instance EQ 'someinstance' or url.instance EQ 'all'>
<cfset sStatus="">
<cfhttp method="get"

        <cfcatch type="any"><cfset sStatus="bad"></cfcatch>
<b>SOMEINSTANCE 1 - status</b> <cfif sStatus EQ "bad">Down<cfelse>Up</cfif>
<cfif sStatus EQ "" OR sStatus EQ "good">

This code calls out to a file sitting within the instances built-in web server path. Since I need to leave this enabled to effectively manage the instance anyway, it's a good way to test that it's "alive". That monitor.cfm file contains:

    System = createObject("java","java.lang.System");
JRun = createObject("java","jrunx.kernel.JRun");

<cfinclude template="Duration.cfm">
<cfset uptime = duration(server.coldfusion.expiration,now())><br>
<cfoutput>#uptime.days# Day(s) #uptime.hours# Hour(s) #uptime.minutes# Minute(s)</cfoutput><br>

<cfset this_servername = JRun.getServerName()>
<cfoutput>Instance: #this_servername#</cfoutput>

This display the instance information, and uses the UDF duration call (from CFLIB) to get the uptime count for the server. This information is then used within the first monitor call to display uptime status.

Why bother? Well, I need some type of text on the page to tell the monitor (soon to be Nagios) that my instances are up. And near as I can tell, this is the only accurate way to do so. It's not pretty, I admit, but it gets the job done.

Set up muliple instances for just one website - caveats

To expand upon this earlier post, when you map multiple instances within the same website (via virtual webs), items that use CFCHART will break. To make sure that the correct CFIDE is called when calling things like cfform, cfchart, etc. you need to make these modifications (thanks to Bruce Purcell)

  • In {cfmx-root}/lib/neo-graphing.xml
    Change /CFIDE/GraphData.cfm to /somesite/CFIDE/GraphData.cfm
  • In {cfmx-root}/wwwroot/WEB-INF/web.xml
    Change /CFIDE/GraphData.cfm to /somesite/CFIDE/GraphData.cfm

In addition, we were experiencing issues with session replication when users were moving between virtual webs within the same site. The fix for this is to place this code into a normal index.html template, and ensure that this template is called first when entering your site.

<script LANGUAGE="JavaScript">
         document.cookie = "JSESSIONID=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/";
         document.cookie = 'CFID=; expires=Thu, 2 Aug 2001 20:47:11 UTC; path=/';
         document.cookie = 'CFTOKEN=; expires=Thu, 2 Aug 2001 20:47:11 UTC; path=/';


    <!-- <META http-equiv="refresh" content="0;URL=http://<somedomain>/<somesite>/index.cfm" /> -->
    <!-- <p>The eBusiness home page can be found at <a href="http://<somedomain>/<somesite>/index.cfm">http://<somedomain>/<somesite>/index.cfm</a></p> -->

FarCry plugin breakdown - Part I

I promised a breakdown, and so it shall be writ. This first segment is going to analyze the newly created objects. If I have wherewithal to finish tonight, we'll move along to the administrator addon.

Let's start with our objects then:

  • massMailer - This object will hold all the information about our email. Things like message body, subject, from, to, and the massMailerList objects.
  • massMailerList - This object contains the name of the list, and holds massMailerUser objects.
  • massMailerUser - This object contains the name, email address, and dateTime stamp when the object was created.

Now let's look at the code. We'll start with the massMailerUser.

<cfcomponent extends="farcry.core.packages.types.types" displayname="Mass Mailer Users" bFriendly="1" hint="Mass mailer object to hold the users" bobjectbroker="true" objectbrokermaxobjects="1000">
type properties
<cfproperty ftSeq="11" ftFieldset="User Details" ftWizzardStep="General Details" name="Title" ftLabel="Name" type="string" hint="Users Name" required="no" default="">
<cfproperty ftSeq="12" ftFieldset="User Details" ftWizzardStep="General Details" name="Email" ftLabel="Email" type="string" hint="Email Address" required="no" default="">
<cfproperty ftseq="13" ftFieldset="User Details" ftWizzardStep="General Details" name="DateAdded" type="date" hint="The date user was added" required="yes" default=""ftDefaultType="Evaluate" ftDefault="now()" ftType="datetime" ftDateFormatMask="mm dd yyyy" ftTimeFormatMask="hh:mm tt" ftToggleOffDateTime="false" ftlabel="Date Added" />

object methods

Hmm... so what does THAT mean?? Let's break this object down. Formtools will generate our object administration page for us, but it needs some help to get along.

  • ftSeq - Numeric sequence that you wish the fields to be displayed in
  • ftFieldset - Gives "groups" within a given page. Usually denoted by a horizontal line
  • ftwizardSet - Should give pagination, but it isn't working (for me) at this time
  • name - Name for the object to be created in the database
  • ftLabel - Label to displayed in the admin
  • type - Type for database creation
  • hint - Typical component hint. Although I think there's a way to give context sensitive help, I just haven't explored it yet.
  • required - No need for explanation, right?
  • other ft types - Not going to into these in detail. There are several examples in the core for working with date/time types with the supplied date/time picker.

Next up, our massMailerList object

<cfcomponent extends="farcry.core.packages.types.types" displayname="Mass Mailer List" bFriendly="1" hint="Mass mailer object to create the lists" bobjectbroker="true" objectbrokermaxobjects="1000">
type properties
<cfproperty ftSeq="11" ftFieldset="List Details" ftWizzardStep="General Details" name="Title" type="string" hint="Title of object." required="no" default="">
<cfproperty ftSeq="12" ftFieldset="List Details" ftWizzardStep="General Details" name="aObjectIDs" type="array" hint="Holds objects to be displayed at this particular node. Can be of mixed types." required="no" default="" ftLabel="Users" ftJoin="massMailerUser">

object methods


Pretty much more of the same, EXCEPT, for this little gem. Notice that my aObjectIDs is of type array. This type MUST have an ftJoin attribute applied. You would specify a component here that you would like to have data populated from. In our case it is massMailerUser. But it could easily be dmImage (default supplied image library) or dmFile (default supplied file library). Heck, it can even be a comma separated list of any of these things.

So what happens when you add this type of field? Formtools will generate a button for you to click, called open library. This will pop open a window, and you will be given a choice of various tabs. In the main view, you can drag the massMailerUser (or image, or file, or whatever) objects from the right hand pane to the left hand pane. And that's it, you're done. You've now attached objects as an array to your massMailerList object. And you didn't even have to write any code!

This leaves us with massMailer

<cfcomponent extends="farcry.core.packages.types.types" displayname="Mass Mailer" bFriendly="1" hint="Mass mailer object to send to lists created by Mass Mailer List" bobjectbroker="true" objectbrokermaxobjects="1000">
type properties
<cfproperty ftSeq="11" ftfieldset="Mailer Details" ftWizzardStep="General Details" name="Title" type="string" hint="Title of object." required="Yes" default="">
<cfproperty ftSeq="12" ftfieldset="Mailer Details" ftWizzardStep="General Details" name="aObjectIDs" type="array" hint="FarCry Groups to send email to" required="Yes" default="" ftLabel="Lists" ftJoin="massMailerList">
<cfproperty ftSeq="13" ftfieldset="Mailer Details" ftWizzardStep="General Details" name="fromEmail" type="string" hint="From email address" required="Yes" default="">
<cfproperty ftSeq="14" ftfieldset="Mailer Details" ftWizzardStep="General Details" name="replyTo" type="string" hint="Address(es) to which the recipient is directed to send replies" required="no" default="">
<cfproperty ftSeq="15" ftfieldset="Mailer Details" ftWizzardStep="General Details" name="wraptext" type="string" hint="Specifies the maximum line length, in characters of the mail text." required="no" default="">
<cfproperty ftSeq="16" ftfieldset="Mailer Details" ftWizzardStep="General Details" name="failTo" type="string" hint="Address to which mailing systems should send delivery failure notifications. Sets the mail envelope reverse path value" required="no" default="">
<cfproperty ftSeq="17" ftfieldset="Mailer Details" ftWizzardStep="General Details" name="charset" type="string" hint="Character encoding of the mail message, including the headers" required="no" default="UTF-8">

<cfproperty ftSeq="21" ftfieldset="Text Body" ftWizzardStep="Text Body" name="Body" type="longchar" hint="Main body of content, text only." required="no" default="">
<cfproperty ftSeq="31" ftfieldset="HTML Body" ftWizzardStep="HTML Body" name="htmlBody" type="longchar" hint="Main body of content, to be sent to users as HTML" ftType="richtext"
    ftImageArrayField="aObjectIDs" ftImageTypename="dmImage" ftImageField="StandardImage" required="no" default=""
    ftTemplateTypeList="dmImage,dmFile" ftTemplateWebskinPrefixList="insertHTML"

<cfproperty name="bSent" type="boolean" hint="Flag for email being sent" required="yes" default="0">

object methods

<cffunction name="send" access="public" output="true" hint="Prepares and sends email to members">
    <cfargument name="objectid" required="yes" type="UUID">
    <cfset stObjMail = createobject("component", application.types.massMailer.packagepath)>
    <cfset massObj = stObjMail.getData(objectid=arguments.objectid)>        
    <cfinclude template="send.cfm">


Again, more of the same. Except we also used a rich text for generation of our "Pretty" email body. Examples of such types exist in the core. Two things worth noting is the send function and the array of massMailerList(s). I plan to fully expound upon this in part II or III, but for now, know that it's there for us when it comes time to send out our mass mail!

Oh, and thank the heavens for FireFox's built in spell checker... it at least keeps these posts from being slightly more legible than I could manage without it.

My First Farcry Plugin... it's done, and here it is

Alrighty. I've created a zip of the plugin, and it will be available from here to download.

Installation instructions:

1) Install the latest version of FarCry Beta from either Jeff Coughlin's site or from the FarCry CMS page. Pertinent installation information can be found at their respective sites.

2) Modify your project//www/Application.cfm so that the plugins list includes massMailer in the list. This is a comma delimited list.

3) Open the FarCry admin and click on the Admin tab. Select COAPI from the dropdown list, and then click types. Deploy the three massMailer types. Next click rules, and deploy the massMailer rule.


Example 1: You want to have a form add a user to an email distribution list.

1) Open the FarCry admin and click on the Mass Mailer tab.

2) Click (in the left hand pane) the Mass Mailer List to create a new list.

3) Click Add to create a new List. Each List has two properties, a name, and a list of emails. We'll only worry about the name for now. Give the List a name, and Save.

4) Open a window to view your FarCry site. Switch to Design Mode, and click on a container where you'd like the new form to reside.

5) Choose the Mass Mailer Rule from the list, and add it to the container using the Commit button. This should take you to the next step. From here, select the Display Method (one is supplied for you), and use the Open Library to add a list. You can add only one list per rule! I'm thinking of modifying this in the future, but for now it stays. Save the results.

6) Refresh the page, and you should now see a form containing the Name and Email fields. Complete the form, and once submitted, it will add a new entry to your list (as well as create a new massMailerUser object). To verify, open the FarCry admin/Mass Mailer Tab and edit the Mass Mailer List you just created.

Example 2:

1) Follow steps 1-3 above. While still in the open library, you can choose to attach a new object.

2) Otherwise, click Mass Mailer User, add the new user, and then attach using the open library from Mass Mailer List.

Sending Mail

1) Open the FarCry admin, and click the Mass Mailer tab.

2) Click on the Mass Mailer link in the left hand pane. And then click Add from the top navigation.

3) Fill out the form fields as required. You need, at minimum, the Subject and List (open library). You can add as many lists as you like to the email.

4) There is a plan to add an attachment to the emails, but that's slated for the next release.

5) Save the object. Then select the object, and from the top/central navigation buttons, click Send.

The end! Tomorrow (or as time permits) I'll break down the objects and the "Why" of it.

My First Farcry... well, plugin is the term now, take 3.1

Alright. We have successful email creation in place. You can also assign a rule and a webskin to the rule. The final piece is adding the massMailerUser object to the massMailerList object via an online form. This should be completed tonight, family willing, and I'll start the break down/analysis of what each file does, and why. Thank you ray for the use of code tags, which ya'll will see extensive use of tomorrow ;).

Update: so close to the finish I can almost taste it... however, it's late. I need to sit in on performance tests tomorrow morning, so it will need to wait until tomorrow afternoon to finish up. The good news, though, is it works! I need to cull the deadwood of copied functions from the core/admin/facade/library.cfm that will not be used, but it appears that everything is working as it should. Yay!

My First FarCry library take 3

I finally got some free time to move this project towards completion. And then things went to heck in a handbasket when Daemon decided to change around the code base ;). So, what has changed is that farcry_core is now just core. Projects have moved to a projects folder. And farcry_lib is now plugins. That last is what really affected me. I had to change my customadmin and customlists to reflect this change.

As Stephen mentioned in previous comments, Formtools is just too sexy for itself. I went the easy route for the time being, but will climb the hard road in time.

My three objects still exist, one calling the other using the open library feature of Formtools. The only drawback I can fore see is there is no way to select multiple objects at a time. I'll see if anyone has extended this yet. This is now working smashingly.

Next up, setup the special columns required to send mail through the admin. Then, finally, adding users to lists via the web signup form.

Update: And we have success! You now create a user. Assign the user to a list(s). Assign that list to an email to be distributed, and then send. Full source to be fourth coming as soon as the rule (which can be dropped into a page) and webskin templates are setup. Maybe tonight, maybe tomorrow.

Update 2: The rule for adding the massMailer to a page has been created (which was pretty simple). Now the tough part... adding the formtools functionality to the webskin. Since we're attaching a new objectid into the massMailerList object, seems to be the most practical way of doing so. Of course, we could do it by straight database manipulation, but where's the fun in that ;).

My First FarCry library take 2

So, I'm going to need three different objects to accomplish this task. One massMailer, massMailerList and massMailerUser. The massMailer object is the main object, and it contains fields for From, Body, To (shown as a dropdown, but really a link to the massMailerList object), etc. The massMailerList object contains a title, and an array of massMailerUser objects. The massMailerUser object contains things like name, email, date added. Whew. These objects have been deployed, and their associated table data has been created.

Next up, creating the display methods and tweaking code so that Formtools displays the object properties correctly. However, given the lateness of the hour, it's not happening tonight.

Update: Sorry to those who are watching in anticipation of an early completion. Due to sick family members, I can't really finish this up until tomorrow night. On that note... sleep awaits.

More Entries