<?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 - generic database messages</title>
 <link>http://www.evenamonkey.com/taxonomy/term/32/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>Chaining ModelGlue Generic Commit  Events</title>
 <link>http://www.evenamonkey.com/chaining_modelglue_generic_commit_events--2006--doug_sims</link>
 <description>&lt;!-- google_ad_section_start --&gt;
&lt;p&gt;I have really been loving the generic ORM stuff that is part of ModelGlue 2.0. I had been doing way to much work to stuff the objects we needed into the viewstate.   Now I have been able to remove countless listeners and broadcasts I was using to get various objects when needed.&lt;br /&gt;
Now a generic read takes  care of that.&lt;/p&gt;
&lt;p&gt;The basic functionality of the generic events are documented at http://docs.model-glue.com so I wont get into how to use them, but one thing that isn&#039;t documented is how to handle updates to multiple unrelated objects in the same form post( event-handler) &lt;/p&gt;
&lt;p&gt;Here is how I am doing it, It works like a charm for quick prototyping,as far as I am concerned.&lt;/p&gt;
&lt;p&gt;Lets say I have 2 objects, Cinders and Ashes. I am collecting this data on the same form and I need to handle the validation and update the results. I need two generic commit message broadcasts&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;message name=&amp;quot;modelglue.GenericCommit&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;object&amp;quot; value=&amp;quot;Cinder&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;CinderId&amp;quot; value=&amp;quot;Cinder&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/message&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;br /&gt;
and&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;message name=&amp;quot;modelglue.GenericCommit&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;object&amp;quot; value=&amp;quot;Ashes&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;argument name=&amp;quot;AshesId&amp;quot; value=&amp;quot;Ashes&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/message&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;My form lives at an event called &quot;CindersAndAshes.form&quot; and submits   to an event called&lt;/p&gt;
&lt;!-- google_ad_section_end --&gt;
&lt;p&gt;&lt;a href=&quot;http://www.evenamonkey.com/chaining_modelglue_generic_commit_events--2006--doug_sims&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.evenamonkey.com/chaining_modelglue_generic_commit_events--2006--doug_sims#comment</comments>
 <category domain="http://www.evenamonkey.com/monkeyblog/coldfusion">coldfusion</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/generic_database_messages">generic database messages</category>
 <category domain="http://www.evenamonkey.com/monkeyblog/modelglue">modelglue</category>
 <pubDate>Fri, 14 Jul 2006 15:42:22 -0400</pubDate>
 <dc:creator>Doug Sims</dc:creator>
 <guid isPermaLink="false">38 at http://www.evenamonkey.com</guid>
</item>
</channel>
</rss>
