Click to search Andy Jarrett.co.uk RSS feed

Loading Twitter

ORM on Railo

Gert (of Railo) has just tweeted that if you ping them via their Contact form they'll give you access to the pre-release group.

This is a good chance to test your CF9 apps against Railo implementation or just to give ORM a whirl

Comments Comments (0) | Print Print | Send Send | 1060 Views

Application-wide datasource in Railo

Another one of those features that I knew was is in CF 9 but didn't know was in Railo and thats Application wide datasource name.

What this means is that in your Application.cfc (NOT .cfm!) you can set a per-application datasoure which lets you ommit the "datasource" attribute in your <cfquery> tags.

Your Application.cfc

view plain print about
1<cfcomponent displayname="Application.cfc">
2<cfscript>
3    // Set the application name
4
    this.name = "myApp" & hash(getCurrentTemplatePath())
5    
6    // Set the datasource
7
    this.datasource = "myDSN";
8    
9
</cfscript>
10</cfcomponent>

Your test.cfm page

view plain print about
1<cfquery name="qry">
2        SELECT * FROM yourTable
3    </cfquery>
4    <cfdump var="#qry#" label="Query Dump">

Comments Comments (0) | Print Print | Send Send | 1779 Views

Pet Rescue SOS, a new site in the works

Pet Rescue SOS is a site I've had a hand in putting it together, put simply, is the place where you can register your pets, have them assigned a unique tag and identity number which can used to identify and locate your pet anywhere in the world. This service is available online 24hrs a day and you have access to your own registration section from where you can manage your account and pets.

Below for anyone interested is some of the tech specs:

Comments Comments (1) | Print Print | Send Send | 1147 Views

Suppressing whitespace in ColdFusion with Railo

I've been meaning to blog this for a while.

When it comes to getting rid of the amazing amount of whitespace CF can generate in your page there are quite for tricks to getting around this from multiple tags to server filters that you can use.

With Railo its a little more simplier. Log in to your admin panel, go to "Output" in the left hand side and check "Whitespace management: Removes all white spaces in the output that follow a white space".

Comments Comments (7) | Print Print | Send Send | 727 Views

Scotch on the Road 2009 is coming to Europe

And the price of the ticket should make the tightest of managers happy - €0,00 (thats £0.00 or $0.00). You read that right, its free as in beer, so check out the scotch-on-the-rocks.co.uk site for more information. Below are the dates and locations. I'm already registered for London and trying my hardest to get to the Amsterdam one as well.

Location Date
Munich October 19th [Register]
Zurich October 21st [Register]
Milan October 23rd [Register]
Amsterdam October 26th [Register]
Brussels October 27th [Register]
London October 29th [Register]

Comments Comments (0) | Print Print | Send Send | 227 Views

Railo 3.1 has been released

Railo 3.1 has been released. This see's a year of development come together for the open source CFML engine.

I've been running the beta source successfully for a couple of sites with no issues.

Check out the Press release, Whats new, download it, or even suggest new features and vote for others.

Comments Comments (0) | Print Print | Send Send | 195 Views

Update Railo to the new admin

Updating Railo couldn't be easier. In case you didn't know, from the Administrator under Services go to Update and if a patch is available you can "Execute Update"

Whats even nicer is that you can change where you get your update from and if you want to be on the edge you can point the update url to http://dev.railo.ch/. This is currently looking at 0.24 and will give you access to the new looking admin (follow the links below for screenshots)

  1. http://www.markdrew.co.uk/leak/Picture%203.png
  2. http://www.markdrew.co.uk/leak/Picture%204.png
  3. http://www.markdrew.co.uk/leak/Picture%205.png
  4. http://www.markdrew.co.uk/leak/Picture%206.png

Comments Comments (0) | Print Print | Send Send | 218 Views

Railo allowing var'ing at any point in CFC

This is one of those features I know is coming in ColdFusion 9, but I don't know if its new in Railo 3.1.0.024 or been there for a while?

Anyway i've just found out you can "var" your variables in a CFC at any point. This isn't copying the way CF9 is planning on handling this by adding it to the LOCAL scope but it does mean you don't have to put everything at the top. Even though I'll most likely keep all my vars at the top for now its good to know that the following bit of code which in the past would throw an error now works fine.

[sourcecode language="plain"] &lt;cffunction name=&quot;text&quot; access=&quot;public&quot; returntype=&quot;string&quot; output=&quot;false&quot;&gt; &lt;cfset doSomethingFirst() /&gt; &lt;cfset var b = &quot;set second&quot; /&gt; &lt;cfreturn b /&gt; &lt;/cffunction&gt; [/sourcecode]

Comments Comments (3) | Print Print | Send Send | 256 Views

The Ternary Operator and Railo

The Ternary Operator and Railo

With CF9 beta out the blogs have been busy looking at all the new features. There has been some great reads and they've substituted for the fact that I haven't had the time to look at the new version myself yet.

Whats also been a good experience is that they have given me the chance to learn new stuff about Railo that I hadn't realised. The first one is that it already has Ternary Operator. This is a way of writing an IF/ELSE block in a single statement:

[sourcecode language="plain"] $variable = condition ? if true : if false [/sourcecode]

So in my CFSCRIPT block I have:

[sourcecode language="plain"] <cfscript> val = (true ? "A True Response" : "A False Response"); writeOutput(val); </cfscript> [/sourcecode]

Comments Comments (3) | Print Print | Send Send | 418 Views

cfStopWatch on Railo

After I found the Ternary Operator on Railo I've decided to have a look over the Tags documentation, and Functions documentation viewer on Railo Wiki.

Then I came across CFStopWatch. It works like CFTimer in that its used to determine how long it takes for a block of code to execute. The difference is that CFStopWatch stores the time to execute in a variable so you can reference it later. It works by wrapping the tags around the code block you want to execute and setting the time to a variable:

[sourcecode language="plain"] <cfstopwatch label="myLabel" variable="var" > CFML logic goes here <!--- pause for 1 second ---> <cfsleep time="1000"/> </cfstopwatch> <cfoutput><p>Your code took #var# milliseconds to run</p></cfoutput> [/sourcecode] Running the above code will output
CFML logic goes here Your code took 1000 milliseconds to run

I can see me using this when running code blocks which I know might take ages, you could write of the time to a log or even send an email.

Comments Comments (3) | Print Print | Send Send | 255 Views

More Entries

BlogCFC by Raymond Camden + Twitter @AndyJ + ColdFusion jobs + Contact Me + Snippets/Downloads + RSS .