- All of the event and request collection methods within the modules are context aware similar to setLayout() and setView(). For example, all of the following method calls within a module named “admin” would route to the appropriate view, handler or action within the “admin” module:
Aaron, unfortunately, you cannot make everything context aware, as there can be use cases where you need to talk to specifc modules or maybe NON modules (the parent). So you cannot make everything context aware.
The runEvent(), overrideEvent(), setNextEvent(), requires the event signature, so in this case it needs the module portion in event syntax. This is the agreement for events, that you use event syntax. You cannot make everything context aware, if you do, you introduce more scenarios where you need it off and then those methods need overrides.
As for the “/” notation, that is view folder notation. So if you are using event syntax you use periods, if you do view/folder syntax that uses “/”. You might say? Why don’t you convert the “.” to “/” automatically? Well, what if my folders have a period in the name. Then this would break.
Now, the setView() and setLayout() do not require a prefix and they are context aware, because of the nature of modules. What is this? Well, you need this in order to activate the parent overrides for views and layouts. So you can easily override ANY view or layout from a parent or vice versa. So you do not need the prefix there.
setNextEvent(“admin:Product/edit”); looks for /module/admin/handlers/Product.cfc and calls the edit() action
overrideEvent(“admin:Product/edit”); looks for /module/admin/handlers/Product.cfc and calls the edit() action
runEvent(“admin:Viewlet/prepareNavigation”); = looks for /module/admin/handlers/Viewlet.cfc and calls prepareNavigation()
This works already!
I can also see maybe enhancing the setView(), setLayout() methods to not be context aware and pass in an argument for module. Would this work.
Luis F. Majano
President
Ortus Solutions, Corp
ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com