Marcos Placona Blog

Programming, technology and the taming of the web.

Category: Railo (page 1 of 3)

The CFML engine Railo is an open source website scripting language that obeys the CFML markup definition

Running Railo on AppFog… For free!

Reading time: 2 – 4 minutes

You will have noticed I deviated my blog posts quite a bit from CFML in the last couple of months. That doesn’t mean I don’t love it anymore, but just that I’ve been “putting my eggs on lots of other baskets” lately.

This blog is hosted on a VPS, and I haven’t really found it necessary to have any CFML engine running on it. I could allocate some memory to have a tiny instance of Railo running, but I’d prefer not having to deal with something else running, since it could easily crash, and take me months to actually realize it. This happened to my Langithub project the other day, and I simply didn’t notice until someone pinged me to let me know.

However, I do sometimes want to post working examples written in CFML, and I could simply use some of the few free services out there, but… I’d rather not.

So for a blog post I’ve been working on, I decided I’d give cloud hosting a go. I’ve been playing with AppFog for a few weeks now, and noticed it’s got a Java Application option listed on the application types it supports. I then went ahead and created one of them called railo.

AppFog Java App

This now gave me an empty Java Application.

Knowing the folks at Railo provide a download in war format, I went ahead and downloaded it

Railo .war download

I’ve put it on $ ~/marcos/railo, but you can put it anywhere you want.

Now within that folder from console, I issued:

This will do two things.

  1. Prompt you for your appfog login and password
  2. deploy the .war file to the railo project

You will then see a few other things will happen, as it will now be decompressing the war file, and starting your application.

If you now browse your application (using the URL provided by AppFog appending index.cfm to it), you will see Railo has been installed, and you can start rocking on the Cloud.

The example I used here can be seen on

CFUnited is dead!

Reading time: 4 – 7 minutes

CFUnited is dead, but ColdFusion is alivePhoto by: cote

It came to my attention today that one of the most famous ColdFusion conferences, CFUnited,  will cease to exist from 2011 onwards. While the fact that one of the most important and longest running ColdFusion conferences in the world will not be around next year deeply saddens me, but at the same time I see it as a door opener for the new and more modern conference models.

I have never been to the American version of CFUnited myself, and believe everyone that say it’s a Summer Camp for developers. On the other hand, I have been to the European Version back in 2008, and have to say I wasn’t impressed at all. After talking to people during the conference who have actually been to the American version, I was left underwhelmed by their comments about it being 50% marketing. My first impression about the whole thing was the companies would pay a top price to have their stands around and offer their products while we tried to get something out of the conference itself. While I understand conferences aren’t cheap, i’ve been to other conferences before, and marketing wasn’t so aggressive.

Anyway, the objective of this post is not to slag CFUnited off, but to bring some hope to the hopeless, and happiness to the sad.

The end of CFUnited DOES NOT mean the end of ColdFusion (CFUnited.dead() NEQ ColdFusion.dead()). ColdFusion is alive and kicking, and after CF9, it’s been livelier than ever. Ever since Adobe bought Macromedia, ColdFusion has never been in a better situation than it is right now.

ColdFusion currently has an entire team of engineers working actively on it, and a really capable team working on it’s evangelism. Better than all that, this entire team can be easily reached by anyone willing to do so.

Some examples are:

And many others. That is without mentioning the great community the CFML language has. Some people there will remain my friends, even if I one day decide that ColdFusion is not the main technology I’ll be using.

That said, what really triggered me to write this, was a blog post by Hal Helms earlier today, where he tries to somehow tie the fact that CFUnited is only halting because ColdFusion is not strong enough, and that although people should not over-react, they should not under-react either.

This in my opinion (with all the due respect to Hal Helms) is just plain FUD, and was intentionally posted to generate flame. While I truly believe someone like Hal Helms would not need this sort of “notorious popularity”, I fail to understand what exactly his point was on posting such a thing.

I believe knowledge is the key to everything, so you should keep learning constantly, and try your best to keep on top of everything on your domain, and agree that Hal made a good point by saying this. It’s just that it doesn’t really seem like the same person who wrote this just the other day.

Now, in terms of conference, there are tons of good ones around, and just to mention some of them:

And many others as Terrence Ryan mentions here.

With that said, we still can’t forget that the CFML community got recently a tremendous addition when Railo was made open-source. This takes CFML to a whole new level, where developers coming from other languages can’t complain any more about ColdFusion being too expensive, or it’s source being too strict. There is no excuses not to use CFML. It’s got a great community always willing to help, some excellent resources all around, development of complex systems is made a breeze, and more and more companies are adopting it.

