Mark Drew (Redux)- cf_etc...

a compendium of railo, cfml, cfeclipse and technology topics

Mark Drew (Redux)- cf_etc...

Entries Tagged as webdev

URGENT!: Seeking RegEx guru

April 25, 2007 ·

No, not for a job, I just need to find a reg ex expression to find the values of the following expression: xpath("/root/framework_root/framework_mg/controllers/controller/message-listener/@message/text()", "|") basically its a function, you pass in two values, the xpath and then a delimiter. I need to get the value of the parameters. e.g. 1. /root/framework_root/framework_mg/controllers/controller/message-listener/@message/text()
2. |
Any ideas? (I SUCK at RegEx, and I am hoping someone can show me the light!)

Tags: cfeclipse · coldfusion · webdev

Overwriting HTML tags using cfimport

April 11, 2007 ·

Here is a quick, ColdFusion tip about using cfimport that I learned many years ago in some ColdFusion training I did for CFMX 6, but I guess its still relevant. You can re-implement any HTML tag using a custom tag by using cfimport. To do this you have to firstly create a directory where you are going to store your custom tags, so lets say /htmltags under your webroot. Then at the top of the page that you are going to be doing the replacement in put the following: <cfimport prefix="" taglib="/htmltags">

<a href="somelink">I dont like how Links are done</a>
Now in your /htmltags add a file called a.cfm with the following content: <cfparam name="attributes.href" default="">
<cfif ThisTag.executionmode IS "start">
<a href="<cfoutput>#attributes.href#</cfoutput>" style="overWrittenStyle">
</cfif>
<cfif ThisTag.executionmode IS "end">
</a>
</cfif>
And you will get the style attribute added. This is just an example, you could loop through all the attributes and output them in the tag, and do whatever you like of course. (now back to document writing... fun fun fun)

Tags: coldfusion · webdev

Get to know your Xpath

March 14, 2007 ·

Working with XML in ColdFusion can be fun or can be daunting sometimes. One of the things that is a gotcha for me all the time is doing XPath, even after a few minutes of googling for "Xpath Tutorial" or whatever I get bored, find the solution and then that's it. One of the great little tools I found upon my travels is the XPath Explorer, its a nice little jar file that you can just double click and run (if you are on a Mac, God help you if you are on a PC, Windows will proably think its a banana or a Nokia package installer). Once you have it running you can load in an XML File and start creating XPaths either by entering the text or clicking on nodes. It also comes as plugins for Eclipse and NetBeans Very handy!

Tags: coldfusion · webdev

Announcing codeShare!

January 31, 2007 ·

Have you ever been in the position that you had some code that wouldn't do something? You wanted to show it to someone, so you cut and paste the code (bye bye formatting) and email it... great... but what if you could do this straight from your editor? Announcing the codeShare project! This is a new website by Ryan Everhart, Robert Froehling (and Dave Shuck and Aaron Lynch on the InstantSpot integration) allows you to post a code fragment and it returns a private URL that you can share with others and comment on the code. You might ask why I am announcing this (apart from it being a damned useful service)? Well, over the last couple of weeks I have written a plugin for this service that works straight from your IDE of choice, Eclipse! So now codeShare also works with Eclipse, standalone and with InstantSpot! Check out Ryan's post for more details on codeShare Of course, you could also watch a little video I made (no sound) on how to use it. You can get the plugin from the codeSharePlugin website

Tags: webdev

Coldfusion handling Java null's

July 12, 2006 ·

I have been reading a number of posts how to handle nulls in Coldfusion. Coldfusion doesnt naturally handle a "null" object returned from Java (as far as I can see, I have read a few posts and still no definate answer, so here goes for a couple of tips, just to keep myself sane and to remind myself. There are two ways that you can handle a null and it depends what the returned object is, firstly lets handle nulls where the returned object might be something simple like a number or a string, the easiest method would be to simplify the variable, so you can trim the result, if it is null, you will get an empty string: <cfset myString = CreateObject("java", "com.some.Class").init().getName()>

<cfif Len(myString)>
#myString#
</cfif>
The second method is used if you return complex data, such as an Array, Structure or Java Objects themselves: <cfset UsersArray = CreateObject("java", "com.some.Class").init().getUsers()>

<cfif isDefined("UsersArray")>
<cfdump var="#UsersArray#">
</cfif>
If someone has a better method of managing returned nulls from Java, please let me know and I can update this post.

Tags: coldfusion · reference · webdev

Model-Glue outage!

May 30, 2006 ·

I just got pinged by Joe Rinehart: model-glue.com, clearsoftware.net, doughughes.netand boyzoid.com are all moving servers at the moment and hence they are down. Joe is on the case and all should return to normal soon. your patience, apreciated it is.

Tags: model-glue · webdev

cf_teachers (sung to Daft Punk's Teachers)

May 18, 2006 ·

Ben Forta, Sean Corfield, Ray Camden, Spike Milligan in the house. Joe Rinehart, Doug Hughes, Simeon Bateman, Rob Rohan, Ollie Tupman in the house.
Jared Rypka-Hauer, Nathan StrutzMike Nimer, Tim Buntel is out the house. 

Just a little sing song for all the people who have helped and taught me things about ColdFusion and CFEclipse along the way.

THANK YOU!
(Check out the song on Daft Punk - Homework - Teachers )

Tags: adobe · cfeclipse · coldfusion · flex · fusebox · model-glue · personal · reactor · webdev

UKCFUG Presentation: Model Glue and Reactor

April 04, 2006 ·

On the 27th of April I shall be presenting at the UK CFUG, talking about Model Glue and Reactor. This is my second presentation this year! not bad!  If you would like to attend check out the CFUG site.

Links:
Model Glue
Reactor (Dough Hughes blog)

Tags: coldfusion · model-glue · personal · reactor · webdev

How to open up pop-up windows

March 27, 2006 ·

This is just a quicky but it does show a bit of best practice on opening up JavaScript pop-up windows. It makes it nice and neat and accessable too.

Check it out at jehiah.com via Digital Media Minute

Tags: webdev

coldfusion best practices

February 22, 2006 ·

Spotted by the coldfusionpodcast.com over at benorama.com, a great article on coldfusion best practices. Very informative and a great way to structure your applictions in a MVC way.

Check it out at: http://www.benorama.com/coldfusion/index.htm

Tags: coldfusion · webdev