Client Specific Handlers

I have playing with ColdBox a while and I have run into a problem that
I am hoping I can solve in ColdBox. I support an application that has
100's of clients and every once an a while we get a client that wants
to completely customize a module but rarely does it require DB
changes. So what I am ask is, is it possible to have client specific
handlers with the same URL? The way that I vision this is when a user
makes a request for a widget the system would check to see if there
was a handler for that client and execute it if there was, if not it
would execute the generic handler. I hope this make sense.

You can leverage the extension locations for handlers.

Basically, the extensions work this way.

You request for an event, the fw checks the local handlers directory for the event, if it does not find it it looks at an external location for that event.

This way, you can do customized events in the local conventions, and have a central repository of events that act as generic.

The setting is “HandlersExternalLocation”

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

Would this work for multiple clients?
Like this

Generic
WidgetHandler

Clients
ACME_WidgetHandler
WB_WidgetHandler
ABC_WidgetHandler

All of these clients are on the same application? I think Luis was
speaking as if each client had their own Coldbox application, but
shared common handlers between the apps.

Yes they are all in one app

I have found a solution.

in my widget handler I set a variable
this.index = $index;

Then below I do some logic to see if the client has a custom handler
and they do I include the cfm file which is not in the handler
directory. Here is my client specific handler:

<cffunction name="acmecleint_index" returntype="void" output="false"
hint="My main event">
    <cfargument name="event" required="true">
    <cfset var rc = event.getCollection()>

    <cfset rc.welcomeMessage = "Welcome to ColdBox! ACME Client">

    <cfset event.setView("home")>
  </cffunction>

  <cfscript>
    this.index = acmecleint_index;
  </cfscript>

and that would override this function

<cffunction name="$index" returntype="void" output="false" hint="My
main event">
    <cfargument name="event" required="true">
    <cfset var rc = event.getCollection()>

    <cfset rc.welcomeMessage = "Welcome to ColdBox!">

    <cfset event.setView("home")>
  </cffunction>

This seems to work. But now I need to know if I can set views that are
not in the view folder? Also will the method above effect caching?