By Rupert
Posts tagged modelglue
AppTemplate Released Beta
Feb 7th
This is my beta release of apptemplate which runs ColdFusion, ColdSpring and Reactor.
To configure:
1. rename all instances of apptemplate to your “myapplication” found in the ff files;
Application.cfm:2:<cfapplication name="apptemplate" sessionmanagement="true"> build.xml:2: <property name="source" value="E:\wwwroot\apptemplate"> build.xml:3: </property><property name="target" value="E:\wwwroot\apptemplate"> build.xml:12: token="apptemplate" build.xml:13: value="apptemplate" config/ModelGlue.xml:4: <controller name="SecurityController" type="apptemplate.controller.SecurityController"> config/ModelGlue.xml:10: </controller><controller name="UserController" type="apptemplate.controller.UserController"> config/ColdSpring.xml:12: <property name="viewMappings"><value>/apptemplate/views</value></property> config/ColdSpring.xml:13: <property name="generatedViewMapping"><value>/apptemplate/views/generated</value></property> config/ColdSpring.xml:27: <constructor -arg name="pathToConfigXml"><value>/apptemplate/config/Reactor.xml</value></constructor> config/ColdSpring.xml:28: <property name="project"><value>apptemplate</value></property> config/ColdSpring.xml:29: <property name="dsn"><value>apptemplate</value></property> config/ColdSpring.xml:31: <property name="mapping"><value>/apptemplate/model/data</value></property> config/ColdSpring.xml:48: <bean id="dataAccess" class="apptemplate.model.db.DataAccess" singleton="true"> config/ColdSpring.xml:53: <value>apptemplate</value> config/ColdSpring.xml:57: </bean><bean id="utility" class="apptemplate.model.ValidationUtility" singleton="true"></bean> config/ColdSpring.xml:62: <bean id="userGateway" class="apptemplate.model.db.UserGateway" singleton="true" autowire="byName"></bean> config/ColdSpring.xml:64: <bean id="userDAO" class="apptemplate.model.db.UserDAO" singleton="true" autowire="byName"></bean> config/ColdSpring.xml:66: <bean id="securityService" class="apptemplate.model.service.SecurityService" singleton="true"></bean> config/ColdSpring.xml:68: <bean id="userService" class="apptemplate.model.service.UserService" singleton="true"> controller/UserController.cfc:3: <cffunction name="init" returntype="apptemplate.controller.UserController" access="public" output="false"> controller/UserController.cfc:11: <cfargument name="userService" type="apptemplate.model.service.UserService" required="true"> controller/UserController.cfc:15: <cffunction name="getUserService" returntype="apptemplate.model.service.UserService" access="public" output="false"> controller/SecurityController.cfc:3: </cffunction><cffunction name="init" returntype="apptemplate.controller.SecurityController" access="public" output="false"> controller/SecurityController.cfc:11: <cfargument name="securityService" type="apptemplate.model.service.SecurityService" required="true"> controller/SecurityController.cfc:15: <cffunction name="getSecurityService" returntype="apptemplate.model.service.SecurityService" access="public" output="false"> controller/SecurityController.cfc:20: <cfargument name="userService" type="apptemplate.model.service.UserService" required="true"> controller/SecurityController.cfc:24: <cffunction name="getUserService" returntype="apptemplate.model.service.UserService" access="public" output="false"> model/service/SecurityService.cfc:3: </cffunction><cffunction name="init" returntype="apptemplate.model.service.SecurityService" access="public" output="false"> model/service/UserService.cfc:8: <cfargument name="userGateway" type="apptemplate.model.db.UserGateway" required="true"> model/service/UserService.cfc:12: <cffunction name="getUserGateway" access="public" returntype="apptemplate.model.db.UserGateway" output="false"> model/service/UserService.cfc:17: <cfargument name="userDAO" type="apptemplate.model.db.UserDAO" required="true"> model/service/UserService.cfc:21: <cffunction name="getUserDAO" access="public" returntype="apptemplate.model.db.UserDAO" output="false"> model/db/UserDAO.cfc:1:<cfcomponent name="UserDAO" displayname="UserDAO" extends="apptemplate.model.db.DataAccess" output="false"> model/db/UserGateway.cfc:1:</cfcomponent><cfcomponent name="UserGateway" displayname="UserGateway" extends="apptemplate.model.db.DataAccess" output="false"> </cfcomponent></cffunction></cfargument></cffunction></cfargument></cffunction></cfargument></cffunction></cfargument></cffunction></cfargument></cffunction></bean></controller></property></cfapplication>
2. Create the database w/c runs on MySQL 5 and is found on
apptemplate/
db/
3. If you want to reload all classes, append “init” on the URL string.
ColdSpring bean creation magic…
Feb 1st
Adam describes some fun and exciting changes in ModelGlue Unity. I can now ditch cflocation by using argument.event.forward(“location.cfm”).
Its just now that im loving ColdSpring, I think its much better to instantiate beans and set/create other objects using setters/getters through the property instead of constructor-arg. Here’s an example:
<cfcomponent displayname="UserService" output="false" hint="I am a UserService."> <cffunction name="init" access="Public" returntype="UserService" output="false" hint="I am a new UserService"> <cfreturn> </cfreturn> </cffunction><cffunction name="setUserGateway" returntype="void" access="public" output="false" hint="Dependency: UserService"> <cfargument name="userGateway" type="cfcodetrack.model.UserGateway" required="true"> <cfset variables.usergateway="arguments.userGateway"> </cfset> <cffunction name="getUserGateway" access="public" returntype="cfcodetrack.model.UserGateway" output="false"> <cfreturn> </cfreturn> </cffunction><cffunction name="authenticate" access="public" returntype="string" output="false"> <cfargument name="username" type="string" required="true"> </cfargument><cfargument name="password" type="string" required="true"> <cfdump var="#password#"> <cfabort> </cfabort> <cffunction name="getUsers" access="public" returntype="any" output="false"> <cfreturn> </cfreturn> </cffunction> </cfdump></cfargument></cffunction></cfargument></cffunction></cfcomponent>
In your ColdSpring.xml your beans should only look like this:
<bean id="dsn" class="cfcodetrack.model.dsn"> <constructor -arg name="dsn"> <value>cfcodetrack</value> </constructor> </bean> <bean id="reactorFactory" class="reactor.reactorFactory"> <constructor -arg name="configuration"> <ref bean="reactorConfiguration"> </ref> </constructor> <!-- Security Service --> </bean><bean id="securityService" class="cfcodetrack.model.SecurityService" singleton="true"></bean> <bean id="userGateway" class="cfcodetrack.model.UserGateway" singleton="true"> <property name="reactorFactory"> <ref bean="reactorFactory"> </ref> </property><property name="dsn"> <ref bean="dsn"> </ref> </property> </bean><bean id="userService" class="cfcodetrack.model.UserService" singleton="true"> <property name="userGateway"> <ref bean="userGateway"> </ref> </property> </bean>
ModelGlue Unity, ColdSpring, Reactor Install Guide
Jan 29th
ModelGlue Unity
1. If you are using ColdFusion6.1 then you need to download the updater from Macromedia. You could also download them from our servers…
ColdFusion updater 1 downloads:

