Thursday, February 09, 2012    
Home My Books Blog ColdFusion About Me Back    

Calendar
<< Jul 2006 >>
S M T W T F S
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Search

Categories
 • Acrobat (5) [RSS]
 • Adobe (110) [RSS]
 • AdobeMAX06 (45) [RSS]
 • AdobeMAX07 (59) [RSS]
 • AdobeMAX08 (66) [RSS]
 • AdobeMAX09 (39) [RSS]
 • AdobeMAX10 (34) [RSS]
 • AdobeMAX11 (27) [RSS]
 • AIR (297) [RSS]
 • Appearances (217) [RSS]
 • Books (86) [RSS]
 • CFEclipse (15) [RSS]
 • Cloud (1) [RSS]
 • ColdFusion (1477) [RSS]
 • ColdFusion Builder (22) [RSS]
 • Data Services (42) [RSS]
 • Fish Tank (5) [RSS]
 • Flash (356) [RSS]
 • Flex (562) [RSS]
 • Home Automation (5) [RSS]
 • HTML5 (23) [RSS]
 • JavaScript (2) [RSS]
 • Jobs (130) [RSS]
 • jQuery (14) [RSS]
 • JRun (14) [RSS]
 • Labs (62) [RSS]
 • LiveCycle (37) [RSS]
 • MAX (284) [RSS]
 • Mobile (239) [RSS]
 • Regular Expressions (19) [RSS]
 • RIA (21) [RSS]
 • SQL (45) [RSS]
 • Stuff (554) [RSS]
 • Tips (CF Studio) (80) [RSS]
 • Tips (CF) (795) [RSS]
 • Tips (Dreamweaver) (91) [RSS]
 • Tips (Flex Builder) (2) [RSS]
 • Using CF (167) [RSS]

Other BLOGs
 • Charlie Arehart
 • Lee Brimelow
 • Ray Camden
 • Christophe Coenraets
 • Sean Corfield
 • Mihai Corlan
 • Cornel Creanga
 • Mark Doherty
 • John Dowdell
 • Danny Dura
 • Enrique Duvos
 • Steven Erat
 • Kevin Hoyt
 • Serge Jespers
 • Adam Lehman
 • Duane Nickull
 • Miti Pricope
 • Andrew Shorten
 • Ryan Stewart
 • James Ward
 • Greg Wilson
 • Full As A Goog

RSS Feeds
 • Feed
 • Subscribe

Join my mailing list and find out about new books and other topics of interest.

Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.

Viewing By Month : July 2006 / Main
July 31, 2006

Using CFEXECUTE To Execute Command Line Utilities

A user just wrote to me to ask about using <CFEXECUTE>. He was trying to execute a command-line utility (based on an example I posted back in CF 5 days) and the code kept throwing Java errors. His specific problem turned out to be one of pathing, pre CFMX you may not have needed to provide fully qualified paths (for example, the path to cmd.exe) but now you do.

The following is a simple test, it invokes netstat and displays the results:

<cfexecute name="c:\windows\system32\netstat.exe"
        variable="data"
        timeout="10" />


<cfdump var="#data#">

Executing a shell command (like DIR and SET) is a little trickier. You can't execute set directly, you'll need to execute the command interpreter (cmd on Windows) and have it execute set. And you MUST pass /c as an argument - this tells the command interpreter to run and terminate upon completion, without /c it will be waiting for an explicit exit command and will never return.

Here is an example using set:

<cfexecute name="c:\windows\system32\cmd.exe"
        arguments="/c set"
        variable="data"
        timeout="10" />


<cfdump var="#data#">

Note: Obviously these example are Windows specific.

July 27, 2006

Building Rich Internet Applications eSeminar

Join me online to learn about Adobe Flex 2, and how ColdFusion and Flex have been designed to work seamlessly together. ColdFusion productivity and simplicity on the back-end, coupled with Flex-generated rich and engaging Flash on the client-side, empowers you to build better and richer applications than ever before. I'll be presenting this Breezo August 2nd at 1:00 pm Eastern. Registration required


ColdFusion And PaperThin Power Massive New Multilingual VOA Site

The new Voice Of America site has been launched, consisting of sub-sites serving content in 44 different languages, and handling over 2,000,000 unique visitors and 120,000,000 hits each month. The original site was Spectra based, but the new site is powered by PaperThin's CommonSpot running on top of ColdFusion MX. Over 1/4 million pages of content were migrated from the old system to the new one, and our pals over at Fig Leaf worked on the implementation and wrote custom extensions. For more details see the press release. Congrats to PaperThin and Fig Leaf on this impressive accomplishment!


