Posts in Category "General"

Heads-up: Server maintenance this weekend

I just wanted to let everyone know that on Saturday, April 12th, from noon to midnight PDT, our network team will be performing maintenance on the cluster that includes examples.adobe.com. Due to this work, applications running on the example cluster will experience 1-2 minute network outages throughout the service window.  

ColdFusion and Flex LiveDocs are misbehaving

We’re currently seeing a caching corruption problem with LiveDocs in which random files display instead of the correct pages. You’ll see a variety of symptoms:
* The wrong page displays
* Infinite loops in the TOC (this happens when LD loads a .js file instead of an HTML file)
* Bad formatting (when a CSS file doesn’t load properly)

The good news is that our web team has identified the bug that causes this. The bad news is that they’re still testing the fix and it won’t get rolled out until April 17.

I’ve had fairly random results over the last few days. Sometimes changing browsers helps, sometimes it doesn’t; sometimes clearing browser cache fixes it, sometimes it doesn’t. One suggestion is to download the complete Flex doc zip file, which contains usage docs in PDF and the Language Reference in HTML and access the docs locally.
This is available at http://livedocs.adobe.com/flex/3/flex3_documentation.zip. Individual PDFs are available from the Flex Help Resource Center page: http://www.adobe.com/support/documentation/en/flex/

I sincerely apologize for the inconvenience this is causing.
Randy Nielsen
Flex Documentation Manager

Updated ColdFusion Using Flash Remoting Update chapter

The Using Flash Remoting Update chapter of the ColdFusion Developers Guide documents how to integrate Flex and ColdFusion by using mx:RemoteObject tags to call ColdFusion Component (CFC) functions. It includes information on how to configure a Flex Builder project to compile an application that accesses ColdFusion, and describes how to specify and use CFCs in your Flex applications. Finally, it describes how to compile and run such applications.

The version of the chapter that was released with ColdFusion 8 was not updated correctly at that time, so it is not appropriate to use when integrating either Flex 2 or Flex 3 with ColdFusion 8. The updated chapter is (we believe) correct, and covers Flex Builder 2 and Flex Builder 3.

Download UseFlashRemotingUpdate_Blog.pdf

JRun 4 Updater 7

Apparently the word isn’t getting out so, I’m passing this along (after all, my screen name is jrunrandy!)

JRun 4 Updater 7 is now live on Adobe.com and is publicly available to customers. Updater 7 supports a host of new platforms, upgrades to existing software and bug fixes. To get Updater 7, go to http://www.adobe.com/support/jrun/updaters.html.

If you are running multi-server or standalone ColdFusion 8, there is no need to apply this updater. However, you should apply it if you deployed ColdFusion 8 using the EAR/WAR configuration on JRun.

CFML Reference Docs for the iPod

In addition to leading the Flex doc team, I also manage ColdFusion documentation. And, as someone who started with Allaire iback n 1998, I love working on ColdFusion. We realize that CF has been around for a long time and work hard to provide docs in all the places our developers work (local, LiveDocs, PDF, HomeSite, and Eclipse).

This one was fun, though.

A while ago, I read an article on the (minimal) hypertext capabilities in iPod Notes and when I mentioned the idea of deploying minimal CFML Reference information on the iPod to Sotion Shipcka, our crack TechBoston intern, he leapt at the chance.

Now maybe the rest of you will be like Sotion and say “Of course. I know how that works,” but just in case you’re like me, here are instructions to get this working:
1) Download the attached ZIP file.
2) Plug your iPod into iTunes and ensure that “Enable disk use” is selected.
3) Extract the ZIP-file contents to your iPod’s Notes folder.
4) Unplug your iPod.
5) Go to Extras>Notes and look for CF8 QuickRef for iPod
6) The material is separated into Tags and Functions. The functions are then separated alphabetically.

Try it out if you get a chance and let me know what you think!

Download file

Flex 3 Beta 1 (Moxie) Documentation

Yesterday, we released Flex 3 Beta 1 (code-named Moxie)on Adobe Labs. We also released Beta 1 of Adobe Integrated Runtime (AIR, code-named Apollo). I think we have pretty good doc coverage of new features but, as usual for a Beta release, things are a bit scattered.

Read me first
The Flex Builder online Help is only half updated. The Language Reference is at the Flex 3 level, but the usage docs (Developer’s Guide, Building, etc.) are still for Flex 2. For up-to-date usage docs, follow the Learning Resources links later in this posting.

