Search

Subscribe

Enter your email address to subscribe to this blog.

Recent Comments

Grails Spring Security Plugin - Logout postOnly setting
eriihine said: I still had some issues with this one. It seems that the href link is always generating a GET method... [More]

Intro to Spring Security Core for Grails
Dan Vega said: Just a heads up but I decided to write up a quick post on your question just in case it trips up any... [More]

Intro to Spring Security Core for Grails
eriihine said: Thanks for the clarification! [More]

Intro to Spring Security Core for Grails
Dan Vega said: First off thank you for the kind words. I plan on releasing more screencasts very soon. If you loo... [More]

Intro to Spring Security Core for Grails
eriihine said: Thanks for making these videos! They were much more helpful then the slightly outdated versions in s... [More]

Coldbox Bootstrap Starter Template

Most of my new applications these days are built using ColdBox and Bootstrap. Whenever I start a new project I take some time to customize Coldbox to my liking that included converting the components to script and setting up the layouts & views using Bootstrap. I decided to create a starter template so I would no longer have to do this. If you use Coldbox Platform Utilities for ColdFusion Builder you can just drop this in your Application Templates folder and it will be an option when creating a new project. If not, just copy all of the files to your new project template. When you fire up the project you should have something that looks like this. This is just a very basic starter template and I would love this just to be the starting point. Please provide any feedback so we can make improvements to this application template.

You can download the template at https://github.com/cfaddict/cb-bootstrap

 
 

ColdBox Bean Populator and ORM

Dustin Writes

Have you found a solution for this. I know I need to implement something like (JavaCast("null", '')). I'm just not sure where to do it. Have you check this out: http://www.dustinmartin.net/2011/04/using-a-populate-method-to-handle-nulls-empty-strings-and-numeric-values-with-cf9-orm
I actually know exactly what Dustin is going through because I had the same issues not too long ago. Before we look at a solution we need to take a step back and look at the problem.

When working with ORM Entities we need to populate them from forms. The long way of doing this is by calling each setter like so. This is fine for smaller entities but it becomes a real pain in the butt when you have large objects and relationships to work with. Coldbox ships with a bean populator that will basically look for any elements in the request collection (form+url) and will try and populate the entity. The problem with this is two fold. I don't think this handles relationships (I could be wrong on that) which still leaves you with work to do and it doesn't handle nulls. This is something I have been meaning to talk with the ColdBox team about.

Continue Reading >>

 
 

Getting started with Cachebox

This week Aaron Greenlee gave a presentation titled Cachebox: Caching layers. It was a pretty low level discussion so I thought it would give a very basic example here of how to get started with Cachebox.

So what is Cachebox?

CacheBox is an enterprise caching engine, aggregator and API for ColdFusion applications. It is part of the ColdBox 3.0.0 Platform but it can also function on its own as a standalone framework.
ColdFusion 9 came with a ton of caching enhancements so why would I want to use this? Well first of all not everyone is on ColdFusion 9 (what are you waiting for people) and they could be using another cfml engine. Cachebox will give us a standard API to work with across versions and vendors. In my case though I am using ColdBox and it comes out of the box along with some great dashboard views that allow me to see whats in the cache.

I am going to use my website because I think there is a pretty basic and common example to draw from. On the home page of this site I have a twitter feed that shows the last 3 tweets. I also have a list of the latest blog entries and comments.



This is a perfect example of where we want to take advantage of caching. We don't want the expense of making these 3 requests every time the page loads.

Continue Reading >>

 
 

Coldbox datasource setting and Wirebox

A reader sent me a question and wanted to know why something wasn't working. In the ColdBox config we have the following setting. Then in your model you have 2 ways that you can access this datasource object both of which work off of the alias. The alias is the left side of the assignment in our settings here so in our case mysite is the datasource alias. We can wire up the property using wirebox and the correct dsl coldbox:datasource:alias The easier way is to use the ColdBox Model Integration features and use the shortcut. Then in your code you can access the name in a query by using getName()

What happend in the case of our reader is he might of got the wrong idea about alias. In his code he had the following datasource setting. And when he was trying to wire up the datasource object he was using the following which will end up throwing a dsn is not defined error when you trying accessing the object.

So moral of the story is the alias is what you assign the structure to, in the case of our reader it will be dsn.

 
 

My New Website has launched

I have been working hard the last couple of weeks on putting together a new website. I am happy to announce that this site launched tonight. I still have some bugs to work out but nothing major. I needed a site that show of my hard work a little better so please look around and let me know what you think. A big thanks to BlogCFC, ColdBox and ColdFusion 9 for powering this site!

 
 

More Entries