Entries Tagged as “Links”

ColdFusion Zeus POTW - Extra edition again...

Posted By: Ray Camden 2 Comments December 22, 2011

Hey, it's the holidays, so why not share one more quick ColdFusion Zeus update? This is another little feature that literally became available two days ago. If you've ever needed to dynamically invoke a CFC method, you know that's simply enough using cfinvoke. So for example:

<cfset s = new some()>
<cfset dynmeth = "test">
<cfinvoke component="#s#" method="#dynmeth#" returnVariable="res">
<cfdump var="#res#">

But of course, that's tag based. How do you do this in script? Unfortunately, the only way to do it was with evaluate, and while evaluate isn't as slow as it used to be, it can get messy to use.

ColdFusion Zeus corrects this by adding an invoke function.


<cfset s = new some()>
<cfset dynmeth = "test">

<cfset res = invoke(s, dynmeth)>
<cfdump var="#res#">

The first argument is either an instance of a CFC or the name of a CFC. The second argument is the method to call. If you need to pass arguments, then you can simply add a third argument - a struct.


<cfset res = invoke(s, "sum", {x:4, y:9})>
<cfoutput>#res#<p /></cfoutput>

By the way - take note of the fix to implicit struct notation. You can still use an equals sign ({x=4}), but colons work now too.

As a final quick aside - a certain person decided to take my words out of context regarding these Zeus previews I've been doing. That person also hasn't bothered to approve the comment I added 24 hours or so ago. I'm not going to bother linking to troll bait, but to be clear - these Zeus previews have intentionally focused on small things. It's easier for me to write, and secondly, it lets me ramp up slowly to the larger things we've announced already, like REST, closures, and web sockets. (Also, some of our larger features are still being hashed out.) For folks who attended my MAX preso, you already know this. Personally I'm really enjoying sharing these small, but useful, improvements, but I want folks to know that - obviously - we have bigger things in the works.

Respond Now

ColdFusion Zeus POTW: CallStack

Posted By: Ray Camden 2 Comments December 19, 2011

One of the new language additions to ColdFusion Zeus is the ability to get the current callstack. If that sounds Greek to you, it's simply the ability for a function to know who call it, who called that guy, and so on. It sounds confusing, but a few quick examples will help.

In our first example, I've got a call to a UDF that calls another UDF. That UDF runs one of the two new functions introduced in this blog post, callStackGet.

<cfscript>
function top() {
   return child();
}

function child() {
   return callStackGet();
}
</cfscript>

<cfdump var="#top()#">
</cfdump>

callStackGet returns an array of "invokers", or basically, how in the heck did we get here. Looking at the code it's easy enough to tell that child was called by top, and top was called by our cfdump. When displayed, this is what we get.

Notice the array is ordered from most immediate to the final originator of the caller. Also note that the function is labelled where appropriate. How about a slightly more complex example? Consider the code below.

<cfscript>
function grandparent() {
   return parent();
}

function parent() {
   return child();
}

function child() {
   return new some().test();
}
</cfscript>

<cfdump var="#grandparent()#">
</cfdump>

This is similar to our earlier code, but now child is invoking a CFC as well. Here is some.cfc.

component {

   function test() {
      return callStackGet();
   }

}

And the result...

As expected, it picks up on the different file in the CFC.

Another option is callstackDump. callstackDump returns a string based version of the callstack. It supports logging to a file, logging to console, or simply printing to the browser. Here's a modified form of the CFM we last tested with.

<cfscript>
function grandparent() {
   return parent();
}

function parent() {
   callstackDump(expandPath("./callstack.log"));
   callstackDump("browser");
   return child();
}

function child() {
   return new some().test();
}
</cfscript>

<cfdump var="#grandparent()#">
</cfdump>

Notice I've added two calls to callstackDump. Most likely, this is a more real world example as you won't probably ever return a callstack to the user. Here's an example of how it prints to my browser.

And there you have it folks. I'll be posting another Zeus preview before the Christmas break.

Respond Now

ColdFusion - No change in plan for Zeus

Posted By: Hemant Khandelwal 14 Comments November 15, 2011

Adobe evangelist Terry Ryan has already spoken about it in his blog and recently Josh Adams from our sales team wrote a blog post entry to state that ColdFusion is still in development and staying the course. I want to iterate that there is no change in plan for next version of ColdFusion codenamed Zeus and we continue to go aggressively trying to make Zeus a kick ass release. I & Rupesh recently presented a session at MAX where we demo couple of new features of Zeus that we have been busy building. If you have any questions, feel free to leave a comment or contact me. Hemant Twitter - khandelwalh

Respond Now

OSX Lion is now supported with the release of CHF2 for 9.0.1

Posted By: Hemant Khandelwal 17 Comments September 17, 2011

ColdFusion 9.0.1 installed with Cumulative hotfix 2 supports Mac OSX Lion (10.7.x). Check http://kb2.adobe.com/cps/918/cpsid_91836.html for more details. We are currently investigating our support for Lion server.

Respond Now

Cumulative Hot-fix 2 released for ColdFusion9.0.1

Posted By: Shilpi Khariwal 4 Comments September 16, 2011

Cumulative Hot-Fix 2 is released for CF9.0.1. Cumulative Hotfix 2 consists of previously released fixes for the Security issues mentioned in the bulletins APSB11-04, APSB11-14, APSB11-15 along with the cumulative hotfix 1 and the new bug fixes. This cumulative hot fix also has the new session invalid fix added to the Security hot fix. The complete instructions and list of issues fixed can be found at - http://kb2.adobe.com/cps/918/cpsid_91836.html

Respond Now

Blue Mango Theme Design By Mark Aplet

Super Powered by Mango Blog