Notes: Managing, Monitoring, and Upgrading Your ColdFusion Servers

These are notes from Adobe MAX 2009. This is what is new in ColdFusion Administrator for ColdFusion 9.

Mail. You can sign mail with a keystore. You can view undeliverable email by clicking a button instead of browsing to the directory on the server.

Document. You can configure ColdFusion to point to an OpenOffice installation on the server. This is necessary for a lot of the document integration features in ColdFusion.

Data Collections. You can now have Verity or Solr collections. You can configure Solr in the Administrator. So ColdFusion 9 includes both Verity and Solr.

Security. Since there are ColdFusion services (CFaaS) now, you can configure which IP addresses may use your server for these services.

Server Monitor. The server monitor allows you to see how the server is using memory, which templates are running slow, the database pooling, how are template and database queries running, etc.

Server Manager. A basic AIR app that provides a way to perform administrative functions on ColdFusion server(s). It provides a nice way to manage multiple servers at once. At the CF Unconference, this became a topic of light debate on Wednesday at lunch, because there are typical 1.0 weaknesses in the interface of the server manager that make it a little bit of a pain to use. But it is a great start, and hopefully the next iteration will be a little more fine-tuned.

Migrating to CF9. Beware using these keywords: interface, pageencoding, finally, import, local. These are new CF9 keywords that will cause a conflict if your code was using them. BlazeDS now ships out of the box with CF9, which is great. LCDS Express Edition is no longer supported. It is recommended to upgrade from Verity to Solr. To do this, you’ll need to add engine=”solr” in your CFCOLLECTION tags. What’s more, the CFSEARCH tag will need some slight syntax changes when migrating to Solr! Ugh.

Notes: Migrating from Flex 3 to Flex 4

These are notes from Adobe MAX 2009. This session will help us see what problems we may encounter moving to Flex 4, as well as what new features we can use.

Packages. The old mx packages are still there. But now everything new is in the spark packages. Why two different packages? At first, they had them all in the same package, but the component had a prefix for the new version. It wasn’t received well. So instead, Adobe just put the new components in new namespaces.

The MX namespace is also called “Halo”. Don’t consider it a “legacy” namespace. These are still fully supported. Spark is all of the new stuff. The general MXML has a new 2009 namespace, but the legacy namespace is still supported.

Graphics

You can add graphic primitives enabling you to draw lines, ellipses, and curves, directly within the MXML. With the new FXG file format, you can import a graphic in as a vector graphic that appears as code. Cool. Using a static FXG image is great for icons or other static simple images, because its rendering is faster than an MXML graphic container.

Flex States

Instead of using AddChild and RemoveChild for changing states, you have includeIn=”" and excludeIn=”" attributes that go directly on components. What’s more, you can set various attributes of a component for the different states by using a dot notation. For instance, title.mystate=”Title”. This seems like a pretty drastic change.

With states, you have to use the OLD way with the 2006 namespace, and you have to use the NEW way with the 2009 namespace.

Skinning

Components all have separate skin files. This will allow you to create a custom skin for any component easily.

Common migration issues

Type selectors need namespaces now in your Flex CSS. For instance, if you’re styling a button, Flex doesn’t know if it is a Spark button or a Halo button. So you need to define the namespace in your stylesheet and update your selectors accordingly.

You must compile against Flash Player 10. This won’t be an issue if you use Flash Builder 4 with Flex 4.

Application.application should now be renamed to FlexGlobals.topLevelApplication. Just a direct rename.

RSLs are on by default.

The “Declarations” tag is a problem child. In Flex 4, anything that is not a display object or default property must be within the fx:Declarations tag. Even tags like RadioButtonGroup. Formatters, Effects, RPC stuff, Validators, etc. need to go in the Declarations.

“If Looks Could Kill.” The default theme is now Spark, which looks different than the old Halo theme. You can switch back to the Halo theme. To do so, turn on “Use Flex 3 compatibility mode” in the project properties, or go into the “Flex Theme” panel and change the theme (this is the preferred way).

If moving to Flex 4, try to use as many Spark components as you can. They should play nicely with MX components. You can intermix them together. Caveats: (1) The graphic primitives cannot go in an MX component, just wrap them with a group; (2) you cannot put MX components in Spark containers; (3) MX effects do not work on Spark graphic primitives; (4) MX navigators (ViewStack, Accordion, etc) should use NavigatorContent component.

Other things to watch out for:

  • Spark components don’t support the Halo theme.
  • Cannot create spark component based itemRenderers for MX List based components
  • APIs between MX and Spark components are different (e.g. addChild vs. addElement)!
  • When using MX and Spark components together, you may see a text difference since they are themed differently. There is a TLFText theme that can help with this.

