ColdFusion Framework Note

I tend to monitor the “ColdFusion Programmers” Facebook group. Today a poster asked:

Hi guys, What do you prefer: CFWheels or Coldbox? I used before CFWheels and is good but I recently starts playing with Coldbox and so far is pretty cool – Jorge Alexandro Martinez Dominguez

My response was:

I use FW/1 for about everything because it’s simple and what I know. However ColdBox will give you a ton more functionality via modules and they aggressively keep that framework up-to-date. They are very involved in the community and even have a “Into The Box” event once a year for pre-conference. I would use either, but if you’re new to both I’d probably look at ColdBox. Both base frameworks are similar.

ColdBoxLogo2015_300Brad Wood, from Ortus Solutions, also chimed in a with a blog post from 2015 about how ColdBox 4 changed pretty drastically. It’s always a good read when asking yourself the Framework question: It’s Time You Looked At ColdBox 4

Simple jQuery AJAX w/ ColdFusion

I had a request to supply a sample HTML page that would send a subscriber’s email address to ColdFusion without reloading the page. So I figured I’d post it here for any others looking for a simple example. This method uses jQuery, AJAX and a ColdFusion component.

index.html or index.cfm

<!DOCTYPE html>
<html>
	<head>
	</head>
	<body>
		<div id="subscribeContainer">
			<input type="email"><button type="button">Subscribe</button>
		</div>
		<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>

		<script>
			(function($) {
				// bind the button with an event handler
				$('#subscribeContainer button').click( function(e) {
					// when button is pushed, POST data to remote ColdFusion component method
					$.post(
						'subscription.cfc',
						{
							method: 'subscribe',
							email: $('#subscribeContainer input').val()
						}
						)
						.done( function() {
							// everything worked
							$('#subscribeContainer').text('You have been subscribed.');
						})
						.fail( function() {
							// something failed
							$('
<span>There was an error subscribing.</span>').appendTo('#subscribeContainer');
						}
					);
				});
			})(jQuery);
		</script>
	</body>
</html>

subscription.cfc

component {

	remote void function subscribe( required string email ) {
		// call database insert method here
	}

}

Come Work With My Team!

CF Webtools LogoCF Webtools, where I’ve placed my career coming up on 8 years, is seeking a talented ColdFusion developer. We’re 25 strong and are looking for #26!

You can either work remotely in the comforts of your own personal office space (AKA your spare bedroom) or enjoy your own office space at our Omaha, NE office. We keep in touch with each other day-to-day via Skype. This provides us with one-on-one, project chats and company-wide chats. Most of the time it’s text chatting, but we also use it for voice when it’s just more efficient.

CF Webtools is a great fit for me because it provides the diversity and challenges needed not to become worn out with the same task over-and-over. There are always new opportunities that arise over the years. With this also comes constant learning. Each project brings its own set of challenges.

Granted most projects are not picture perfect as they tend to build up technical debt over time; but you get the opportunity to sell your expertise to the customer giving them the best path forward fitting their needs.

Experience needed not only includes ColdFusion but SQL, SQL, SQL, web server, Windows, Linux, Mobile OS, basic networking and just a good set of troubleshooting skills.

Give Mark or Jason a call at 402-408-3733, tweet @cfwebtools or contact the business owner Mark via his blog at coldfusionmuse.com .

Omaha Staff 2015

Omaha Staff

 

#career, #cf-webtools, #coldfusion-2, #job, #nebraska, #omaha

Allaire Brothers talking about ColdFusion

“What is the best IDE for CFM”

I run into the question “What is the best IDE for CFM” here and there. So I thought I’d post my response here as well for others to find:

I personally use ColdFusion Builder and Sublime Text 3 for my projects at CF Webtools.

There is only one IDE for ColdFusion: ColdFusion Builder. An IDE, as opposed to a code editor, has the ability to communicate with a ColdFusion server instance and debug your code. It can also introspect your code, offering code hints based upon what your code is doing.

  • ColdFusion Builder is actively updated. Versions 1 and 2 had massive footprints that really turned me off. I have found that version 3 is much faster and therefore I find much more usable than the previous two. Builder 2016 also came out but you only gain a newer version of a JRE and Security Analyzer which you need CF Enterprise to even run. So I’ve decided not to spend the money for a fairly worthless upgrade at this point.

Everything else is just a code editor (enhanced text editor). A code editor, as opposed to an IDE, does not debug or introspect your code. In order of my recommendation:

  1. The ColdFusion Plugin for Sublime Text doesn’t support CF11 and you can’t install it on version 3 via the package manager. But overall Sublime Text is an excellent code editor. I recommend also installing a jshint package for JavaScript development. It’s a good deal for $70, plus version 3 has been free to try for a long time now while it’s in Beta.
  2. Atom was suggested for me to put on this list. It’s an open source desktop application built with HTML, JavaScript, CSS, and Node.js integration by the folks at GitHub. Adam Tuttle put out a language-cfml package. I’ve never used it but have seen it mentioned a few times on Slack.
  3. ColdFusion Builder Express makes the list as the Express version. Basically use the trial version for 60 days, then it’ll revert to a more basic and free version without the IDE functionality.
  4. CFEclipse might be the most recent with their 1.4.6 release that “only” took 2 years to come up with. But it is free.
  5. cfbrackets for Brackets is still in Beta and hasn’t been updated since June of 2014. It also doesn’t support cfscript which is a huge negative for me. Brackets is open source.
  6. Visual Studio Code was mentioned in the ColdFusion Facebook group. It has a couple of ColdFusion extensions you can install. One is based upon the SublimeText ColdFusion package. I don’t do MS programming, but from what I’ve seen VS seems like a nice piece of software, so hopefully Visual Studio Code lives up to that and becomes a nice option for ColdFusion.
  7. IntelliJ IDEA stopped ColdFusion updates for awhile, but release 15 has support for it again as of November 2015. They don’t list ColdFusion in their what’s new though. I’ve heard some good things about this, but one major downside is the cost ($500 commercial || $200 personal). As of v14 it doesn’t seem to support IDE functions such as debugging but it does have console support. I’ve heard they may have added some actual IDE features since then:Per Nick Kwiatkowski in August of 2016, “it provides limited CFC introspection. It does have the best refactoring, intellisense and Java tools out there (we deploy our copy of Lucee as WAR files). Additionally, it has a ton of tools for working with SQL, CI, and version control — which are lacking or non-existent in other tools.”

    Per James Harvey in August of 2016, “intelliJ has a servers panel that you can.set.up and use services like RDS and yes, debug from. I had my Railo, Lucee and CF servers tied into it.”

Then of course there are outdated code editors such as:

If you’re looking for a true IDE I would stick with ColdFusion Builder for the sole reason is it continues to receive ColdFusion updates. But then again “best” is subjective.

#code, #coldfusion-2, #editor, #ide

ColdFusion Builder 3 Fuzzy Features

Between ColdFusion Builder 2 and 3, I used Sublime Text editor for about a year. One of the best features that Sublime Text had was fuzzy searches.

For example, on code assist, for a cfqueryparam attribute, I could type “var” and get type=”cf_sql_varchar”. In ColdFusion Builder, you’d have to type “cf_sql_v” to get the same. May not seem like much, but when your brain is focusing on the differences, why should I have to type “cf_sql_” when everyone has that?

Another example would be when using the “Goto Anything” feature, I regularly knew approximately what file name I was looking for, but maybe not exact. So if I type “page”, I may get 30 results. Then I continue to type to get “pagedsp” and find my file “pagedisplay.cfm”. Very handy and quick.

In ColdFusion Builder 3, everything relies upon starting from the beginning of line and pretty exact. It’s very rigid. The file content searches also always take a bit of time.

2014-05-23_1654

 

The alleviate the file search issue, I installed the InstaSeach plugin : http://marketplace.eclipse.org/content/instasearch

This plugin instantly returns fuzzy results if your keyword matches text inside the current open file, a file name or content inside a file — INSTANTLY —

Highly recommend to replace your Search > File and Search > Search

 

To alleviate the code assist issue:

Go to Preferences->ColdFusion->Profiles->Editor->Code Assist and select option ‘Filter Proposals Containing Text’

Thanks to Ramchandra Kulkarni for this tip.

Now I can just type “v”, arrow down once to pass up “cf_sql_longvarchar” and hit enter.

 

It’s the little things in life.

#coldfusion-2

IIS URL Rewrite Config for FW/1 SES

SES_Screen_ShotAfter a bit of research, I was never able to find a definitive answer as how to properly set up SES (Search Engine Safe URL’s) to work with FW/1 (Framework 1) using IIS 7.5 and IIS URL Rewrite 2.0.

SES makes turns your URL’s from this:

http://www.mysite.com/index.cfm?action=main.default&ID=0

Into this:

http://www.mysite.com/main/default/ID/0

First of all you may need to install URL Rewrite 2.0 using Microsoft Web Platform Installer. There are other options out there, but I’m using this since it’s simple and nicely integrated.

From the URL Rewrite options screen, add a new rule and select “User-friendly URL” under the “Inbound and Outbound Rules”.

The requested URL should match the pattern using regular expressions. The pattern being:

^(.*)$

Add the conditions that the type is not a file or a directory.

The action type is rewrite and the rewrite URL is:

/index.cfm/{R:1}

Be sure to check “Append query string” and “Stop processing of subsequent rules”

Continue reading

#coldfusion-2, #fw1, #iis, #microsoft-web-platform-installer