Hi Fernando,
In their earliest incarnation, event types were created via CFCs
rather than defined in the MG XML, and the sample actionpacks both
contain examples of this implementation. (As a side note, this is
something that I personally would like to deprecate and ultimately
remove in favor of always specifying event types in XML).
So the MainTemplateEvent CFC is indeed defining an event type for the
actionpack -- in XML, it would look like this:
<event-types>
<event-type name="MainTemplateEvent">
<after>
<results>
<result do="template.main" />
</results>
</after>
</event-type>
</event-types>
HTH,
--
Ezra Parker
On Wed, Mar 3, 2010 at 7:40 AM, Fernando Lopez <[email protected]> wrote:
> I started looking into MG3 and Action Packs recently and I went
> through the installation of the ActionPacks Sample app. After finding
> a couple issues that I'll explain in a separate entry I got the sample
> application to work.
>
> Now I'm going through the code and the first thing I see under /
> modelgluesamples/actionpacks/config/modelglue.xml
>
> is this
> <event-handler name="page.index"
> type="modelglueactionpacks.common.event.MainTemplateEvent">
> <views>
> <include name="body" template="pages/index.cfm"
> />
> </views>
> </event-handler>
>
> I thought that the attribute "type" in an event-handler would have a
> value from the <event-Types> section of the XML. but I looked
> under the /modelglueactionpacks/common and /modelglueactionpacks/
> usermanagement and I cannot see any event-type defined as
> "modelglueactionpacks.common.event.MainTemplateEvent" I do however see
> a MainTemplateEvent.cfc defined at that location.
>
> Contents of that CFC are below.
>
> Could anybody explain what is happening and why the event handler type
> is pointing to a CFC instead of a event-type??
>
> If I'm missing something I'd be grateful to whoever can explain what
> it is that I'm missing.
>
> Fernando
>
> --------------------------
> modelglueactionpacks/common/event/MainTemplateEvent
> --------------------------
>
>
> <cfcomponent extends="ModelGlue.gesture.eventhandler.EventHandler">
>
> <cffunction name="afterConfiguration" access="public"
> returntype="void" output="false" hint="Called after configuring the
> event handler. Subclasses can use this to add messages, results, or
> views after they're added by something like a ModelGlue XML file.">
> <cfset var result = createObject("component",
> "ModelGlue.gesture.eventhandler.Result") />
>
> <cfset result.event = "template.main" />
>
> <cfset addResult(result) />
> </cffunction>
>
> </cfcomponent>
>
> --
> 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