<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.evenamonkey.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>even a monkey - reactor</title>
 <link>http://www.evenamonkey.com/taxonomy/term/27/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>MG:Unity - Calling your own custom reactor gateway methods using a Generic list</title>
 <link>http://www.evenamonkey.com/mg_unity_calling_your_own_custom_reactor_gateway_methods_using_a_generic_list--2007--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;Are you guys using the ModelGlue generic list? A basic generic list (using reactor as the orm) calls the getByFields() method in the reactor gateway for the object you specify.&lt;/p&gt;
&lt;p&gt;for example, if you broadcast this message in your eventhandler:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;message name=&amp;quot;modelglue.genericList&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;object&amp;quot; value=&amp;quot;user&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;criteria&amp;quot; value=&amp;quot;userID&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/message&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h4&gt;Would call getByFields(UserID={userIDValueInTheViewState})&lt;/h4&gt;
&lt;p&gt; and stuff the results into the viewstate.&lt;br /&gt;
&lt;br&gt;&lt;br&gt;&lt;br /&gt;
Well, If you need complex query results (joins etc), you can specify the gateway method to call and modelglue will pass on the criteria as arguments to your custom method.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;message name=&amp;quot;modelglue.genericList&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;object&amp;quot; value=&amp;quot;user&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;criteria&amp;quot; value=&amp;quot;userID&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;gatewayMethod&amp;quot; value=&amp;quot;getUserInfo&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/message&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Then ModelGlue will take the results and stuff them into the viewstate just like any other generic list.&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;br&gt;&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/mg_unity_calling_your_own_custom_reactor_gateway_methods_using_a_generic_list--2007--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/generic_database_messages">generic database messages</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/modelglue">modelglue</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Wed, 09 May 2007 09:32:27 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">49 at http://www.evenamonkey.com</guid>
</item>
<item>
 <title>Reactor.xml: Understanding the difference between &#039;relate&#039; and &#039;link&#039;</title>
 <link>http://www.evenamonkey.com/reactor_xml_understanding_the_difference_between_relate_and_link--2007--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;One of my favorite features of reactor (besides everything) is the ability to set up hasOne and HasMany relationships in your reactor.xml file and then be able to use iterators and get other related records and data from the record you are working with. setting up these relationship seems to be an area of confusion for people as they get started with reactor.&lt;/p&gt;
&lt;h3&gt;Relationships:&lt;/h3&gt;
&lt;p&gt;There are two basic relationship types: &lt;strong&gt;hasOne&lt;/strong&gt; and &lt;strong&gt;HasMany&lt;/strong&gt; to decide from. this should be an easy task if you already have a basic plan for the app. It may help if you imagine yourself as the object...I am a user object and I &#039;have many&#039; roles or I am a user and I &#039;have one&#039; address.&lt;/p&gt;
&lt;h3&gt;Relationship Types:&lt;/h3&gt;
&lt;p&gt;Inside the hasOne or hasMany tag, you can define the relationship type.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;There are two basic types of reactor.xml relationship types, Reactor syntax calls these &#039;relate&#039; and &#039;link&#039;&lt;/em&gt;&lt;br /&gt;
 This is HOW the objects are related. Either a direct relationship(relate) or through a linking table (link) &lt;/p&gt;
