Scheduler Program

One thing that I run into frequently in my programming life is the desire to schedule events. I like CFSCHEDULE, but by iteself it has a few limitations that I don't like. It is a bit limited in the intervals available and I have to have an HTTP page set up for it.

What I want is the ability to schedule a CFC method to be run directly from that CFC. Fortunately, Scheduler.cfc allows me to do just that. Scheduler.cfc itself still requires a scheduled task to run it. Scheduler.cfc also has the ability to report data about the scheduled tasks that it has run, but (as it is just a CFC) it doesn't have a UI to report that data.

The Scheduler program solves both of those. It is essentially a wrapper for Scheduler.cfc. When the program is installed (copying it to a folder after installing Neptune), it automatically creates a "/schedule.cfm" and creates a ColdFusion scheduled task to execute it every 15 minutes (you can, of course change that). It also creates a page that reports all of the scheduled tasks running on the system as well as how long they execute (in seconds) on average, as well as the ability to see details of every time that they have run.

This information can be invaluable if you are trouble-shooting a scheduled task.


Neptune Framework in Beta 2

It took a little longer than I had hoped to get this out - mostly owing to being behind on a number of other things. Even so, I am really excited about this release of the framework.

For an overview of what Neptune is, you can read the Neptune framework announcement or see the Neptune documentation.

So, what's new in Beta 2?


English-Friendly Interval Calculation

I am working on a small program to digest and store RSS feeds (in part using Ray Camden's nice RSS.cfc). One thing I ran into is that I want to be able to specify how frequently feeds should get updated. It seems obvious that I should have an argument for this in the init() method of my CFC. What I don't want, however, is to either limit myself to one interval (days, for example) or to have multiple arguments just for the interval.

Moreover, I really want to be able to specify the interval in a human-readable format. So, I created a UDF (implemented as a method in my CFC) to make date calculations based on a readable string indicating the interval.

Here are some examples of intervals that it will calculate:

  • daily
  • annually
  • every day
  • every other minute
  • every 3rd quarter
  • every fourth year
  • every other Saturday
  • 4th Saturday
  • three weeks
  • 2 months, 2 days, 11 minutes
  • - every second Sunday

Most of these should be pretty obvious, but the last two might require a touch of explanation. The UDF will accept a comma delimited list, in which case it will apply all of the intervals to the date given.

If the interval starts with a "-" then it will subtract the interval given. The subtraction will only apply to the entire interval, not to single items in the list.


Adding Fields to StarterCart

Every shopping cart that I have tried or reviewed has some generic fields in their products that are meant to handle any product data that wasn't otherwise covered by their existing fields. I never liked this approach. It makes the GUI user somehow responsible for data structure and probably doesn't eliminate the need for custom code anyway.

With StarterCart, I took a different approach. Instead of having several product fields as well as some generic fields, I have only the bare bones - fields for the name, price, description. I honestly debated about whether or not to include a description field.

So, how do you add fields?


New Open Source ColdFusion Shopping Cart

I have tried a handful of ColdFusion shopping carts and I have never been happy with them. They tend to do more than I need, but not in the way that I need it. That they don't work quite as I need isn't a problem. That they are difficult to modify is.

After a few frustrating experiences, I finally decided to build a shopping cart the way I always wanted one to work. The real difference between this cart and others is that it assumes that you will have to modify it. Rather than give you 90% of what you need and making it hard to do the other 10%, it gives you closer to 60% of what you need, but makes it extremely easy to get the other 40%.

The result is a free, open source, shopping cart program that I call StarterCart. While it is very slim on features, it does provide some significant advantages over other shopping cart programs that I have seen.


Real World HTML: Client Review

In our last "Real World HTML" entry, we created a printable page - finishing up the implementation of the design and the print page. There's nothing left to do now, but show it to the client.

I don't think I have ever shown something to a client that hasn't wanted something changed - even if I show them a pixel-perfect match of the original design. In fact, I have been tempted to use the approach Hal Helms mentions for exacting clients (watch for the Rick Roll).

In any event, I had no reason to expect this to be any different.


I'm Speaking at cf.Objective() this year!

It is hard to believe, but I have been accepted to speak at cf.Objective() this year. I have been to this conference twice before and I loved it both times. The presentations were great and so were the hallway and dinner conversations. It seemed like I was learning something all the time.

I am honored and humbled (ok, intimidated) to be among the speakers at cf.Objective() 2011. They recently announced the schedule and it is well, awesome! Seriously, go take a look. I'll wait.


Real World HTML: The Printable Page

In our last "Real World HTML" entry, we handled a rounded corner box sitting on a gradient - finishing up the implementation of the design. The only thing that remains now is making the printed page look good. Styling for print should be easy - especially if the HTML is structured well.

With that in mind, let's take a quick look at what we have so far.


Neptune Beta 1.5

Two weeks ago, I launched the initial beta of my Neptune framework. As I am prone to do, I missed something obvious in the released files (failing to include a needed file), causing the example in the documentation not to work. Tom Hubbard was nice enough to point this out to me.

In addition to that, my CF-Talk announcement, generated quite a discussion on the security of file uploads in Neptune. Consequently, I have made some adjustments in response to that discussion.

I felt these to changes were significant enough that I wanted to get them out right away, but not significant enough to call this release "Beta 2", so I punted and called it "1.0 Beta 1.5" - kind of a lame version number, but oh well.


Real World HTML: Rounded Corners Box

In our last "Real World HTML" entry, we handled a funny joining of graphical lines. This time we need to handle some rounded corner boxes sitting on a gradient.

Before we go on, let's take a look at the box.


More Entries

BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.