[coldbox:15645] [CB 3.5.X] Disable Implict View Feature

You are correct, Andrew. I was talking about a couple different options and probably wasn’t very clear. When I said the thing about lookups being cached, I was referring to a solution where the application name was the same and only one instance of ColdBox existed, but you changed the coldfusion mappings so your external location resolved to different place based on domain.

You are correct though, that changing the coldfusion app name would resolve that issue by having a different instance of coldbox for each client

Thanks!

~Brad

ok, so I gave this a shot:

// this is the application name setting in application.cfc
<cfset this.name = “sa-” & replace(cgi.http_HOST,".", “_”,“all”) />

//Extension Points…these are the externals
UDFLibraryFile = “includes/helpers/ApplicationHelper.cfm”,
coldboxExtensionsLocation = “”,
modulesExternalLocation = “modules”,
pluginsExternalLocation = “plugins”,
viewsExternalLocation = “views”,
layoutsExternalLocation = “layouts”,
handlersExternalLocation = “handlers”,
requestContextDecorator = “”,

// these are the conventions
conventions = {
handlersLocation = “accounts/#replace(cgi.http_HOST,’.’, ‘’,‘all’)#/handlers",
pluginsLocation = "accounts/#replace(cgi.http_HOST,’.’, '
’,‘all’)#/plugins”,
viewsLocation = “accounts/#replace(cgi.http_HOST,’.’, ‘’,‘all’)#/views",
layoutsLocation = "accounts/#replace(cgi.http_HOST,’.’, '
’,‘all’)#/layouts”,
/modelsLocation = “accounts/#replace(cgi.http_HOST,’.’, ‘’,‘all’)#/model",
modulesLocation = "accounts/#replace(cgi.http_HOST,’.’, '
’,‘all’)#/modules”,
/
eventAction = “index”
};

On a reinit, I’d expect to see the exact same home page I’ve been seeing, the CB general.main I’ve always been seeing…I don’t. Initially, I got some errors but I figured out what I was messing up…now, I get absolutely nothing rendered. Now, if the modelsLocation and modulesLocation are active, things go a bit wonky…so I remove them. Sometimes this seems to work, other times it does not. Eventually I’ll get some kind of error message, then reinit…and eventually, nothing renders, error or otherwise.

I’m not sure what’s going on but unless what is up above is all that is needed to get this working and there is nothing wrong with it, I’m not sure why this is not working.

Mike

No problem Brad, I think that it was my fault for not fully reading your post.

Mike,

I personally don’t like this approach, and there is some very good reasons behind why I don’t. One of these is that it leaves your development environment in a state of well which site do I need to run while developing?

What I have done in the past, and continue to advocate, is the use of settings stored in a DB or some other means, that can pull up the required information and then set what is required. This means that if you are running in a development, staging or even testing you can control the settings with more ease.

Does that make sense?

Yes, absolute sense. For many things, that’s exactly what I do…but the problem I’m trying to find my way around is for a SaaS environment where two things happen:

  1. Clients want to use their own URL to get to the SaaS site
  2. Clients are willing to pay for unique solutions / add-ons

These two facts, at least as I struggle through ways to accomplish this with CB in control of as much as possible, mean that I need to be able to extend the application in a unique way for a client, override functionality (maybe not but most likely) of core code (the clients home.index overrides the default home.index in other words) and of course and most importantly, use different URLs for clients.

I tried the module way, and that works but yields a couple of problems:

  1. Squirrely URLS
  2. Cannot easily override existing core handlers…thus…
  3. Only provides the ability to extend
  4. Finding it difficult to only load modules needed based on the client accessing the SaaS site
    Mike

Mike,

The advice Brad and I have given should be enough to get your app working in the way you want.

Why don’t you contact me off list so I can send you an adjusted coldbox sample app…