Book Your MAX Hotel

The MAX 2006 attendee rate at The Venetian Hotel is $219/night, much cheaper than the $499/night you'll pay without the MAX discount. So, if you do plan on staying at The Venetian Hotel, you may want to register soon. Hotel details are on the MAX 2006 Hotel and Travel page.


Mark Andrachek On Getting ColdFusion To Run On Mactel

Mark Andrachek has posted an entry entitled CFMX on Intel Macs - The Definitive Guide (aka, How I Did It). Thanks, Mark!


CF_PDFForm: Programmatically Set And Get PDF Form Fields

The ability to programmatically access and manipulate PDF forms from within ColdFusion has been requested since, well, since we first demonstrated PDF generation abilities in ColdFusion MX 7. At CFUNITED a few weeks ago, Jason Delmore (ColdFusion Product Manager) demonstrated a planned ColdFusion "Scorpio" tag named <cfpdfform> which he used to populate (pre-fill) and extract values from a PDF form.

Scorpio is scheduled to be released in 2007. So what to do if you need PDF form support in ColdFusion right now? Well, here's a solution:

Adobe has a Java API named XPAAJ (which stands for XML/PDF Access API for Java). The API can be used to:

  • Extract and insert PDF form field data.
  • Convert PDF documents to XDP format.
  • Access PDF metadata and file attachments.
  • Add, replace, and delete embedded data objects, file attachments, and annotations.
  • Obtain PDF file properties.
  • ... and more.

Until a few days ago the XPAAJ license restricted use of the API to customers with licensed copies of LiveCycle servers. But that license has been updated to include other Adobe servers, including ColdFusion. As such, if you have a licensed copy of ColdFusion you may register and download XPAAJ and use it with ColdFusion.

Of course, using XPAAJ from within CFML code requires writing ColdFusion Java code. And so, to make life easier for us CFers, I wrote a Custom tag named <cf_pdfform> which makes it really easy to get and set PDF form field values. Want to pre-fill a PDF form? You can use this code:

<!--- PDF form --->
<cfset pdfForm=ExpandPath("Grant Application.pdf")>
<!--- Output PDF name --->
<cfset pdfResult=ExpandPath("Grant Application Filled.pdf")>

<!--- Generate filled in form --->
<cf_pdfform action="set"
        form="#pdfForm#"
        destination="#pdfResult#">

<cf_pdfformparam name="ProjectTitle" value="My Project">
<cf_pdfformparam name="RequestNum" value="1234567890">
<cf_pdfformparam name="RequestTitle" value="Widget Study">
</cf_pdfform>

Extracting PDF form field values is just as easy:

<!--- Output PDF name --->
<cfset pdfResult=ExpandPath("Grant Application Filled.pdf")>

<!--- Get field data --->
<cf_pdfform action="get"
        form="#pdfResult#"
        result="fields">


<!--- Dump it --->
<cfdump var="#fields#">

<cf_pdfform> is not as powerful or capable as Scorpio's planned <cfpdfform> tag family, but it'll help you in the interim.