&lt;h3&gt;relate&lt;/h3&gt;
&lt;p&gt;This is when the Primary key(PK) of one table is used as a foreign key in a second table. This is the one to use if you are only involving 2 tables -with no linking table in the middle. In the below example the &#039;UserID&#039; PK in the User table is a foreign key in the Reports table. In this instance the user &#039;Has Many&#039; Reports using a relate tag:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt; &amp;lt;object name=&amp;quot;User&amp;quot; &amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;hasMany name=&amp;quot;Report&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;relate from=&amp;quot;UserID&amp;quot; to=&amp;quot;UserID&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/hasMany&amp;gt;&lt;br /&gt; &amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;this is the easiet to set up in reactor as you just need only define the two objects with a &lt;relate&gt; tag within the hasOne or hasMany&lt;/p&gt;
&lt;h3&gt;link&lt;/h3&gt;
&lt;p&gt;the &#039;link&#039; syntax is for when you have a table in the middle like in the case of a user table, a role table and a table that links userID&#039;s to RoleID&#039;s (UserRole table) This requires three reactor object definitions. in this example: User, Role and UserRole&lt;br /&gt;
the user and role both &#039;have many&#039; of each other:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;object name=&amp;quot;User&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;hasMany name=&amp;quot;Role&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;link name=&amp;quot;UserRole&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/hasMany&amp;gt;&lt;br /&gt; &amp;lt;/object&amp;gt;&lt;br /&gt; &amp;lt;object name=&amp;quot;Role&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;hasMany name=&amp;quot;User&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;link name=&amp;quot;UserRole&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/hasMany&amp;gt;&lt;br /&gt; &amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;The linking table (UserRole) has 2 hasOne definitions, relating back to the 2 PK&#039;s&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt; &amp;lt;object name=&amp;quot;UserRole&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;hasOne name=&amp;quot;User&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;relate from=&amp;quot;UserID&amp;quot; to=&amp;quot;UserID&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/hasOne&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;hasOne name=&amp;quot;Role&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;relate from=&amp;quot;RoleID&amp;quot; to=&amp;quot;RoleID&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/hasOne&amp;gt;&lt;br /&gt; &amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/reactor_xml_understanding_the_difference_between_relate_and_link--2007--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Thu, 22 Mar 2007 10:29:37 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">48 at http://www.evenamonkey.com</guid>
</item>
<item>
 <title>Reactor Tip: Super.validate()</title>
 <link>http://www.evenamonkey.com/reactor_tip_super_validate--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;Using super.validate to add custom validation to reactor:&lt;/p&gt;
