Archive for July 3rd, 2008|Daily archive page

Analyzing Coldbox

I’d like to continue from the last entry.

We were discussing the directory structure of MG, and event handlers and controllers. We’ll turn to Coldbox now. Let’s jump right to it!

Read more »

Analyzing Model Glue

I still don’t understand why the structure of these different frameworks don’t match up with their architecture (MVC). You’ll have to forgive me, because I’m basically learning three frameworks at the same time! I’m not afraid to discuss my confusion though. Maybe it will help some of you.

Read more »

Issues with Coldbox

I have run into some issues with Coldbox that I don’t quite understand. I’d like to post my problems in the hopes that someone can help, or I can help someone else.

UPDATE: I found the solution. It still revolves around SES, just like I thought. I noticed one of my other forms was behaving itself, so I looked closer for the difference, and found it.

Here’s the working form action: #getSetting(’sesBaseURL’)#/

And the non-working form action: #getSetting(’sesBaseURL’)#

Yep, I was mising the / at the end. That’s what threw off my SES routing. Oh well! Movin’ on…

Read more »

Announcing Code Scanner 1.0!

I’ve written a code review tool application and would like to make it available to the community. The application lets you manage a RegEx library (database), and scan directories and files using those RegEx’s. A few already reside there to get you started. I’m not a RegEx ninja, so they could probably use some improvement.

While the code isn’t all that tidy, It’s good enough to do the job. I’ll warn you – the server side validation is crude. I wrote it quickly, but I plan to keep whipping it into shape in the near future.  My company’s code standards demand it.

Features:

  • Scan a directory and optionally scan subdirectories
  • Scan up to 5 individual files
  • Add your own custom RegExs to the library
  • A RegEx can be applied on a per-line basis, or a full page basis
  • Scans multiple file types – you pick them
  • Optionally have the scanner remove tabs and carriage returns (This could be improved. DB-driven would be nice). My company doesn’t allow tabs or carriage returns.
  • Tested on CF8/MySQL 5

You can download it here:

www.wtomlinson.com/CodeScan.zip

Just open the README.txt file to get started.

Enjoy!

My Little Contribution to Coldbox…

I was happy to be able to make a little contribution to Coldbox. Why? Because I’ve kind of gotten attached in my few days of messing with it.

I was using the messagebox plugin for the first time, and got it to render on the screen. All looked fine, except I noticed it created an embedded stylesheet just above the messagebox, IN the body.

It belongs in the head of course, so I tracked down the cfm that displays the box.

It’s here: /system/includes/messagebox.cfm

I fixed it by using a trick my buddy Bobby showed me a few years back. Goes a lil somethin’ like this:

<cfsavecontent variable=”injectHead”>

Some content. Static or generated by <cfoutput>

</cfsavecontent>

<cfhtmlhead text=”#injectHead#”>

When CF processes the template, it will render the page with your injectHead (call it whatever you want) variable IN the head, where it belongs. I supposed there would be problems if you’re using <cfflush> or <cflocation>. You can’t use those tags then use <cfhtmlhead>, because by the time CF encounters the tag, the page has left the building!

I emailed Luis the fix, and he let me know he committed my fix. So cool!

Here it is…

<cfsavecontent variable=”injectHead”>
<!— Style Declaration —>
<style type=”text/css”>
.cbox_messagebox{
font-size: 13px;
font-weight: bold;
}
.cbox_messagebox_info{
background: ##D1E6EF url(/coldbox/system/includes/images/cmsg.gif) no-repeat scroll .5em 50%;
border: 1px solid ##2580B2;
margin: 0.3em;
padding: 0pt 1em 0pt 3.5em;
}
.cbox_messagebox_warning{
background: ##FFF2CF url(/coldbox/system/includes/images/wmsg.gif) no-repeat scroll .5em 50%;
border: 1px solid ##2580B2;
margin: 0.3em;
padding: 0pt 1em 0pt 3.5em;
}
.cbox_messagebox_error{
background: ##FFFFE0 url(/coldbox/system/includes/images/emsg.gif) no-repeat scroll .5em 50%;
border: 1px solid ##2580B2;
margin: 0.3em;
padding: 0pt 1em 0pt 3.5em;
}
</style>
</cfsavecontent>
<cfhtmlhead text=”#injectHead#”>

I’m havin’ a CF’n good time!