Fusebox Scaffolding on SVN
OK, So I know you think I spent the summer enjoying myself and forgot all about Fusebox Scaffolding!
Actually spent a lot of it in my Girlfriends Bathroom where I fitted a new Bathroom Suite with help from a plumber. On top of that the expected flow of work did not slow down.
One customer who have been using CF5 for many years finally decided to upgrade to CF7 a week after CF8 was released. So we have been installing a bunch of CF7 instances and also getting out first CF8 customer going.
Enough of the excuses....
This week I finally got around to working out how to make the Scaffolding work with multiple sets of templates and moved the existing reactor templates to a subdirectory of the templates directory so that there can be any number of templates for different purposes or frameworks.
The current reactor templates have some serious limitations. Firstly they assume that every table has an integer primary key which is auto incrementing (Identity in SQL Server).
One of the problems in Reactor was that it requires that any generated (calculated) field use the name and data type of an exsiting field. So when I want to create a filed containing a record count for a table there has to be a suitable integer field to use as a dummy. I really wanted to have a way to deal with tables where the primary key was an arbitary field or a UUID but can see a way to do that 100% reliably with reactor. Maybe Transfer will do it better, I will wait to find out.
I have decided to leave the current reactor templates as they are for the time being and create some standalone templates as the next step. The new templates will not need any other framework.
I may also create a set for use with ColdSpring since that is what is needed for a new project I am about to begin.
If you want to try the latest version of the generator then download it from SVN on the fusebox site. I will put a box at the side here with the URL. There is a version in extensions directory on the fusebox 5.5 trunk but that may not always be up to date so the best one is the dev branch.
To make use of the scaffolding copy the scaffolder directory to your coldFusion root.
Currently you will have to add the following lines to the start your index.cfm file (later this will be part of fusebox 5.5):
// Instrospection Phase
// Create the MetaData object
oMetaData = CreateObject("component","scaffolder.scaffolder.metadata").init(datasource="FuseForum");
// Introspect the database
oMetaData.introspectDB();
// Code Generation Phase
// create a cftemplate object
cftemplate = CreateObject("component","scaffolder.scaffolder.cftemplate").init();
// Build the application
oMetaData.build(cftemplate=cftemplate,template="reactor");
</cfscript>
Run it.
It will create a directories for model, view, controller, udfs and subdirectorys named using the name of the datasource.
/myapplication/
/myapplication/controller/
/myapplication/controller/FuseForum/
/myapplication/model/
/myapplication/model/mFuseForum/
/myapplication/view/
/myapplication/view/vFuseForum/
/myapplication/view/vLayout/
/myapplication/udfs/
Good Luck!



There are no comments for this entry.
[Add Comment]