3 Jun 2009 1:16 PM #1
ExtDirectCF: A Managed ColdFusion Server-side stack with security
ExtDirectCF: A Managed ColdFusion Server-side stack with security
This is a new, heavily modified fork of aconran's DirectCFM (http://extjs.com/forum/showthread.php?t=67983) that I am calling ExtDirectCF.
Link to original details about this project and it's evolution:
Register exposed cfcs as in a stateful bean in application scope.
Fine grain which cfcs and methods to register.
Limit method registration to specific access scopes (remote, public, package, private).
Preserve ColdFusion Role based access enforcement.
Better error handling and reporting similar to java Exceptions.
Re-written in efficient cfscript.
Full scoping of access permission and variables.
Managment Console style application to manage registered cfcs.
Saving and loading of Registry.
Finish mass recursive directory scan
Un-Registering individual methods from registered components via Management Console
* Added new Editable Paging Grid example (with Ext.ux.RowEditor) that drives
off a query object loaded into it's cfc's stateful bean in application scope.
Demonstrates a full CRUD api implentation. (thanks Ben Nadel for the info on
deleting rows from a query object)
* Added an index.cfm page in the ExtDirect directory with links to:
- ExtDirectCF Management Console
- the API.cfm page for debugging
- a link to force the framework to refresh
- a new readme file and release notes(taken from the forum)
- a link to the forum itself
- and a link to the above mentioned paging grid example.
* Added support for the Ext.Direct 1.0.1 spec.
* Fixed paths to extjs in console.cfm and example.cfm (you will still need to modify these for your own environment)
* Fixed dialogue size issue for add button in IE
* Fixed nasty bug killing directFn. directFn now works. See example.cfm.
* Added ability to load and save the Registry to disk.
* Init() attempts to load Registry from disk. New arguments for Init() to specify path and file for saving Registry.
* Added onApplicationEnd() to application.cfc to ensure Registry is backed up to disk when application scope expires.
* ExtDirect.cfc Self Registers.
* Added support for 'Stateful Namespaces'. Example: You have a stateful cfc loaded into application or server scope. If you try to invoke it from previous versions, you'll have a new instance of that cfc. Now, you can tell it to use the existing stateful cfc instance. Components.Ext.ExtDirect has a 'Stateful Namespace' of 'application.ExtDirect'
* Some major internal registry structure changes.
* Added Management Console (console.cfm) for managing registered components. It does not yet have the ability to unregister individual methods, but it will register and unregister full components.
* Moved the Component Registry into a private member to prevent abuse (accessible via getExtDirectRegistry()).
* Moved generateAPI() into the private scope and replaced with getAPIScript() in the public scope.
* The script API is now cached internally to the bean's private scope (accessed via getAPIScript()) and is updated whenever a component/method is added or removed. This eliminates json reserializing every time the api is loaded into a page, thus saving cpu cycles.
* Init() method now takes ns and desc as arguments to store internally and be used when generating the API script.
* Added unRegisterComponent() and unregisterMethod to remove entries from the registry. These will be useful for the Management Console.
* ExtDirect.cfc now registers itself upon initialization. This is to support the upcomming Management Console.
* Fixed bug for cffunctions that do not use the 'access' attribute (shame on you! you really should be using it!) and defaults to 'public' scope
* API.cfm changed to reflect new call to get API script
* Fixed bug in Example.cfm
* Expanded Example.cfm to better show off features and usage.
* Initial Release
p.s. If the zip file is giving anyone problems, let me know. Try to download with firefox or chrome. IE seems to corrupt it somehow.
Last edited by jimmifett; 14 Oct 2009 at 8:28 AM. Reason: Feature Update
4 Jun 2009 2:26 AM #2
It all sounds great! I've downloaded everything, and look forward to taking 'er for a test drive
4 Jun 2009 6:47 AM #3
fixed some bugs.
made the example a bit clearer.
added more support for the upcoming management console.
made the stack self-registering.
moved some stuff into private member access.
see above for full details.
5 Jun 2009 12:24 PM #4
Fixed a few bugs, esp a nasty bug breaking directFn.
Added Management Console
see above for more details
5 Jun 2009 12:56 PM #5
The way i'm invoking stateful cfc's (line 158 of ExtDirect.cfc) is pretty ugly, using an evaulate(), but it works. I try to avoid evaluate() like plague infested zombies.
Does anyone have a better way of doing this?
//StatefulNamespace = 'application.ExtDirect', specified
// in the cfcomponent tag's attributes and loaded into the registry
//Arguments.Component is the name of the component with it's dot
// path and used as the struct key for variables.extDirectComponentRegistry.
// Example: Componets.Ext.ExtDirect
//Arguments.Method is the method to call
// Example: saveRegistry
//argv is a name/value parameter struct. With the above examples,
// it's simply an empty StructNew()
MyStruct.OperationResult = Evaluate("#variables.extDirectComponentRegistry[Arguments.Component]['StatefulNamespace']#.#Arguments.Method#(argumentcollection = argv)");
5 Jun 2009 1:36 PM #6
Have you tried something like...
MyStruct.OperationResult = VARIABLES.extDirectComponentRegistry[ARGUMENTS.Component]['StatefulNamespace'][ARGUMENTS.Method](argumentCollection:argv);
5 Jun 2009 2:23 PM #7
That doesn't work for me since the StatefulNamespace is the actual location in memory for the already instantiated component.
So, the component is registered as 'Components.Ext.ExtDirect', but the StatefulNamespace 'application.ExtDirect' says that it's already loaded into the application scope under application.ExtDirect.
application.ExtDirect = CreateObject("Component", "Components.Ext.ExtDirect").Init()
This could also be used when you load stateful cfcs into the server scope:
server.mycfc = CreateObject("Component", "mycfc").Init()
8 Jun 2009 6:27 AM #8
Ok, looks like what I want to attempt with function references to replace the evaluate may not work. Oh well, at least evaluate is better than nothing.
Anywho, some screenshots of the Management Console:
8 Jun 2009 1:23 PM #9
Management Console looks neat; great work!Aaron Conran
Sencha Architect Development Team
14 Aug 2009 5:48 AM #10
This looks very interesting.
I've tried putting ExtDirectCF in a subdir of the webroot but then all hell breaks loose.
Is that not an option or am I missing something?