So, migrating an app from Flex 3 to Flex 4 is a bit of a slippery slope. And even just beginning to use Flex 4 with current Flex 3 knowledge will require a bit of a slowdown as you undo some of those brain synapses to do things the new Flex 4 way. But these changes going forward are good for the Flex framework.

Notes: What’s New in ColdFusion 9

These are notes from Adobe MAX 2009. The talk was given by Adam Lehman.

First, ColdFusion 9 also introduces the new ColdFusion Builder product, an Eclipse-based IDE “to rule them all”. Because it is based on Eclipse, you can also combine other products, like Flash Builder, so that one IDE gets the job done for everything, whether it is HTML, CFML, JS, Flex, ActionScript, CSS, etc.

ColdFusion Builder also supports some interesting server integration features. You can access ColdFusion Administrator and other functionality right from ColdFusion Builder; you can see and browse all of the databases that ColdFusion has datasources for. With such functionality, you can do cool stuff like auto-generate ORM-based CFCs by pointing it to an existing database table! Now, it doesn’t generate just the bean CFC. It generates the entire service layer: DAO and Gateway beans as well!! Now, this obviously is just a starter step. It’s expected that you’d tweak it from that point. With the Flash Builder integration, you can take this to the next step by also generating ActionScript objects to help with Flex integration as well.

CFML Enhancements

Well, in CF7, they introduced Application.cfc that supported hooks for application events. But now in CF9, there is a Server.cfc with an onServerStart() method for handling that event.

Various other holes have been filled. You can now have nested CFTRANSACTION tags. Error catching now supports “finally”. And looping now supports CFCONTINUE.

Variable level enhancements: You can now pass implicit structures/arrays to tags and functions. Before you had to assign it to a var and then pass it. There is assignment chaining (a=b=c). Direct access to elements of returned arrays (i.e. myFunction()[x] couldn’t be done previously). And, finally, ternary operators! For instance, you can do something like: a = (b<c)?b:c

CFSCRIPT enhancements. Starting in CF9, you can now write 100% script-based code, including classes/components.

CFC enhancements. There is now an explicit LOCAL scope. Instead of doing var myvar=1, you can do LOCAL.myvar=1. What’s more, you can declare a variable with var anywhere in the code, not just at the top. CFCs also support implicit getters/setters by using the CFPROPERTY tag. These are worth using if there is no special handling going on, because they’re 7x faster than your own getters/setters.

Here’s an awesome feature. You no longer have to use CreateObject() to create a CFC. You can use the IMPORT keyword to point to a directory of CFCs and have them be first-class citizens in your code. And you can use the NEW keyword to create CFCs, like user = new User(). Looking more Java-like all the time.

How to convince your boss to upgrade

First, with CFIMAP, you can now access email with IMAP support, such as GMail.

There are many PDF support enhancements. Create PDF packages, add/remove headers and footers, optimize PDFs (down-sample images, for instance), extract text/images, high-quality thumbnails, convert Word documents to PDF.

There are presentation options. The CFPRESENTATION tag will generate PPT files from CFML/HTML content. And you can go the other way: Convert PPT to HTML or Flash. Supports Microsoft PowerPoint ’97 to ’08 and Open Office Presentations.

Spreadsheet support. The CFSPREADSHEET helps you create, read, and merge native Excel spreadsheets. This isn’t just a CSV file. This is a real Excel spreadsheet with formulas and formatting support.

SharePoint integration. Native access to SharePoint data and services (Sites, templates, sub-sites, web parts, and workspaces). You can get lists including data, views, and alerts and querying against lists. Users, permissions, site groups, cross-site groups, security groups, and distribution groups. Build web parts with CFML. Integrate with SharePoint Single sign-on. You may wonder, “Why is this necessary since SharePoint has web services and exposes information as XML?” Because it’s painful. ColdFusion makes it significantly easier and faster.

ColdFusion Server Manager. A Flex-based AIR application that helps you manage multiple ColdFusion servers. And it receives system notifications and alerts. Helps apply settings for multiple servers.

The next generation of applications

Coldfusion 9 ORM functionality. Powered by the Java Hibernate framework, so it is industry standard. Various ormXXX() and entityXXX() functions provide this functionality for you. With this feature, no more SQL is necessary, so apps can be developed faster (and potentially with fewer errors). CFCs will just be automagically saved. But it’s not just a matter of saving time on development; it also makes it so that your app is no longer database-dependent. It can point to any database server and it should just work.