To use <cf_pdfform> you must download and install XPAAJ.jar from the LiveCycle Developer Center XPAAJ page (you will need to register and accept the license before doing so). XPAAJ comes with extensive documentation and examples (none of which are actually needed to use <cf_pdfform>, although if you want to use XPAAJ to do more, this is all of the documentation you'll need). Then you'll need the attached ZIP file (see the download link below) which contains the <cf_pdfform> Custom Tag, documentation, and a CFML example.

Enjoy!

July 25, 2006

Mark Niemann-Ross On The New Combined Partner Program

The Adobe Solutions Network and the Macromedia Alliance Partner Program have been merged, and Mark Niemann-Ross has posted an entry with a link to a FAQ with useful information.

July 24, 2006

Brian Kotek: Stop Trying To Make CF Like Java

Brian Kotek has posted an important entry entitled Adobe Should Stop Trying To Make CF Like Java. I believe that Brian is right on the money on this one, and the entry and comments are well worth the read.

July 21, 2006

Kevin Lynch On Adobe Engagement Platform And Apollo

Knowledge@Wharton interviewed Kevin Lynch who discussed the Adobe Engagement Platform, Apollo, and more.


ColdFusion Positions In Denmark, Minnesota, and Connecticut

Looking for a ColdFusion position? Here are some new ones that were sent my way:

  • Info-Connect A/S (Denmark) is looking for a ColdFusion developer. ColdFusion and Java experience required. Details are online at http://www.info-connect.dk/index.cfm?page=job%5Fcold.
  • Mayo Clinic (Rochester, MN) is looking for a senior ColdFusion developer. A Bachelors degree in Computer Science or closely related field is required, as are demonstrable skills in SQL, JavaScript, HTML, and XML/XSLT. For more details visit http://mayoclinic.org/jobs-rst/ and enter keyword 9070.
  • MediFit Corporate Services (Norwalk, CT) is looking for a ColdFusion developer. Requirements include 3+ years experience and strong database skills. Flex experience a plus. Resumes can be sent to David O Malley.


Looking For CFTHREAD/CFJOIN? Head Over To Damon's Blog

Damon Cooper has posted proof-of-concept CFTHREAD and CFJOIN tags.

July 20, 2006

July 2006 Edge: My Top Ten Reasons To Attend MAX

The July 2006 edition of Edge (which sports a cool new CSS driven look) contains my article entitled Top 10 reasons to attend MAX 2006 in Las Vegas.

July 19, 2006

Sean Corfield: Ruby? Why Not ColdFusion?

Sean commented on a review of a book on Ruby, stating that the benefits enumerated could apply just as well to ColdFusion. The post has already garnered over 40 comments. This one is worth a read!

July 17, 2006

Blog Updated To BlogCFC 5.1

I have updated my blog to use Ray's latest and greatest. The upgrade was not as simple as I'd have hoped, I ran into a data migration issue caused by database table changes, and I had to make lots of tweaks to the actual UI (as I don't use Ray's default UI, I want the blog to look and feel like the rest of my site) and apparently broke stuff along the way. :-( Thankfully the blog is no longer sending error messages to my inbox. But if you do notice anything misbehaving, please let me know. Thanks!


CFMXLauncher Simplifies ColdFusion On Mac

Trying to run ColdFusion on an Intel based Mac? Then check out Jared Rypka-Hauer's CFMXLauncher. I don't have a Mac to test this myself, but if you do then this may be worth checking out.

July 16, 2006

FusionReactor 2.0 Released

I've mentioned FusionReactor before, and know of many companies successfully using this product. FusionReactor 2.0 has now been released. Among the new features are:

  • Enterprise Dashboard, which provides a great real-time status of your production environments "health" (local and remote) from a single window
  • Extensive data collection and troubleshooting, including stack trace, SQL support (using new JDBC Wrapper), end-to-end request and response as well as support for Flex/Flash Remoting and AMF data
  • Improved crash protection, featuring automatic "self healing" corrective actions, based on your defined server survival strategy
  • Automated server/instance detection with a very simple integrated installer

FusionReactor 2.0 is well suited for hosting companies, as it provides performance management and analysis for ColdFusion and J2EE applications, using a single piece of software.

Check it out!

July 13, 2006

Filtering Data In Flex

This afternoon a user IMed me to ask for help with a ColdFusion powered Flex 2 application. He wanted to be able to perform on-the-fly filtering of data in a CF populated Flex DataGrid control. Here is the solution I sent him.

Populate the DataGrid with an ArrayCollection (converting the data to an ArrayCollection if needed). ArrayCollection has a property named filterFunction (well, technically filterFunction is a property of listCollectionView of which ArrayCollection is a subclass) which takes the name of a function to be used to filter data. Each time ArrayCollection contents are refreshed this passed function will be called, once per ArrayCollection item. If the function returns true then the item is included, if false then it is excluded. So, to filter DataGrid contents on-the-fly, simple define a filter function that performs the filtering you need, and call ArrayCollection.refresh() as the filter text changes.

Here is a complete example. In the interests of simplicity this uses a local ArrayCollection (as opposed to data returned from ColdFusion) and will run as is. ArrayCollection myData is the dataProvider for the DataGrid. Function processFilter() is the filter function, it accepts an object and returns true or false based on whether it is a match or not (this filter function looks for substrings in a single column, and this could be changed of course). The TextInput box is where filter text is entered, and the change event simply calls myData.refresh() which forces the filter function to be reapplied to the ArrayCollection.

It is worth noting that filterFunction should not be specified until the ArrayCollection has been populated (or you'll get a null reference error). So, if you are using RemoteObject to invoke a CFC method to return data to populate an ArrayCollection, you should not set filterFunction until data has been returned. As such, you may want to do this in a RemoteObject result handler.

Here's the code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                layout="vertical" creationComplete="initApp()">


    <mx:Script>
    <![CDATA[

    // On startup

    public function initApp():void
    {

        // Set filter function
        // Be careful to set filterFunction
        // only after ArrayCollection has been
        // populated.

        myData.filterFunction=processFilter;
    }
        
    // Filter function

    public function processFilter(item:Object):Boolean
    {
        var result:Boolean=false;

        // If no filter text, or a match, then true

        if (!item.name.length
            || item.name.toUpperCase().indexOf(txtFilter.text.toUpperCase()) >
= 0)
            result=true;
                
        return result;
    }
    ]]>

    </mx:Script>

    <!-- Data (use ArrayCollection) -->
    <mx:ArrayCollection id="myData">
        <mx:source>
            <mx:Object name="Ben Forta" location="Oak Park, MI" phone="(248)555-5555" />
            <mx:Object name="Jane Doe" location="New York, NY" phone="(212)555-1234" />
            <mx:Object name="Jim Jones" location="Atlanta, GA" phone="(414)555-1212" />
            <mx:Object name="Roberta Roberts" location="Chicago, IL" phone="(312)555-4321" />
            <mx:Object name="Steve Stevens" location="Boston, MA" phone="(617)555-5656" />
        </mx:source>
    </mx:ArrayCollection>

    <!-- UI -->
    <mx:HBox width="100%">
        <mx:Label text="Filter:"/>
        <mx:TextInput id="txtFilter" width="100%"
                        change="myData.refresh()"/>

    </mx:HBox>
    <mx:DataGrid dataProvider="{myData}"
                    width="100%" height="100%">

        <mx:columns>
            <mx:DataGridColumn headerText="Name"
                                dataField="name"/>

            <mx:DataGridColumn headerText="Location"
                                dataField="location"/>

            <mx:DataGridColumn headerText="Phone"
                                dataField="phone"/>

        </mx:columns>
    </mx:DataGrid>
    
</mx:Application>

July 12, 2006

Ashwin Mathew Explains The ColdFusion Template Cache

Ashwin Mathew has posted a very useful entry on the ColdFusion Template Cache. This one is well worth the read.

July 10, 2006

Happy Birthday ColdFusion

Happy Birthday to you,
Happy Birthday to you,
Happy Birthday ColdFusion,
Happy Birthday to you!

11 years old today!


MAX 2006 Registration Open, Agenda Posted

MAX 2006 registration is now open! The agenda is also online, and yes, there are more sessions this year than in any prior conference!

July 7, 2006

ColdFusion Positions In Florida

In what is becoming a weekly Friday ritual, here are ColdFusion positions to be filled:

  • eDiets (Deerfield Beach, FL) is looking for a contract CF developer. Requirements include 2-3 years of ColdFusion experience, 2-3 years of SQL Server experience, and strong JavaScript and CSS skills. Contact Wendee Wright.
  • CBIZ Human Capital Services seeks to fill two positions for a client (South Florida). Requirements include 3-5 years experience with ColdFusion and SQL Server, experience using CFCs, and good documentation and QA skills. Contact KG@CBIZjobs.com.

July 6, 2006

Richard Ziade Loves Flex 2 And Shares 10 Reasons Why

Richard Ziade of arc90 shares his 10 Reasons We Love Flex 2.


InfoWorld: Flex Platform Better Positioned Against AJAX

Not that is need be one against the other, but, InfoWorld is running a story explaining how Flex is now a better alternative to AJAX than it was before. The main reason? No surprise, the new pricing.

July 5, 2006

Joe Rinehart Talking Up ColdFusion Productivity On TheServerSide

Joe Rinehart (of Model-Glue fame) has started a thread on TheServerSide.com entitled IoC, AOP, and Rails-like productivity...in ColdFusion?.


ComputerWeekly.com: Productivity Gains Make The Case For ColdFusion

Short (and rather shallow) overview of what ColdFusion is posted by ComputerWeekly.com in the UK (complete with quotes attributed to me, although I have no recollection of having spoken to these guys as of late).

  © Copyright 1997-2009 Ben Forta, All Rights Reserved