cfmx_61update_linux.bin
Note: You would have metadata problems later on if you have 6.1 and no updater 1. However, if your on CFMX7 then no worries. Read my earlier post.
2. Downlaod modelglue unity from www.model-glue.com or http://www.model-glue.com/modelglue_2.0.161.zip
3. Unzip modelglue in your webroot.
4. Test your installation. I highly recommend you go through the ModelGlue2.0 Unity docs found in here, especially the “quickstart” section since it would get you up-to-speed with learning MVC concepts.

If you want to skip the learning curve then you can extract the translator.zip in your webroot and should see the ModelGlue 2.0 Unity up and running page.
5. Your old modelglue1.1 apps are reverse compatible like poiadmin or poidemo, so it should work. You could also test by using the modelglueapplicationtemplate found under the modelglue directory found here:

Load the modelglueapplicationtemplate in eclipse and change the parameters in build.xml, then execute it by ant. You should now have a new application.

6. If you have any problems, then here are some ModelGlue References:
Joe Rinehart Blog
docs.model-glue.com
Builder: Better coding with the Model-Glue:Unity ColdFusion application framework
ColdSpring
5. Download coldspring from:
stable release-Coldspring 1.0 Final Release
bleeding-edge (cvs)
6. Unzip Coldspring in your webroot.
7. You should have the ff directory structure for coldspring in your webroot.

If you decide to put the coldspring directory in a different directory, then you could create a coldfusion mapping in your coldfusion administrator.
8. ColdSpring Resources:
Dave Ross and Chris Scott.
As far as I want this post to be verbose as much as possible for the Chinese team, you could also checkout nodans blog regarding ModelGlue Unity and ColdSpring Tutorials.
Reactor
9. Create a mapping for reactor so that ModelGlue1.1 and 2.0 can coexist. Just make sure CF sees “E:\wwwroot\ModelGlue\Reactor\reactor” as “/Reactor”.
10. Here are some resources in reactor:
Doug Hughes Blog
Trac Site
Reactor Documentation
Reactor Mailing List
Reactor Mailing List Archives
11. I highly recommend going through the reactor livedocs be sure to read the quickstart as it gives you a general idea of how to use reactor in developing your applications.

Comments