Read me second
To get up to speed on Flex 3 features, I think it’s best to start by reading Matt Chotin’s Overview article .

Beta 1 learning resources
Here is a list (including links) of Flex 3 Beta 1 learning resources:

And here is a list of AIR learning resources for Beta 1; some apply when developing Flex applications for AIR and some apply when developing HTML applications for AIR:

As always, you can send us feedback using LiveDocs comments. Also, starting with this Beta release, our bug database is public; you can enter and track bugs yourself by going to http://bugs.adobe.com/flex/.

Flex and ActionScript Error Codes

One of the great things about working on the Flex development team is seeing how people create these amazing applications; things you never would have thought possible. However, the flip side of that is that when people are developing things you never would have thought possible, they get errors you never would have thought possible. I have set up a wiki page to help track error codes and possible solutions. I update this page whenever I hear of a new one and I encourage you to do the same. So far, it just has runtime errors, but feel free to add compiler errors and warnings, too. At some point, we’ll harvest these and roll them into the docs.

Along the same lines, Judah Frangipane (perhaps better known as dorkie dork fromdorktown on flexcoders), has written a flex app that searches LiveDocs, his blog, and the Error Codes wiki page for a given error code. Give that a try, too!

Wish I’d Said That …

We monitor a variety of forums, lists, blogs, etc., and sometimes we see a really brilliant answer that causes us to say “I wish we’d said that in the docs!” With that thought in mind, here is the first of a series of “Wish I’d Said That…” postings and it comes from Adobe Engineer Kevin Hoyt in response to a question about MySQL connectivity to Flex. However, Kevin goes way beyond that and offers a great overview of data access in Flex, along with considerations for choosing one over the other.

So, without further ado, ladies and gentlement, Kevin Hoyt!

Question: What is the most direct connection to MySQL with FDS and Flex where queries can be made against the DB?

Kevin’s response:
This is a pretty broad question as there are a number of ways to connect to data from a Flex application. Generally speaking however, Flex applications are services-centric (SOA) and in that respect always require some degree of middleware to access a database. The most common means of connecting to data are:

REST/XML-RPC
In these scenarios the customer might have a middleware resource such as a JSP page or servlet that gets a GET/POST request from a Flex application (HTTPService class). That server resource would then access the database using whatever means are traditional to that middleware – JDBC in the case of Java. The results of data access can then be formatted into XML (where one might more traditionally format the results in an HTML table) and returned as the response to the initial request. Flex/Flash Player have excellent XML handling capabilities and can then manipulate the data for display in the application UI.

The great thing about this approach is that it acts as a lowest common denominator. I’ve mentioned a Java-centric approach here, but this could easily be implemented using any number of technologies. Essentially anything that can get an HTTP request and return XML as the response.

SOAP/Web Services
This is really just a more formalized/standardized version of the XML-RPC approach. Rather than accessing a JSP specifically, a Flex application can access a web service endpoint. Per a specification, that service knows the format in which the data was sent, and how to format a response. Most middleware technologies these days support exposing logic/objects as web services. In this case, virtually any of these services can be consumed by a Flex application (WebService class).

The great thing about web services is that since they follow a standard, the application doesn’t have to know about the infrastructure details. This is especially great for B2B composite applications where there needs to be (or already exists) a high degree of abstraction. There is a trade-off however over XML-RPC in that SOAP is often very verbose and heavy across the wire, which can also mean more client-side memory requirements and processing/parsing time.

Remoting/AMF
Within the context of FDS, we figure that rather than rework your business logic as XML or SOAP (which is ultimately XML itself), why not just access the business logic directly? This saves developers time in having to write potentially tedious code to expose existing logic as XML. In the case of a Java application server, a Flex application can access a Java object directly by remote invocation of a method on a designated object (RemoteObject class). That object on the server can then deal with it’s native data types as arguments, query a database from those arguments, and return it’s native data types as a value (i.e. return a List of Contact objects).

Above and beyond this ease of use, is the speed with which this communication happens across the wire. Data exchanges still happen over HTTP/S but the data itself is serialized into a binary representation. This ultimately means less data needs to go across the wire, that data requires less client memory, and there’s less processing time for the data.

Data Management
There’s comes a point in RIA development (or client/server if that’s your customer’s background) that more complexity is introduced on the client. After all, with Flex, we now have a client that can work on data quite independent of a server after the initial request(s). How are we to be sure that the data that has changed on one client hasn’t been changed somewhere else (on another client)? Writing RPC-oriented code (the three aforementioned examples) this can get really tricky to deal with on a per application basis. The data management features of FDS abstract all this from the developer. You can literally write a client application that handles real-time synchronization across connected clients in just a few lines of code.

