just to be awkward, if debug is turned off in the modelglue config bean, would either of these methods allow you to turn it on only for a specific event? and if not, might that be a desirable behaviour?

-Chris



On 18 Jan 2010, at 16:42, Dan Wilson <[email protected]> wrote:

That isn't a bad way to do it either and might actually help out later on when we add portcullis to the mix.

We should discuss the implementation details of this and make sure we are on the same page. Where do you foresee this living inside the framework?

DW

On Mon, Jan 18, 2010 at 10:51 AM, Dennis Clark <[email protected]> wrote: While I agree that debug output breaking JSON and XML output is an issue for many Model-Glue applications, I'm not convinced that it's worth extending the ModelGlue.XML API to solve this when solving this with the existing API is fairly straightforward and does not take that much more code over the approach presented here.

All that I see that we really need is a predefined controller that listens to a special message to disable debugging. A good name for this message would be "ModelGlue.suppressDebugging" (to match the request.modelGlueSuppressDebugging variable that it sets).

Revised example:

        <event-handler name="eventHandlerWithDisabledDebug">
                <broadcasts>
                        <message name="ModelGlue.suppressDebugging" />
                </broadcasts>
        </event-handler>

Revised event type example:

        <event-type name="hasNoDebug">
                <before>
                        <message name="ModelGlue.suppressDebugging" />
                </before>
        </event-type>

I'd much prefer we be conservative with extending the XML APIs as the size of the API affects the learning curve of Model-Glue, and it's much harder to shrink an API than it is to expand it.

What do others think?

-- Dennis


On Thu, Jan 14, 2010 at 9:00 PM, Dan Wilson <[email protected]> wrote:
I just checked in a pretty cool enhancement for Model-Glue into SVN.

Ticket: http://trac.model-glue.com/ticket/350
Title: Disable Model-Glue debug information for certain events
Example:

What if you have an event that generates JSON or XML or another structured format and you never ever ever want Model-Glue debugging to munge it up?

Well now you can simply decorate your event-handler or event-type with disableDebug=true and Model-Glue debugging will vanish. In both code examples below, the Model Glue debugging will shut itself off for that request. Thus, your structured data won't be affected by Model-Glue debugging.


Examples:

<event-handler name="eventHandlerWithDisabledDebug" disableDebug="true">

Or using Event Types:

        <event-type name="hasNoDebug" disableDebug="true">
                <before>
                </before>
        </event-type>

<event-handler name="eventHandlerWithEventTypeOfDisabledDebug" type="hasNoDebug">


DW


--
“Come to the edge, he said. They said: We are afraid. Come to the ed ge, he said. They came. He pushed them and they flew.”

Guillaume Apollinaire quotes


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



--
“Come to the edge, he said. They said: We are afraid. Come to the ed ge, he said. They came. He pushed them and they flew.”

Guillaume Apollinaire quotes
--
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
-- 
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