Blog

Blog posts made in July 2006
31Jul
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:

view plain print about
1<cfexecute name="c:\windows\system32\netstat.exe"
2        variable="data"
3        timeout="10" />

4
5<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:

view plain print about
1<cfexecute name="c:\windows\system32\cmd.exe"
2        arguments="/c set"
3        variable="data"
4        timeout="10" />

5
6<cfdump var="#data#">

Note: Obviously these example are Windows specific.

Read More ›

27Jul
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

Read More ›

27Jul
2006
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!

Read More ›

27Jul
2006
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.

Read More ›

27Jul
2006
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!

Read More ›

27Jul
2006
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:

view plain print about
1<!--- PDF form --->
2<cfset pdfForm=ExpandPath("Grant Application.pdf")>
3<!--- Output PDF name --->
4<cfset pdfResult=ExpandPath("Grant Application Filled.pdf")>
5
6<!--- Generate filled in form --->
7<cf_pdfform action="set"
8        form="#pdfForm#"
9        destination="#pdfResult#">

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

Extracting PDF form field values is just as easy:

view plain print about
1<!--- Output PDF name --->
2<cfset pdfResult=ExpandPath("Grant Application Filled.pdf")>
3
4<!--- Get field data --->
5<cf_pdfform action="get"
6        form="#pdfResult#"
7        result="fields">

8
9<!--- Dump it --->
10<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!

Read More ›

25Jul
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.

Read More ›

24Jul
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.

Read More ›

21Jul
2006
Kevin Lynch On Adobe Engagement Platform And Apollo

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

Read More ›

21Jul
2006
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.