Enhanced caching. ColdFusion is already pretty optimized for speed (esp. between CF7 to CF8). So to get more speed, developers need to use these new caching features. Using cacheGet(), cachePut(), and cacheGetMetaData(), you can save/retrieve objects from a built-in cache. Page fragment caching allows you to have a combination of static and dynamic content on a page. This provides a HUGE performance boost, depending on what you’re doing. For instance, you only want to generate a menu dynamically the first time, but then another area of the page is dynamic every time.

Performance gains. Okay, Adam lied. ColdFusion 9 is actually 40% faster than ColdFusion 8, with no changes to code, just upgrading ColdFusion. CFC creation is 8x faster, method invocation is 3x faster. And UUID creation is 100x faster. These are some huge bottlenecks that have been blown away. There is a performance brief that Adobe will be releasing on ColdFusion 9 in the near future.

Search engine. ColdFusion 9 now includes Apache Solr. Verity is still included, but so is Solr, which is actually even faster than Verity. So you may choose to upgrade to Solr! They even provide a Verity-to-Solr migration utility.

ColdFusion Server API. You can have direct access to ColdFusion services for CFCHART, CFDOCUMENT, CFPDF, CFIMAGE, and more. This makes it even easier to access ColdFusion mail/pdf/images services directly within Flex without having to custom code some ColdFusion code.

What’s more, Flash Remoting is 9x faster. It may arguably be the fastest flash remoting server-side technology around.

There are various JavaScript/Ajax tags, like CFMAP for Google Maps, CFMESSAGEBOX, CFSLIDER, and more. Ajax functionality in CF is powered by ExtJS 3.0 (which is nice, because ExtJS isn’t free anymore, so getting CF9 gets you a copy of ExtJS basically), and JQuery is also supported.

This presentation was very rapid fire, which is testimony to how feature-rich of an upgrade ColdFusion 9 is.

Notes: What’s Coming in AIR 2

These are notes taken at MAX 2009. This is obviously subject to change before AIR 2 is launched.

Multi-touch gestures. This is especially useful for Flash’s new ability to compile down to iPhone, but it will even work on tablets or laptops that support multi-touch, such as the track pad on MacBooks.

Opening Files. There is now a File.openWithDefaultApplication() method which does just what it says. So you can open data document of any type in its native app from your AIR app, i.e. open a Word document in Word from your AIR app. Executables are blacklisted, such as *.exe, *.bat, or other executables.

File “downloaded”. You can use myFile.downloaded=true to set the bit on a file that will notify the user with a message like, “This file has been downloaded from the Internet. Are you sure you want to open it?” the first time it opens.

Volume Detection. Listen for mounting and unmounting of volumes. Query system for volume info. So this gives you the ability to work with external volumes including optical media or attached cameras.

Native processes. You can start native processes outside of AIR, or even reference it and launch it. This includes passing in arguments and utilizing stdin, stdout, stderr! Now, you can’t use this ability from an app that has been installed straight from an AIR file. You have to have the app in a native installer. This way, someone on a Mac won’t try to run an app that wants to run a Windows executable, or something similar. In the demo, the Mac screenshot process was invoked, and in another demo, Spotlight functionality was invoked and its output was incorporated into the app!

File promises. Ability to tell the OS about files you don’t have yet. Gives you the ability to drag and drop files in cases when they are on the network or Internet.

Listening on a socket. Ability for inter-application communication. Better protocol support (such as FTP). Networking utilities. You just use ServerSocket.bind() and ServerSocket.listen() methods in conjunction with an event listener to act on activity. Demonstrated it with an HTTP proxy app called HTTPeek (on Google Code). Very fast. Handles the socket connection well.

Advanced Networking. Get network information. Support for IPv6. UDP support. A DNS resolver. More coming.

Audio Encoding. Surprisingly, this wasn’t supported before. Now you can encode data directly from the microphone.

Global Error Handling. You can now catch all uncaught errors and error events in your app. This is useful because on a client that does not have the debugger version of Flash, the app will just stop working. With this global error handling feature, you can log the errors to a file or over the network, or do other things.

Accessibility. Functionality from Flash Player 10 will now be supported in AIR. It has 28 accessible Flex components, supporting MSAA (Microsoft Active Accessibility) in JAWS or Microsoft Narrator, for example.

JavaScript Profiling. Can access profiling information via Aptana.

Optimization. Lower memory consumption, lower CPU utilization especially when the app is idle.

Misc. Improved printing. SQLite supports nested transactions. Exit even on shutdown (can now see when the event is not cancelable). Various WebKit enhancements.

Flex 3 will work for AIR 2, but Flex 4 with Flash Builder 4 will be a cleaner, more set up approach for developing AIR 2. You’ll have to overlay AIR 2 SDK on your Flex Builder 3 installation if you want to develop for AIR 2 in Flex 3.

  Theme Brought to you by Directory Journal and Elegant Directory.