&lt;p&gt;If you have been copying the entire validate method from the reactor/project/XXX/validator to your extended object to overload the validate method and add extended custom validation, there is a much cleaner and more elegant way to do this. But first, lets cover some reactor validation basics:&lt;/p&gt;
&lt;h2&gt;Basic Reactor Validation information&lt;/h2&gt;
&lt;p&gt;Reactor generates basic validation methods based on database metadata. These validations are held in the base validator objects inside the reactor/project folder.&lt;br /&gt;
Reactor provides 2 cfc&#039;s that extend the base objects, located in the validator subfolder in your &quot;mapping&quot; directory path(set in your reactor configuration). There is one nonDB specific CFC which is also extended by a DB specific one (with the dbtype appended to the filename). Unless you are doing some database specific stuff on your validations You can use the nonDB specific CFC.  &lt;/p&gt;
&lt;h2&gt;Extending Validation&lt;/h2&gt;
&lt;p&gt;To add extended validation you will need to write a custom function in one of the extended validator CFC&#039;s.&lt;/p&gt;
&lt;p&gt;In my example below, we will add validation to check to see if one property of a populated record object is a valid choice based on another property. Here is my validation function&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;CFFUNCTION name=&amp;quot;validateSkyIsBlue&amp;quot; access=&amp;quot;public&amp;quot;&amp;nbsp; output=&amp;quot;false&amp;quot; returntype=&amp;quot;reactor.util.ErrorCollection&amp;quot;&amp;gt;&lt;br /&gt;	&amp;lt;CFARGUMENT name=&amp;quot;weatherRecord&amp;quot; hint=&amp;quot;I am the Record to validate.&amp;quot; required=&amp;quot;no&amp;quot; type=&amp;quot;reactor.project.MemberManager.Record.weatherRecord&amp;quot; /&amp;gt;&lt;br /&gt;	&amp;lt;CFARGUMENT name=&amp;quot;ErrorCollection&amp;quot; hint=&amp;quot;I am the error collection to populate. If not provided a new collection is created.&amp;quot; required=&amp;quot;no&amp;quot; type=&amp;quot;reactor.util.ErrorCollection&amp;quot; default=&amp;quot;#createErrorCollection(arguments.weatherRecord._getDictionary())#&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;!--Blue is only allowed as a selection for Sky for people&amp;nbsp; whose weathercode = 5--&amp;gt;&lt;br /&gt;	&amp;lt;CFIF&amp;nbsp; arguments.weatherRecord.getsky() is &amp;quot;Blue&amp;quot; and arguments.weatherRecord.getweathercode() neq 5 &amp;gt;&lt;br /&gt;			&amp;lt;CFSET arguments.ErrorCollection.addError(&amp;quot;weather.sky.noBlueAllowed&amp;quot;) /&amp;gt;	&amp;lt;/CFIF&amp;gt;&lt;br /&gt;	&amp;lt;CFRETURN arguments.ErrorCollection /&amp;gt;&lt;br /&gt;&amp;lt;/CFFUNCTION&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;(in my dictionary xml files, i added a definition for weather.sky.noBlueAllowed)&lt;/p&gt;
&lt;p&gt;To call this method, we need  to overload the validate() method to include this validation as well as the reactor generated validation methods. There are two ways to accomplish this, you can copy the entire contents of the validate method from the base object (which I &lt;i&gt;reluctantly&lt;/i&gt; admit I was doing until a few weeks ago), Or you can use the &quot;super&quot; keyword to call the base validate method. You will need to pass in the record and the error collection. Here is my validate method as it exists in the extended object:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;	&amp;lt;CFFUNCTION name=&amp;quot;validate&amp;quot; access=&amp;quot;public&amp;quot; hint=&amp;quot;I validate an&amp;nbsp; record&amp;quot; output=&amp;quot;false&amp;quot; returntype=&amp;quot;reactor.util.ErrorCollection&amp;quot;&amp;gt;&lt;br /&gt;		&amp;lt;CFARGUMENT name=&amp;quot;weatherRecord&amp;quot; hint=&amp;quot;I am the Record to validate.&amp;quot; required=&amp;quot;no&amp;quot; type=&amp;quot;reactor.project.WeatherManager.Record.weatherRecord&amp;quot; /&amp;gt;&lt;br /&gt;		&amp;lt;CFARGUMENT name=&amp;quot;ErrorCollection&amp;quot; hint=&amp;quot;I am the error collection to populate. If not provided a new collection is created.&amp;quot; required=&amp;quot;no&amp;quot; type=&amp;quot;reactor.util.ErrorCollection&amp;quot; default=&amp;quot;#createErrorCollection(arguments.weatherRecord._getDictionary())#&amp;quot; /&amp;gt;&lt;br /&gt;			&amp;lt;CFSET validateSkyIsBlue(arguments.weatherRecord, arguments.ErrorCollection) /&amp;gt;&lt;br /&gt;			&amp;lt;CFSET super.validate(arguments.weatherRecord, arguments.ErrorCollection) /&amp;gt;&lt;br /&gt;		&amp;lt;CFRETURN arguments.ErrorCollection /&amp;gt;&lt;br /&gt;	&amp;lt;/CFFUNCTION&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;One error collection is returned containg any or all validation errors.&lt;br /&gt;
The benefit of doing this as opposed to copying the validate method from the base object is that now you need to make no change to catch validation for new and modified fields in the database.&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/reactor_tip_super_validate--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Mon, 21 Aug 2006 09:36:18 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">44 at http://www.evenamonkey.com</guid>
</item>
<item>
 <title>Thanks Tom! - Reactor nightly builds</title>
 <link>http://www.evenamonkey.com/thanks_tom_reactor_nightly_builds--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;If you are not on the reactor list you may have missed this:&lt;/p&gt;
&lt;h2&gt;Bleeding Edgers rejoice!&lt;/h2&gt;
&lt;p&gt;Tom Chiverton is providing nightly builds of reactor for those of you who cannot access the reactor subversion repository through WebDEV.&lt;/p&gt;
&lt;p&gt;The builds can be found at&lt;br /&gt;
&lt;a href=&quot;http://www.falkensweb.com/reactor.html&quot;&gt;http://www.falkensweb.com/reactor.html&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Thanks Tom!&lt;/h4&gt;
&lt;p&gt;and everyone else who makes the reactor list such a great resource.&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/thanks_tom_reactor_nightly_builds--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Fri, 18 Aug 2006 15:05:50 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">43 at http://www.evenamonkey.com</guid>
</item>
<item>
 <title>Reactor mixed case gotcha</title>
 <link>http://www.evenamonkey.com/reactor_mixed_case_gotcha--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;It has come up on the Reactor mailing list that since the Coldfusion XML functions are all case specific,&lt;br /&gt;
