Viewing by month: August 2007


Adobe AIR WebKit Doesn't Support Client-side XSLT?

Posted on Aug 31, 2007

I got on a weird mission today for no specific reason (ok, I had something in mind but since it may not be possible I won't go into details). What I wanted to know was whether I could do an XSL Transform within Adobe AIR either through ActionScript 3, JavaScript or otherwise. After a little research, it appears that AS3 doesn't support XSLT directly. In addition, WebKit has added an XSLT JavaScript API but it seems to be new and, to be honest, I couldn't locate anything showing how to implement it.

After those two paths were blocked, I found an excellent beginners tutorial on client-side XSLT simply by loading the XML with the defined XSL template in the browser. The example they gave worked nicely in IE7, Firefox and even Safari on Windows. Seeing as Safari and AIR both use WebKit, I thought this might work in AIR. To my dismay, it did not. Here's what I did...

 Continue Reading →


Music for Your Work Week: Latin Electro-pop

Posted on Aug 29, 2007

As I have mentioned on this semi-regular column before, I love Latin music, just not the stuff you might catch on American Top 40 radio stations. Most of what I like falls under the "Alt-Latin" category but I am also a big fan of the "Electronic" music category and sometimes these two worlds meet nicely. The following are my three favorite electro-pop bands and the respective albums. If you have some favorites of your own in this genre, please feel free to share them in the comments as I would love to hear more. :)

 Continue Reading →


Remove Empty Array Elements ColdFusion Function

Posted on Aug 28, 2007

Here's a simple but useful UDF for handling arrays in ColdFusion. I was working on something today where I would create an array that happened to have a number of undefined elements contained within. What I wanted was to have all the undefined elements removed. ColdFusion 8 did add the ArrayIsDefined() function, but I needed this to work on 7 as well, so I copied a bit from Ray Camden's ArrayDefined UDF. CFLib actually had an ArrayCompact UDF that has a similar goal, except that it will only work for arrays with simple values, while this will work for arrays with any type of value.

Now, before anyone criticizes the use of duplicate(), I will make it known that the original version of this function simply tried to modify the reference to the original array and returned nothing. Theoretically, this should have worked since arrays are passed by reference, but it didn't and I am not quite sure why. When I dumped the argument in the function itself after it ran, you would see the array was properly modified, but when I viewed the original it still showed the empty values. If anyone can explain this, I would love to hear it (p.s. for this, I was testing on 7).

<cffunction name="arrayRemoveEmpty" access="public" description="removes empty array elements" output="false" returntype="array">    <cfargument name="theArray" required="true" type="array" />        <cfset var i = 0 />    <cfset var newArray = duplicate(arguments.theArray) />    <cfloop from="#arrayLen(newArray)#" to="1" index="i" step="-1">       <cftry>          <cfset newArray[i] />          <cfcatch type="coldfusion.runtime.UndefinedElementException">             <cfset arrayDeleteAt(newArray,i) />          </cfcatch>          <cfcatch type="coldfusion.runtime.CfJspPage$ArrayBoundException">             <cfset arrayDeleteAt(newArray,i) />          </cfcatch>       </cftry>    </cfloop>    <cfreturn newArray /> </cffunction>

 Continue Reading →


Automatically Proxy Java Objects in ColdFusion 8

Posted on Aug 28, 2007

Mark Mandel, the creator of Transfer ORM for ColdFusion, has posted on about an upcoming update to his JavaLoader component for dynamically loading Java classes into ColdFusion without requiring that they be added to the ColdFusion classpath. In this instance he uses ColdFusion 8's new functionality (including onMissingMethod() support) to create an automatic ColdFusion Component (CFC) proxy for the Java class rather than returning an instance of the class itself. Very interesting and potentially useful stuff for deeper CF/Java integration.

Writing my own JavaProxy for ColdFusion 8 using onMissingMethod

Usually I save this stuff for my open source updates, but this one I found particularly fascinating personally - particularly since I had a similar idea when I read about the onMissingMethod() support in ColdFusion 8. Nonetheless, looking at Mark's code, it is clear that my working on this would have been like Miss Teen South Carolina at a Mensa conference. Nice work Mark!

 Continue Reading →


ColdFusion Open-Source Update - August 27

Posted on Aug 27, 2007

Four new projects and one update this week. I wanted to take this opportunity to send a thank you to Justin Treher for sending me Super Princess Peach for the Nintendo DS from my wish list. Technically speaking, this game was for my son who is a big time Mario fan though I am totally digging it myself. No, this game isn't too "girlie" - Peach rocks, 'nuff said, though I still prefer Daisy 'cause she's got attitude! ;)

 Continue Reading →


|

About

My name is Brian Rinaldi and I am the Web Community Manager for Flash Platform at Adobe. I am a regular blogger, speaker and author. I also founded RIA Unleashed conference in Boston. The views expressed on this site are my own & not those of my employer.