Long live to CF!

Migrating Mango Blog to WordPress

Reading time: 5 – 8 minutes

Migration in actionPhoto by: gagilas

As previously promised, today I’ll be publishing my migration scrips from Mango Blog to WordPress.

As mentioned previously, I wrote this script entirely for my own benefit, so please excuse me if it doesn’t meet your expectations. It has only been tested on mySQL, but should run on other SQL engines without major updates.

The script is supposed to deal with all the posts and comments, and will convert code snippets that use the SyntaxHighlighter plugin (by Tony Garcia) into the default Alex Gorbatchev‘s SyntaxHighlighter style. So the only thing you will need to do, is install a WordPress plugin that can deal with the tags. I’m using a plugin called SyntaxHighlighter Evolved, and am very happy so far.

It will also make sure all the categories are adequately created and asigned to your posts as they are created, so you won’t have to manually create them, or import them in a separate batch. Categories in WordPress a very tricky, and it took me a great deal of time to understand exactly how they are stored, and how the relationships work, so this should save you a long time on the migration.

I’ll briefly explain the script’s functionality here, but the comments on the code should be enough ro help someone trying to extend it, or even make it work with other blogging engines.

There is only one file responsible for the actions, and as long as the right method is called (batchPostWordpress), everything should happen automatically, and your posts, along with comments and everything else will be migrated. The only thing this script does not deal with, are the images, but as you should already be using only image paths (i.e. you are not storing anything on the database), your images should still work as long as they are stored on the right path. In my case, as I normally store images on a separate server, I wouldn’t have to worry about that.

Step ONE:

You must have two ColdFusion DSN’s on your server. One is for the current Mango Blog, and another for the new WordPress install. Obviously your WordPress won’t be using this DSN after you have migrated, but as this is a ColdFusion script, and you will be using ColdFusion to migrate your content, you will need a DSN created on your ColdFusion server.

In my case, I was “creative”, and called one mango (pointing to the mangoblog datrabase) and another one wordpress (pointing to the wordpress database). No rocket science up to here as you can see.

Step TWO:

Download the files, and extract them to your ColdFusion root, or anywhere where you can execute CFML files. For this example, I’m executing everything from ColdFusion’s root ( OR localhost).

Having the files in there, open runner.cfm, and change the variables mango_dsn and wordpress_dsn to suit your needs. Mine looks like this:

<cfset posts = createObject("component", "PostManager").init	(
											mango_dsn : 'mango',
											wordpress_dsn : 'wordpress'
											) />

On the next lines, you will find the following:

<cfset qPosts = posts.batchPostWordpress(
									start 	: 0,
									limit 	: 100
										) />

This pretty much says everything. It’s calling the method batchPostWordpress and processing posts in batches of 100 posts. I ran this with batches of 200 posts without any problems, and it only took about 30 seconds running on Railo. The numbers may vary according to the number of posts you have, as well as the number of comments and categories. Remember that if you have too many comments, your posts will take longer to be migrated, as everything is created in one go.

Step Three:

