Hi Dennis,
 
Thank you for your reply. I've reported the bug as you suggest (Ticket
#355)
 
Regards,
 
Richard
 

________________________________

From: [email protected] [mailto:[email protected]]
On Behalf Of Dennis Clark
Sent: 17 August 2009 20:22
To: [email protected]
Subject: [Model-Glue] Re: MG and OnRequestStart


It looks like you found a documented MG2 feature that has been broken in
MG3.

The ModelGlue.xml reference contains the following under the
<event-handler> entry:

If an <event-handler> is added whose NAME attribute is in use by another
event-handler, it will overwrite the previous event-handler, except in
the case of the predefined modelglue.onRequestStart,
modelglue.onQueueComplete, and modelglue.onRequestEnd event-handlers. In
this case, any messages, views, or results defined will be added to the
predefined event handlers.

Your findings suggest that defining these events now overrides the
predefined handlers instead of adding to them. The internal code for the
predefined event handlers was rewritten in MG3, so I browsed the new
code but could not find anything that tries to keep the previous
behaviour.

I suggest you file a bug report on http://docs.model-glue.com/newticket.

-- Dennis


On Mon, Aug 17, 2009 at 11:26 AM, Richard East <[email protected]>
wrote:



         

        I'm experiencing an unusual problem with the OnRequestStart
listening in MG3.

         

        I'm using MG2 and want to try MG3. I do not have trace() in my
code. I am using ColdSpring 1.2 and CF8.

         

        My index.cfm calls MG like so:

        <cfinclude template="/ModelGlue/unity/ModelGlue.cfm" />

        ModelGlue is successfully mapped in the administrator and all
works fine in MG2.

         

        In my ModelGlue.xml, I have the following:

         

        <controller name="MainController"
type="controller.MainController">

                        <message-listener message="OnRequestStart"
function="OnRequestStart"/>

                        <message-listener message="OnQueueComplete"
function="OnQueueComplete"/>

                        <message-listener message="OnRequestEnd"
function="OnRequestEnd"/>

        </controller>

        <controller name="SecurityController"
type="controller.SecurityController">

                          <message-listener message="isAuthorised"
function="isAuthorised"/>

        </controller>

         

        And:

         

        <event-handler name="ModelGlue.onRequestStart">

              <broadcasts>

                    <message name="isAuthorised"/>

              </broadcasts>

        <results>

                    <result name="NotAuthorised"
do="Exception.NotAuthorised" redirect="true"/>

              </results>

         

        This code runs the OnRequestStart function and then isAuthorised
function in MG2.

         

         

        I've downloaded MG3. And have changed the mappings to point to
the correct folder.

        My index.cfm still points to:

        <cfinclude template="/ModelGlue/unity/ModelGlue.cfm" />

         

        When I run the app, I find that my code no longer runs the
OnRequestStart function, but it does run the isAuthorised function .

         

        If I add a message OnRequestStart to the broadcasts in the
ModelGlue.onRequestStart function, the app works again as intended.

         

        1.      Do I need to change my cfinclude? (I'm sure I will in
the long run, but as it's calling unity I'd imagine it should still be
able to use all the functionality of MG2) 
        2.      Do I need to change my ModelGlue.xml? 
        3.      Any other suggestions as to the issue here, please?

        

        Thank you for any help.

         

        Kind regards,

         

        Richard



________________________________

This transmission is strictly confidential, possibly legally privileged,
and intended solely for the addressee. Any views or opinions expressed
within it are those of the author and do not necessarily represent those
of 192.com, i-CD Publishing (UK) Ltd or any of it's subsidiary
companies. If you are not the intended recipient then you must not
disclose, copy or take any action in reliance of this transmission. If
you have received this transmission in error, please notify the sender
as soon as possible. No employee or agent is authorised to conclude any
binding agreement on behalf of i-CD Publishing (UK) Ltd with another
party by email without express written confirmation by an authorised
employee of the Company. http://www.192.com <http://www.192.com/>  (Tel:
08000 192 192). 
i-CD Publishing (UK) Ltd is incorporated in England and Wales, company
number 3148549, VAT No. GB 673128728.   
________________________________



        








--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to