Dan Mackey On ColdFusion Development

ColdFusion, Java, .NET, AJAX, DHTML development and general programming. Daniel is owner and Administrator of CFTagStore.com and works for an Application Development Company in Ireland called Digital Crew. His interests cover all areas of programming in multiple languages with a particular interest in Internet Technologies.

All Articles tagged : Custom Tags
2009-01-14 14:29:00.0

CFX_CompareHTML ColdFusion HTML diff custom tag

Following on from my last post I have released Version 1 of my ColdFusion HTML Diff Custom Tag, CFX_CompareHTML.

When we wrote Teamwork Project Manager one of my jobs was to compare versions of Notebooks which were marked up using HTML.

I did lots of searching and found Diff.cfc which did a line for line comparison but did not represent the changes in HTML format, it only output the differences line-by-line with all the HTML viewable.

Diff.cfc is perfect for text or source code but we needed something a little bit more user-friendly.

A great start on this was DaisyDiff,  a Java library that diffs (compares) HTML files.

The problem with this was that I had to use CFExecute and some timeouts, writing to the drive etc to get some results. It soon became a nightmare on large files so I decided the best thing to do was to build a CFX tag around the main components of DaisyDiff.

CFX_CompareHTML was born.

You can call the tag using :

<cfx_CompareHTML left="Some HTML content" right="Some more HTML Content">

The tag can be downloaded from here :

DOWNLOAD CFX_COMPAREHTML

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [8] - Leave a comment
2009-01-07 14:58:00.0

Railo 3 : Adding Java CFX Tags

I have a small project that I am working on that needs a Java custom tag that I'm writing. I need this running on ColdFusion 7/8 and Railo 3.

Adding the CFX to CF is fine and I had no problems, except that its laborious. Having to place the file in the right folder, adding that folder to the Java Classpath and restarting CF Application Server.

Railo is a little different. Infact, its a bit easier once you know.

Everytime Railo starts up it runs through the Railo/lib/ folder and adds all JAR files to the Class Path, saving you the hassle of adding them manually.

You still have to add the CFX tag using the Administrator though.

BTW : Railo 3 Community Administrator doesnt have a CFX option in the menu anymore (V2.0 had it) but you can call the page directly using:

http://localhost/railo-context/admin/web.cfm?action=resources.cfx_tags

Another thing to note is that only Jar libraries are allowed in Railo. I created a simple CFX tag using Eclipse and compiled it to TestTag.class.

In ColdFusion, I was able to place this in a Java Class Path accessible folder, restart the service and add the CFX tag using the Administrator. Bingo, tag ran when called in my CF template.

No way could I get this to work in Railo. Because the class path is built up from a folder on startup that enumerates JAR files, .class files would not get loaded.

To fix this, I exported the CFX to a JAR of its own in Eclipse and did the steps above.

Hopefully this will help someone in the same bind. I love Railo but the lack of documentation is killing me. Gert is very good responding by email but sometimes you need answers right away!

Once I finish this little project, I'll release the Java CFX on my blog. Its going to be cool ;-)

<hint>HTML Diff Tag</hint>

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [4] - Leave a comment
2007-01-25 14:10:00.0

Annoying IE7 bug with window.opener.document.location

I hate these types of bugs.

I have just wasted an hour of my day trying to figure this out. It works in Mozilla as expected and I havent tried IE6 but IE7 threw a strange error.

I was trying to check if a certain string was in the url of the window that opened a pop-up.

The code I was using that failed was:

I tried everything I could think of to try and test and re-check my code etc. I stripped it all back and thought maybe it was to do with string types so did the following:

Bingo...it worked. Turns out when I concatenate the str variable with an empty string, it solved the problem.

BTW, the code above is taken from the updates I am making to CF_FileManager to allow it to use CF_ProFlashUpload if you have that component in your dcCom folder.

Working pretty well right now!

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [5] - Leave a comment
2006-09-22 13:03:00.0

Apple G4 Arrived Today...

After 15 years I have finally given in and purchased an Apple G4. I really need to get the thumb out and make my apps truely cross-platform so this morning handed the cash over and took delivery of my first Apple computer.

I am actually looking forward to re-writing CF_FileManager and getting it truely cross-platform and especially running in Safari. Same goes for all my Custom Tags and Applications on CFTagStore.com

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [2] - Leave a comment
2006-07-29 12:38:00.0