This description doesn’t do justice at all to the other great features that FDS can provide developers. Implicit paging through large datasets is another common use-case.

Internally the data management scenario looks very similar to the remoting option save that there’s an additional layer called an “assembler” that acts as the touchpoint between the Flex client application, the FDS installation on the server, and the server resources that are accessing data. At a low level however it is common that developers have their objects leverage JDBC to access various types of database systems to include MySQL.

Messaging
To the point of getting updates from the database to the client – the first question to ask is what is making the update to the database? Would this be another Flex application? If so, then this would fall squarely under common FDS data management features. In short, you’d get this type of cross-client update through push (or polling) automatically as a feature. If there’s another (external) process that’s updating the database, then you’ll want to leverage the capability of FDS to tie into JMS for client notification. At a high level, the process can make a change to the database and then drop a message on the queue stating that something has changed. That message will be propogated (via push most commonly) to all the clients. The clients can then take whatever action they need to update their copy of the data.

Hello World Application for Flex using ColdFusion Remoting

Feedback from a variety of sources has convinced me that we need a simpler on-ramp to Flex for ColdFusion users. The Getting Started with Flex 2 book has a CF-related lesson, however, it talks about the event gateway, a useful, but relatively complex feature. What we should have provided (and will provide in future releases) is a lesson on using the mx:RemoteObject tag to invoke a method on a CFC, a much more commonly used feature.

There are three ways to get started using the mx:RemoteObject tag to retrieve data from a CFC:

  • Use the default remoting destination, ColdFusion
  • Create CFC-specific destinations in the cf_root/WEB-INF/flex/services-config.xml file
  • Use the ColdFusion Extension Wizards in Flex Builder. As of the Flex Builder 2.0.1 update, the installer for the ColdFusion Extensions is in a subdirectory directly beneath your Flex Builder install root.

This posting describes the first two and will help you understand the third. For information on the ColdFusion Extension Wizards, I recommend viewing Dean Harmon’s presentations on the ColdFusion Developer Center.

These instructions cover configuration and usage for a simple Hello World application. For detailed information on using the Flash Remoting Update (the official name of this feature), see Using ColdFusion MX with Flex 2. This document includes data type mappings, which are always important with features like this.

Background

  • If you are using Flex to access data through ColdFusion, you typically use mx:RemoteObject instead of mx:WebService because mx:RemoteObject offers better performance.
  • You manage Flex mx:RemoteObject access to ColdFusion through destination elements in the cf_root/WEB-INF/flex/services-config.xml file.
  • This file contains a destination named ColdFusion that allows you to access any remote CFC method.
  • You can create CFC-specific destinations in the services-config.xml file, which provides a more secure configuration.