Run the file  runner.cfm (in my case, and wait till the page stops loading. Once everything is done, you should see a message saying “Done!” on the screen.

Well done, you’ve just migrated from Mango Blog to WordPress without any major hassle.

This script is dealing with a number of custom things I had on my setup, such as different ways of posting code snippets. It should be a problem to people using only one way, or not using it at all, as it tries to replace text only, and won’t break anything should the text isn’t available.

The private method cleanupPostCode, is the method that dos all the conversions, and it’s there that you will need to add any other conversion you may need should you be using other form of syntax highlighting. I’d recommend that id you are not using it, you can simply replace lines 153 and 154 to read:

<cfset var cleanContent = arguments.content>
<cfset var cleanExcerpt = arguments.excerpt>

This way, you are not cleaning up your post’s code, and that should make the code run considerably faster. if you leave it as it was before, it won’t break anything as previously stated.

I hope this script is of any use to someone, and if you feel like modifying / improving the code, please contact me sending the updates, and I’ll merge it and give credit where credit is due. Also, on the right-hand menu, you will find a link to PayPal, where you can make donations to help maintaining this website. Any amount will be much appreciated.

MangoBlog 1.4 Released and Important notes

Reading time: 3 – 5 minutes

I’m probably late on this one, but mangoBlog v1.4 has just been released. From the changelogs:

What’s new in version 1.4

  • Revisions of posts and pages are now stored and user can “restore” an older version
  • Added a permission for users to not to be able to access the administation (thanks to Seb Duggan)
  • Added a replacement for Verity search to search in database
    directly (this search now includes comments). It is the default search
  • Plugin settings are now stored in database, which should make it easier to migrate a blog
  • TinyMCE editor upgraded
  • Configuration file now has placeholders for base path so that directories do not need to be hardcoded in configuration file
  • Ability to disable or enable threading
  • Plugins made for ColdFusion 8 only can extend org.mangoblog.plugins.BasePlugin without including BasePlugin in their own folder
  • Friendly URLs for author archives

Changes in theme tags:

  • Added a descending order option for the comments tag
  • Enhanced Posts tag to be able to show posts for a given author
  • AuthorProperty tag can now output the name of the role of the author
  • Added AuthenticatedAuthor tag that allows the theme to know if the current visitor is logged in


  • Post pagination and search
  • Session will be maintained while user is writing a post or page
  • Added permission to manage pods and to run blog updates
  • Drafts now always “float” to the top of the list
  • Ability to remove plugins
  • Added “beforeAdminPageContentEnd” event to the bottom of the page
    edit screen and “beforeAdminPostContentEnd” to the bottom of the post
    edit screen
  • Ability to manually set the post URL (thanks to Seb Duggan)
  • Added more functionality to BasePlugin to make it easier to write plugins.
  • Plugins can now run their own upgrade method when a new version is installed via the administration
  • Paging for authors screen
  • Cosmetic changes: Add ons renamed to Plugins, go directly to edit
    mode after adding a new post or page (thanks to Seb Duggan), changed
    Pod Manager icon

Updates to new installs:

  • Added new plugin that allows keeping the old BlogCFC URLs functional
  • Added sample data
  • Include CFFormProtect (enabled by default instead of Captchas)
  • New default theme called Cutline
  • New installs on Railo will now have an error on main page (thanks to Andrea Campolonghi)

Plugins updated:

  • formRememberer (included in update)
  • CFFormProtect (not included in automatic update)

Bug fixes:

  • Solved some compatibility issues with Railo
  • Fixed XSS vulnerability (themes need to be updated to take advantage of this)
  • Preview link was wrong in future posts
  • Comments are now rejected if comments are closed for a post or page
  • Error when entering an empty search string
  • Error when not using friendly URLs
  • and more…


Now, for those who are using Railo and are updating via admin interface. There is a bug with the mango updater and Railo, Laura (Mango blog’s developer) explains:
“This is a known issue with Railo (we should report it, since it is an incompatibility with CF). I thought 1.3.1 included the fix, but apparently not.
Open file components/Updater.cfc and change line 436 from

<cfhttp url="#arguments.zipAddress#" method="get" path="#tempdir#">


<cfhttp url="#arguments.zipAddress#" method="get" path="#tempdir#" file="#filename#">

More info can be found here:
Mango 1.4 upgrade bug / Railo 3.1 / Centos 5

Railo 3.1.1 released

Reading time: 2 – 2 minutes

Railo 3.1.1 Relased
Railo has just been released and is available at
From the changelogs:

  • [ RAILO-163 ] cfexecute and arguments containing spaces (Linux)
  • [ RAILO-257 ] Railo will not start – start/stop shells contain ^M characters
  • [ RAILO-275 ] Binary arguments to Railo treated as array
  • [ RAILO-302 ] CFHTTP PUT sends corrupted binary data in body
  • [ RAILO-342 ] Query/Array Rows not Bracketed; on large volumes causes slow performance and poor UI [FDAPI]
  • [ RAILO-347 ] Unable to create remote clients in
  • [ RAILO-349 ] Mapping stripped from CFCATCH.MissingFile value
  • [ RAILO-356 ] Spelling Error in upgrade script
  • [ RAILO-359 ] Problem with CF_SQL_CHAR type
  • [ RAILO-360 ] XML lost when serializing an XML document to JSON
  • [ RAILO-361 ] java.util.Calendar
  • [ RAILO-362 ] ordered keys in struct dump
  • [ RAILO-364 ] Error when using cf_sql_numeric with floating number
  • [ RAILO-365 ] Query bracketing does not have correct row numbers in drill down [FDAPI]
  • [ RAILO-366 ] Misspelled struct key on exceptions
  • [ RAILO-368 ] serialize xml
  • [ RAILO-370 ] Query Exception Compatibility: SQL
  • [ RAILO-372 ] Query Exception Compatibility: Datasource

To update your current installation, simply access Railo Server Administrator, select the left item on the menu called “update“, and make sure the URL is set to be ““. Simply click update, and the available updates will be shown.
Click the button called execute updates, and wait for about 10 seconds while it does all the work for you.

Older posts