In the first part of Using Metro, I reviewed the Service and Gateway portion of the Metro security package. In this post, I'll describe the core Metro Decorator and Validator as well as the jQuery plugin I use for client side validation.
The latest version of Metro is now available on RIAForge. Here's the skinny on what has changed.
- Added an audit package
I've been using a Transfer AfterCreate and AfterUpdate observer to track changed to Transfer objects that I wish to track. Since this has become a common part of some of the apps I'm building, I decided to include it in Metro. - Updated the core Service and Gateway to add getByProperty() support
I ran into a use case for this on a new project and decided to add it to simplify things. - Fixed a bug in core Decorator related to validation rule creation
This update fixes a problem created when no min and max arguments are passed to addRule(). - Updated the security package to add "Active" attribute to User
Another use case addition. In order to provide a little more security to user registration, I added and Active flag to the User object.
Using Metro - Creating Concrete Services and Gateways
Metro , Transfer , ColdFusion , ColdSpring 1 Comment »In my brief introduction to Metro, I provided some cursory configuration details. Today, I'll describe portions of the included sample security package to demonstrate how to integrate Metro and leverage the simple User, Role, Permission model. Since Metro is designed specifically for use with Transfer ORM, we'll need to set up a database, dsn and configure Transfer and ColdSpring for this demo.
<cfset var obj = get(arguments.objectName,arguments.input[arguments.objectName&"Id"])>
Is now this:
<cfset var pkName = getGateway(arguments.objectName).getPrimaryKey()>
<cfset var obj = get(arguments.objectName,arguments.input[pkName])>
And the core Gateway has this new method.
<cffunction name="getPrimaryKey" access="public" output="false" returntype="string">
<cfreturn getTransfer().getTransferMetadata(getClassName()).getPrimaryKey().getName()>
</cffunction>
These are small but important changes to the Metro library.
Introducing Metro - A Transfer ORM Service Factory and More...
Transfer , Ideas , ColdFusion , ColdSpring 3 Comments »Using the Eclipse MXUnit Plugin with Apache Virtual Hosts Revisited
MXUnit , cfeclipse , Apache No Comments »In a previous post on the topic of using the MXUnit eclipse plugin with virtual hosts, I described how I setup my eclipse project and Apache virtual host for testing. Although that setup worked, I would get periodic errors that necessitated disabling and re-enabling the MXUnit plugin. Until recently, I was still running eclipse 3.2, so when I got the opportunity to configure a new machine from the ground up, I decided to go with a fresh install of the latest eclipse (3.4) and essential plugins, CFEclipse (1.3.1.6), Subclipse (1.4.5) and MXUnit (1.0.7).
Recent Comments