extra care has to be taken to be sure the db fields and the reacor.xml &lt;code&gt;&amp;lt;object&amp;gt;&lt;/code&gt; definitions and subtags all match in case. &lt;/p&gt;
&lt;p&gt; Care must also be taken when throwing custom validation messages.&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;		&amp;lt;CFSET arguments.ErrorCollection.addError(&amp;quot;emailAddress.emailAddress.NoAtSign&amp;quot;) /&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h3&gt;Is different from: &lt;/h3&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;		&amp;lt;CFSET arguments.ErrorCollection.addError(&amp;quot;EmailAddress.emailAddress.NoAtSign&amp;quot;) /&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
Which ever variation does not exactly match the dictionary.xml file for that object will throw an exception:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;Message&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  An error occured while Transforming an XML document.&lt;br /&gt;Detail&amp;nbsp; Empty expression!&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;So after painstakingly making sure all the DB fields (dev and production) matched the object tags, that matched the validation error definitions, that matched the case in the dictionary.xml files, I mysteriously received the error again. But this time it worked in one place in the app, and not in another, both using almost identical code. The only difference was what the reactorfactory was passed as the object name.&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;Reactor.createRecord(&amp;quot;emailAddress&amp;quot;) /&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h3&gt;is not the same as:&lt;/h3&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;Reactor.createRecord(&amp;quot;EmailAddress&amp;quot;) /&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;I currenly develop mainly in coldfusion/IIS, but these three mixed case gotchas have really gotten me thinking about becoming more aware of case no matter what I am coding. Maybe I can make make case consistancy second nature before I switch languages/platforms and really need it. &lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/reactor_mixed_case_gotcha--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Mon, 24 Jul 2006 14:11:58 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">41 at http://www.evenamonkey.com</guid>
</item>
<item>
 <title>Reactor - Using the field tag to to alias duplicate columns</title>
 <link>http://www.evenamonkey.com/reactor_using_the_field_tag_to_to_alias_duplicate_columns--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;It is mentioned in the &lt;a href=&quot;livedocs.reactorframework.com&quot;&gt;Reactor docs &lt;/a&gt; that the &lt;code&gt;&amp;lt;field&amp;gt;&lt;/code&gt;  tag can be used within your object definitions to pretty up ugly column names such as txt_lastname or strCity, but it should also be noted it can be used to diferentiate between two tables which both have fields with the same name.&lt;/p&gt;
&lt;h3&gt;for example, if all my tables have a modified date timestamp&lt;/h3&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;object name=&amp;quot;User&amp;quot;&amp;gt;&lt;br /&gt;	&amp;lt;field name=&amp;quot;ModifiedDate&amp;quot; alias=&amp;quot;UserModifiedDate&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;hasMany name=&amp;quot;Task&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;relate from=&amp;quot;Taskid&amp;quot; to=&amp;quot;Taskid&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/hasMany&amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;br /&gt;&amp;lt;object name=&amp;quot;Task&amp;quot;&amp;gt;&lt;br /&gt;	&amp;lt;field name=&amp;quot;ModifiedDate&amp;quot; alias=&amp;quot;TaskModifiedDate&amp;quot; /&amp;gt;&lt;br /&gt;	&amp;lt;hasOne name=&amp;quot;User&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;relate from=&amp;quot;UserId&amp;quot; to=&amp;quot;UserId&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/hasOne&amp;gt;&lt;br /&gt;&amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Then, when I am doing a join later, I can reference the modified dates correctly.&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/reactor_using_the_field_tag_to_to_alias_duplicate_columns--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Wed, 19 Jul 2006 11:55:07 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">40 at http://www.evenamonkey.com</guid>
</item>
<item>
 <title>Perfect Unity between Model-glue 1 and    2</title>
 <link>http://www.evenamonkey.com/perfect_unity_between_model_glue_1_and_2--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;I have been working on a gigantic Modelglue 2 app at my day job. to aid in information exchange we had been using &lt;a href=&quot;http://ray.camdenfamily.com/projects/canvas&quot;&gt;canvas wiki&lt;/a&gt; (thanks &lt;a href=&quot;http://ray.camdenfamily.com/&quot;&gt;Ray!&lt;/a&gt; ). We have been using MG2 since its infancy (original semi-public beta in April). &lt;/p&gt;
