ActionScript

aerial-logo

Introducing Aerial CMS

Well, I finally let my irritation get to me… I’ve been developing Flash, Flex & AIR applications for two years now – most of them pulling data through AMFPHP from a PHP-based back-end. In those two years, I’ve tried nearly all the suggested solutions for managing content on the back-end and pulling it through to the front-end; Drupal, MODx, WordPress, Symfony. They are all fantastic PHP-based frameworks and systems, but they don’t allow me to develop applications the way I want to. So, as a consequence of this combination of irritation, frustration, egotism and flat-out boredom with writing the same code, over and over, for each project, I’ve decided to build a CMS – Aerial CMS.

aerial-logo

What is Aerial CMS?

Aerial CMS (named Aerial because it was the first word i could think of with “RIA” in it) is a simple content management framework. I decided to rethink the concept of a content management system, because – the way I see it – CMSs these days are about content management AND content presentation. I think that these two massive areas of development & design need to stay very far away from each other. They are like brother and sister to us now, but sometimes – when stuck in a room together for so long – they breed and the results are disastrous (on top of being scandalous!).

Design Philosophy

Look at how the MVC (Model View Controller) pattern came about: software engineers found that separating application logic from presentation from data has serious design benefits. Now, i’m not attempting to bad-mouth all the incredible efforts of the CMS developers… I’m saying that for Rich Internet Application development, it really becomes a chore to use systems like Drupal or Symfony because they were not meant to be used in that way. They do what they do superbly well, but for RIAs they fail to impress me.

Aerial CMS has been built from the first line of code for optimized Rich Internet Application development. It focuses only on content management and development tooling, and wants nothing to do with how you present the data. It’s certainly a change from the standard model, and i’m convinced about how I want to develop my RIAs, but that’s why i’ve put out this early release – to see if you all agree with me. This CMS still has a very, very long way to go; it works well for most situations but the tools haven’t been developed yet.

Technology

Aerial has been built on two very well established and loved open-source frameworks, namely AMFPHP 1.9 and Doctrine 1.2.1. The Aerial framework is built for compatibility with PHP 5 only. Aerial enforces no rules upon you when you get down to developing your back-end code, but it does stick to Doctrine’s method of generating database tables and models. In essence, once you’ve set up your database schema, you can do whatever you like :) you can plug into Doctrine’s API or you can write your own code; it really gives you the freedom to code the way you’re comfortable with.

Tutorials and Videos

I’ve made a Getting Started video to get you familiar with the framework and i’ll be writing a series of tutorialsĀ in the Wiki section of theĀ Google Code page for Aerial CMS. I’ve also got plans for a couple more video tutorials, so keep checking the site for updates or follow me on Twitter (@dannykopping).

Comments, Suggestions, et al

I’d love to hear what you have to say (as long as it’s in English – being monolingual sucks)! I’m very open to suggestions, any offers to help contribute would be welcomed and all constructive criticism is encouraged!

A tip on using the Image component in Flex

At some time in the future – if you’re using the <mx:Image> component in Flex – you will need to listen for an event that will signal the load completion of an image’s source. The Event.COMPLETE function doesn’t work, so you’ll have to use the FlexEvent.UPDATE_COMPLETE function. This will do exactly the same thing as using the Loader class, and using the following code: loader.contentLoaderInfo.addEventListener(Event.COMPLETE…).

SHA-1… broken?

For many web developers – particularly those interested in security of data – the SHA1 hashing algorithm is a very neat and seemingly secure method of storing one’s passwords, etc. Although i do not claim to know that much about cryptography, the subject has always interested me. When reading my news feeds this morning, i saw that a new version of the as3corelib was released.

I then proceeded to scan the new featues, one of which is an HMAC implementation. This got me curious, since HMAC – as far as i understand it – works on top of SHA-1 or MD5 for example, and doesn’t bother with collisions. This also got me curious as to the progress of the cracking of the SHA-1 algorithm. So i googled it, and found this: http://www.schneier.com/blog/archives/2005/02/sha1_broken.html. Very scary stuff indeed. Then i looked at the date: February 2005 :| ! Does anybody know the current state of the algorithm? Should we all start moving onto HMAC and SHA-256?

Acedia – apathy and laziness in the practice of virtue

I am an admittedly lazy programmer and therefore, i hate doing manual “labour” with regards to coding. A perfect example of manual labour in coding is writing APIs. The toString() function kills me! I like to write my own toString() functions for enhanced debugging, but i couldn’t take it anymore. I’m working on a project in which the one class has 10 public properties and i refused to write a function that would put all 10 in a pretty, indented, explanatory format. So i began digging in the AS3 API and found this beauty…

describeType(value:Object):XML

In AS3, the for..in loop does not enumerate properties and functions declared by a class (thanks to Emmy Huang). What this means is that you cannot create a toString() function like this – which is what i’d hoped to do.

Instead, what you have to do is use the describeType function in your for..in loop instead of using this. However, the describeType function returns an XML layout of your class, so – for example – to enumerate all variables in the XML returned from this function, simply do this:

// enumerate variables in its own class
var variables:XMLList = describeType(this)..variable;

// enumerate variables from outside its class.
var variables:XMLList = describeType(getDefinitionByName(“MyClass”))..variable;

Then, with the variables XMLList, you can loop for all variables in your class, do whatever you like with them, and know deep in your heart that you’re such a lazy fucker :D

Community efforts

I’m a very investigative programmer in that i’m always looking for packages that will make my life easier, my application more vibrant or more exciting, or my ideas come alive. Below is a list of incredible packages developed by the community and are free for usage (but be sure to check the licences individually for any fine print).

RSS/Atom

as3syndicationlib – an excellent package for reading all RSS/Atom specifications, or using the generic parser.

Tweening

TweenLite, TweenFilterLite, TweenMax (not MaxTween, Neil :P ) – amazing trio!

Caurina’s Tweener – probably the simplest Tweening engine i’ve come across

gTween – looks promising, haven’t tried it yet, though.

3D

Sandy3D – by far, the best documented and well-designed 3D engine i’ve come across.

Papervision – apparently the 3D package, but there are very few tutorials. If anybody knows of some, let me know.

Alternativa – built by a bunch of crazy Russian coders… Ridiculously impressive, difficult to use.

Utilities

as3corelib – A collection of handy utilities for encryption (SHA1, MD5), encoding (JPG, PNG), and a myriad of other useful bells and whistles.

Cryptology

as3crypto – An incredible package for encrypting and decrypting your data using everything from MD2, LZW and RSA.

Database Interaction

asSQL – A package for connecting to a MySQL database directly from ActionScript 3.0!

Frameworks

PureMVC – my personal favourite… Brilliant framework!

Cairngorm – a good (albeit difficult and clunky) framework developed by Adobe

Mate – a tag-based framework… Looks good, haven’t tried it yet

Components

flexlib – great collection of components for usage in Flex

Site-related APIs

Facebook

Amazon

Yahoo!

Google

Physics

APE

Remoting/Webservices

as3httpclientlib

amfphp – the godsend.

WebOrb – fantastic effort by themidnightcoders… ports for many languages

External Resources

bulk-loader

Metadata

metaphile – a package for reading and writing metadata of common filetypes

Hope this is useful!

—–
Danny