|By Charlie Arehart||
|August 23, 2002 12:00 AM EDT||
With each new release of CFMX some features are trumpeted a lot and others seem to fall between the cracks. I call these "hidden gems,"and in CFMX there are quite a few.
In this article I'll uncover several features that don't warrant publicity in the popular top 10 (or even top 20) lists that Macromedia and others might put out. Perhaps they won't influence the average IT buyer considering an upgrade. Sure, things like J2EE integration and XML/Web services support are critical to many organizations, and things like CFCs and Flash remoting may fundamentally change the way we develop CF apps.
But it's been my experience that what really intrigues most developers is the little things that have changed, some of which just may serve to make every day of our development lives easier without any substantial changes in current practices.
The big new things in CFMX are of course praiseworthy, and I don't mean to diminish them. It's just that maybe for some developers one or more of these hidden gems could be the real "gotta have" trigger that motivates them to upgrade. Or solve a long-standing problem.
I've broken the topics into a couple of categories. I'm not even mentioning all the hidden gems, nor even all the important changes to CFMX. As such, this article shouldn't be considered a compendium of all hidden gems. I can only highlight several.
Before proceeding, I want to point out that there are addititional new features of CFMX that may not get quite as much widespread acclaim. I don't consider them to be hidden gems since they're talked about often and are well documented. If you haven't yet looked into them, you should:
- CFFUNCTION: Creates UDFs that can include tags
- CFLOGIN, related tags: Support standardized login processing
- CFIMPORT: Enables JSP custom tags
- CFCHART: Replaces and exceeds CF5's CFGRAPH
- Automatic compilation of CF templates
- Support for internationalization (UNICODE)
- Improved debugging with CFTRACE
At the end of this article I'll point out several resources available for learning more about these and the other features I'll mention.
Hidden Gems in CFML
I've grouped the first set of hidden gems in a general category of CFML (ColdFusion Markup Language) gems, meaning new or changed tags and functions.
New Variable Scopes
More and more CF variable scopes have become available to use as structures. CFMX adds to this list the variables, caller, and server scopes. The value here is that you can use the CFLOOP COLLECTION tag to loop over the values in these scopes, or, more simply, you can display all the variables in a given scope with CFDUMP, among other things.
For instance, if you're not familiar with the server scope, try <CFDUMP VAR="#server#">. The output will show several useful variables you may never have known about, including several describing the CF server and the operating system it runs on. The server scope can also be written to, in which case any user on the entire server has shared access to the variables placed in that scope.
It's now possible to programmatically override the "request timeout" duration for a given template, using <CFSETTING REQUESTTIMEOUT="nn">, where "nn" is a number of seconds. The CF Administrator has a value set that controls the maximum time a CF template is allowed to run before the server "times out" the template. If you have a template that needs to run longer than that default, this is the means to programmatically indicate that it should be allowed to run longer.
Some will recognize this as an alternative to (and in some ways an improvement over) the long-existing means to make this sort of template-specific request to override the "request timeout" value. In previous releases you could add REQUESTTIMEOUT=nn to the query string of a URL requesting a template, and that indicated the maximum runtime for the template. That approach had its pluses and minuses, but it's important to note that this old query string approach is no longer supported (any value provided is ignored).
Try/catch in CFSCRIPT, UDFs
Prior to CFMX, there was no way to perform try/catch exception handling in the CFSCRIPT language (which was the means to create User-Defined Functions). This limitation has been lifted and there is now a Try and a Catch statement available in CF SCRIPT. See the documentation references provided later for more details.
Note: As opposed to CFML's CFTRY and CFCATCH tags, in CFSCRIPT, a Catch is not embedded within a Try. Also, while there are CFTHROW and CFRETHROW tags in CFML, there are no corresponding throw and rethrow statements in CFSCRIPT.
"Importing" CF Custom Tag Libraries, "Adaptive Tags"
In my article "Using JSP Custom Tags in CFMX" (CFDJ, Vol. 4, issue 5), I showed how you can use the new CFIMPORT tag to allow your applications to use JSP custom tags. One thing I didn't mention is that there's a side benefit to CFIMPORT, even if you're not using JSP custom tags. You can also use it to point to a directory that holds one or more CF custom tags (any directory with a relative path or using a mapped path in the CF Administrator). With that, you can then use JSP-style custom tag syntax to refer to your CF custom tags.
For instance, if you used <CFIMPORT TAGLIB="pathname" PREFIX="mytags"> to create a reference to some directory of tags that included sometag.cfm, you could now refer to it in your code with <mytags:sometag>.
There's also an interesting new possibility being referred to as "server-side HTML" or "adaptive tags." If you leave off the PREFIX in a CFIMPORT or set it to the empty string, then CF will process every tag (other than CF tags and taglib:-prefixed tags) as if it's a custom tag. It will look in the named TAGLIB to see if there's a template of that name, and will run it if there is. So if you had a page with such a CFIMPORT and had a file named form.cfm tag in such a taglib, a <form> tag on that page would cause CF to run form.cfm like a custom tag as it processed the page. Very interesting possibilities. Again, it cannot be used to override CF tags.
By the way, for those using CFIMPORT for JSP custom tags, I failed to mention in the article (available online at www.sys-con.com/coldfusion/article.cfm?id=435) that the feature of importing JSP custom tags is not supported in the Professional edition of CFMX. It's available only in Enterprise (or the Evaluation or Developer edition, which it becomes after 30 days of trial). I should clarify, however, that the notion of using CFIMPORT to work with CF custom tags does indeed work in all editions.
Evaluations Within Expressions
This hidden gem may not excite many, and it's actually a return to the way things were done in the past. You can now perform evaluations within expressions without needing to use the evaluate() function. For instance, if you wanted to display how long it took to run a query that was just executed, you couldn't (in CF5) just say:
<cfoutput>Time used:You'd need to use an evaluate around the expression cfquery.executiontime/1000. That's no longer needed. Removing it where it's not needed could yield a modest performance boost.
Miscellaneous Hidden Gems
Several other hidden gems that aren't part of CFML are worth pointing out.
CFMX Tag Updater for CF Studio
Folks who are still running CF Studio/HomeSite 4.5 or 5 will be thrilled to learn that they can arrange to install a "tag update" for the CFMX tags and functions. This way, the tag/function insight, tag editor, and tag/function help features work for most CFMX tags and functions (see www.macromedia.com/software/ coldfusionstudio/productinfo/resources/tag_updaters/). Also, there's an update for the Studio/HomeSite Help References (Help>Open Help References Window), available at http://download.macromedia.com/pub/homesite/ updates/cfml_ref.zip. Though the instructions in the zip suggest it works only for HomeSite + (part of the new Studio MX), the update also works in Studio/ HomeSite 4.5 or 5.
Free CFMX Hosting
If you're reluctant or unable to install CFMX, you may want to seek out a hosting company to do your testing. Fortunately, as of July, one company is offering free CFMX hosting for trial (nonproduction) purposes. See www.hostmysite.com/cfmx.hms for signup details. If anyone learns of other such instances, please let me know, or you can simply add them to the comments area of the online version of this article (see the end of this article for more on that).
Running CFMX on Mac OS X
Precompiling ColdFusionMX Templates
You may know that CFMX now compiles templates into Java classes. You may also have noticed that this means the first user to run a template after it's created or changed will suffer a small hit (up to a couple of seconds) when it's compiled the first time.
You can alleviate that wait by precompiling one or more templates. Unfortunately, the steps to do this take a little more room than we have for this article, so I'll save them for next month. There's also the matter of how to compile templates outside the default wwwroot directory (for those that have set up their servers to support that). In the meantime you can check out my blog at http://cfmxplus.blogspot.com/ for a preview of the topic.
Other Changes Worth Investigating
There are still more changes and/ or new features that I just don't have time to discuss. As mentioned in the next section, there are several resources from which you can learn more about these. Consider whether any of them may be of interest to you:
- Several Query of Query enhancements.
- Several CFLDAP changes.
- CFMAIL spooling option changes.
- Sort order in ListSort, ArraySort.
- Date processing functions have short, medium, long formats.
- Localization functions now follow Java standard rules.
- Several Regular Expressions support changes.
- CFTHROW can now throw an OBJECT.
- CFLOG now always writes thread, date, and time.
- CFHTTP reading text file in as query, new FIRSTROWASHEADERS attribute.
- COM object access improvements.
- Dynamic class reloading.
- New commenting flexibility.
- How to save the compiled template as .java (versus .class) files.
- Can indicate alternative directory for templates outside of normal <cfusionmx_home>\wwwroot.
- At least two Security Bulletins currently available.
- Many CF admin settings are now saved in <cfusion_home>\lib\neoruntime.xml.
- Examples in online CFML Reference are now housed at Macromedia.com (avoids security issues of running them locally).
There are still many others. You really owe it to yourself to read the resources mentioned next to make sure there aren't changes that could concern you.
Indeed, some of these issues fall more into the area of "hidden traps" for migration. I intentionally am not writing about those aspects of the upgrade. There are ample resources for that, not the least of which is the new manual, Migrating CF5 Applications, available within the substantial new CFMX documentation set. See the next section for how to obtain that both in print and online.
Finding More Information
The sources of many of the features I've mentioned here are the very documents that come with the new release. The thing is, many people don't know they exist or for some reason don't bother to or don't have the time to read them. I always point them out when possible, and it's especially important for this new release.
The entire CFMX documentation set has been revamped and added to. There are four updated and five new books. If you're not aware that there is documentation, or figure the books are just for reference, you really need to check them out. So many questions people ask are answered in the manuals.
The most substantial of them, Developing ColdFusion MX Applications with CFML, is a whopping 900 printed pages! No need to wait for books to hit the market: Macromedia has written one, and it's been improved over previous releases. Besides covering all the new features in a user-guide (rather than reference) style, it even has improved discussions of "old" subjects such as Query of Queries, UDFs, and CFSCRIPT.
You may find the manuals on your server at http://<yourserver>/cfdocs/dochome.htm. They're also available online at http://livedocs.macromedia.com/cfmxdocs/, and in PDF form at www.macromedia.com/support/coldfusion/documentation.html. Or you can buy them in print format (only $50 for the set) at http://dynamic.macromedia.com/bin/MM/store/US/ product.jsp?category=/BooksVideos/Documentation/ ColdFusionServer&type=FULL.
The books do indeed cover most of the new features, but there are always hidden gems in the "Release Notes" ( www.macromedia.com/support/coldfusion/ releasenotes/mx/releasenotes_mx.html), the "Documentations Updates" ( www.macromedia.com/v1/Handlers/ index.cfm?ID=22811&Method=Full), and the "Documentation Additions" ( www.macromedia.com/v1/Handlers/ index.cfm?id=22993&Method=Full).
There is also substantial coverage of new features on the Macromedia Designer/Developer site ( www.macromedia.com/desdev/mx/coldfusion/). And the "Upgrade FAQ" ( www.macromedia.com/software/coldfusion/ productinfo/faq/upgrade/) and "New Feature Comparison Grid" ( www.macromedia.com/software/coldfusion/ productinfo/upgrade/comparison.html) can also be useful.
Finally, don't miss the example applications that you'll likely find installed on your CFMX server, at http://<yourserver>/cfdocs/exampleapps/index.cfm.
There's a lot more to CFMX than it may seem at first. Indeed, I'd say "there's gold in them thar hills." Keep mining these resources for still more hidden gems, and feel free to add them to the online version of this article (whose link I'll offer on my list of articles at www.systemanage.com).
|dedi 05/04/03 12:42:00 AM EDT|
give me for mare information about available resources.
In his keynote at 18th Cloud Expo, Andrew Keys, Co-Founder of ConsenSys Enterprise, will provide an overview of the evolution of the Internet and the Database and the future of their combination – the Blockchain. Andrew Keys is Co-Founder of ConsenSys Enterprise. He comes to ConsenSys Enterprise with capital markets, technology and entrepreneurial experience. Previously, he worked for UBS investment bank in equities analysis. Later, he was responsible for the creation and distribution of life ...
May. 24, 2016 01:30 PM EDT Reads: 1,713
In his session at 18th Cloud Expo, Bruce Swann, Senior Product Marketing Manager at Adobe, will discuss how the Adobe Marketing Cloud can help marketers embrace opportunities for personalized, relevant and real-time customer engagement across offline (direct mail, point of sale, call center) and digital (email, website, SMS, mobile apps, social networks, connected objects). Bruce Swann has more than 15 years of experience working with digital marketing disciplines like web analytics, social med...
May. 24, 2016 01:30 PM EDT Reads: 933
What a difference a year makes. Organizations aren’t just talking about IoT possibilities, it is now baked into their core business strategy. With IoT, billions of devices generating data from different companies on different networks around the globe need to interact. From efficiency to better customer insights to completely new business models, IoT will turn traditional business models upside down. In the new customer-centric age, the key to success is delivering critical services and apps wit...
May. 24, 2016 01:15 PM EDT Reads: 624
The essence of data analysis involves setting up data pipelines that consist of several operations that are chained together – starting from data collection, data quality checks, data integration, data analysis and data visualization (including the setting up of interaction paths in that visualization). In our opinion, the challenges stem from the technology diversity at each stage of the data pipeline as well as the lack of process around the analysis.
May. 24, 2016 01:00 PM EDT Reads: 814
SYS-CON Events announced today that ContentMX, the marketing technology and services company with a singular mission to increase engagement and drive more conversations for enterprise, channel and SMB technology marketers, has been named “Sponsor & Exhibitor Lounge Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York City, New York. “CloudExpo is a great opportunity to start a conversation with new prospects, but what happens after the...
May. 24, 2016 10:30 AM EDT Reads: 671
SYS-CON Events announced today that 24Notion has been named “Bronze Sponsor” of SYS-CON's 18th Cloud Expo, which will take place on June 7-9, 2016, at the Javits Center in New York, New York. 24Notion is full-service global creative digital marketing, technology and lifestyle agency that combines strategic ideas with customized tactical execution. With a broad understand of the art of traditional marketing, new media, communications and social influence, 24Notion uniquely understands how to con...
May. 24, 2016 09:30 AM EDT Reads: 1,666
The demand for organizations to expand their infrastructure to multiple IT environments like the cloud, on-premise, mobile, bring your own device (BYOD) and the Internet of Things (IoT) continues to grow. As this hybrid infrastructure increases, the challenge to monitor the security of these systems increases in volume and complexity. In his session at 18th Cloud Expo, Stephen Coty, Chief Security Evangelist at Alert Logic, will show how properly configured and managed security architecture can...
May. 24, 2016 09:00 AM EDT Reads: 1,947
When it comes to IoT in the enterprise, namely the commercial building and hospitality markets, a benefit not getting the attention it deserves is energy efficiency, and IoT's direct impact on a cleaner, greener environment when installed in smart buildings. Until now clean technology was offered piecemeal and led with point solutions that require significant systems integration to orchestrate and deploy. There didn't exist a 'top down' approach that can manage and monitor the way a Smart Buildi...
May. 24, 2016 08:30 AM EDT Reads: 2,030
SYS-CON Events announced today BZ Media LLC has been named “Media Sponsor” of SYS-CON's 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. BZ Media LLC is a high-tech media company that produces technical conferences and expositions, and publishes a magazine, newsletters and websites in the software development, SharePoint, mobile development and Commercial Drone markets.
May. 24, 2016 06:00 AM EDT Reads: 3,368
WebRTC is bringing significant change to the communications landscape that will bridge the worlds of web and telephony, making the Internet the new standard for communications. Cloud9 took the road less traveled and used WebRTC to create a downloadable enterprise-grade communications platform that is changing the communication dynamic in the financial sector. In his session at @ThingsExpo, Leo Papadopoulos, CTO of Cloud9, will discuss the importance of WebRTC and how it enables companies to fo...
May. 24, 2016 04:30 AM EDT Reads: 2,385
SYS-CON Events announced today TechTarget has been named “Media Sponsor” of SYS-CON's 18th International Cloud Expo, which will take place on June 7–9, 2016, at the Javits Center in New York City, NY, and the 19th International Cloud Expo, which will take place on November 1–3, 2016, at the Santa Clara Convention Center in Santa Clara, CA. TechTarget is the Web’s leading destination for serious technology buyers researching and making enterprise technology decisions. Its extensive global networ...
May. 24, 2016 04:00 AM EDT Reads: 3,001
With major technology companies and startups seriously embracing IoT strategies, now is the perfect time to attend @ThingsExpo 2016 in New York and Silicon Valley. Learn what is going on, contribute to the discussions, and ensure that your enterprise is as "IoT-Ready" as it can be! Internet of @ThingsExpo, taking place Nov 3-5, 2015, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with 17th Cloud Expo and will feature technical sessions from a rock star conference faculty ...
May. 23, 2016 05:00 PM EDT Reads: 4,611
The 19th International Cloud Expo has announced that its Call for Papers is open. Cloud Expo, to be held November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, brings together Cloud Computing, Big Data, Internet of Things, DevOps, Containers, Microservices and WebRTC to one location. With cloud computing driving a higher percentage of enterprise IT budgets every year, it becomes increasingly important to plant your flag in this fast-expanding business opportunity. Submit y...
May. 23, 2016 04:00 PM EDT Reads: 1,818
Internet of @ThingsExpo, taking place November 1-3, 2016, at the Santa Clara Convention Center in Santa Clara, CA, is co-located with the 19th International Cloud Expo and will feature technical sessions from a rock star conference faculty and the leading industry players in the world and ThingsExpo New York Call for Papers is now open.
May. 23, 2016 03:00 PM EDT Reads: 1,662
There are several IoTs: the Industrial Internet, Consumer Wearables, Wearables and Healthcare, Supply Chains, and the movement toward Smart Grids, Cities, Regions, and Nations. There are competing communications standards every step of the way, a bewildering array of sensors and devices, and an entire world of competing data analytics platforms. To some this appears to be chaos. In this power panel at @ThingsExpo, moderated by Conference Chair Roger Strukhoff, panelists will discuss the vast to...
May. 23, 2016 02:00 PM EDT Reads: 2,333
SYS-CON Events announced today that Enzu, a leading provider of cloud hosting solutions, will exhibit at SYS-CON's 18th International Cloud Expo®, which will take place on June 7-9, 2016, at the Javits Center in New York City, NY. Enzu’s mission is to be the leading provider of enterprise cloud solutions worldwide. Enzu enables online businesses to use its IT infrastructure to their competitive advantage. By offering a suite of proven hosting and management services, Enzu wants companies to foc...
May. 23, 2016 01:45 PM EDT Reads: 2,058
Customer experience has become a competitive differentiator for companies, and it’s imperative that brands seamlessly connect the customer journey across all platforms. With the continued explosion of IoT, join us for a look at how to build a winning digital foundation in the connected era – today and in the future. In his session at @ThingsExpo, Chris Nguyen, Group Product Marketing Manager at Adobe, will discuss how to successfully leverage mobile, rapidly deploy content, capture real-time d...
May. 23, 2016 12:45 PM EDT Reads: 1,338
A strange thing is happening along the way to the Internet of Things, namely far too many devices to work with and manage. It has become clear that we'll need much higher efficiency user experiences that can allow us to more easily and scalably work with the thousands of devices that will soon be in each of our lives. Enter the conversational interface revolution, combining bots we can literally talk with, gesture to, and even direct with our thoughts, with embedded artificial intelligence, wh...
May. 23, 2016 12:30 PM EDT Reads: 1,794
IoT generates lots of temporal data. But how do you unlock its value? How do you coordinate the diverse moving parts that must come together when developing your IoT product? What are the key challenges addressed by Data as a Service? How does cloud computing underlie and connect the notions of Digital and DevOps What is the impact of the API economy? What is the business imperative for Cognitive Computing? Get all these questions and hundreds more like them answered at the 18th Cloud Expo...
May. 23, 2016 12:30 PM EDT Reads: 2,033
Whether your IoT service is connecting cars, homes, appliances, wearable, cameras or other devices, one question hangs in the balance – how do you actually make money from this service? The ability to turn your IoT service into profit requires the ability to create a monetization strategy that is flexible, scalable and working for you in real-time. It must be a transparent, smoothly implemented strategy that all stakeholders – from customers to the board – will be able to understand and comprehe...
May. 23, 2016 08:15 AM EDT Reads: 2,382