Cfexecute tag: a few useful notes

Written on 20 October 2011, 04:50pm

Tagged with: ,

Some quick notes about cfexecute tag:

  1. It is async.
  2. You cannot put other ColdFusion tags or functions between the start and end tags of cfexecute.
  3. You cannot nest cfexecute tags.
  4. In CF8 or less, only stdout output is captured, not stderr. If you need to capture the error, redirect stderr to stdout using 2>&1 – as described here.
  5. In CF9, you can use errorVariable and errorFile attributes to store (into a variable or file respectively) the result of an error. [#]
  6. To capture the output, use variable or outputFile attributes. If no outputFile or variable attribute is specified, output is displayed on page from which it was called.

Flex 4.5: the certification

Written on 18 October 2011, 03:45pm

Tagged with: , , ,

A few days ago I passed the exam for becoming Adobe Certified Expert in Flex 4.5. Now I want to share my experience about the exam.

1. A little background

Because most of my working experience is in ColdFusion and PHP, I approached Flex more like a hobby. I wanted to have a better grip of the RIA concept and event-driven architecture. I started to use it also in real life, but it’s only 3 months ago when I started the preparation for the exam.
I read two Flex 4 books (both published in November 2010):

  1. “Learning Flex 4: Getting Up to Speed with Rich Internet Application Design and Development” by Alaric Cole, Elijah Robison [#]
  2. “Flex 4 in Action” Tariq Ahmed, Dan Orlando, John C. Bland II, and Joel Hooks[#]

While the first one provided a quick-and-easy approach to Flex, the second one came to consolidate my overall Flex knowledge. I recommend them both, preferably in the same order.
Aside from the books above, the Livedocs where always the reference. The problem was that I had to switch from ActionScript documentation, to Flex 4.5, to AIR, and even data services livedocs. Making sure that I am always reading the latest version was a concern, as Google sometimes shows first the old resources (AS 2, Flex 3, etc).

2. Preparing for the exam

After reading and reviewing the two books above (I keep Google Docs notes :)), I bought the Attest 3 exam engine. I learned a surprisingly lot more from there, especially in the AIR and design patterns sections, barely covered in the books. The links to the Livedocs were quite helpful, even though they were pointing to the Flex 3 version and I had to manually switch to the latest Flex version. My test results started from about 70%, and got up as the questions started to repeat (they say the total number of questions is 200+).

How to read ColdFusion log files directly from your app

Written on 16 October 2011, 01:41am

Tagged with: ,

CFLOG is a very useful tool for debugging. Along with CFDUMP, it is probably one most used tags in development 🙂
Logging with CFLOG is extremely simple:

<cflog file="myLogFile" text="#TimeFormat(Now(),'hh:mm:ss.l')#: log message" />

I am usually prepending the timestamp to get the milliseconds (by default, CF only logs the time down to the seconds):

"Information","web-261","10/13/11","06:03:21","APP","06:03:21.319: log message"

About the other attribute of the CFLOG: file, the CF documentation says:

Message file. Specify only the main part of the filename. For example, to log to the Testing.log file, specify “Testing”.
The file must be located in the default log directory. You cannot specify a directory path. If the file does not exist, it is created automatically, with the extension .log.

The log file is created inside the ColdFusion default log directory. You can see the content of this file using the ‘Log files’ screen of your CF Admin interface:

But what do you do when you don’t have access to the CF Admin interface? Luckily, you can still see the contents of your log file. You just have to locate the log folder contents and then output the log file contens, as the following script shows: