Client Specific Handlers

2 views
Skip to first unread message

spiraldev

unread,
Dec 12, 2009, 12:54:11 PM12/12/09
to ColdBox Platform
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.

Luis Majano

unread,
Dec 12, 2009, 1:00:51 PM12/12/09
to col...@googlegroups.com
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



--
You received this message because you are subscribed to the Google Groups "ColdBox: A ColdFusion Framework" group.
To post to this group, send email to col...@googlegroups.com
To unsubscribe from this group, send email to coldbox-u...@googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/coldbox
For more information, visit http://www.luismajano.com/projects/coldbox
For Documentation, visit http://ortus.svnrepository.com/coldbox/trac.cgi

Matt Graf

unread,
Dec 12, 2009, 1:09:10 PM12/12/09
to col...@googlegroups.com
Would this work for multiple clients?
Like this

Generic
WidgetHandler

Clients
ACME_WidgetHandler
WB_WidgetHandler
ABC_WidgetHandler

Jason Durham

unread,
Dec 12, 2009, 1:25:10 PM12/12/09
to col...@googlegroups.com
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.
Jason Durham

Matt Graf

unread,
Dec 12, 2009, 1:37:20 PM12/12/09
to col...@googlegroups.com
Yes they are all in one app

Sent from my iPhone

spiraldev

unread,
Dec 14, 2009, 5:10:55 PM12/14/09
to ColdBox Platform
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?

On Dec 12, 10:37 am, Matt Graf <spiral...@gmail.com> wrote:
> Yes they are all in one app
>
> Sent from my iPhone
>
> On Dec 12, 2009, at 10:25 AM, Jason Durham <ja...@durhamcons.com> wrote:
>
> > 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.
>
> > On Sat, Dec 12, 2009 at 12:09 PM, Matt Graf <spiral...@gmail.com>  
> > wrote:
> >> Would this work for multiple clients?
> >> Like this
>
> >> Generic
> >> WidgetHandler
>
> >> Clients
> >> ACME_WidgetHandler
> >> WB_WidgetHandler
> >> ABC_WidgetHandler
>
> >> On Sat, Dec 12, 2009 at 10:00 AM, Luis Majano <lmaj...@gmail.com>  
> >> wrote:
>
> >>> 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
>
> >>> On Sat, Dec 12, 2009 at 9:54 AM, spiraldev <spiral...@gmail.com>  
> >>>> For Documentation, visithttp://ortus.svnrepository.com/coldbox/trac.cgi
>
> >>> --
> >>> You received this message because you are subscribed to the Google  
> >>> Groups
> >>> "ColdBox: A ColdFusion Framework" group.
> >>> To post to this group, send email to col...@googlegroups.com
> >>> To unsubscribe from this group, send email to
> >>> coldbox-u...@googlegroups.com
> >>> For more options, visit this group at
> >>>http://groups-beta.google.com/group/coldbox
> >>> For more information, visithttp://www.luismajano.com/projects/coldbox
> >>> For Documentation, visithttp://ortus.svnrepository.com/coldbox/trac.cgi
>
> >> --
> >> You received this message because you are subscribed to the Google  
> >> Groups
> >> "ColdBox: A ColdFusion Framework" group.
> >> To post to this group, send email to col...@googlegroups.com
> >> To unsubscribe from this group, send email to
> >> coldbox-u...@googlegroups.com
> >> For more options, visit this group at
> >>http://groups-beta.google.com/group/coldbox
> >> For more information, visithttp://www.luismajano.com/projects/
> >> coldbox
> >> For Documentation, visithttp://ortus.svnrepository.com/coldbox/trac.cgi
Reply all
Reply to author
Forward
0 new messages