2008 Seeking ColdFusion 8 Case Studies
ColdFusion Product Marketing Manager Kristen Schofield is looking for ColdFusion 8 customers with cool stories to tell for future 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:
2
3 <cffunction name="getOrders" access="remote" returntype="query">
4 <cfset var result="">
5
6 <cfquery datasource="cfartgallery" name="result">
7 SELECT orders.orderid,
8 artname, orderitems.price,
9 customerlastname || ', ' || customerfirstname AS customer
10 FROM orders, orderitems, art
11 WHERE orders.orderid=orderitems.orderid
12 AND orderitems.artid=art.artid
13 ORDER BY customer, orders.orderid
14 </cfquery>
15
16 <cfreturn result>
17 </cffunction>
18
19</cfcomponent>
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:
2<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
3 layout="vertical" width="100%" height="100%"
4 creationComplete="initApp()">
5
6 <mx:Script>
7 <![CDATA[
8 // Init
9
10 public function initApp():void
11 {
12 // Get data
13
14 svc.getOrders();
15 }
16 ]]>
17 </mx:Script>
18
19
20 <!-- Define CFC -->
21 <mx:RemoteObject id="svc"
22 destination="ColdFusion"
23 source="test.Art"
24 result="gc.refresh()" />
25
26 <!-- Button bar -->
27 <mx:ApplicationControlBar width="100%">
28 <!-- Expand all rows in data grid -->
29 <mx:Button label="Expand All"
30 click="adg.expandAll()" />
31 <!-- Collapse all rows in data grid -->
32 <mx:Button label="Collapse All"
33 click="adg.collapseAll()" />
34 </mx:ApplicationControlBar>
35
36 <!-- The grid -->
37 <mx:AdvancedDataGrid id="adg"
38 width="100%" height="100%">
39
40 <!-- Define grouping in dataProvider -->
41 <mx:dataProvider>
42 <!-- Convert flat data to group -->
43 <mx:GroupingCollection id="gc"
44 source="{svc.getOrders.lastResult}">
45 <mx:Grouping>
46 <!-- First group by customer -->
47 <mx:GroupingField name="CUSTOMER">
48 <!-- Calculate total per customer -->
49 <mx:SummaryRow summaryPlacement="group">
50 <mx:fields>
51 <mx:SummaryField dataField="PRICE"
52 operation="SUM"
53 label="Total"/>
54 </mx:fields>
55 </mx:SummaryRow>
56 </mx:GroupingField>
57 <!-- Then group by orderid -->
58 <mx:GroupingField name="ORDERID">
59 <!-- Calculate total per orderid -->
60 <mx:SummaryRow summaryPlacement="group">
61 <mx:fields>
62 <mx:SummaryField dataField="PRICE"
63 operation="SUM"
64 label="Total"/>
65 </mx:fields>
66 </mx:SummaryRow>
67 </mx:GroupingField>
68 </mx:Grouping>
69 </mx:GroupingCollection>
70 </mx:dataProvider>
71
72 <!-- The grid columns-->
73 <mx:columns>
74 <!-- Empty colume for tree -->
75 <mx:AdvancedDataGridColumn />
76 <!-- Query columns -->
77 <mx:AdvancedDataGridColumn dataField="CUSTOMER"
78 headerText="Customer" />
79 <mx:AdvancedDataGridColumn dataField="ORDERID"
80 headerText="Order"/>
81 <mx:AdvancedDataGridColumn dataField="ARTNAME"
82 headerText="Item" />
83 <mx:AdvancedDataGridColumn dataField="PRICE"
84 headerText="Price" textAlign="right" />
85 <!-- Column for calculated totals -->
86 <mx:AdvancedDataGridColumn dataField="Total"
87 headerText="Total" textAlign="right" />
88 </mx:columns>
89
90 </mx:AdvancedDataGrid>
91
92</mx:Application>
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
The Digital Media Dude (aka Marcelo Lewin) interviewed me for his Meet The Experts Podcast series. That interview is now online. Thanks, Marcelo!
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.
- Carolinas HealthCare System (Charlotte, NC) is looking for 4 ColdFusion developers for 4-6 month contracts, and the potential to convert to full-time positions. Requirements include 4+ years of experience with ColdFusion, proficiency with ColdFusion 6.1 or later, SQL Server experience, and strong JavaScript and CSS skills. Experience with Ajax, Flex, and Spry is a plus. Please contact one of the following agencies: Nathan Zientek at Ettain Group 704-731-8035, Michael Norton at Insight Global 704-357-3177, C.J. Comer at Pelican Technology Partners 704-543-1590, Paige Chappell at Quick Solutions 704-329-7277, Ryan West at Revolution Technologies 910-332-4126, Chris Seitz at Sherpa 704-374-0001, Jonathan Tucker at Tek Systems 704-357-4628.
- Vertex Pharmaceuticals (Cambridge, MA) is looking for a ColdFusion development. Requirements include a bachelors degree in computer science or a related field, 5+ years of ColdFusion experience, and strong JavaScript, CSS, AJAX and XML skills. Details posted online.
2008 Flex 3 / AIR Pre-Launch Tour Slide Deck Posted
Many of you have been asking for the slide deck we've been showing on the Flex 3 / AIR pre-launch tour. A PDF version is now online.
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.