ColdFusion And AJAX Organizational Chart - Beta

About 2 weeks ago before I started my , I worked on a quick proof-of-concept ColdFusion and Ajax enabled Organizational Chart widget.

My main aim was to create a widget that would render in modern browsers and would allow the adding of nodes to the chart using AJAX so the whole page didnt have to be reloaded.

I faced some interesting problems:

  • I wanted to use pure CSS and DIVs but soon found out this was impossible for the moment so had to settle for a mix of CSS and normal TABLE elements.
  • The logic in finding the current parent to append new elements to needed quite a bit of thought to work on all browsers.
  • Deleting nodes a few levels up had to take sub-nodes into consideration.
  • The user-interface had to be very simple and in context with each node.

I decided on the following:

  • I created a custom tag which runs using recursion. This allows the whole chart to be generated using one line of code and you can choose which node to start rendering from.
  • Because the chart is built using a recursive custom tag and I can choose any start node, implementing the AJAX was easy, easy easy.... All I have to do when an add node icon is clicked, the parent node id is passed using AJAX and the custom tag is called with a start ID of the passed parent and the returned HTML is rendered without reloading the page.
  • I used the extremely handy CFSAVECONTENT to render the HTML from the custom tag and simply return the resultant variable. This made the code really easy, flexible and readable.

The main way to use the tag is:

  • To create a node, you click the Add Node icon from the parent node.
  • To edit a node, you double-click an existing node.
  • To delete a node, you click the Delete Node icon on the node to be deleted.

The editing of nodes is not complete. I envisage this to dynamically create a text area in the node and update the TEXT of the node on the fly using . Another option in the future would be to pop-up a menu that allows you to change the TYPE of node.

Things I would like to see added:

  • Panning of a VIEW area for large charts
  • Ability to change each nodes type
  • Add the ability to render each node with rounded corners using the brilliant NiftyCude library.
  • Ability to export the chart in a variety of formats : graphics or PDF

The funny thing is, I developed this 2 weeks ago on one of my 3 hour after-work learning stints where I generally read new things through blogs or try proof-of-concept ideas that may help in future projects. About 2 days ago, I got an email from someone through who had an idea for a CFOrgChart type tag/application with the same ideas I had planned.

Funny how things happen...

Now the fun part...try the demo : demos/cforgchart/index.cfm

PS: Please use with care and dont ruin it for other people by deleting all nodes. This is only a demo and I havent performed any checking or locking of nodes yet.

PPS: Can someone (Karl :-) ) check this on Safari and report back?

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [12] - Leave a comment
2006-07-20 12:52:00.0

CF_ProFlashUpload Released on CFTagStore.com

Topper has released our Flash based Multiple File Upload with progress status for ColdFusion on CFTagStore.com

You can view the component and online demo from:
http://www.cftagstore.com/tags/flashmultipleupload.cfm

Pricing is $50 per application with discounts for multiple licenses.

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [0] - Leave a comment
2006-06-23 12:03:00.0

ColdFusion Multiple File Upload On Mac OSX using Safari

Thanks Karl!!

Karl (a good friend and decent ColdFusioneer) took the trouble to test the Flash Upload widget on Mac OSX using Safari and it worked seamlessly!

We are getting close. Now all we need is Flash 8 to be released for Linux and we may have achieved our goal.

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [0] - Leave a comment
2006-06-22 12:28:00.0

Flash Multiple File Upload Control - 90% finished!

As you all probably know, Topper and myself have been working on a powerful ColdFusion based multiple file upload control with progress indicators etc.

I am delighted to be able to post a link to a fully functional online sneak preview:

http://www.cftopper.com/playground/dcFileUpload/test.cfm

More can be read here on Toppers Blog

Just wondering if anybody with a Mac can run the demo and report back the results!