Using the default remoting destination
To use the default remoting destination, you need a CFC with at least one remote method and a Flex application.

  1. Create a Hello World CFC:

    <cfcomponent name=”User”>
      <cffunction name=”sayHelloString” access=”remote” returnType=”string”>
        <cfreturn “Hello World!”>
      </cffunction>
    </cfcomponent>
  2. Save this file as cfweb_root/myApplication/components/User.cfc
  3. Create a Flex Builder project and choose ColdFusion Flash Remoting Service, which automatically adds the –services compiler argument, pointing to the services-config.xml file. You’ll also need to specify:
    • Root folder (for example C:/CFusionMX/wwwroot) – This is the directory that contains the WEB-INF/flex directory, and the WEB-INF/flex directory must contain a services-config.xml
    • Root URL (for example, http://localhost:8500)
    • Context root (CF J2EE only)
    • Save your project in a directory under the ColdFusion webroot. Do not use the default location.
  4. Create the MXML file. The following (simple) file invokes the sayHelloString method in User.cfc:

    <?xml version=”1.0″ encoding=”utf-8″?>
    <mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute”>
      <mx:RemoteObject
        id=”myCfc”
        destination=”ColdFusion”
        source=”myApplication.components.User”
        result=”remotingCFCHandler(event)”/>
     
      <mx:Script>
      <![CDATA[
        import mx.rpc.events.ResultEvent;
        import mx.utils.ObjectUtil;
     
        private function remotingCFCHandler(e:ResultEvent):void
        {
          returnedText.text = ObjectUtil.toString(e.result);
        }
     
        private function callRemotingCFC():void
        {
        // invoke sayHelloString method on User.cfc
          myCfc.sayHelloString();
        }
        ]]>
      </mx:Script>
      <mx:VBox>
        <mx:TextArea id=”returnedText” />
        <mx:Button label=”Show” click=”callRemotingCFC()”/>
      </mx:VBox>
    </mx:Application>
  5. Compile and run the application.

Using a CFC-specific destination
To use a CFC-specific destination, you need to modify the services-config.xml file, create a CFC with at least one remote method, and create a Flex application.

  1. The first three steps are the same as the previous procedure.
  2. Open the cf_root/WEB-INF/flex/services-config.xml file and create a destination element for your CFC. The source element specifies the path to the CFC, relative to the webroot:

    <destination id=”helloworld”>
      <channels>
        <channel ref=”my-cfamf”/>
      </channels>
      <properties>
        <source>myApplication.components.User</source>
          <!– define the resolution rules and access level of the cfc being invoked –>
          <access>
          <!– Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. –>
          <use-mappings>false</use-mappings>
          <!– allow “public and remote” or just “remote” methods to be invoked –>
          <method-access-level>remote</method-access-level>
        </access>
     
        <property-case>
          <!– cfc property names –>
          <force-cfc-lowercase>false</force-cfc-lowercase>
          <!– Query column names –>
          <force-query-lowercase>false</force-query-lowercase>
          <!– struct keys –>
          <force-struct-lowercase>false</force-struct-lowercase>
        </property-case>
      </properties>
    </destination>

  3. Create a new Flex Builder project, as described above, or reuse the existing project.
  4. Code an mx:RemoteObject tag, but specify the new destination in the destination attribute and omit the source attribute.
  5. Compile and run the application.

Using the command-line compiler
If you’re using the command-line compiler, you must include the –services and -context-root compiler arguments The –services argument specifies the location of the services-config.xml file. The -context-root argument specifies the context root of the ColdFusion web application (for the standalone version, specify /). For example:


C:\CFusionMX7\wwwroot\hello>c:\flexsdk201\bin\mxmlc –services c:\CFusionMX7\ww
wroot\WEB-INF\flex\services-config.xml -context-root=/ hello.mxml

If you use the command-line compiler, you’ll need to create a wrapper file manually, as described in the Creating a Wrapper discussion in Building and Deploying Flex 2 Applications.

What’s next?

  • If you use Flex Builder, install and run the ColdFusion Extension Wizards in Flex Builder. This tool creates MXML, ActionScript, and ColdFusion code, allows you to view and select data from ColdFusion data sources, and provides more of a real-world architecture.
  • For reference, see Using ColdFusion MX with Flex 2.
  • For more usage and configuration information, see the RPC chapters of the Flex 2 Developer’s Guide.

Finding and Using Flex Documentation

Matt Chotin posted similar information to Flexcoders last week, and it reminded me that many people don’t know about the Flex Documentation page. The Flex Documentation page contains links to the latest and greatest Flex docs in PDF and LiveDocs format. It also contains a link to a ZIP file that contains the complete documentation for local use.

Now that we have that out of the way, let’s look at the complete range of formats and locations:

  • The Flex Builder Help system contains all Flex documentation in HTML format. Each page contains a link to the same page running on LiveDocs. We leverage the Eclipse Help engine for table of contents, search, and dynamic help functionality.
  • LiveDocs contains all Flex documentation in HTML, along with comments from community and Flex-team members. We occasionally update pages on LiveDocs and use the LiveDocs Related Topics functionality to provide links to related pages, such as Flex Quick Starts. We leverage adobe.com google search and provide a JavaScript-based table of contents.
  • Release Notes provide a high-level description of each product, along with a list of known issues and, for an update release like Flex 2.0.1, fixed bugs.
  • The Installation page provides install instructions for Flex Builder, Flex Data Services, Flex SDK, and Flex Charting.

The one you use depends on the way you work. If you use Flex Builder, the Flex Builder Help system is a handy and fast tool that links to LiveDocs for the latest and greatest information. Tip: Have you tried Flex Builder Dynamic Help? Dynamic Help, which is an option on the Help menu) provides links to the current tag and changes the links in near real time as you move through your file.

If you’re not using Flex Builder, try LiveDocs. You can either display the home page and navigate using the table of contents or use a search engine to hone in on the right page. Also, if you’re offline for a significant portion of your development time, we suggest downloading the complete doc set (50Mb ZIP file) and using it locally.