OK, This link will get you a build of the Default Event Types. It does pass unit testing and I'd like feedback on usefulness and on usability.
http://datacurl.com/modelglue/ModelGlue-DefaultEventTypes.zip DW On Tue, Jun 2, 2009 at 7:20 PM, Dan Wilson <[email protected]> wrote: > Hey Folks. > An Update. > > Doug Hughes and I sorted out the Unit Test to test XMLModuleLoader so now > all those tests are now running as expected. This means I can now get around > to implementing this default event type patch from Chris. > > I am going to put this into a branch and let a select few people play with > it. Mostly the people on this email thread, since they know the most about > what we want to do. With any luck, I'll have this up and dropped tomorrow or > Thursday. > > I'll be out of the office Fri-Monday and won't be thinking of ModelGlue at > all. So Long Suckers! > > > DW > > > > On Sun, May 24, 2009 at 9:11 AM, Chris Blackwell <[email protected]>wrote: > >> I've just taken a shot at implementing this feature. >> All of the heavy lifting is done by >> /ModelGlue/gesture/module/XMLModuleLoader.cfc, and looking at the way >> ModelGlue.xml is parsed, it appears that multiple <event-handlers> blocks >> (indeed most xml nodes) can already appear more than once, so no change >> needed there. >> To implement the defaultType attribute only needed 2 tiny tweaks, see the >> attached diff. >> >> heres a quick example of the xml >> >> >> <event-types> >> <event-type name="MyDefaultEventType"> >> <after> >> <results> >> <result do="template.main" /> >> </results> >> </after> >> </event-type> >> <event-type name="AnotherEventType"> >> <after> >> <results> >> <result do="template.different" /> >> </results> >> </after> >> </event-type> >> </event-types> >> >> <!-- declares the default event type --> >> <event-handlers defaultType="MyDefaultEventType"> >> <!-- inherits the defaultType --> >> <event-handler name="page.1"> >> </event-handler> >> >> <!-- overrides the defaultType and only gets AnotherEventType --> >> <event-handler name="page.2" type="AnotherEventType"> >> </event-handler> >> >> <!-- removes the defaultType --> >> <event-handler name="page.3" type=""> >> </event-handler> >> </event-handlers> >> >> <!-- no default type declared --> >> <event-handlers> >> <!-- apply event type individually --> >> <event-handler name="page.3" type="AnotherEventType"> >> </event-handler> >> </event-handlers> >> >> Anyway, take a look, try it out and let me know if anything blows up :) >> >> Chris >> >> >> >> > > > -- > “Come to the edge, he said. They said: We are afraid. Come to the edge, he > said. They came. He pushed them and they flew.” > > Guillaume Apollinaire quotes > -- “Come to the edge, he said. They said: We are afraid. Come to the edge, he said. They came. He pushed them and they flew.” Guillaume Apollinaire quotes --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "model-glue" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/model-glue?hl=en For more about Model-Glue, check http://www.model-glue.com . -~----------~----~----~----~------~----~------~--~---