&lt;p&gt;everything has been working better that expected, however, a few SVN updates ago the wiki stopped working with a Bean creation error. Apparently this is due to the reactor config path.&lt;/p&gt;
&lt;p&gt;Since our root site is a Unity app, the reactor bean in the coldspring config looks like this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;constructor-arg name=&amp;quot;pathToConfigXml&amp;quot;&amp;gt;&amp;lt;value&amp;gt;/config/Reactor.xml&amp;lt;/value&amp;gt;&amp;lt;/constructor-arg&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;When you try to launch the nested app, it doesnt like the path and gives this error:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt; Bean creation exception during init() of ModelGlue.unity.eventhandler.EventHandlerFactory&lt;br /&gt;Bean creation exception during init() of ModelGlue.unity.orm.ReactorAdapter&lt;br /&gt;The error occurred in C:\Inetpub\wwwroot\WebFiles\coldspring\beans\DefaultXmlBeanFactory.cfc: line 539&lt;br /&gt;Called from C:\Inetpub\wwwroot\WebFiles\coldspring\beans\DefaultXmlBeanFactory.cfc: line 332&lt;br /&gt;Called from C:\Inetpub\wwwroot\WebFiles\ModelGlue\unity\loader\XmlConfigurationLoader.cfc: line 16&lt;br /&gt;Called from C:\Inetpub\wwwroot\WebFiles\ModelGlue\unity\loader\XmlConfigurationLoader.cfc: line 319&lt;br /&gt;Called from C:\Inetpub\wwwroot\WebFiles\ModelGlue\unity\loader\XmlConfigurationLoader.cfc: line 49&lt;br /&gt;Called from C:\Inetpub\wwwroot\WebFiles\ModelGlue\unity\loader\FrameworkLoader.cfc: line 63&lt;br /&gt;Called from C:\Inetpub\wwwroot\WebFiles\ModelGlue\unity\ModelGlue.cfm: line 48&lt;br /&gt;Called from C:\Inetpub\wwwroot\WebFiles\ModelGlue\ModelGlue.cfm: line 1&lt;br /&gt;Called from C:\Sandboxes\Sandbox2\wiki\index.cfm: line 25&lt;br /&gt;537 : 								&amp;lt;cfthrow type=&amp;quot;coldspring.beanCreationException&amp;quot;&lt;br /&gt;538 : 									message=&amp;quot;Bean creation exception during init() of #beanDef.getBeanClass()#&amp;quot;&lt;br /&gt;539 : 									detail=&amp;quot;#cfcatch.message#&amp;quot;&amp;gt;&lt;br /&gt;540 : 							&amp;lt;/cfcatch&amp;gt;&lt;br /&gt;541 : 						&amp;lt;/cftry&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;h2&gt;How I fixed It&lt;/h2&gt;
&lt;p&gt;I simply copied the coldspring.xml and reactor.xml to:&lt;br /&gt;
 webroot/wiki/config&lt;br /&gt;
and changed the reactor config constructor-arg to&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;constructor-arg name=&amp;quot;pathToConfigXml&amp;quot;&amp;gt;&amp;lt;value&amp;gt;/wiki/config/Reactor.xml&amp;lt;/value&amp;gt;&amp;lt;/constructor-arg&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;I did try to make the path relative (&quot;config/reactor.xml&quot; not /config/reactor.xml&quot;) but that didn&#039;t seem to work either. Please let me know if there is a better fix!&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/perfect_unity_between_model_glue_1_and_2--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldspring">coldspring</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/modelglue">modelglue</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Fri, 14 Jul 2006 14:57:18 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">37 at http://www.evenamonkey.com</guid>
</item>
<item>
 <title>extending reactor record objects</title>
 <link>http://www.evenamonkey.com/extending_reactor_record_objects--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;Reactor provides a simple mechinism to easily add new functionality to your record objects. The advantage of this is that you dont have to create a seperate CFC, invoke it, pass it the parameters and interprit the results. The reactor record object already has access to its own instance data,and (if you are using reactor) you have already created it and are already calling functions on it.&lt;/p&gt;
