RE: Re: Re: [coldbox:18051] Changing from a dynamic root to a directory

Yep. that would be correct. You’ll need to create a mapping for “model” so ColdFusion knows how to resolve it. If you have multiple sites, I’d recommend an app-specific mapping.

Your other option is to append the appMapping setting as a prefix to all your bindings.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

So I assume

property name=“dao” inject=“model.system.TDCCModuleIntegrationDAO”;

is not going to be an option unless I map “model” to “/tdcc/model” (or wirebox everything) since I cannot use variables…and then I’ll have a problem with…

component extends=“model.basecollector” accessors=“true” singleton {

because I cannot use a variable in the extend attribute?

Also, if I map “model”, I assume I’d have to map other directories like interceptor?

Mike

I added

<cfset this.mappings[ “/model” ] = getDirectoryFromPath(getCurrentTemplatePath()) & “/model/” />

and got past the model problem, the site comes up…but I have not tested interceptors for the same problem and cannot tell if my modules loaded (I think they did) because the CB debugging panes are now not showing up

groan…why would anyone do this this way :frowning:

Mike

I typically create an appRoot mapping in App.cfc when my Coldbox code lives outside of the webroot.

inject=“appRoot.model.system.TDCCModuleIntegrationDAO”

component extends=“appRoot.model.basecollector” accessors=“true” singleton {

oooh…that had never occured Jason…I like that…so now you can do the same for any CB path and if you moved to another sub-directory you just change the mapping or if you created a virtual host to make it a root site, you could set appRoot to map to “/”.

Thanks!

Mike

perfect so far…except the CB debug panels are still not showing up…otherwise, interceptors, models, modules all seem to work correctly with a minimum amount of change.

Mike

Never mind about the debugger…rogue abort.

So now, with that setting in there, I can actually use “dev.tdcc.com” or “localhost/tdcc/index.cfm” and both work swimmingly.

Thanks Andrew, Brad and Jason for getting me on the path!

heh…pun was unintentional

Mike