2008 Seeking ColdFusion 8 Case Studies
2008 Have Us Visit Your School Armed With Flex, AIR, And Pizza
You probably know that Flex Builder is free for students. But did you know that we could drop by to present Flex and AIR? If you organize a school event with a minimum of 200 students, we'll come and present Flex and Adobe AIR at your school, and pay for the pizza and drinks. See the flex.org - Flex for Students and Faculty page for details.
2008 Case-Study: The Alpha School System And ColdFusion 8
The Alpha School System (TASS) is an Australian browser-based administration and portal application for K-12 schools. It includes modules for enrollment; student, parent, and teacher records; timetables; fundraising information, and financial accounts. It also offers online community portals for students, parents, and teachers, as well as web-based student grading tools. The application was built using ColdFusion 8 and Flash CS3, and uses ColdFusion 8 PDF generation and integration features extensively. A case-study has been posted on Adobe.com.
2008 Summarizing Grouped Data With Flex 3 AdvancedDataGrid
Last week I showed how to use the new Flex 3 AdvancedDataGrid to group data (that example used ColdFusion data returned as a query, although the example could also be applied to other back-ends, too). Grouping creates a tree within the data grid, so that groups of data may be collapsed and expanded as needed.
Now let's take the example a step further, this time adding summary data. For example, suppose you were displaying sales orders, grouped by customer and then by order number. When collapsed the tree would list all customers, but no details. When a customer was expanded the tree would list all orders for that customer, but no details. When a specific order was expanded, then the details for that order would be displayed. That's how basic grouping works.
But what if you wanted to show summary data for groups? For example, customer rows could show total of all orders for that customer, regardless of how many orders there were, and whether or not the customer group is expanded or collapsed. And then order rows could show order totals. You get the idea. And yes, this functionality is built in to the Flex 3 AdvancedDataGrid.
As before, this is a ColdFusion powered example using the default database tables that come with ColdFusion 8. Here is the simple CFC method which just returns several columns from three tables:
<cffunction name="getOrders" access="remote" returntype="query">
<cfset var result="">
<cfquery datasource="cfartgallery" name="result">
customerlastname || ', ' || customerfirstname AS customer
FROM orders, orderitems, art
ORDER BY customer, orders.orderid
I saved this component as art.cfc in a folder named test beneath the web root. You can save it wherever you like, but of course you'll need to adjust the path in the MXML accordingly. (If you tried the previous example, you could just add this getOrders() method to the existing CFC.
Now for the MXML:
layout="vertical" width="100%" height="100%"
public function initApp():void
// Get data
<!-- Define CFC -->
<!-- Button bar -->
<!-- Expand all rows in data grid -->
<mx:Button label="Expand All"
<!-- Collapse all rows in data grid -->
<mx:Button label="Collapse All"
<!-- The grid -->
<!-- Define grouping in dataProvider -->
<!-- Convert flat data to group -->
<!-- First group by customer -->
<!-- Calculate total per customer -->
<!-- Then group by orderid -->
<!-- Calculate total per orderid -->
<!-- The grid columns-->
<!-- Empty colume for tree -->
<!-- Query columns -->
headerText="Price" textAlign="right" />
<!-- Column for calculated totals -->
headerText="Total" textAlign="right" />
I am not going to explain the basics of invoking the CFC method via <mx:RemoteObject>, populating the GroupingCollection, and refreshing the <mx:AdvancedDataGrid>. That was covered in the previous post. Rather, let's look at what has changed.
First of all, to make it easier to expand and collapse the tree within the <mx:AdvancedDataGrid>, I added a <mx:ApplicationControlBar> containing two buttons, one to expand all rows and one to collapse all rows.
As before, <mx:GroupingField> is used to define the grouping levels. In the previous example a single level of grouping was used, here two are used (to group by customer, and then by order id within customer). In the previous example <mx:GroupingField> had no child tags, because simple grouping was used. Here, <mx:SummaryRow> has been added to each <mx:GroupingField> so as to summarize data by those groups. <mx:SummaryRow> can display summary data at the group level, as well as at the first or last member within the group, as specified by the "summaryPlacement" attribute. A <mx:SummaryRow> contains one or more fields to be summarized. Here a single <mx:SummaryField> is used for each <mx:SummaryRow> to "SUM" the total of that group, putting the result in a column named "Total". The "operation" attribute specifies the summary to be performed, and AVG, COUNT, MAX, MIN, and SUM are all built-in and ready for use. It is also possible to perform your own calculations, specifying an ActionScript function to be called instead of one of the built-in operations.
And as before, <mx:columns> is used to list the columns within the <mx:AdvancedDataGrid>. But here, two non-database columns have been added. An empty column has been inserted at the front of the list. This forces <mx:AdvancedDataGrid> to display the tree in its own column, rather than in the actual data column (and this technique can be used whether or not summary data is being displayed). In addition, a row named "Total" has been added to the end of the column list to display the summary totals. The <mx:SummaryField> tags point to the "Total" as the destination for calculated summary data. This is optional, the "Total" column could have been omitted (both from the <mx:columns> list and from the <mx:SummaryField> tags) in which case the summary values would have been displayed within the field being summarized (in this example the "PRICE" column).
As you can see, adding summary data to an <mx:AdvancedDataGrid> is not at all difficult once grouping has been implemented.
One last note, the example data used here is not ideal, as each customer has a single order, and only one order (for customer "White, Sue") has more than one item. You may want to add some data to the example tables to better demonstrate how summary data works. Or just use your own data.
2008 The Digital Media Dude Interview Posted
2008 DZone On Flex 3 / AIR Pre-Release Presentation
DZone has posted a write-up on my presentation in Raleigh last week. Thanks, guys!
2008 ColdFusion Positions In CA, NC, And MA
6 ColdFusion positions this week:
- Amcom (San Ramon Valley, CA) is looking for a senior ColdFusion developer. Requirements include 8+ years of software development experience, expert with ColdFusion 7, and familiarity with frameworks and design patterns. Flex familiarity preferred. Details posted online by Tariq Ahmed.
2008 Flex 3 / AIR Pre-Launch Tour Slide Deck Posted
2008 Raleigh Was Amazing, Next Up Is Nashville
I am in Memphis, waiting for my connecting flight to Nashville for tonight's Flex 3 / AIR Pre-release presentation.
Last night's presentation in Raleigh was incredible! Almost 120 attendees packed the room (many had to stand or sit on the floor), and the event run for close to 3 hours! A lively crowd, great questions and feedback, excitement and enthusiasm - the one was lots of fun.
There are still lots more presentations and lots more venues, so be sure to check the complete location list.
2008 Case Study: voeveo Using ColdFusion 8
A case-study on how voeveo is using ColdFusion 8 has been posted to the Adobe site. This one is worth a read.