&lt;p&gt; The base record objects are located in the project/projectname/record/ folder under the reactor folder.&lt;/p&gt;
&lt;p&gt;reactor provides you with two CFC&#039;s that extend this base record object. these are created in the folder you have set up in the mapping section in the reactor.xml file (or in coldspring.xml if using modelglue 2 unity).&lt;/p&gt;
&lt;p&gt;If you are not doing anything that is database specific, use the tablenameRecord.cfc. If you are doing something that is specific to your database convention, use the  tablenameRecord?????.cfc. &lt;/p&gt;
&lt;p&gt;In my example, we will be performing simple math calculations on several values from our record object, returning a sum total.&lt;/p&gt;
&lt;p&gt;Assume I have a table/record called &#039;Rate&#039; that has the following fields:&lt;br /&gt;
RateID (pk)&lt;br /&gt;
EmployeeCost&lt;br /&gt;
EmployerCost&lt;br /&gt;
ThirdPartyCost&lt;/p&gt;
&lt;p&gt;In my reactor.xml file I have defined the rate table as an object&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;nbsp; &amp;nbsp; &amp;lt;object name=&amp;quot;Rate&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/object&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Now in a cfm page,  I create a reactor rate record&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;cfset reator = CreateObject(&amp;quot;Component&amp;quot;, &amp;quot;reactor.reactorFactory&amp;quot;).init(expandPath(&amp;quot;.&amp;quot;) &amp;amp; &amp;quot;/reactor.xml&amp;quot;) /&amp;gt;&lt;br /&gt; &amp;lt;CFSET raterecord =reactor.createRecord(&amp;quot;Rate&amp;quot;)&amp;gt;&lt;br /&gt;&amp;lt;CFSET raterecord.SetRateID(url.RateID)&amp;gt;&lt;br /&gt;&amp;lt;CFSET raterecord.load()&amp;gt;&lt;br /&gt;&amp;lt;CFDUMP var=&amp;quot;raterecord#&amp;quot;&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Afterloading this page, reactor creates my Raterecord CFC&#039;s. We can now add our custom function. Open mappingvalue/record/RateRecord.cfc and look for  the comment &lt;code&gt;&amp;lt;!--- Place custom code here, it will not be overwritten ---&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;between this and the closing CFCOMPONENT tag is where I will add my function:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;CFFUNCTION name=&amp;quot;CalculateTotalCost&amp;quot; access=&amp;quot;public&amp;quot; hint=&amp;quot;I am a custom method created to demonstrate how to extend and customize record objects&amp;quot; output=&amp;quot;false&amp;quot; returntype=&amp;quot;string&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;CFSET var result = &amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;cfset result = val(getEmployeeCost()) + val(getEmployerCost() + val(getThirdPartyCost() )&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;CFRETURN result /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/CFFUNCTION&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Now, going back to my Raterecord, I see I have a new method &quot;CalculateTotalCost&quot;. After populating  my rateRecord with data, I can access the computed total cost value with this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;CFSET cost = raterecord.CalculateTotalCost()&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Yes I do know I could have calculated this in the view with one line of code, but by placing the logic in the Model, it is in a consistant place to be access by other pages as well as webservices, etc.&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/extending_reactor_record_objects--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Thu, 29 Jun 2006 11:31:45 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">35 at http://www.evenamonkey.com</guid>
</item>
<item>
 <title>Hello World</title>
 <link>http://www.evenamonkey.com/hello_world--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;just when you thought the internet had enough blogs about everything, here is one more to add to the pile.&lt;/p&gt;
&lt;p&gt;A blog about a monkey having an idea? not exactly. more like a blog about modern web development (web &amp;gt; 1.5) and the tools to involved in designing and developing achieve rich web applications using Coldfusion, java, AJAX, flex, ROR, etc.&lt;/p&gt;
&lt;p&gt;As background,I have been a coldfusion web developer for the last 7 or 8 years and have gradualy moving towards Object Oriented development. I am currently infatuated with Reactor(&lt;a href=&quot;http://doughughes.net&quot;&gt;doughughes.net&lt;/a&gt;) , ModelGlue Unity (&lt;a href=&quot;http://modelglue.com&quot;&gt;modelglue.com&lt;/a&gt;) and coldspring(&lt;a href=&quot;http://coldspringframework.com&quot;&gt;coldspringframework.com&lt;/a&gt;).&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
</description>
 <comments>http://www.evenamonkey.com/hello_world--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/evenamonkey_com">evenamonkey.com</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/modelglue">modelglue</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/reactor">reactor</category>
 <pubDate>Thu, 29 Jun 2006 02:24:26 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">34 at http://www.evenamonkey.com</guid>
</item>
</channel>
</rss>
