module namespace for all model uses within coldbox/wirebox

Coldbox Guru’s,

I have a “security module” that has service models that are common and maybe used in the parent application it is being loaded into. I fully understand that I need to map my model’s with Wirebox.

something like
map(“sec@userService”).to(modelMapping & “.model.user.userService”);
map(“sec@roleService”).to(modelMapping & “.model.role.roleService”);

etc.

but my module has many models, is there a current way to provide that namespace “sec@” to all my models inside that module?

something like
mapNamespace(“sec”).to(modelMapping & “.model”);

so if i do a getModel(“sec@group.groupService”) it knows to expand the sec@ !

thanks,
Craig Benner

I don’t think we have something like that included but you can easily do this. Remember that the binde is programmatic. Just create your own map function locally and there prefix it.

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions

Thanks! I’ll be giving it a try real soon.

Hello,

I hit a stumbling point in getting the customBuilder registered

in my module config configure() function I have:

binder.mapDSL(namespace=“ns”,path=moduleMapping & “.model.dsl.testBuilder”);

in my handler I have
getModel(name=“ns:folder.service”)

in my dsl.testBuilder

I have init() and process()
both having “other stuff” and the following before the return statement:

but I get an error that ns:folder.service cannot be found in any of the scan locations.

what am I missing?

thanks,
Craig

It is get model with a Dsl not name argument

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano

But my builder.init(injector) never gets executed either.

Thanks,
Craig

Ok, I figured some things out.

if I move my
binder.mapDSL(namespace=“ns”,path=moduleMapping & “.model.dsl.testBuilder”);

from the MODULE CONFIG to the host application config/WIREBOX.cfc config then it works without a hitch.

I’m still trying to follow the code backwards to determine where it is failing or where my configuration is incorrect.

thanks,
Craig

You are absolutely right Craig.

I have traced this and builders are registered once the injector starts up, that is why in the main parent app it works.

At this point in time I see no why to alter it at runtime. So if you want this then please create a ticket for it and we can start evaluating how to do this at runtime: https://ortussolutions.atlassian.net/browse/WIREBOX

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano