Category Selected:

tutorials

Blog

Coldbox 3.0 and the CFC Config...

Curt Gratz |  June 29, 2010

One of my favorite new features of Coldbox 3.0 is the ability to have a CFC only config file. Thats right, no more XML. No don't get me wrong, XML has its place, but I love the ability to get funky with my config file. With it now being a CFC, I can do some crazy cool stuff.

For example

  1. I can now have my config files all extend a base config file or any other CFC, now thats cool.
  2. I can get creative with defining my enviromental variables, or create any other kind of helper functions.
  3. I can easily set a variable anywhere in the config file and EASILY refer to it.

These are just a few of the ways that I have already taken advantage of the Config.cfc.

What are some ways you have? Feel free to comment with any crazy or funky ideas you've used or plan to use with a fully ColdFusion-ifide (its a word, look it up) config file, I'd love to hear them.

Read More

ColdBox Plugins - A wealth of hidden treasure

Curt Gratz |  May 28, 2010

Today I was getting ready to send a file from my app to the browser for the user to download.  I was all set to use cfcontent to do this, but knowing ColdBox I thought I would do a quick check to see if the framework had any nice convenience methods for me to use to make life easier and sure enough... sendFile() in the core Utilities plugin.

getPlugin("Utilities").sendFile(file="test.txt");

So, this post is just a quick word of advice.  Don't reinvent the wheel.  If you are doing something, anything common, check the docs and see if ColdBox can do it for you.  You will be amazed at whats available in the core plugin set already for you to use.  

Plug it In

Plug IT IN

Here are just a few I use commonly.

ORMService - generic ORM Service helper for Hibernate
QueryHelper - all sorts of goodies in here, sorting queries is one of my favorite. Or the querySim.
Validator - all sorts of standard validation methods here. checkEmail and checkIPAddress are my favorites.
FileUtils - This is a utilities library that are file related. Lots of fun methods here.
Utilities - A good mix of a variety of handy methods, like todays gem sendFile()

 

Read More

Unit Testing with Mock Objects via MockBox

Luis Majano |  May 17, 2010

Once you get an appreciation for the importance of unit testing and integration testing is when we reach a new level in our development careers.  Testing is critical to mission critical applications, and even for our own little projects, where we test that our code should work as expected.  There’s that word again, expected.  Expectations in unit testing is like a nasty hamburger at a soccer match in El Salvador.  They go hand in hand :)

Read More

Unit Testing with Mock Objects via MockBox

Luis Majano |  May 17, 2010

Once you get an appreciation for the importance of unit testing and integration testing is when we reach a new level in our development careers.  Testing is critical to mission critical applications, and even for our own little projects, where we test that our code should work as expected.  There’s that word again, expected.  Expectations in unit testing is like a nasty hamburger at a soccer match in El Salvador.  They go hand in hand :)

Read More

ColdBox REST Enabled URLs

Luis Majano |  May 17, 2010

Thanks to our 3.0.0 milestones, the SES capabilities have been really fine tuned and added some great concepts in order to enable it for more RESTful applications.  We have added things like:

  • -alpha : Alpha only placeholders
  • {X} : Digit quantifiers for all placeholders
  • constraints : A separate structure where you can give any placeholder your own regular expression
  • RESTful actions : A way to split actions according to the incoming HTTP method
    Read More

ColdBox REST Enabled URLs

Luis Majano |  May 17, 2010

Thanks to our 3.0.0 milestones, the SES capabilities have been really fine tuned and added some great concepts in order to enable it for more RESTful applications.  We have added things like:

  • -alpha : Alpha only placeholders
  • {X} : Digit quantifiers for all placeholders
  • constraints : A separate structure where you can give any placeholder your own regular expression
  • RESTful actions : A way to split actions according to the incoming HTTP method
    Read More

ColdBox REST Enabled URLs

Luis Majano |  May 17, 2010

Thanks to our 3.0.0 milestones, the SES capabilities have been really fine tuned and added some great concepts in order to enable it for more RESTful applications.  We have added things like:

  • -alpha : Alpha only placeholders
  • {X} : Digit quantifiers for all placeholders
  • constraints : A separate structure where you can give any placeholder your own regular expression
  • RESTful actions : A way to split actions according to the incoming HTTP method
    Read More

Using regular expressions on SES routes

Luis Majano |  May 10, 2010

With ColdBox 3.0.0 you can use any kind of regular expression with your SES routes which makes it extremely flexible.  One way to accomplish this is by using the constraints arguments when calling the addRoute() method to add a routing entry. So if I wanted to add a placeholder that matches a regex then I would do this:

addPattern(pattern="/api/:format/", constraints={format="(xml|json)"})

As you can see from the code ab...

Read More

Using regular expressions on SES routes

Luis Majano |  May 10, 2010

With ColdBox 3.0.0 you can use any kind of regular expression with your SES routes which makes it extremely flexible.  One way to accomplish this is by using the constraints arguments when calling the addRoute() method to add a routing entry. So if I wanted to add a placeholder that matches a regex then I would do this:

addPattern(pattern="/api/:format/", constraints={format="(xml|json)"})

As you can see from the code ab...

Read More

Cool SES Custom Placeholder Routes on 3.0.0

Luis Majano |  April 02, 2010
This is a quick guide to showcase a cool new feature in ColdBox 3.0.0 that helps you create routes based upon your own regular expressions and needs.  Before (coldbox < 3.0.0) you created routes with placeholders and these placeholders could be alphanumerical or numerical values.  In ColdBox 3.0.0 they can be alphanumerical, alpha, numerical, and custom.  Custom is what we are after, which makes URL Mappings in ColdBox 3.0.0 extermely flexible.  So let me pinpoint the use ...
Read More