We have yet to get our hands on a Mac :-(

BTW, Linux still doesnt have Flash 8 released so the demo unfortunately wont run on Linux.

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [2] - Leave a comment
2006-06-20 11:45:00.0

Most Useful ColdFusion Custom Tag - UDI

One of the great tools Peter wrote, UDI - Ultimate Database Interface is something we use in every ColdFusion project we work on here in Digital Crew. From Website Administrations, to Intranet applications.

UDI has 2 specific parts to it :

  • Design Time View
    This view gives you a wizard based view of your database allowing you to create a View/Edit/Delete interface for any of your database tables.

    Its amazingly simple yet powerful. The wizard pulls in all the fields in your database (MySQL, MSSQL or MSAccess) and allows you to define what type of data is contained in the field and allows you to choose a specific interface to manage the data. This could be a Date Selector, URL, Textbox, text input, duel-select, drop-down based on another table, image (with image selecting tools) etc

    With 5 minutes of clicking and building, you can create a spreadsheet type view of your database tables.
  • Runtime View
    The runtime view is the actual view you use to view, edit and delete data. This is broken into 2 panes. The top pane gives a paged grid with summary records and the bottom pane contains the generated form holding all the different types of controls per field. You can double-click a record in the View Pane and the data for that record is loaded into an easy to use form for editing.

The whole package is so easy to use and literally saves us days of extra work. Gone are the days of hand coding hundreds of admin pages for editing data. Now we just click, point and define our data. The rest is handled. Also, the component only uses one code base and auto generates the required pages for calling the component.

With over 65 internal projects using the component and more than 150+ 3rd party developers using the component around the world, UDI has literally become a must-have tool!

You can view the component on CFTagStore.com and order it for $100. Bulk licensing is available and also a demo to try before you buy! I guarantee you wont be disappointed!

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [2] - Leave a comment
2006-06-08 13:38:00.0

ColdFusion Mutltiple File Upload

Peter has outdone himself yet again on his work on our Flash based ColdFusion multiple file upload control we decided to write.

We had one concern while developing this product and that was the look and feel of the product and to build in from the start all the features developers would need while using it themselves. We work well as a team and together we made a list of features we wanted to include and call it version 1.

One of the aims of this product is to show the current progress and speed of each file being uploaded. Our last ColdFusion based multiple file upload control used an activeX control and gave a progress bar which changed as each file went up only showing the overall progress but the new control uses a progress bar for each file and also an overall progress bar.

Its a thing of beauty to watch work and you can find out more at CFTopper where Peter has written a post and uploaded a screenshot.

Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [2] - Leave a comment
2006-05-29 13:25:00.0

Uploading multiple files with ColdFusion

One of the most common annoyances about ColdFusion is the way the file upload functionality is implemented. Unlike ASP, PHP, JSP etc, file uploading is not handled by the Application Server (ColdFusion) but is farmed out to the webserver (IIS or Apache etc)

This means that while the file is being uploaded, ColdFusion just kinda sits there waiting for the file to be uploaded and a reference to the file handed back to CF. This means that you cant use some of the upload tricks of ASP, PHP etc to show the progress of the upload etc

Over the years, Peter and myself have tried to find a way of accomplishing this on the server side but to no avail. We have tried CFX tags, Java servlets called through ColdFusion etc

Andrei Kondrashev made a good stab at it using a CFX Tag and ISAPI filter but if you are on a server where installing such beasts isnt feasible there is nothing much can be done.

We wrote an ActiveX and DHTML ColdFusion component to allow multiple file uploads but the disadvantage is that it is IE only for selecting multiple files all at once. The DHTML interface is cross-browser and will uploaded multiple files but still requires you to add each file seperatley.

With the introduction of Flash 8, the problem is now achievable. ColdFusion will still use the webserver to upload the file so server side analysis of the file upload progress is still a no-no but using a Flash Component, DHTML and some clever programming, we can select and upload multiple files and give user feedback on the file upload progress.

I am tasked with designing the interface, the methods required, functionality and documentation and Peter is going to do the actual Flash programming.

Together we are finally going to solve this annoying problem and will be releasing our solution on CFTagStore.com for others to purchase and use in their applications.

Using Flash is beneficial for the following reasons:

  • Client side checking of file size instead of waiting for a PFO from the server after the upload
  • Select multiple files using SHIFT/CTRL or drag a selection using mouse
  • Available to all browsers on all platforms
  • Interface with Javascript for customisation and control such as event handlers etc
Add to your del.icio.us    DIGG This!    Technorati Cosmos Link    Post to Reddit    Add to your Furl    Add to Blinklist
Comments [7] - Leave a comment