If I could chime in, I am doing something similar in order to run multiple websites off of one application. In essence my 'engine', if you will, consists of site-specific events that are meant to override the default event, and a single plug-in that runs during the 'pre- event' plugin-point. This plugin looks at the name of the current event being run, and then compares that to the list of all the currently registered events available to the application. If it finds a match, it terminates the default event and announces the overriding event. I do this with prefix notation. For example:
<event-handler event="homepage"/> - default homepage event <event-handler event="siteA.homepage"/> - siteA's homepage event You will have to find some way of knowing which prefix to override with, but that should be simple. As far as overriding properties, I didn't find a way of doing that. What I did do was I set properties specific to each site using my prefix notation, and then in my plug-in I retrieved those properties having the right prefix and set them as even-args. If you take some time to look through the API docs, you should find out how to do all this stuff. If not, you can always ask back here. Hope that helps! :) On Mar 5, 12:31 pm, Po <fermar...@gmail.com> wrote: > I am in the process of creating a reskinning application. This works > as follows: there is a set of default views/assets/properties/etc, > otherwise known as the default skin. > When we create a "reskin", some or all of this code can be > overwritten, depending on the need. > > So I basically need to create multiple applications that share code. > The shared space would have all that default code, and the reskins > could override that code if > necessary. To give an example, if I have a layout.cfm in the shared > space, and a site also contains a file with that name, the site's file > would override the shared file. > Same would apply to properties: if i have an orderBy property which is > shared, but a site also defines it, the site's would override. > > First, it seemed that the obvious route to take was to have one > application with multiple modules (the reskins) which would inherit > the main code from the parent app and then > override when necessary. But this meant that I had to include all the > modules in the main xml, meaning they would all be instantiated on app > start (Is that the way it works?). This didn't seem very > efficient since there are 50+ reskins and they are never all used > simultaneously. Maybe if the modules could have a lazy loading option > this test case would work better. > > Additionally, this would require some type of filter to determine > which reskin (module) to announce based on the URL. > > Another option would have been to use includes to bring in the base > code, but as far as I know, inheritance would not work properly for > views, environment / htmlHelper > properties, etc... > > So in the end, having many applications that share one module would > get rid of the need to include all modules in the parent app as stated > above, and get rid of the need for > the filter. But this would only work if the module had an option to > not override code if it's defined in the parent, such as "useParent". > > I hope this was not too confusing. :D > > Thank you for your help. > > On Mar 4, 5:04 pm, "Peter J. Farrell" <pe...@mach-ii.com> wrote: > > > > > The short answer is this is not possible. Module use a parent / child > > relationship and the entire framework architecture is geared to that > > programming paradigm. > > > Maybe there is a different way to structure your modules so you wouldn't > > need this. Could you share a detailed test case? > > > .pjf > > > Po said the following on 04/03/10 13:57: > > > > I currently have a module which multiple applications include, and I > > > would like this module to never override the parent. So if something > > > (event-handler, subscriber, etc..) is defined in the module, use that, > > > but if it's also defined in the parent, use the parent's. > > > > Could there be an overrideAction attribute at the module level so that > > > one can choose whether or not to override the parent without having to > > > go to each event-handler, subscriber, etc.. and adding it? Could this > > > also apply to views and non-controller dependent properties? -- You received this message because you are subscribed to Mach-II for CFML list. To post to this group, send email to mach-ii-for-coldfusion@googlegroups.com To unsubscribe from this group, send email to mach-ii-for-coldfusion-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/mach-ii-for-coldfusion?hl=en SVN: http://greatbiztoolsllc.svn.cvsdude.com/mach-ii/ Wiki / Documentation / Tickets: http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/